Interface: EncoderModule
Defined in: src/batteries/isolation/codec.ts:44
The slice of @nhtio/encoder's API surface this codec uses. Deliberately non-generic (unknown in, unknown out) — this codec always encodes/decodes values whose shape it cannot statically know, so the real encoder's <T extends Encodable>-constrained signature is narrowed away via defaultEncoderLoader's adapter rather than reflected here.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
decode | (encoded: string) => unknown | Decode a @nhtio/encoder wire string back into the original value. | src/batteries/isolation/codec.ts:48 |
encode | (value: unknown) => string | Encode an arbitrary value to its @nhtio/encoder wire string. | src/batteries/isolation/codec.ts:46 |
isCustomEncodable | (value: unknown) => boolean | Whether value is an instance of a class previously passed to registerClass. | src/batteries/isolation/codec.ts:52 |
isError | (value: unknown) => boolean | Whether value is an Error (or subclass), per the encoder's own classification. | src/batteries/isolation/codec.ts:54 |
registerClass | (ctor: { name: string; }) => void | Register a class as custom-encodable so encode/decode round-trip its instances. | src/batteries/isolation/codec.ts:50 |