# Interface DuplexOptions

interface DuplexOptions {
signal?: AbortSignal;
emitClose?: boolean;
highWaterMark?: number;
objectMode?: boolean;
autoDestroy?: boolean;
encoding?: BufferEncoding;
decodeStrings?: boolean;
defaultEncoding?: BufferEncoding;
allowHalfOpen?: boolean;
readableObjectMode?: boolean;
writableObjectMode?: boolean;
readableHighWaterMark?: number;
writableHighWaterMark?: number;
writableCorked?: number;
construct?(this: Duplex, callback: ((error?: Error) => void)): void;
read?(this: Duplex, size: number): void;
write?(this: Duplex, chunk: any, encoding: BufferEncoding, callback: ((error?: Error) => void)): void;
writev?(this: Duplex, chunks: {
chunk: any;
encoding: BufferEncoding;
}[], callback: ((error?: Error) => void)): void;
final?(this: Duplex, callback: ((error?: Error) => void)): void;
destroy?(this: Duplex, error: Error, callback: ((error?: Error) => void)): void;
}

#### Hierarchy (view full)

- ReadableOptions
- WritableOptions
  - DuplexOptions
    - TransformOptions

- Defined in node_modules/@types/node/stream.d.ts:1009

#####
Index

### Properties

signal?
emitClose?
highWaterMark?
objectMode?
autoDestroy?
encoding?
decodeStrings?
defaultEncoding?
allowHalfOpen?
readableObjectMode?
writableObjectMode?
readableHighWaterMark?
writableHighWaterMark?
writableCorked?

### Methods

construct?
read?
write?
writev?
final?
destroy?

##
Properties

### `Optional` signal

signal?: AbortSignal

When provided the corresponding `AbortController` can be used to cancel an asynchronous action.

Inherited from WritableOptions.signal

- Defined in node_modules/@types/node/events.d.ts:437

### `Optional` emitClose

emitClose?: boolean

Inherited from WritableOptions.emitClose

- Defined in node_modules/@types/node/stream.d.ts:45

### `Optional` highWaterMark

highWaterMark?: number

Inherited from WritableOptions.highWaterMark

- Defined in node_modules/@types/node/stream.d.ts:46

### `Optional` objectMode

objectMode?: boolean

Inherited from WritableOptions.objectMode

- Defined in node_modules/@types/node/stream.d.ts:47

### `Optional` autoDestroy

autoDestroy?: boolean

Inherited from WritableOptions.autoDestroy

- Defined in node_modules/@types/node/stream.d.ts:50

### `Optional` encoding

encoding?: BufferEncoding

Inherited from ReadableOptions.encoding

- Defined in node_modules/@types/node/stream.d.ts:53

### `Optional` decodeStrings

decodeStrings?: boolean

Inherited from WritableOptions.decodeStrings

- Defined in node_modules/@types/node/stream.d.ts:685

### `Optional` defaultEncoding

defaultEncoding?: BufferEncoding

Inherited from WritableOptions.defaultEncoding

- Defined in node_modules/@types/node/stream.d.ts:686

### `Optional` allowHalfOpen

allowHalfOpen?: boolean

- Defined in node_modules/@types/node/stream.d.ts:1010

### `Optional` readableObjectMode

readableObjectMode?: boolean

- Defined in node_modules/@types/node/stream.d.ts:1011

### `Optional` writableObjectMode

writableObjectMode?: boolean

- Defined in node_modules/@types/node/stream.d.ts:1012

### `Optional` readableHighWaterMark

readableHighWaterMark?: number

- Defined in node_modules/@types/node/stream.d.ts:1013

### `Optional` writableHighWaterMark

writableHighWaterMark?: number

- Defined in node_modules/@types/node/stream.d.ts:1014

### `Optional` writableCorked

writableCorked?: number

- Defined in node_modules/@types/node/stream.d.ts:1015

##
Methods

### `Optional` construct

- construct(this, callback): void

- #### Parameters

  - this: Duplex
  - callback: ((error?: Error) => void)
    - - (error?): void

      - #### Parameters

        - `Optional` error: Error

        #### Returns void

  Overrides WritableOptions.construct

  - Defined in node_modules/@types/node/stream.d.ts:1016

### `Optional` read

- read(this, size): void

- #### Parameters

  - this: Duplex
  - size: number

  #### Returns void

  Overrides ReadableOptions.read

  - Defined in node_modules/@types/node/stream.d.ts:1017

### `Optional` write

- write(this, chunk, encoding, callback): void

- #### Parameters

  - this: Duplex
  - chunk: any
  - encoding: BufferEncoding
  - callback: ((error?: Error) => void)
    - - (error?): void

      - #### Parameters

        - `Optional` error: Error

        #### Returns void

  Overrides WritableOptions.write

  - Defined in node_modules/@types/node/stream.d.ts:1018

### `Optional` writev

- writev(this, chunks, callback): void

- #### Parameters

  - this: Duplex
  - chunks: {
    chunk: any;
    encoding: BufferEncoding;
    }[]
  - callback: ((error?: Error) => void)
    - - (error?): void

      - #### Parameters

        - `Optional` error: Error

        #### Returns void

  Overrides WritableOptions.writev

  - Defined in node_modules/@types/node/stream.d.ts:1019

### `Optional` final

- final(this, callback): void

- #### Parameters

  - this: Duplex
  - callback: ((error?: Error) => void)
    - - (error?): void

      - #### Parameters

        - `Optional` error: Error

        #### Returns void

  Overrides WritableOptions.final

  - Defined in node_modules/@types/node/stream.d.ts:1027

### `Optional` destroy

- destroy(this, error, callback): void

- #### Parameters

  - this: Duplex
  - error: Error
  - callback: ((error?: Error) => void)
    - - (error?): void

      - #### Parameters

        - `Optional` error: Error

        #### Returns void

  Overrides WritableOptions.destroy

  - Defined in node_modules/@types/node/stream.d.ts:1028