nodes

Interfaces

BaseNode

Defined in: nodes.ts:30

Base interface for all schema nodes.

Every node in the schema system extends this interface. The nodeType discriminator enables TypeScript's discriminated union narrowing for type-safe node handling.

Codegen emits nodeType: 'unknown' for schemas it cannot parse, allowing graceful degradation - the UI will render a fallback for these.

Remarks

No index signature is used - this allows TypeScript's discriminated union narrowing to work correctly. All node properties must be explicitly defined in their respective node type interfaces.

Extended by

Properties

description?

optional description: string

Defined in: nodes.ts:34

Optional description from the OpenAPI schema.

nodeType

nodeType: string

Defined in: nodes.ts:32

Discriminator identifying the node type (e.g., 'object', 'string', 'array').


UnknownNode

Defined in: nodes.ts:41

Fallback node for schemas that couldn't be parsed. Used when codegen encounters an unsupported or malformed schema.

Extends

Properties

description?

optional description: string

Defined in: nodes.ts:43

Optional description from the OpenAPI schema.

Overrides

BaseNode.description

nodeType

nodeType: "unknown"

Defined in: nodes.ts:42

Discriminator identifying the node type (e.g., 'object', 'string', 'array').

Overrides

BaseNode.nodeType

Type Aliases

NodeInformation

NodeInformation<Nodes> = object

Defined in: nodes.ts:69

Derived type information from a node map. Provides convenient access to node types, unions, and discriminators.

Type Parameters

Nodes

Nodes

The node map to derive information from

Properties

AnyNode

AnyNode: NodeValuesWithUnknown<Nodes>

Defined in: nodes.ts:73

Union of all node types (for discriminated union patterns).

NodeNames

NodeNames: LiteralKeys<Nodes & object>

Defined in: nodes.ts:75

Union of all node name strings.

Nodes

Nodes: Nodes & object

Defined in: nodes.ts:71

The node map with UnknownNode included.

Type Declaration
unknown

unknown: UnknownNode

NodeTypes

NodeTypes: NodeValuesWithUnknown<Nodes> extends object ? Extract<T, string> : string

Defined in: nodes.ts:77

Union of all nodeType discriminator values.


NodeMap

NodeMap = Record<string, BaseNode>

Defined in: nodes.ts:47

A map of node names to their node definitions.


NodeTypeUnion

NodeTypeUnion<N> = NodeValues<N> extends object ? Extract<T, string> : string

Defined in: nodes.ts:59

Extracts the union of nodeType strings from a node map.

Type Parameters

N

N


NodeValues

NodeValues<N> = [LiteralKeys<N>] extends [never] ? UnknownNode : N[LiteralKeys<N>]

Defined in: nodes.ts:53

Extracts the union of node values from a node map. Returns UnknownNode if the map has no literal keys.

Type Parameters

N

N


NodeValuesWithUnknown

NodeValuesWithUnknown<N> = NodeValues<N & object>

Defined in: nodes.ts:56

Node values union that always includes UnknownNode.

Type Parameters

N

N


TUnknownNodeType

TUnknownNodeType = typeof UnknownNodeType

Defined in: nodes.ts:14

Type alias for the unknown node type string literal.

Variables

UnknownNodeType

const UnknownNodeType: "unknown" = 'unknown'

Defined in: nodes.ts:11

Constant for the unknown node type discriminator.