mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
bind ponyfill type def (#12559)
This commit is contained in:
parent
8b21b7adde
commit
988774a261
8
bind-ponyfill/bind-ponyfill-tests.ts
Normal file
8
bind-ponyfill/bind-ponyfill-tests.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import ponyBind = require('bind-ponyfill');
|
||||
|
||||
let boundFn: Function;
|
||||
|
||||
boundFn = ponyBind(() => { console.log(this); }, 'Hello world!');
|
||||
boundFn = ponyBind((...args: Array<string>) => { console.log(this, ...args); }, 'Hello world!', 'arg1');
|
||||
boundFn = ponyBind((...args: Array<string>) => { console.log(this, ...args); }, 'Hello world!', 'arg1', 'arg2');
|
||||
boundFn = ponyBind((arg1: string, arg2: number) => { console.log(this, arg1, arg2); }, 'Hello world!', 'arg1', 2);
|
||||
7
bind-ponyfill/index.d.ts
vendored
Normal file
7
bind-ponyfill/index.d.ts
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
// Type definitions for bind-ponyfill 0.1.0
|
||||
// Project: https://www.npmjs.com/package/bind-ponyfill
|
||||
// Definitions by: Steve Jenkins <https://github.com/skysteve>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare function ponyBind(fn: Function, that: any, ...args: Array<any>): Function;
|
||||
export = ponyBind;
|
||||
19
bind-ponyfill/tsconfig.json
Normal file
19
bind-ponyfill/tsconfig.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"bind-ponyfill-tests.ts"
|
||||
]
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user