Skip to content

JsonTypeDefinition

Declares a 'json' value whose contents are checked by a parser.

  • BaseTypeDefinition

TResult = unknown

The type the parser produces on success.

readonly key: string

Key of the Property or value the declaration belongs to.

BaseTypeDefinition.key


readonly parse: (value) => { data: TResult; success: true; } | { error: unknown; success: false; }

Parser derived from the zod schema given to addProperty. The Runtime applies it after confirming the value is JSON-serializable; a failed parse is treated as an invalid value.

unknown

{ data: TResult; success: true; } | { error: unknown; success: false; }


readonly type: "json"

Discriminator naming this data type.

BaseTypeDefinition.type