DefinitelyTyped/types/react-native/globals.d.ts
2017-12-07 11:33:03 +08:00

25 lines
1.2 KiB
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;
declare function fetchBundle(bundleId: number, callback: (error?: Error | null) => void): void;
declare function fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;