mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
[slice-source] Add type definitions (#47690)
* [slice-source] Add type definitions * Remove empty file * Revert "Remove empty file" This reverts commit 7365af4ede01c3bc51a27a20792a4ec3156c9d20. * Fix lint
This commit is contained in:
parent
4923c0dc8d
commit
0718ea0f9f
19
types/slice-source/index.d.ts
vendored
Normal file
19
types/slice-source/index.d.ts
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
// Type definitions for slice-source 0.4
|
||||
// Project: https://github.com/mbostock/slice-source
|
||||
// Definitions by: Björn Harrtell <https://github.com/bjornharrtell>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare function slice(source: ReadableStream | ReadableStreamReader | SliceSource): SliceSource;
|
||||
|
||||
interface SliceChunk {
|
||||
value: Uint8Array;
|
||||
done: boolean;
|
||||
}
|
||||
|
||||
interface SliceSource {
|
||||
slice(length: number): Promise<Uint8Array>;
|
||||
read(): Promise<SliceChunk>;
|
||||
cancel(): Promise<void>;
|
||||
}
|
||||
|
||||
export = slice;
|
||||
1
types/slice-source/slice-source-tests.ts
Normal file
1
types/slice-source/slice-source-tests.ts
Normal file
@ -0,0 +1 @@
|
||||
import slice = require('slice-source');
|
||||
23
types/slice-source/tsconfig.json
Normal file
23
types/slice-source/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6", "dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"slice-source-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/slice-source/tslint.json
Normal file
1
types/slice-source/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user