web-streams-polyfill

  • Version 4.0.0
  • Published
  • 441 kB
  • No dependencies
  • MIT license

Install

npm i web-streams-polyfill
yarn add web-streams-polyfill
pnpm add web-streams-polyfill

Overview

Web Streams, based on the WHATWG spec reference implementation

Index

Classes

Interfaces

Type Aliases

Classes

class ByteLengthQueuingStrategy

class ByteLengthQueuingStrategy implements QueuingStrategy<ArrayBufferView> {}
  • A queuing strategy that counts the number of bytes in each chunk.

    Modifiers

    • @public

constructor

constructor(options: QueuingStrategyInit);

    property highWaterMark

    readonly highWaterMark: number;
    • Returns the high water mark provided to the constructor.

    property size

    readonly size: (chunk: ArrayBufferView) => number;
    • Measures the size of chunk by returning the value of its byteLength property.

    class CountQueuingStrategy

    class CountQueuingStrategy implements QueuingStrategy<any> {}
    • A queuing strategy that counts the number of chunks.

      Modifiers

      • @public

    constructor

    constructor(options: QueuingStrategyInit);

      property highWaterMark

      readonly highWaterMark: number;
      • Returns the high water mark provided to the constructor.

      property size

      readonly size: (chunk: any) => 1;
      • Measures the size of chunk by always returning 1. This ensures that the total queue size is a count of the number of chunks in the queue.

      class ReadableByteStreamController

      class ReadableByteStreamController {}

      property byobRequest

      readonly byobRequest: ReadableStreamBYOBRequest;
      • Returns the current BYOB pull request, or null if there isn't one.

      property desiredSize

      readonly desiredSize: number;
      • Returns the desired size to fill the controlled stream's internal queue. It can be negative, if the queue is over-full. An underlying byte source ought to use this information to determine when and how to apply backpressure.

      method close

      close: () => void;
      • Closes the controlled readable stream. Consumers will still be able to read any previously-enqueued chunks from the stream, but once those are read, the stream will become closed.

      method enqueue

      enqueue: (chunk: ArrayBufferView) => void;
      • Enqueues the given chunk chunk in the controlled readable stream. The chunk has to be an ArrayBufferView instance, or else a TypeError will be thrown.

      method error

      error: (e?: any) => void;
      • Errors the controlled readable stream, making all future interactions with it fail with the given error e.

      class ReadableStream

      class ReadableStream<R = any> implements AsyncIterable<R> {}
      • A readable stream represents a source of data, from which you can read.

        Modifiers

        • @public

      constructor

      constructor(
      underlyingSource: UnderlyingByteSource,
      strategy?: { highWaterMark?: number; size?: undefined }
      );

        constructor

        constructor(
        underlyingSource?: UnderlyingSource<R>,
        strategy?: QueuingStrategy<R>
        );

          property locked

          readonly locked: boolean;
          • Whether or not the readable stream is locked to a reader.

          method [Symbol.asyncIterator]

          [Symbol.asyncIterator]: (
          options?: ReadableStreamIteratorOptions
          ) => ReadableStreamAsyncIterator<R>;

          method cancel

          cancel: (reason?: any) => Promise<void>;
          • Cancels the stream, signaling a loss of interest in the stream by a consumer.

            The supplied reason argument will be given to the underlying source's cancel() method, which might or might not use it.

          method from

          static from: <R>(
          asyncIterable: Iterable<R> | AsyncIterable<R> | ReadableStreamLike<R>
          ) => ReadableStream<R>;
          • Creates a new ReadableStream wrapping the provided iterable or async iterable.

            This can be used to adapt various kinds of objects into a readable stream, such as an array, an async generator, or a Node.js readable stream.

          method getReader

          getReader: {
          ({ mode }: { mode: 'byob' }): ReadableStreamBYOBReader;
          (): ReadableStreamDefaultReader<R>;
          };
          • Creates a ReadableStreamBYOBReader and locks the stream to the new reader.

            This call behaves the same way as the no-argument variant, except that it only works on readable byte streams, i.e. streams which were constructed specifically with the ability to handle "bring your own buffer" reading. The returned BYOB reader provides the ability to directly read individual chunks from the stream via its read() method, into developer-supplied buffers, allowing more precise control over allocation.

          • Creates a ReadableStreamDefaultReader and locks the stream to the new reader. While the stream is locked, no other reader can be acquired until this one is released.

            This functionality is especially useful for creating abstractions that desire the ability to consume a stream in its entirety. By getting a reader for the stream, you can ensure nobody else can interleave reads with yours or cancel the stream, which would interfere with your abstraction.

          method pipeThrough

          pipeThrough: <RS extends ReadableStream<any>>(
          transform: { readable: RS; writable: WritableStream<R> },
          options?: StreamPipeOptions
          ) => RS;
          • Provides a convenient, chainable way of piping this readable stream through a transform stream (or any other { writable, readable } pair). It simply pipes the stream into the writable side of the supplied pair, and returns the readable side for further use.

            Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.

          method pipeTo

          pipeTo: (
          destination: WritableStream<R>,
          options?: StreamPipeOptions
          ) => Promise<void>;
          • Pipes this readable stream to a given writable stream. The way in which the piping process behaves under various error conditions can be customized with a number of passed options. It returns a promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered.

            Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader.

          method tee

          tee: () => [ReadableStream<R>, ReadableStream<R>];
          • Tees this readable stream, returning a two-element array containing the two resulting branches as new ReadableStream instances.

            Teeing a stream will lock it, preventing any other consumer from acquiring a reader. To cancel the stream, cancel both of the resulting branches; a composite cancellation reason will then be propagated to the stream's underlying source.

            Note that the chunks seen in each branch will be the same object. If the chunks are not immutable, this could allow interference between the two branches.

          method values

          values: (
          options?: ReadableStreamIteratorOptions
          ) => ReadableStreamAsyncIterator<R>;
          • Asynchronously iterates over the chunks in the stream's internal queue.

            Asynchronously iterating over the stream will lock it, preventing any other consumer from acquiring a reader. The lock will be released if the async iterator's return() method is called, e.g. by breaking out of the loop.

            By default, calling the async iterator's return() method will also cancel the stream. To prevent this, use the stream's values() method, passing true for the preventCancel option.

          class ReadableStreamBYOBReader

          class ReadableStreamBYOBReader {}

          constructor

          constructor(stream: ReadableStream<Uint8Array>);

            property closed

            readonly closed: Promise<undefined>;
            • Returns a promise that will be fulfilled when the stream becomes closed, or rejected if the stream ever errors or the reader's lock is released before the stream finishes closing.

            method cancel

            cancel: (reason?: any) => Promise<void>;

            method read

            read: <T extends ArrayBufferView>(
            view: T,
            options?: ReadableStreamBYOBReaderReadOptions
            ) => Promise<ReadableStreamBYOBReadResult<T>>;
            • Attempts to reads bytes into view, and returns a promise resolved with the result.

              If reading a chunk causes the queue to become empty, more data will be pulled from the underlying source.

            method releaseLock

            releaseLock: () => void;
            • Releases the reader's lock on the corresponding stream. After the lock is released, the reader is no longer active. If the associated stream is errored when the lock is released, the reader will appear errored in the same way from now on; otherwise, the reader will appear closed.

              A reader's lock cannot be released while it still has a pending read request, i.e., if a promise returned by the reader's read() method has not yet been settled. Attempting to do so will throw a TypeError and leave the reader locked to the stream.

            class ReadableStreamBYOBRequest

            class ReadableStreamBYOBRequest {}

            property view

            readonly view: ArrayBufferView;
            • Returns the view for writing in to, or null if the BYOB request has already been responded to.

            method respond

            respond: (bytesWritten: number) => void;
            • Indicates to the associated readable byte stream that bytesWritten bytes were written into view, causing the result be surfaced to the consumer.

              After this method is called, view will be transferred and no longer modifiable.

            method respondWithNewView

            respondWithNewView: (view: ArrayBufferView) => void;
            • Indicates to the associated readable byte stream that instead of writing into view, the underlying byte source is providing a new ArrayBufferView, which will be given to the consumer of the readable byte stream.

              After this method is called, view will be transferred and no longer modifiable.

            class ReadableStreamDefaultController

            class ReadableStreamDefaultController<R> {}
            • Allows control of a readable stream's state and internal queue.

              Modifiers

              • @public

            property desiredSize

            readonly desiredSize: number;
            • Returns the desired size to fill the controlled stream's internal queue. It can be negative, if the queue is over-full. An underlying source ought to use this information to determine when and how to apply backpressure.

            method close

            close: () => void;
            • Closes the controlled readable stream. Consumers will still be able to read any previously-enqueued chunks from the stream, but once those are read, the stream will become closed.

            method enqueue

            enqueue: (chunk: R) => void;
            • Enqueues the given chunk chunk in the controlled readable stream.

            method error

            error: (e?: any) => void;
            • Errors the controlled readable stream, making all future interactions with it fail with the given error e.

            class ReadableStreamDefaultReader

            class ReadableStreamDefaultReader<R = any> {}

            constructor

            constructor(stream: ReadableStream<R>);

              property closed

              readonly closed: Promise<undefined>;
              • Returns a promise that will be fulfilled when the stream becomes closed, or rejected if the stream ever errors or the reader's lock is released before the stream finishes closing.

              method cancel

              cancel: (reason?: any) => Promise<void>;

              method read

              read: () => Promise<ReadableStreamDefaultReadResult<R>>;
              • Returns a promise that allows access to the next chunk from the stream's internal queue, if available.

                If reading a chunk causes the queue to become empty, more data will be pulled from the underlying source.

              method releaseLock

              releaseLock: () => void;
              • Releases the reader's lock on the corresponding stream. After the lock is released, the reader is no longer active. If the associated stream is errored when the lock is released, the reader will appear errored in the same way from now on; otherwise, the reader will appear closed.

                A reader's lock cannot be released while it still has a pending read request, i.e., if a promise returned by the reader's read() method has not yet been settled. Attempting to do so will throw a TypeError and leave the reader locked to the stream.

              class TransformStream

              class TransformStream<I = any, O = any> {}
              • A transform stream consists of a pair of streams: a writable stream, known as its writable side, and a readable stream, known as its readable side. In a manner specific to the transform stream in question, writes to the writable side result in new data being made available for reading from the readable side.

                Modifiers

                • @public

              constructor

              constructor(
              transformer?: Transformer<I, O>,
              writableStrategy?: QueuingStrategy<I>,
              readableStrategy?: QueuingStrategy<O>
              );

                property readable

                readonly readable: ReadableStream<O>;
                • The readable side of the transform stream.

                property writable

                readonly writable: WritableStream<I>;
                • The writable side of the transform stream.

                class TransformStreamDefaultController

                class TransformStreamDefaultController<O> {}

                property desiredSize

                readonly desiredSize: number;
                • Returns the desired size to fill the readable side’s internal queue. It can be negative, if the queue is over-full.

                method enqueue

                enqueue: (chunk: O) => void;
                • Enqueues the given chunk chunk in the readable side of the controlled transform stream.

                method error

                error: (reason?: any) => void;
                • Errors both the readable side and the writable side of the controlled transform stream, making all future interactions with it fail with the given error e. Any chunks queued for transformation will be discarded.

                method terminate

                terminate: () => void;
                • Closes the readable side and errors the writable side of the controlled transform stream. This is useful when the transformer only needs to consume a portion of the chunks written to the writable side.

                class WritableStream

                class WritableStream<W = any> {}
                • A writable stream represents a destination for data, into which you can write.

                  Modifiers

                  • @public

                constructor

                constructor(underlyingSink?: UnderlyingSink<W>, strategy?: QueuingStrategy<W>);

                  property locked

                  readonly locked: boolean;
                  • Returns whether or not the writable stream is locked to a writer.

                  method abort

                  abort: (reason?: any) => Promise<void>;
                  • Aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an errored state, with any queued-up writes discarded. This will also execute any abort mechanism of the underlying sink.

                    The returned promise will fulfill if the stream shuts down successfully, or reject if the underlying sink signaled that there was an error doing so. Additionally, it will reject with a TypeError (without attempting to cancel the stream) if the stream is currently locked.

                  method close

                  close: () => Promise<undefined>;
                  • Closes the stream. The underlying sink will finish processing any previously-written chunks, before invoking its close behavior. During this time any further attempts to write will fail (without erroring the stream).

                    The method returns a promise that will fulfill if all remaining chunks are successfully written and the stream successfully closes, or rejects if an error is encountered during this process. Additionally, it will reject with a TypeError (without attempting to cancel the stream) if the stream is currently locked.

                  method getWriter

                  getWriter: () => WritableStreamDefaultWriter<W>;
                  • Creates a writer and locks the stream to the new writer. While the stream is locked, no other writer can be acquired until this one is released.

                    This functionality is especially useful for creating abstractions that desire the ability to write to a stream without interruption or interleaving. By getting a writer for the stream, you can ensure nobody else can write at the same time, which would cause the resulting written data to be unpredictable and probably useless.

                  class WritableStreamDefaultController

                  class WritableStreamDefaultController<W = any> {}
                  • Allows control of a writable stream's state and internal queue.

                    Modifiers

                    • @public

                  property abortReason

                  readonly abortReason: any;
                  • The reason which was passed to WritableStream.abort(reason) when the stream was aborted.

                    Deprecated

                    This property has been removed from the specification, see https://github.com/whatwg/streams/pull/1177. Use WritableStreamDefaultController.signal's reason instead.

                  property signal

                  readonly signal: AbortSignal;
                  • An AbortSignal that can be used to abort the pending write or close operation when the stream is aborted.

                  method error

                  error: (e?: any) => void;
                  • Closes the controlled writable stream, making all future interactions with it fail with the given error e.

                    This method is rarely used, since usually it suffices to return a rejected promise from one of the underlying sink's methods. However, it can be useful for suddenly shutting down a stream in response to an event outside the normal lifecycle of interactions with the underlying sink.

                  class WritableStreamDefaultWriter

                  class WritableStreamDefaultWriter<W = any> {}

                  constructor

                  constructor(stream: WritableStream<W>);

                    property closed

                    readonly closed: Promise<undefined>;
                    • Returns a promise that will be fulfilled when the stream becomes closed, or rejected if the stream ever errors or the writer’s lock is released before the stream finishes closing.

                    property desiredSize

                    readonly desiredSize: number;
                    • Returns the desired size to fill the stream’s internal queue. It can be negative, if the queue is over-full. A producer can use this information to determine the right amount of data to write.

                      It will be null if the stream cannot be successfully written to (due to either being errored, or having an abort queued up). It will return zero if the stream is closed. And the getter will throw an exception if invoked when the writer’s lock is released.

                    property ready

                    readonly ready: Promise<undefined>;
                    • Returns a promise that will be fulfilled when the desired size to fill the stream’s internal queue transitions from non-positive to positive, signaling that it is no longer applying backpressure. Once the desired size dips back to zero or below, the getter will return a new promise that stays pending until the next transition.

                      If the stream becomes errored or aborted, or the writer’s lock is released, the returned promise will become rejected.

                    method abort

                    abort: (reason?: any) => Promise<void>;

                    method close

                    close: () => Promise<void>;

                    method releaseLock

                    releaseLock: () => void;
                    • Releases the writer’s lock on the corresponding stream. After the lock is released, the writer is no longer active. If the associated stream is errored when the lock is released, the writer will appear errored in the same way from now on; otherwise, the writer will appear closed.

                      Note that the lock can still be released even if some ongoing writes have not yet finished (i.e. even if the promises returned from previous calls to write() have not yet settled). It’s not necessary to hold the lock on the writer for the duration of the write; the lock instead simply prevents other producers from writing in an interleaved manner.

                    method write

                    write: (chunk: W) => Promise<void>;
                    • Writes the given chunk to the writable stream, by waiting until any previous writes have finished successfully, and then sending the chunk to the underlying sink's write() method. It will return a promise that fulfills with undefined upon a successful write, or rejects if the write fails or stream becomes errored before the writing process is initiated.

                      Note that what "success" means is up to the underlying sink; it might indicate simply that the chunk has been accepted, and not necessarily that it is safely saved to its ultimate destination.

                    Interfaces

                    interface AbortSignal

                    interface AbortSignal {}
                    • A signal object that allows you to communicate with a request and abort it if required via its associated AbortController object.

                      Remarks

                      This interface is compatible with the AbortSignal interface defined in TypeScript's DOM types. It is redefined here, so it can be polyfilled without a DOM, for example with abortcontroller-polyfill in a Node environment.

                      Modifiers

                      • @public

                    property aborted

                    readonly aborted: boolean;
                    • Whether the request is aborted.

                    property reason

                    readonly reason?: any;
                    • If aborted, returns the reason for aborting.

                    method addEventListener

                    addEventListener: (type: 'abort', listener: () => void) => void;
                    • Add an event listener to be triggered when this signal becomes aborted.

                    method removeEventListener

                    removeEventListener: (type: 'abort', listener: () => void) => void;

                    interface QueuingStrategy

                    interface QueuingStrategy<T = any> {}
                    • A queuing strategy.

                      Modifiers

                      • @public

                    property highWaterMark

                    highWaterMark?: number;
                    • A non-negative number indicating the high water mark of the stream using this queuing strategy.

                    property size

                    size?: QueuingStrategySizeCallback<T>;
                    • A function that computes and returns the finite non-negative size of the given chunk value.

                    interface QueuingStrategyInit

                    interface QueuingStrategyInit {}
                    • Modifiers

                      • @public

                    property highWaterMark

                    highWaterMark: number;

                    interface ReadableStreamAsyncIterator

                    interface ReadableStreamAsyncIterator<R> extends AsyncIterableIterator<R> {}

                    method next

                    next: () => Promise<IteratorResult<R, undefined>>;

                      method return

                      return: (value?: any) => Promise<IteratorResult<any>>;

                        interface ReadableStreamBYOBReaderReadOptions

                        interface ReadableStreamBYOBReaderReadOptions {}

                        property min

                        min?: number;

                          interface ReadableStreamDefaultReaderLike

                          interface ReadableStreamDefaultReaderLike<R = any> {}
                          • A common interface for a ReadableStreamDefaultReader implementation.

                            Modifiers

                            • @public

                          property closed

                          readonly closed: Promise<undefined>;

                            method cancel

                            cancel: (reason?: any) => Promise<void>;

                              method read

                              read: () => Promise<ReadableStreamDefaultReadResult<R>>;

                                method releaseLock

                                releaseLock: () => void;

                                  interface ReadableStreamIteratorOptions

                                  interface ReadableStreamIteratorOptions {}

                                  property preventCancel

                                  preventCancel?: boolean;

                                    interface ReadableStreamLike

                                    interface ReadableStreamLike<R = any> {}
                                    • A common interface for a ReadadableStream implementation.

                                      Modifiers

                                      • @public

                                    property locked

                                    readonly locked: boolean;

                                      method getReader

                                      getReader: () => ReadableStreamDefaultReaderLike<R>;

                                        interface ReadableWritablePair

                                        interface ReadableWritablePair<R, W> {}

                                        property readable

                                        readable: ReadableStream<R>;

                                          property writable

                                          writable: WritableStream<W>;

                                            interface StreamPipeOptions

                                            interface StreamPipeOptions {}
                                            • Options for piping a stream.

                                              Modifiers

                                              • @public

                                            property preventAbort

                                            preventAbort?: boolean;

                                            property preventCancel

                                            preventCancel?: boolean;
                                            • If set to true, ReadableStream.pipeTo will not cancel the readable stream if the writable stream closes or errors.

                                            property preventClose

                                            preventClose?: boolean;

                                            property signal

                                            signal?: AbortSignal;
                                            • Can be set to an AbortSignal to allow aborting an ongoing pipe operation via the corresponding AbortController. In this case, the source readable stream will be canceled, and the destination writable stream aborted, unless the respective options preventCancel or preventAbort are set.

                                            interface Transformer

                                            interface Transformer<I = any, O = any> {}

                                            property cancel

                                            cancel?: TransformerCancelCallback;
                                            • A function called when the readable side is cancelled, or when the writable side is aborted.

                                            property flush

                                            flush?: TransformerFlushCallback<O>;
                                            • A function called after all chunks written to the writable side have been transformed by successfully passing through transform(), and the writable side is about to be closed.

                                            property readableType

                                            readableType?: undefined;

                                              property start

                                              start?: TransformerStartCallback<O>;
                                              • A function that is called immediately during creation of the TransformStream.

                                              property transform

                                              transform?: TransformerTransformCallback<I, O>;
                                              • A function called when a new chunk originally written to the writable side is ready to be transformed.

                                              property writableType

                                              writableType?: undefined;

                                                interface UnderlyingByteSource

                                                interface UnderlyingByteSource {}
                                                • An underlying byte source for constructing a ReadableStream.

                                                  Modifiers

                                                  • @public

                                                property autoAllocateChunkSize

                                                autoAllocateChunkSize?: number;
                                                • Can be set to a positive integer to cause the implementation to automatically allocate buffers for the underlying source code to write into. In this case, when a consumer is using a default reader, the stream implementation will automatically allocate an ArrayBuffer of the given size, so that controller.byobRequest is always present, as if the consumer was using a BYOB reader.

                                                property cancel

                                                cancel?: UnderlyingSourceCancelCallback;

                                                property pull

                                                pull?: UnderlyingByteSourcePullCallback;

                                                property start

                                                start?: UnderlyingByteSourceStartCallback;

                                                property type

                                                type: 'bytes';
                                                • Can be set to "bytes" to signal that the constructed ReadableStream is a readable byte stream. This ensures that the resulting ReadableStream will successfully be able to vend BYOB readers via its getReader() method. It also affects the controller argument passed to the start() and pull() methods.

                                                interface UnderlyingSink

                                                interface UnderlyingSink<W = any> {}

                                                property abort

                                                abort?: UnderlyingSinkAbortCallback;
                                                • A function that is called after the producer signals, via stream.abort() or writer.abort(), that they wish to abort the stream. It takes as its argument the same value as was passed to those methods by the producer.

                                                  Writable streams can additionally be aborted under certain conditions during piping; see the definition of the pipeTo() method for more details.

                                                  This function can clean up any held resources, much like close(), but perhaps with some custom handling.

                                                property close

                                                close?: UnderlyingSinkCloseCallback;
                                                • A function that is called after the producer signals, via writer.close(), that they are done writing chunks to the stream, and subsequently all queued-up writes have successfully completed.

                                                  This function can perform any actions necessary to finalize or flush writes to the underlying sink, and release access to any held resources.

                                                property start

                                                start?: UnderlyingSinkStartCallback;
                                                • A function that is called immediately during creation of the WritableStream.

                                                property type

                                                type?: undefined;

                                                  property write

                                                  write?: UnderlyingSinkWriteCallback<W>;
                                                  • A function that is called when a new chunk of data is ready to be written to the underlying sink. The stream implementation guarantees that this function will be called only after previous writes have succeeded, and never before start() has succeeded or after close() or abort() have been called.

                                                    This function is used to actually send the data to the resource presented by the underlying sink, for example by calling a lower-level API.

                                                  interface UnderlyingSource

                                                  interface UnderlyingSource<R = any> {}
                                                  • An underlying source for constructing a ReadableStream.

                                                    Modifiers

                                                    • @public

                                                  property cancel

                                                  cancel?: UnderlyingSourceCancelCallback;

                                                  property pull

                                                  pull?: UnderlyingSourcePullCallback<R>;
                                                  • A function that is called whenever the stream’s internal queue of chunks becomes not full, i.e. whenever the queue’s desired size becomes positive. Generally, it will be called repeatedly until the queue reaches its high water mark (i.e. until the desired size becomes non-positive).

                                                  property start

                                                  start?: UnderlyingSourceStartCallback<R>;
                                                  • A function that is called immediately during creation of the ReadableStream.

                                                  property type

                                                  type?: undefined;

                                                    Type Aliases

                                                    type QueuingStrategySizeCallback

                                                    type QueuingStrategySizeCallback<T = any> = (chunk: T) => number;

                                                    type ReadableStreamBYOBReadResult

                                                    type ReadableStreamBYOBReadResult<T extends ArrayBufferView> =
                                                    | {
                                                    done: false;
                                                    value: T;
                                                    }
                                                    | {
                                                    done: true;
                                                    value: T | undefined;
                                                    };

                                                    type ReadableStreamDefaultReadResult

                                                    type ReadableStreamDefaultReadResult<T> =
                                                    | {
                                                    done: false;
                                                    value: T;
                                                    }
                                                    | {
                                                    done: true;
                                                    value?: undefined;
                                                    };

                                                    type TransformerCancelCallback

                                                    type TransformerCancelCallback = (reason: any) => void | PromiseLike<void>;
                                                    • Modifiers

                                                      • @public

                                                    type TransformerFlushCallback

                                                    type TransformerFlushCallback<O> = (
                                                    controller: TransformStreamDefaultController<O>
                                                    ) => void | PromiseLike<void>;
                                                    • Modifiers

                                                      • @public

                                                    type TransformerStartCallback

                                                    type TransformerStartCallback<O> = (
                                                    controller: TransformStreamDefaultController<O>
                                                    ) => void | PromiseLike<void>;
                                                    • Modifiers

                                                      • @public

                                                    type TransformerTransformCallback

                                                    type TransformerTransformCallback<I, O> = (
                                                    chunk: I,
                                                    controller: TransformStreamDefaultController<O>
                                                    ) => void | PromiseLike<void>;
                                                    • Modifiers

                                                      • @public

                                                    type UnderlyingByteSourcePullCallback

                                                    type UnderlyingByteSourcePullCallback = (
                                                    controller: ReadableByteStreamController
                                                    ) => void | PromiseLike<void>;
                                                    • Modifiers

                                                      • @public

                                                    type UnderlyingByteSourceStartCallback

                                                    type UnderlyingByteSourceStartCallback = (
                                                    controller: ReadableByteStreamController
                                                    ) => void | PromiseLike<void>;
                                                    • Modifiers

                                                      • @public

                                                    type UnderlyingSinkAbortCallback

                                                    type UnderlyingSinkAbortCallback = (reason: any) => void | PromiseLike<void>;
                                                    • Modifiers

                                                      • @public

                                                    type UnderlyingSinkCloseCallback

                                                    type UnderlyingSinkCloseCallback = () => void | PromiseLike<void>;
                                                    • Modifiers

                                                      • @public

                                                    type UnderlyingSinkStartCallback

                                                    type UnderlyingSinkStartCallback = (
                                                    controller: WritableStreamDefaultController
                                                    ) => void | PromiseLike<void>;
                                                    • Modifiers

                                                      • @public

                                                    type UnderlyingSinkWriteCallback

                                                    type UnderlyingSinkWriteCallback<W> = (
                                                    chunk: W,
                                                    controller: WritableStreamDefaultController
                                                    ) => void | PromiseLike<void>;
                                                    • Modifiers

                                                      • @public

                                                    type UnderlyingSourceCancelCallback

                                                    type UnderlyingSourceCancelCallback = (reason: any) => void | PromiseLike<void>;
                                                    • Modifiers

                                                      • @public

                                                    type UnderlyingSourcePullCallback

                                                    type UnderlyingSourcePullCallback<R> = (
                                                    controller: ReadableStreamDefaultController<R>
                                                    ) => void | PromiseLike<void>;
                                                    • Modifiers

                                                      • @public

                                                    type UnderlyingSourceStartCallback

                                                    type UnderlyingSourceStartCallback<R> = (
                                                    controller: ReadableStreamDefaultController<R>
                                                    ) => void | PromiseLike<void>;
                                                    • Modifiers

                                                      • @public

                                                    Package Files (1)

                                                    Dependencies (0)

                                                    No dependencies.

                                                    Dev Dependencies (20)

                                                    Peer Dependencies (0)

                                                    No peer dependencies.

                                                    Badge

                                                    To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                    You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/web-streams-polyfill.

                                                    • Markdown
                                                      [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/web-streams-polyfill)
                                                    • HTML
                                                      <a href="https://www.jsdocs.io/package/web-streams-polyfill"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>