保誠-保戶業務員媒合平台
HelenHuang
2022-06-09 ab4e8129d5c94ff96e6c85d0d2b66a04a052b4e5
PAMapp/node_modules/@types/node/stream.d.ts
@@ -14,7 +14,7 @@
 *
 * The `stream` module is useful for creating new types of stream instances. It is
 * usually not necessary to use the `stream` module to consume streams.
 * @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/stream.js)
 * @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/stream.js)
 */
declare module 'stream' {
    import { EventEmitter, Abortable } from 'node:events';
@@ -71,7 +71,7 @@
            readable: boolean;
            /**
             * Returns whether `'data'` has been emitted.
             * @since v16.7.0
             * @since v16.7.0, v14.18.0
             * @experimental
             */
            readonly readableDidRead: boolean;
@@ -408,7 +408,7 @@
             * @since v8.0.0
             * @param error Error which will be passed as payload in `'error'` event
             */
            destroy(error?: Error): void;
            destroy(error?: Error): this;
            /**
             * Event emitter
             * The defined events on documents including:
@@ -639,9 +639,9 @@
             * @param encoding The encoding if `chunk` is a string
             * @param callback Callback for when the stream is finished.
             */
            end(cb?: () => void): void;
            end(chunk: any, cb?: () => void): void;
            end(chunk: any, encoding: BufferEncoding, cb?: () => void): void;
            end(cb?: () => void): this;
            end(chunk: any, cb?: () => void): this;
            end(chunk: any, encoding: BufferEncoding, cb?: () => void): this;
            /**
             * The `writable.cork()` method forces all written data to be buffered in memory.
             * The buffered data will be flushed when either the {@link uncork} or {@link end} methods are called.
@@ -707,7 +707,7 @@
             * @since v8.0.0
             * @param error Optional, an error to emit with `'error'` event.
             */
            destroy(error?: Error): void;
            destroy(error?: Error): this;
            /**
             * Event emitter
             * The defined events on documents including:
@@ -853,9 +853,9 @@
            write(chunk: any, encoding?: BufferEncoding, cb?: (error: Error | null | undefined) => void): boolean;
            write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean;
            setDefaultEncoding(encoding: BufferEncoding): this;
            end(cb?: () => void): void;
            end(chunk: any, cb?: () => void): void;
            end(chunk: any, encoding?: BufferEncoding, cb?: () => void): void;
            end(cb?: () => void): this;
            end(chunk: any, cb?: () => void): this;
            end(chunk: any, encoding?: BufferEncoding, cb?: () => void): this;
            cork(): void;
            uncork(): void;
        }
@@ -1238,6 +1238,19 @@
            ref(): void;
            unref(): void;
        }
        /**
         * Returns whether the stream has encountered an error.
         * @since v17.3.0
         */
        function isErrored(stream: Readable | Writable | NodeJS.ReadableStream | NodeJS.WritableStream): boolean;
        /**
         * Returns whether the stream is readable.
         * @since v17.4.0
         */
        function isReadable(stream: Readable | NodeJS.ReadableStream): boolean;
        const promises: typeof streamPromises;
        const consumers: typeof streamConsumers;
    }