fix ts not compiling, because of type error

This commit is contained in:
Jonas Leder 2021-01-20 23:26:02 +01:00
parent 8855f02a56
commit 021ccebdff

View file

@ -9,7 +9,9 @@ let stringPosition = 0;
let printTask: number;
function writeOut() {
let currentData: Array<JSON> = data[dataIndex];
// @ts-ignore
let currentData: { [key: string]: string } = data[dataIndex];
let currentText: string = currentData["strings"];
promptContainer.innerText = promptContainer.innerText + currentText.charAt(stringPosition);
stringPosition++;
@ -19,7 +21,9 @@ function writeOut() {
historyContainer.innerHTML = historyContainer.innerHTML + "$&nbsp;" + promptContainer.innerHTML + "<br><span class=\"gray\">" + currentData["output"] + "</span><br><br>";
promptContainer.innerHTML = "";
clearInterval(printTask);
// @ts-ignore
if(dataIndex < data.length){
// @ts-ignore
setTimeout(startNewTask, data[dataIndex - 1].postDelay);
}
}