DefinitelyTyped/types/react-native/globals.d.ts

21 lines
1009 B
TypeScript

/*
* This file is necessary to declare global functions that might also be included by `--lib dom`.
* Due to a TypeScript bug, these cannot be placed inside a `declare global` block in index.d.ts.
* https://github.com/Microsoft/TypeScript/issues/16430
*/
//
// Timer Functions
//
declare function clearInterval(handle: number): void;
declare function clearTimeout(handle: number): void;
declare function setInterval(handler: (...args: any[]) => void, timeout: number): number;
declare function setInterval(handler: any, timeout?: any, ...args: any[]): number;
declare function setTimeout(handler: (...args: any[]) => void, timeout: number): number;
declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number;
declare function clearImmediate(handle: number): void;
declare function setImmediate(handler: (...args: any[]) => void): number;
declare function cancelAnimationFrame(handle: number): void;
declare function requestAnimationFrame(callback: (time: number) => void): number;