x-to-zod / ParserConstructor
Type Alias: ParserConstructor
ts
type ParserConstructor = (schema, refs) => Parser;Defined in: src/Parser/index.ts:30
Constructor shape required by the parser registry.
The schema: any parameter is intentional — it bypasses TypeScript constructor parameter contravariance, allowing concrete parsers with schema-specific constructor types (e.g. SchemaNode<Version>) to be registered without modification. Runtime validation is performed by registerParser to ensure structural correctness.
See: research.md §2 — ParserClass registry type widening.
Parameters
schema
any