mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Add types for bindings 1.3
This commit is contained in:
parent
85c17c4f49
commit
d3f02a9035
4
types/bindings/bindings-tests.ts
Normal file
4
types/bindings/bindings-tests.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import bindings = require('bindings');
|
||||
|
||||
// Use your bindings defined in your C files
|
||||
const result = bindings('binding.node').your_c_function();
|
||||
13
types/bindings/index.d.ts
vendored
Normal file
13
types/bindings/index.d.ts
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
// Type definitions for bindings 1.3
|
||||
// Project: https://github.com/TooTallNate/node-bindings
|
||||
// Definitions by: Daniel Perez Alvarez <https://github.com/unindented>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* The main `bindings()` function loads the compiled bindings for a given module.
|
||||
* It uses V8's Error API to determine the parent filename that this function is
|
||||
* being invoked from, which is then used to find the root directory.
|
||||
*/
|
||||
declare function bindings(mod: string): any;
|
||||
|
||||
export = bindings;
|
||||
23
types/bindings/tsconfig.json
Normal file
23
types/bindings/tsconfig.json
Normal 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",
|
||||
"bindings-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/bindings/tslint.json
Normal file
1
types/bindings/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user