import type { HsonSourceProvenance, HsonSourceRange } from "../hson-source-provenance/hson-source-provenance.js"; import { type CanonicalSchemaGraph, type CanonicalRefinementRule, type VerifiedCanonicalSchemaGraph } from "../canonical-schema/graph.js"; export declare const HSON_SCHEMA_MVP_COMPATIBILITY_VERSION: "hson-schema-mvp-10"; export type HsonSchemaIssueCode = "INVALID_ROOT" | "UNKNOWN_SCHEMA_MEMBER" | "INVALID_SCHEMA_EXPRESSION" | "ILLEGAL_OPTIONAL" | "INVALID_UNION" | "INVALID_REFERENCE" | "INVALID_SCHEMA_GRAPH"; export type HsonSchemaIssue = Readonly<{ code: HsonSchemaIssueCode; path: readonly (string | number)[]; message: string; range?: HsonSourceRange; }>; export type HsonSchemaRefinement = Readonly<{ member: "int" | "min" | "max" | "over" | "under" | "len" | "minlen" | "maxlen" | "prefix" | "suffix" | "contains" | "alphabet" | "unique"; rule: CanonicalRefinementRule; }>; type Refined = Readonly<{ refinements: readonly HsonSchemaRefinement[]; }>; export type HsonSchemaDataSemanticNode = (Readonly<{ kind: "string" | "number"; }> & Refined) | Readonly<{ kind: "boolean" | "null" | "any"; }> | Readonly<{ kind: "exact"; value: string | number | boolean | null; }> | Readonly<{ kind: "object"; members: readonly Readonly<{ name: string; optional: boolean; schema: HsonSchemaDataSemanticNode; }>[]; }> | (Readonly<{ kind: "array"; item: HsonSchemaDataSemanticNode; }> & Refined) | (Readonly<{ kind: "tuple"; items: readonly HsonSchemaDataSemanticNode[]; }> & Refined) | Readonly<{ kind: "union"; choices: readonly [HsonSchemaDataSemanticNode, HsonSchemaDataSemanticNode]; }> | Readonly<{ kind: "ref"; name: string; }>; export type HsonSchemaDocumentAttr = Readonly<{ name: string; optional: boolean; } & (Readonly<{ flag: true; }> | Readonly<{ flag: false; schema: HsonSchemaDataSemanticNode; }>)>; export type HsonSchemaDocumentItem = Readonly<{ kind: "document-string"; }> | Readonly<{ kind: "document-ref"; name: string; }> | HsonSchemaDocumentElement; export type HsonSchemaDocumentContent = Readonly<{ kind: "document-empty"; }> | Readonly<{ kind: "document-string-content"; }> | Readonly<{ kind: "document-sequence"; items: readonly HsonSchemaDocumentItem[]; }> | Readonly<{ kind: "document-repeat"; item: HsonSchemaDocumentItem; count?: number; }>; export type HsonSchemaDocumentElement = Readonly<{ kind: "document-element"; tag: string; attrs: readonly HsonSchemaDocumentAttr[]; attrsExact: boolean; content: HsonSchemaDocumentContent; }>; export type HsonSchemaDocument = Readonly<{ kind: "document"; content: HsonSchemaDocumentContent; }>; export type HsonSchemaSemanticNode = HsonSchemaDataSemanticNode | HsonSchemaDocumentElement | HsonSchemaDocument; export type HsonSchemaRangedNode = HsonSchemaSemanticNode | Extract | Extract; export type HsonSchemaDefinition = Readonly<{ name: string; schema: HsonSchemaDataSemanticNode | HsonSchemaDocumentElement; range: HsonSourceRange; }>; export type HsonSchemaReferenceUse = Readonly<{ name: string; schema: Extract | Extract; range: HsonSourceRange; }>; /** * Source-semantic facts for editor tooling. These deliberately identify a * definition by its authored declaration range rather than a lowered graph * node: graph indices are an implementation detail and can change on edits. */ export type HsonSchemaDefinitionSymbol = Readonly<{ id: string; name: string; declarationRange: HsonSourceRange; capability: "data" | "document-item"; referenceRanges: readonly HsonSourceRange[]; }>; export type HsonSchemaReferenceSymbol = Readonly<{ name: string; range: HsonSourceRange; requiredCapability: "data" | "document-item"; targetId?: string; }>; export type HsonSchemaSymbolTable = Readonly<{ definitions: readonly HsonSchemaDefinitionSymbol[]; references: readonly HsonSchemaReferenceSymbol[]; }>; export type CompiledHsonSchema = Readonly<{ semantic: HsonSchemaSemanticNode; definitions: readonly HsonSchemaDefinition[]; referenceUses: readonly HsonSchemaReferenceUse[]; symbols: HsonSchemaSymbolTable; graph: VerifiedCanonicalSchemaGraph; provenance: HsonSourceProvenance; semanticRanges: ReadonlyMap; canonicalNodeCount: number; canonicalRefCount: number; documentRepeatCount: number; documentExactCountCount: number; recursiveSccCount: number; }>; export type HsonSchemaCompilation = Readonly<{ ok: true; value: CompiledHsonSchema; }> | Readonly<{ ok: false; issues: readonly HsonSchemaIssue[]; symbols?: HsonSchemaSymbolTable; }>; /** * Editor-neutral compiler for the frozen Hson Schema MVP. It parses only data * Hson, validates the recursive bootstrap domain, decodes the human vocabulary, * and finally subjects the lowered graph to the canonical verifier. */ export declare function compile_hson_schema(source: string): HsonSchemaCompilation; export declare function lower_hson_schema_semantic(root: HsonSchemaSemanticNode, definitions?: readonly HsonSchemaDefinition[]): CanonicalSchemaGraph; export declare const HSON_SCHEMA_MVP_BOOTSTRAP: VerifiedCanonicalSchemaGraph; export {}; //# sourceMappingURL=compiler.d.ts.map