mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-07 06:28:26 +08:00
Added type definitions for react-timeout (#24916)
* Added type definitions for react-timeout * Fixed export * Removed rules from tslint.json * Added types * Indented * Fixed types
This commit is contained in:
32
types/react-timeout/index.d.ts
vendored
Normal file
32
types/react-timeout/index.d.ts
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
// 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.6
|
||||
|
||||
/// <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;
|
||||
}
|
||||
}
|
||||
23
types/react-timeout/tsconfig.json
Normal file
23
types/react-timeout/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts"
|
||||
]
|
||||
}
|
||||
3
types/react-timeout/tslint.json
Normal file
3
types/react-timeout/tslint.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Reference in New Issue
Block a user