mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
Add types for accurate-interval package (#39030)
* Add types for accurate-interval package * Add accurateInterval function callback argument
This commit is contained in:
committed by
Armando Aguirre
parent
dc348fab28
commit
d5daab9ba8
@@ -0,0 +1,13 @@
|
||||
import accurateInterval = require('accurate-interval');
|
||||
|
||||
const interval = accurateInterval(() => void(0), 100, { aligned: true, immediate: true });
|
||||
interval.clear();
|
||||
const scheduledTime = 1000;
|
||||
const intervalScheludel = accurateInterval((scheduledTime: number) => void 0, 100, { aligned: true, immediate: true });
|
||||
const intervalScheludelError = accurateInterval(
|
||||
() => {
|
||||
return void 0;
|
||||
},
|
||||
100,
|
||||
{ aligned: true, immediate: true },
|
||||
);
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
// Type definitions for accurate-interval 1.0
|
||||
// Project: https://github.com/klyngbaek/accurate-interval#readme
|
||||
// Definitions by: Artur Dziedziczak <https://github.com/grayrattus>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare function accurateInterval(func: (scheduledTime: number) => void, interval: number, opts: accurateInterval.Opts): accurateInterval.AccurateInterval;
|
||||
export = accurateInterval;
|
||||
|
||||
declare namespace accurateInterval {
|
||||
interface Opts {
|
||||
aligned: boolean;
|
||||
immediate: boolean;
|
||||
}
|
||||
|
||||
interface AccurateInterval {
|
||||
clear: () => void;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"accurate-interval-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user