Make typings compatible with @types/node.

Fixes name clashes and uses Node-compatible typings where possible.

Changes:
 - setTimout et al now return NodeJS.Timer instead of number
 - No "console" module anymore. Everyone uses it through global.console
 anyway.
 - We have a typed "global" instance with exposed properties now. Any
 "freeform" accesses must go through a `(<any>global).blah` cast.
 - remove tns-core-modules.{base,es6,es2015}.d.ts. Those were needed
 as workarounds for the ES6/DOM/Node type clashes.
This commit is contained in:
Hristo Deshev
2017-02-14 17:40:25 +02:00
parent 3056ce51c2
commit 86481cce4a
25 changed files with 238 additions and 307 deletions

View File

@ -38,9 +38,10 @@ export function setTimeout(callback: Function, milliseconds = 0): number {
}
export function clearTimeout(id: number): void {
if (timeoutCallbacks[id]) {
timeoutHandler.removeCallbacks(timeoutCallbacks[id]);
delete timeoutCallbacks[id];
let index = id;
if (timeoutCallbacks[index]) {
timeoutHandler.removeCallbacks(timeoutCallbacks[index]);
delete timeoutCallbacks[index];
}
}