JsonSerializable

Type

Signature

type JsonSerializable = 
  | JsonPrimitive
  | readonly JsonSerializable[]
  | {
[key: string]: JsonSerializable | undefined;
};

core/src/job-types/json-serializable.ts:16

A value that survives a JSON round-trip without coercion or loss.

Plain objects, arrays, and JSON primitives are allowed. undefined is permitted only in object value positions (so optional properties such as { label?: string } typecheck).

Class instances (Date, Map, Set, custom classes) are rejected by the runtime isJsonSerializable check, but TypeScript can't always distinguish them from plain objects structurally — see EnsureJsonSerializable for the type level enforcement and rely on the runtime check for the rest.

esc

Search guides, integrations and every exported symbol.

↑ ↓ to navigate↵ to open