mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-02-03 23:42:50 +00:00
added type for bufferhelper (#38954)
* added @type/bufferhelper * added typescript version * added space
This commit is contained in:
parent
7a00793d5a
commit
a9cf1ec909
11
types/bufferhelper/bufferhelper-tests.ts
Normal file
11
types/bufferhelper/bufferhelper-tests.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import BufferHelper from 'bufferhelper';
|
||||
|
||||
// test data
|
||||
const buffer = new BufferHelper();
|
||||
|
||||
// tests
|
||||
buffer.concat('');
|
||||
buffer.toBuffer().toString();
|
||||
buffer.empty();
|
||||
buffer.load('', () => {});
|
||||
buffer.toString('ascii');
|
||||
24
types/bufferhelper/index.d.ts
vendored
Normal file
24
types/bufferhelper/index.d.ts
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
// Type definitions for bufferhelper 0.2
|
||||
// Project: https://github.com/JacksonTian/bufferhelper
|
||||
// Definitions by: Vladimir Grenaderov <https://github.com/VladimirGrenaderov>,
|
||||
// Max Boguslavskiy <https://github.com/maxbogus>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.7
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
declare namespace BufferHelper {
|
||||
type encoding = 'ascii'|'utf8'|'utf16le'|'ucs2'|'base64'|'binary'|'hex';
|
||||
}
|
||||
|
||||
declare class BufferHelper {
|
||||
constructor();
|
||||
|
||||
concat(buffer: any): BufferHelper;
|
||||
empty(): BufferHelper;
|
||||
load(stream: any, callback: (arg: any) => any): void;
|
||||
toBuffer(): Buffer;
|
||||
toString(encoding: BufferHelper.encoding): string;
|
||||
}
|
||||
|
||||
export = BufferHelper;
|
||||
24
types/bufferhelper/tsconfig.json
Normal file
24
types/bufferhelper/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"esModuleInterop": true,
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"bufferhelper-tests.ts"
|
||||
]
|
||||
}
|
||||
3
types/bufferhelper/tslint.json
Normal file
3
types/bufferhelper/tslint.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user