Added type definitions for driftless

This commit is contained in:
dandelany
2019-02-23 01:48:08 -08:00
parent 8816e2e88c
commit d010dabaf4
4 changed files with 52 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
import * as driftless from "driftless";
driftless.setDriftlessTimeout(() => "OK", 10); // $ExpectType number
const interval = driftless.setDriftlessInterval((a) => "OK" + a, 100, "foo"); // $ExpectType number
driftless.clearDriftless(interval); // $ExpectType void
+23
View File
@@ -0,0 +1,23 @@
// Type definitions for driftless 2.0
// Project: https://github.com/dbkaplun/driftless
// Definitions by: Dan Delany <https://github.com/dandelany>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export function setDriftlessTimeout(
callback: (...args: any[]) => void,
delayMs: number,
...params: any[]
): number;
export function setDriftlessInterval(
callback: (...args: any[]) => void,
delayMs: number,
...params: any[]
): number;
export function clearDriftless(
id: number,
options?: {
customClearTimeout?: (...args: any[]) => void;
}
): void;
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"driftless-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }