Skip to content
File

Blob: src/node/internal/streams_duplex.d.ts

typescript41 lines
1// Copyright (c) 2026 Cloudflare, Inc.
2// Licensed under the Apache 2.0 license found in the LICENSE file or at:
3// https://opensource.org/licenses/Apache-2.0
4 
5import { Duplex as _Duplex } from 'node:stream';
6import type {
7 kIsReadable,
8 kIsWritable,
9 kDestroyed,
10} from 'node-internal:streams_util';
11 
12export {
13 Writable,
14 WritableOptions,
15 Readable,
16 ReadableOptions,
17 duplexPair,
18} from 'node:stream';
19 
20export const from: typeof _Duplex.from;
21export const fromWeb: typeof _Duplex.fromWeb;
22export const toWeb: typeof _Duplex.toWeb;
23 
24export declare class Duplex extends _Duplex {
25 _readableState: undefined;
26 _writableState: undefined;
27 _closed: boolean;
28 
29 [kIsReadable]: boolean;
30 [kIsWritable]: boolean;
31 [kDestroyed]: boolean;
32 
33 writableErrored: boolean;
34 readableErrored: boolean;
35}
36 
37export function toBYOBWeb(duplex: Duplex): {
38 readable: ReadableStream;
39 writable: WritableStream;
40};