File
Blob: src/node/internal/streams_duplex.d.ts
| 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 | |
| 5 | import { Duplex as _Duplex } from 'node:stream'; |
| 6 | import type { |
| 7 | kIsReadable, |
| 8 | kIsWritable, |
| 9 | kDestroyed, |
| 10 | } from 'node-internal:streams_util'; |
| 11 | |
| 12 | export { |
| 13 | Writable, |
| 14 | WritableOptions, |
| 15 | Readable, |
| 16 | ReadableOptions, |
| 17 | duplexPair, |
| 18 | } from 'node:stream'; |
| 19 | |
| 20 | export const from: typeof _Duplex.from; |
| 21 | export const fromWeb: typeof _Duplex.fromWeb; |
| 22 | export const toWeb: typeof _Duplex.toWeb; |
| 23 | |
| 24 | export 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 | |
| 37 | export function toBYOBWeb(duplex: Duplex): { |
| 38 | readable: ReadableStream; |
| 39 | writable: WritableStream; |
| 40 | }; |