mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 23:07:06 +00:00
Merge pull request #31829 from BenLorantfy/master
[raf] Add types for raf
This commit is contained in:
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
// Type definitions for raf 3.4
|
||||
// Project: https://github.com/chrisdickinson/raf#readme
|
||||
// Definitions by: Ben Lorantfy <https://github.com/BenLorantfy>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare const raf: {
|
||||
(callback: (timestamp: number) => void): number;
|
||||
cancel: (handle: number) => void;
|
||||
polyfill: (globalObject?: any) => void;
|
||||
};
|
||||
|
||||
export = raf;
|
||||
@@ -0,0 +1,11 @@
|
||||
import * as raf from "raf";
|
||||
|
||||
const handle = raf((timestamp) => {
|
||||
timestamp; // $ExpectType number
|
||||
});
|
||||
|
||||
handle; // $ExpectType number
|
||||
|
||||
raf.cancel(handle);
|
||||
raf.polyfill();
|
||||
raf.polyfill({});
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"raf-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Reference in New Issue
Block a user