What type of value is returned by setTimeout in ts, isn't it Timer?

let timeoutId: Timer = setTimeout(() => {
    console.log("ok");
}, 250);

vscode prompts that there is no Timer type, but if I replace Timer with number, he prompts me that the Timer type returned by setTimeout cannot be assigned to the number type

in the tsconfig of the root directory of the ant component, there is an attribute: "

"
lib": [
    "dom",
    "es7"
]

what are these two for? do they have anything to do with the questions I asked? For beginners of ts, please give me a lot of advice

< hr >

clipboard.png


delete @ types/node dependency
if not, use window.setTimeout


clipboard.png
should be number type


is number type, but your setTimeout and setInterval should be called with window.setTimeout and window.setInterval, you can use


var timeoutID = window.setTimeout (func, delay, [param1, param2,.]);

returns an ID, that is a positive integer.

window.setTimeout

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea8498-1ec1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea8498-1ec1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?