mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-12 22:36:10 +08:00
adds basic typings for the 'bytewise' package
This commit is contained in:
10
types/bytewise/bytewise-tests.ts
Normal file
10
types/bytewise/bytewise-tests.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import bytewise = require('bytewise');
|
||||
|
||||
// $ExpectType Buffer
|
||||
bytewise.encode([1, 2, 3]);
|
||||
|
||||
// $ExpectType any
|
||||
bytewise.decode(bytewise.encode([1, 2 , 3]));
|
||||
|
||||
// $ExpectType Buffer
|
||||
bytewise.encode(bytewise.sorts.array.bound.lower(['123', -1, 0x123, Buffer.from('test')]));
|
||||
16
types/bytewise/index.d.ts
vendored
Normal file
16
types/bytewise/index.d.ts
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
// Type definitions for bytewise 1.1
|
||||
// Project: https://github.com/deanlandolt/bytewise
|
||||
// Definitions by: Daniel Byrne <https://github.com/danwbyrne>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
/// <reference types= "node" />
|
||||
|
||||
interface Bytewise {
|
||||
encode: (value: any) => Buffer;
|
||||
decode: (value: Buffer) => any;
|
||||
[k: string]: any;
|
||||
}
|
||||
|
||||
declare const bytewise: Bytewise;
|
||||
export = bytewise;
|
||||
23
types/bytewise/tsconfig.json
Normal file
23
types/bytewise/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",
|
||||
"bytewise-tests.ts"
|
||||
]
|
||||
}
|
||||
3
types/bytewise/tslint.json
Normal file
3
types/bytewise/tslint.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Reference in New Issue
Block a user