DefinitelyTyped/types/react-timeout/index.d.ts
Ferdy Budhidharma bc0c933415 feat(react-dependents): update to TS 2.8 (part 2 of 2) (#27744)
* feat(react-dependents): update to ts 2.8

* fix version mismatches

* remove package.json

* post merge updates

* add package.json back again
2018-08-06 06:28:42 +01:00

33 lines
1.1 KiB
TypeScript

// Type definitions for react-timeout 1.1
// Project: https://github.com/plougsgaard/react-timeout
// Definitions by: Kerwyn Rojas <https://github.com/kerwynrg>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
/// <reference types="node" />
import * as React from 'react';
export = ReactTimeout;
declare function ReactTimeout<T>(
SourceComponent: React.ComponentClass<T> | React.StatelessComponent<T>
): React.ComponentClass<T>;
declare namespace ReactTimeout {
type Timer = NodeJS.Timer | number;
type Id = number;
interface ReactTimeoutProps {
setTimeout?: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => Timer;
clearTimeout?: (timer: Timer) => void;
setInterval?: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => Id;
clearInterval?: (id: Id) => void;
setImmediate?: (callback: (...args: any[]) => void, ...args: any[]) => Id;
clearImmediate?: (id: Id) => void;
requestAnimationFrame?: (callback: (...args: any[]) => void) => Id;
cancelAnimationFrame?: (id: Id) => void;
}
}