Application value type.
Optional type name and JSON conversion hooks.
Optional Readonlydecode?: (value: unknown) => TValidates and converts parsed JSON-compatible data; identity by default.
Optional Readonlyencode?: (value: T) => unknownConverts an application value to JSON-compatible data; identity by default.
Optional ReadonlytypeName?: stringStable type name used in mapping errors; defaults to json.
A JSON-wire codec for T.
Creates a JSON-wire codec.
Call
jsonCodec()with no arguments to encode withJSON.stringifyand decode withJSON.parsewithout structural validation. That identity codec is the default when a Step or RPC omits an explicit codec. Passdecodewhen the parsed JSON must be validated or converted, such as rebuilding aDate. JSON.stringify semantics apply;undefined, cycles, and unsupported bigint values fail during encoding.