Codec
Defined in: src/persistence/migration/Codec.ts:37
A bidirectional value-transform with validation on both sides.
encode is called when the actor is about to persist; decode
is called after a successful journal read but before the
domain handler sees the payload. Errors thrown from either
surface as PersistError / MigrationError at the actor layer.
Type Parameters
Section titled “Type Parameters”T
Properties
Section titled “Properties”
readonlyoptionalname?:string
Defined in: src/persistence/migration/Codec.ts:47
Diagnostic name shown in error messages.
Methods
Section titled “Methods”decode()
Section titled “decode()”decode(
wire):T
Defined in: src/persistence/migration/Codec.ts:45
Inverse of encode.
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”T
encode()
Section titled “encode()”encode(
value):unknown
Defined in: src/persistence/migration/Codec.ts:43
Validate / serialise a domain value for the wire. Returning the input unchanged is fine — the codec’s job is to throw on invalid input, not necessarily to reshape the payload.
Parameters
Section titled “Parameters”T
Returns
Section titled “Returns”unknown