import Node from '../parser/nodes/nodes.js'; import IODefinitions from '../core/definitions.js'; import IOSchema from './schema.js'; import MemberDef from './types/memberdef.js'; import '../core/positions.js'; import './schema-types.js'; /** * Defines the SchemaValidator interface. */ interface TypeDef { /** * Returns the type this instance is going to handle. */ get type(): string; /** * Returns the schema for the type this instance is going to handle. */ get schema(): IOSchema; /** * Validates and parses the value as per the memberDef and returns the results * specifying whether the value adhers to the schema or not! */ parse(node: Node, memberDef: MemberDef, definitions?: IODefinitions): any; /** Load: JS Value → Validated JS Value (optional until all types adopt) */ load?(value: any, memberDef: MemberDef, definitions?: IODefinitions): any; /** Stringify: Validated JS Value → IO Text (optional until all types adopt) * Returns undefined to signal "skip this field entirely" (for missing optional values) */ stringify?(value: any, memberDef: MemberDef, definitions?: IODefinitions): string | undefined; } export type { TypeDef as default };