1 | # Installation
|
2 | > `npm install --save @types/stream-buffers`
|
3 |
|
4 | # Summary
|
5 | This package contains type definitions for stream-buffers (https://github.com/samcday/node-stream-buffer#readme).
|
6 |
|
7 | # Details
|
8 | Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/stream-buffers.
|
9 | ## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/stream-buffers/index.d.ts)
|
10 | ````ts
|
11 | /// <reference types="node" />
|
12 | import * as stream from "stream";
|
13 |
|
14 | export interface WritableStreamBufferOptions extends stream.WritableOptions {
|
15 | initialSize?: number | undefined;
|
16 | incrementAmount?: number | undefined;
|
17 | }
|
18 |
|
19 | export class WritableStreamBuffer extends stream.Writable {
|
20 | constructor(options?: WritableStreamBufferOptions);
|
21 | size(): number;
|
22 | maxSize(): number;
|
23 | getContents(length?: number): Buffer | false;
|
24 | getContentsAsString(encoding?: string, length?: number): string | false;
|
25 | }
|
26 |
|
27 | export interface ReadableStreamBufferOptions extends stream.ReadableOptions {
|
28 | frequency?: number | undefined;
|
29 | chunkSize?: number | undefined;
|
30 | initialSize?: number | undefined;
|
31 | incrementAmount?: number | undefined;
|
32 | }
|
33 |
|
34 | export class ReadableStreamBuffer extends stream.Readable {
|
35 | constructor(options?: ReadableStreamBufferOptions);
|
36 | put(data: string | Buffer, encoding?: string): void;
|
37 | stop(): void;
|
38 | size(): number;
|
39 | maxSize(): number;
|
40 | }
|
41 |
|
42 | export const DEFAULT_INITIAL_SIZE: number;
|
43 | export const DEFAULT_INCREMENT_AMOUNT: number;
|
44 | export const DEFAULT_FREQUENCY: number;
|
45 | export const DEFAULT_CHUNK_SIZE: number;
|
46 |
|
47 | ````
|
48 |
|
49 | ### Additional Details
|
50 | * Last updated: Tue, 07 Nov 2023 15:11:36 GMT
|
51 | * Dependencies: [@types/node](https://npmjs.com/package/@types/node)
|
52 |
|
53 | # Credits
|
54 | These definitions were written by [Jason Dent](https://github.com/Jason3S).
|
55 |
|
\ | No newline at end of file |