npm.io
0.4.3 • Published 2 years ago

@types/slice-source

Licence
MIT
Version
0.4.3
Deps
0
Size
3 kB
Vulns
0
Weekly
0

Installation

npm install --save @types/slice-source

Summary

This package contains type definitions for slice-source (https://github.com/mbostock/slice-source).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/slice-source.

index.d.ts

// tslint:disable-next-line:use-default-type-parameter
declare function slice(source: ReadableStream | ReadableStreamReader<any> | SliceSource): SliceSource;

interface SliceChunk {
    value: Uint8Array;
    done: boolean;
}

interface SliceSource {
    slice(length: number): Promise<Uint8Array>;
    read(): Promise<SliceChunk>;
    cancel(): Promise<void>;
}

export = slice;

Additional Details

  • Last updated: Tue, 07 Nov 2023 1536 GMT
  • Dependencies: none

Credits

These definitions were written by Björn Harrtell.