Spec-Zone.ru › Deno 2

stream/web

Usage in Deno

import * as mod from "node:stream/web";

interface ByteLengthQueuingStrategy

extends QueuingStrategy<ArrayBufferView>

Usage in Deno

import { type ByteLengthQueuingStrategy } from "node:stream/web";

This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams.

Properties

highWaterMark: number
readonly
size: QueuingStrategySize<ArrayBufferView>
readonly

variable ByteLengthQueuingStrategy

Properties

prototype: ByteLengthQueuingStrategy

ByteLengthQueuingStrategy class is a global reference for import { ByteLengthQueuingStrategy } from 'node:stream/web'. https://nodejs.org/api/globals.html#class-bytelengthqueuingstrategy

Type

globalThis extends { onmessage: any; ByteLengthQueuingStrategy: infer T; } ? T : stream/web

interface CompressionStream

Usage in Deno

import { type CompressionStream } from "node:stream/web";

Properties

readable: ReadableStream
readonly
writable: WritableStream
readonly

variable CompressionStream

Properties

prototype: CompressionStream

CompressionStream class is a global reference for import { CompressionStream } from 'node:stream/web'. https://nodejs.org/api/globals.html#class-compressionstream

Type

globalThis extends { onmessage: any; ReportingObserver: any; CompressionStream: infer T; } ? T : globalThis extends { onmessage: any; TransformStream: { prototype: infer T; }; } ? { prototype: T; } : stream/web

interface CountQueuingStrategy

extends QueuingStrategy

Usage in Deno

import { type CountQueuingStrategy } from "node:stream/web";

This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams.

Properties

highWaterMark: number
readonly
size: QueuingStrategySize
readonly

variable CountQueuingStrategy

Properties

prototype: CountQueuingStrategy

CountQueuingStrategy class is a global reference for import { CountQueuingStrategy } from 'node:stream/web'. https://nodejs.org/api/globals.html#class-countqueuingstrategy

Type

globalThis extends { onmessage: any; CountQueuingStrategy: infer T; } ? T : stream/web

interface DecompressionStream

Usage in Deno

import { type DecompressionStream } from "node:stream/web";

Properties

writable: WritableStream
readonly
readable: ReadableStream
readonly

variable DecompressionStream

Properties

prototype: DecompressionStream

DecompressionStream class is a global reference for import { DecompressionStream } from 'node:stream/web'. https://nodejs.org/api/globals.html#class-decompressionstream

Type

globalThis extends { onmessage: any; ReportingObserver: any; DecompressionStream: infer T extends object; } ? T : globalThis extends { onmessage: any; TransformStream: { prototype: infer T; }; } ? { prototype: T; } : stream/web

interface QueuingStrategy

Usage in Deno

import { type QueuingStrategy } from "node:stream/web";

Type Parameters

T = any

Properties

highWaterMark: number
optional
size: QueuingStrategySize<T>
optional

interface QueuingStrategyInit

Usage in Deno

import { type QueuingStrategyInit } from "node:stream/web";

Properties

highWaterMark: number

Creates a new ByteLengthQueuingStrategy with the provided high water mark.

Note that the provided high water mark will not be validated ahead of time. Instead, if it is negative, NaN, or not a number, the resulting ByteLengthQueuingStrategy will cause the corresponding stream constructor to throw.


interface QueuingStrategySize

Usage in Deno

import { type QueuingStrategySize } from "node:stream/web";

Type Parameters

T = any

Call Signatures

(chunk?: T): number

interface ReadableByteStreamController

Usage in Deno

import { type ReadableByteStreamController } from "node:stream/web";

Properties

byobRequest: undefined
readonly
desiredSize: number | null
readonly

Methods

close(): void
enqueue(chunk: ArrayBufferView): void
error(error?: any): void

variable ReadableByteStreamController

Properties

prototype: ReadableByteStreamController

ReadableByteStreamController class is a global reference for import { ReadableByteStreamController } from 'node:stream/web'. https://nodejs.org/api/globals.html#class-readablebytestreamcontroller

Type

globalThis extends { onmessage: any; ReadableByteStreamController: infer T; } ? T : stream/web

interface ReadableByteStreamControllerCallback

Usage in Deno

import { type ReadableByteStreamControllerCallback } from "node:stream/web";

Call Signatures

(controller: ReadableByteStreamController): void | PromiseLike<void>

interface ReadableStream

Usage in Deno

import { type ReadableStream } from "node:stream/web";

This Streams API interface represents a readable stream of byte data.

Type Parameters

R = any

Properties

locked: boolean
readonly

Methods

cancel(reason?: any): Promise<void>
getReader(options: { mode: "byob"; }): ReadableStreamBYOBReader
getReader(): ReadableStreamDefaultReader<R>
getReader(options?: ReadableStreamGetReaderOptions): ReadableStreamReader<R>
pipeThrough<T>(
transform: ReadableWritablePair<T, R>,
options?: StreamPipeOptions,
): ReadableStream<T>
pipeTo(
destination: WritableStream<R>,
options?: StreamPipeOptions,
): Promise<void>
tee(): [ReadableStream<R>, ReadableStream<R>]
values(options?: { preventCancel?: boolean; }): ReadableStreamAsyncIterator<R>
[[Symbol.asyncIterator]](): ReadableStreamAsyncIterator<R>

Type Parameters

R = any

variable ReadableStream

Properties

prototype: ReadableStream

Methods

from<T>(iterable: Iterable<T> | AsyncIterable<T>): ReadableStream<T>

ReadableStream class is a global reference for import { ReadableStream } from 'node:stream/web'. https://nodejs.org/api/globals.html#class-readablestream

Type

globalThis extends { onmessage: any; ReadableStream: infer T; } ? T : stream/web

interface ReadableStreamAsyncIterator

extends [NodeJS.AsyncIterator]<T, BuiltinIteratorReturn, unknown>

Usage in Deno

import { type ReadableStreamAsyncIterator } from "node:stream/web";

Type Parameters

T

Methods

[[Symbol.asyncIterator]](): ReadableStreamAsyncIterator<T>

interface ReadableStreamBYOBReader

extends ReadableStreamGenericReader

Usage in Deno

import { type ReadableStreamBYOBReader } from "node:stream/web";

MDN Reference

Methods

read<T extends ArrayBufferView>(
view: T,
options?: { min?: number; },
): Promise<ReadableStreamReadResult<T>>

MDN Reference

releaseLock(): void

MDN Reference

variable ReadableStreamBYOBReader

Properties

prototype: ReadableStreamBYOBReader

ReadableStreamBYOBReader class is a global reference for import { ReadableStreamBYOBReader } from 'node:stream/web'. https://nodejs.org/api/globals.html#class-readablestreambyobreader

Type

globalThis extends { onmessage: any; ReadableStreamBYOBReader: infer T; } ? T : stream/web

interface ReadableStreamBYOBRequest

Usage in Deno

import { type ReadableStreamBYOBRequest } from "node:stream/web";

MDN Reference

Properties

view: ArrayBufferView | null
readonly

MDN Reference

Methods

respond(bytesWritten: number): void

MDN Reference

respondWithNewView(view: ArrayBufferView): void

MDN Reference

variable ReadableStreamBYOBRequest

Properties

prototype: ReadableStreamBYOBRequest

ReadableStreamBYOBRequest class is a global reference for import { ReadableStreamBYOBRequest } from 'node:stream/web'. https://nodejs.org/api/globals.html#class-readablestreambyobrequest

Type

globalThis extends { onmessage: any; ReadableStreamBYOBRequest: infer T; } ? T : stream/web

interface ReadableStreamDefaultController

Usage in Deno

import { type ReadableStreamDefaultController } from "node:stream/web";

Type Parameters

R = any

Properties

desiredSize: number | null
readonly

Methods

close(): void
enqueue(chunk?: R): void
error(e?: any): void

Type Parameters

R = any

variable ReadableStreamDefaultController

Properties

prototype: ReadableStreamDefaultController

ReadableStreamDefaultController class is a global reference for import { ReadableStreamDefaultController } from 'node:stream/web'. https://nodejs.org/api/globals.html#class-readablestreamdefaultcontroller

Type

globalThis extends { onmessage: any; ReadableStreamDefaultController: infer T; } ? T : stream/web

interface ReadableStreamDefaultReader

extends ReadableStreamGenericReader

Usage in Deno

import { type ReadableStreamDefaultReader } from "node:stream/web";

Type Parameters

R = any

Methods

read(): Promise<ReadableStreamReadResult<R>>
releaseLock(): void

Type Parameters

R = any

variable ReadableStreamDefaultReader

Properties

prototype: ReadableStreamDefaultReader

ReadableStreamDefaultReader class is a global reference for import { ReadableStreamDefaultReader } from 'node:stream/web'. https://nodejs.org/api/globals.html#class-readablestreamdefaultreader

Type

globalThis extends { onmessage: any; ReadableStreamDefaultReader: infer T; } ? T : stream/web

interface ReadableStreamErrorCallback

Usage in Deno

import { type ReadableStreamErrorCallback } from "node:stream/web";

Call Signatures

(reason: any): void | PromiseLike<void>

interface ReadableStreamGenericReader

Usage in Deno

import { type ReadableStreamGenericReader } from "node:stream/web";

Properties

closed: Promise<undefined>
readonly

Methods

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

interface ReadableStreamGetReaderOptions

Usage in Deno

import { type ReadableStreamGetReaderOptions } from "node:stream/web";

Properties

mode: ReadableStreamReaderMode
optional

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.


interface ReadableStreamReadDoneResult

Usage in Deno

import { type ReadableStreamReadDoneResult } from "node:stream/web";

Type Parameters

T

Properties

done: true
value: T
optional

interface ReadableStreamReadValueResult

Usage in Deno

import { type ReadableStreamReadValueResult } from "node:stream/web";

Type Parameters

T

Properties

done: false
value: T

interface ReadableWritablePair

Usage in Deno

import { type ReadableWritablePair } from "node:stream/web";

Type Parameters

R = any
W = any

Properties

readable: ReadableStream<R>
writable: WritableStream<W>

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.


interface StreamPipeOptions

Usage in Deno

import { type StreamPipeOptions } from "node:stream/web";

Properties

preventAbort: boolean
optional
preventCancel: boolean
optional
preventClose: boolean
optional

Pipes this readable stream to a given writable stream destination. 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.

Errors and closures of the source and destination streams propagate as follows:

An error in this source readable stream will abort destination, unless preventAbort is truthy. The returned promise will be rejected with the source's error, or with any error that occurs during aborting the destination.

An error in destination will cancel this source readable stream, unless preventCancel is truthy. The returned promise will be rejected with the destination's error, or with any error that occurs during canceling the source.

When this source readable stream closes, destination will be closed, unless preventClose is truthy. The returned promise will be fulfilled once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error.

If destination starts out closed or closing, this source readable stream will be canceled, unless preventCancel is true. The returned promise will be rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source.

The signal option can be set to an AbortSignal to allow aborting an ongoing pipe operation via the corresponding AbortController. In this case, this source readable stream will be canceled, and destination aborted, unless the respective options preventCancel or preventAbort are set.

signal: AbortSignal
optional

interface TextDecoderOptions

Usage in Deno

import { type TextDecoderOptions } from "node:stream/web";

Properties

fatal: boolean
optional
ignoreBOM: boolean
optional

interface TextDecoderStream

Usage in Deno

import { type TextDecoderStream } from "node:stream/web";

Properties

encoding: string
readonly

Returns encoding's name, lower cased.

fatal: boolean
readonly

Returns true if error mode is "fatal", and false otherwise.

ignoreBOM: boolean
readonly

Returns true if ignore BOM flag is set, and false otherwise.

readable: ReadableStream<string>
readonly
writable: WritableStream<BufferSource>
readonly
[[Symbol.toStringTag]]: string
readonly

variable TextDecoderStream

Properties

prototype: TextDecoderStream

TextDecoderStream class is a global reference for import { TextDecoderStream } from 'node:stream/web'. https://nodejs.org/api/globals.html#class-textdecoderstream

Type

globalThis extends { onmessage: any; TextDecoderStream: infer T; } ? T : stream/web

interface TextEncoderStream

Usage in Deno

import { type TextEncoderStream } from "node:stream/web";

Properties

encoding: "utf-8"
readonly

Returns "utf-8".

readable: ReadableStream<Uint8Array>
readonly
writable: WritableStream<string>
readonly
[[Symbol.toStringTag]]: string
readonly

variable TextEncoderStream

Properties

prototype: TextEncoderStream

TextEncoderStream class is a global reference for import { TextEncoderStream } from 'node:stream/web'. https://nodejs.org/api/globals.html#class-textencoderstream

Type

globalThis extends { onmessage: any; TextEncoderStream: infer T; } ? T : stream/web

interface Transformer

Usage in Deno

import { type Transformer } from "node:stream/web";

Type Parameters

I = any
O = any

Properties

flush: TransformerFlushCallback<O>
optional
readableType: undefined
optional
start: TransformerStartCallback<O>
optional
transform: TransformerTransformCallback<I, O>
optional
writableType: undefined
optional

interface TransformerFlushCallback

Usage in Deno

import { type TransformerFlushCallback } from "node:stream/web";

Type Parameters

O

Call Signatures

(controller: TransformStreamDefaultController<O>): void | PromiseLike<void>

interface TransformerStartCallback

Usage in Deno

import { type TransformerStartCallback } from "node:stream/web";

Type Parameters

O

Call Signatures

(controller: TransformStreamDefaultController<O>): any

interface TransformerTransformCallback

Usage in Deno

import { type TransformerTransformCallback } from "node:stream/web";

Type Parameters

I
O

Call Signatures

(
chunk: I,
controller: TransformStreamDefaultController<O>,
): void | PromiseLike<void>

interface TransformStream

Usage in Deno

import { type TransformStream } from "node:stream/web";

Type Parameters

I = any
O = any

Properties

readable: ReadableStream<O>
readonly
writable: WritableStream<I>
readonly

Type Parameters

I = any
O = any

variable TransformStream

Properties

prototype: TransformStream

TransformStream class is a global reference for import { TransformStream } from 'node:stream/web'. https://nodejs.org/api/globals.html#class-transformstream

Type

globalThis extends { onmessage: any; TransformStream: infer T; } ? T : stream/web

interface TransformStreamDefaultController

Usage in Deno

import { type TransformStreamDefaultController } from "node:stream/web";

Type Parameters

O = any

Properties

desiredSize: number | null
readonly

Methods

enqueue(chunk?: O): void
error(reason?: any): void
terminate(): void

Type Parameters

O = any

variable TransformStreamDefaultController

Properties

prototype: TransformStreamDefaultController

TransformStreamDefaultController class is a global reference for import { TransformStreamDefaultController } from 'node:stream/web'. https://nodejs.org/api/globals.html#class-transformstreamdefaultcontroller

Type

globalThis extends { onmessage: any; TransformStreamDefaultController: infer T; } ? T : stream/web

interface UnderlyingByteSource

Usage in Deno

import { type UnderlyingByteSource } from "node:stream/web";

Properties

autoAllocateChunkSize: number
optional
cancel: ReadableStreamErrorCallback
optional
pull: ReadableByteStreamControllerCallback
optional
start: ReadableByteStreamControllerCallback
optional
type: "bytes"

interface UnderlyingSink

Usage in Deno

import { type UnderlyingSink } from "node:stream/web";

Type Parameters

W = any

Properties

abort: UnderlyingSinkAbortCallback
optional
close: UnderlyingSinkCloseCallback
optional
start: UnderlyingSinkStartCallback
optional
type: undefined
optional
write: UnderlyingSinkWriteCallback<W>
optional

interface UnderlyingSinkAbortCallback

Usage in Deno

import { type UnderlyingSinkAbortCallback } from "node:stream/web";

Call Signatures

(reason?: any): void | PromiseLike<void>

interface UnderlyingSinkCloseCallback

Usage in Deno

import { type UnderlyingSinkCloseCallback } from "node:stream/web";

Call Signatures

(): void | PromiseLike<void>

interface UnderlyingSinkStartCallback

Usage in Deno

import { type UnderlyingSinkStartCallback } from "node:stream/web";

Call Signatures

(controller: WritableStreamDefaultController): any

interface UnderlyingSinkWriteCallback

Usage in Deno

import { type UnderlyingSinkWriteCallback } from "node:stream/web";

Type Parameters

W

Call Signatures

(
chunk: W,
controller: WritableStreamDefaultController,
): void | PromiseLike<void>

interface UnderlyingSource

Usage in Deno

import { type UnderlyingSource } from "node:stream/web";

Type Parameters

R = any

Properties

cancel: UnderlyingSourceCancelCallback
optional
pull: UnderlyingSourcePullCallback<R>
optional
start: UnderlyingSourceStartCallback<R>
optional
type: undefined
optional

interface UnderlyingSourceCancelCallback

Usage in Deno

import { type UnderlyingSourceCancelCallback } from "node:stream/web";

Call Signatures

(reason?: any): void | PromiseLike<void>

interface UnderlyingSourcePullCallback

Usage in Deno

import { type UnderlyingSourcePullCallback } from "node:stream/web";

Type Parameters

R

Call Signatures

(controller: ReadableStreamController<R>): void | PromiseLike<void>

interface UnderlyingSourceStartCallback

Usage in Deno

import { type UnderlyingSourceStartCallback } from "node:stream/web";

Type Parameters

R

Call Signatures

(controller: ReadableStreamController<R>): any

interface WritableStream

Usage in Deno

import { type WritableStream } from "node:stream/web";

This Streams API interface provides a standard abstraction for writing streaming data to a destination, known as a sink. This object comes with built-in back pressure and queuing.

Type Parameters

W = any

Properties

locked: boolean
readonly

Methods

abort(reason?: any): Promise<void>
close(): Promise<void>
getWriter(): WritableStreamDefaultWriter<W>

Type Parameters

W = any

variable WritableStream

Properties

prototype: WritableStream

WritableStream class is a global reference for import { WritableStream } from 'node:stream/web'. https://nodejs.org/api/globals.html#class-writablestream

Type

globalThis extends { onmessage: any; WritableStream: infer T; } ? T : stream/web

interface WritableStreamDefaultController

Usage in Deno

import { type WritableStreamDefaultController } from "node:stream/web";

This Streams API interface represents a controller allowing control of a WritableStream's state. When constructing a WritableStream, the underlying sink is given a corresponding WritableStreamDefaultController instance to manipulate.

Methods

error(e?: any): void

variable WritableStreamDefaultController

Properties

prototype: WritableStreamDefaultController

WritableStreamDefaultController class is a global reference for import { WritableStreamDefaultController } from 'node:stream/web'. https://nodejs.org/api/globals.html#class-writablestreamdefaultcontroller

Type

globalThis extends { onmessage: any; WritableStreamDefaultController: infer T; } ? T : stream/web

interface WritableStreamDefaultWriter

Usage in Deno

import { type WritableStreamDefaultWriter } from "node:stream/web";

This Streams API interface is the object returned by WritableStream.getWriter() and once created locks the < writer to the WritableStream ensuring that no other streams can write to the underlying sink.

Type Parameters

W = any

Properties

closed: Promise<undefined>
readonly
desiredSize: number | null
readonly
ready: Promise<undefined>
readonly

Methods

abort(reason?: any): Promise<void>
close(): Promise<void>
releaseLock(): void
write(chunk?: W): Promise<void>

Type Parameters

W = any

variable WritableStreamDefaultWriter

Properties

prototype: WritableStreamDefaultWriter

WritableStreamDefaultWriter class is a global reference for import { WritableStreamDefaultWriter } from 'node:stream/web'. https://nodejs.org/api/globals.html#class-writablestreamdefaultwriter

Type

globalThis extends { onmessage: any; WritableStreamDefaultWriter: infer T; } ? T : stream/web

type alias BufferSource

Usage in Deno

import { type BufferSource } from "node:stream/web";

Definition

ArrayBufferView | ArrayBuffer

type alias ReadableStreamController

Usage in Deno

import { type ReadableStreamController } from "node:stream/web";

Type Parameters

T

Definition

ReadableStreamDefaultController<T>

type alias ReadableStreamReader

Usage in Deno

import { type ReadableStreamReader } from "node:stream/web";

Type Parameters

T

Definition

ReadableStreamDefaultReader<T> | ReadableStreamBYOBReader

type alias ReadableStreamReaderMode

Usage in Deno

import { type ReadableStreamReaderMode } from "node:stream/web";

Definition

"byob"

type alias ReadableStreamReadResult

Usage in Deno

import { type ReadableStreamReadResult } from "node:stream/web";

Type Parameters

T

Definition

ReadableStreamReadValueResult<T> | ReadableStreamReadDoneResult<T>

© 2018–2025 the Deno authors
Licensed under the MIT License.
https://docs.deno.com/api/node/stream/web

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API