@coldsmirk/abacus-core 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -313,9 +313,9 @@ interface FieldConditionInput {
313
313
  /**
314
314
  * The field path the operator tests. Emitted **verbatim** into the compiled
315
315
  * ZEN source as a path expression (guarded by an identifier-path pattern that
316
- * also rejects ZEN reserved words such as `true` or `not` as segments), unlike
317
- * `value`, which is serialized to a ZEN literal — so callers must supply a
318
- * valid identifier path, not arbitrary user text.
316
+ * rejects keywords where ZEN cannot parse them as identifiers), unlike `value`,
317
+ * which is serialized to a ZEN literal — so callers must supply a valid
318
+ * identifier path, not arbitrary user text.
319
319
  */
320
320
  subject: string;
321
321
  operator: ConditionOperator;
@@ -382,8 +382,8 @@ declare function isZenRepresentableNumber(value: number): boolean;
382
382
  * {@link encodeZenString}; arrays become `[a, b, ...]`.
383
383
  *
384
384
  * Throws {@link ExpressionError} for a value with no faithful ZEN
385
- * representation — an object, symbol, or function, a string containing both
386
- * quote styles, a number failing {@link isZenRepresentableNumber} (outside
385
+ * representation — an object, symbol, or function, a string containing all
386
+ * three raw-string delimiters, a number failing {@link isZenRepresentableNumber} (outside
387
387
  * ZEN's decimal domain, or held differently by the engine's context
388
388
  * conversion), or a bigint outside the decimal domain. Callers that need a
389
389
  * sentinel instead of a throw go through {@link compileCondition}, which
@@ -630,6 +630,7 @@ declare const enMessages: ExpressionMessages;
630
630
  * Built-in Simplified Chinese message catalog.
631
631
  */
632
632
  declare const zhCNMessages: ExpressionMessages;
633
+ type ExpressionMessagesListener = (messages: ExpressionMessages) => void;
633
634
  /**
634
635
  * Register (or replace) the message catalog for a locale key, making it selectable
635
636
  * via {@link configureExpressionMessages}. This is how a host adds a language the
@@ -663,6 +664,11 @@ declare function configureExpressionMessages({
663
664
  * The active {@link ExpressionMessages} catalog (English by default).
664
665
  */
665
666
  declare function getExpressionMessages(): ExpressionMessages;
667
+ /**
668
+ * Subscribe to active message-catalog changes. Returns an idempotent unsubscribe
669
+ * function; listeners run synchronously after the new catalog becomes active.
670
+ */
671
+ declare function subscribeExpressionMessages(listener: ExpressionMessagesListener): () => void;
666
672
  /**
667
673
  * One `{{ expression }}` hole located in a template document. `from` / `to` are
668
674
  * the character offsets of the inner expression itself — the text between the
@@ -729,4 +735,158 @@ declare function getTemplateDiagnosticsSync(source: string): ExpressionDiagnosti
729
735
  * Async {@link getTemplateDiagnosticsSync}, loading the engine on first use.
730
736
  */
731
737
  declare function getTemplateDiagnostics(source: string): Promise<ExpressionDiagnostic[]>;
732
- export { type BranchSelection, type BuiltInExpressionLocale, CONDITION_OPERATORS, CONDITION_TREE_OPERATORS, type ConditionBranchInput, type ConditionGroupInput, type ConditionInput, type ConditionOperator, type ConditionOperatorArity, type ConditionScalar, type ConditionTreeGroup, type ConditionTreeNode, type ConditionTreeOperator, type ConditionTreeRule, type ConditionTreeValue, type ConfigureMessagesOptions, type ExpressionAnalysis, type ExpressionCompletion, type ExpressionConditionInput, type ExpressionContext, type ExpressionDiagnostic, type ExpressionEngine, ExpressionError, type ExpressionLocale, type ExpressionMessages, type ExpressionMode, ExpressionNotReadyError, type ExpressionType, type ExpressionTypeSpan, type FieldConditionInput, type LoadEngineOptions, MAX_CONDITION_TREE_DEPTH, type TemplateHole, analyzeTemplate, analyzeTemplateSync, analyzeTypes, analyzeTypesSync, compileBranch, compileCondition, compileConditionTree, compileGroup, conditionOperatorArity, configureEngine, configureExpressionMessages, emptyConditionGroup, enMessages, ensureConditionNodeIds, evaluate, evaluateSync, evaluateUnary, evaluateUnarySync, getCompletionItems, getCompletionItemsSync, getDiagnostics, getDiagnosticsSync, getEngineError, getEngineSync, getExpressionMessages, getTemplateDiagnostics, getTemplateDiagnosticsSync, isEngineReady, isZenRepresentableNumber, liftConditionTree, loadEngine, newConditionNodeId, parseTemplateHoles, registerExpressionLocale, resetEngine, satisfiesType, satisfiesTypeSync, selectBranch, selectBranchWith, templateHoleAt, toZenLiteral, zhCNMessages };
738
+ /**
739
+ * The field-tree model behind the visual JSON Schema builder: a lossless projection of the
740
+ * JSON Schema subset the tree can host (`type` / `properties` / `items`, plus `required`).
741
+ * The schema JSON stays the single source of truth: {@link parseSchemaTree} REFUSES anything
742
+ * outside the subset (never a lossy rewrite), so a hand-written `oneOf` or `format` keeps its
743
+ * document JSON-only instead of silently vanishing on the first visual edit.
744
+ */
745
+ /**
746
+ * The one dialect the tree round-trips: a document may omit `$schema` or declare exactly this.
747
+ */
748
+ declare const SCHEMA_DIALECT_2020_12 = "https://json-schema.org/draft/2020-12/schema";
749
+ type SchemaTreeFieldType = "any" | "array" | "boolean" | "integer" | "number" | "object" | "string";
750
+ interface SchemaTreeField {
751
+ /**
752
+ * Stable row identity for React keys and targeted edits — a UI concern, never serialized.
753
+ */
754
+ id: string;
755
+ /**
756
+ * The property name under its parent object; unused on an array-element node.
757
+ */
758
+ name: string;
759
+ type: SchemaTreeFieldType;
760
+ /**
761
+ * Listed in the parent object's `required`; unused on an array-element node.
762
+ */
763
+ required: boolean;
764
+ /**
765
+ * The schema's `description` annotation; blank means none (not serialized).
766
+ */
767
+ description: string;
768
+ /**
769
+ * Sub-fields, meaningful when `type` is `object`.
770
+ */
771
+ children: SchemaTreeField[];
772
+ /**
773
+ * The element node, meaningful when `type` is `array`; `null` means untyped elements.
774
+ */
775
+ items: SchemaTreeField | null;
776
+ /**
777
+ * For an object or array node parsed from JSON, whether its source explicitly
778
+ * declared that type. `false` preserves a type-less applicator; omitted keeps the
779
+ * historical hand-built-tree default of emitting the type.
780
+ */
781
+ explicitType?: boolean;
782
+ /**
783
+ * Whether a blank / whitespace-only name came from a real `properties` key and must be
784
+ * persisted. Omitted blank names are unfinished UI rows and do not serialize.
785
+ */
786
+ preserveBlankName?: boolean;
787
+ }
788
+ interface SchemaTree {
789
+ fields: SchemaTreeField[];
790
+ /**
791
+ * Whether the source declared `$schema` (re-emitted verbatim on serialize).
792
+ */
793
+ dialect: boolean;
794
+ /**
795
+ * The root schema's `description` annotation, preserved verbatim across the round trip
796
+ * (the field view offers no root-level editor); blank means none.
797
+ */
798
+ description: string;
799
+ /**
800
+ * For a tree parsed from JSON, whether the root explicitly declared `type: "object"`.
801
+ * `false` preserves a type-less root; omitted keeps the historical hand-built-tree default
802
+ * of emitting the type.
803
+ */
804
+ explicitType?: boolean;
805
+ }
806
+ /**
807
+ * Why a document cannot be projected onto the field tree — structured so a UI can localize
808
+ * the explanation. Every code names the offending part where one exists.
809
+ */
810
+ type SchemaTreeIssue = {
811
+ code: "invalid-description";
812
+ } | {
813
+ code: "invalid-field-definition";
814
+ field: string;
815
+ } | {
816
+ code: "invalid-field-type";
817
+ field: string;
818
+ } | {
819
+ code: "invalid-json";
820
+ } | {
821
+ code: "invalid-properties";
822
+ } | {
823
+ code: "invalid-required";
824
+ } | {
825
+ code: "misplaced-keyword";
826
+ keyword: string;
827
+ holder: "array" | "object";
828
+ } | {
829
+ code: "root-not-object";
830
+ } | {
831
+ code: "unknown-required-field";
832
+ field: string;
833
+ } | {
834
+ code: "unsupported-dialect";
835
+ } | {
836
+ code: "unsupported-field-type";
837
+ field: string;
838
+ type: string;
839
+ } | {
840
+ code: "unsupported-keyword";
841
+ keyword: string;
842
+ };
843
+ type SchemaTreeParseResult = {
844
+ ok: true;
845
+ tree: SchemaTree;
846
+ } | {
847
+ ok: false;
848
+ issue: SchemaTreeIssue;
849
+ };
850
+ /**
851
+ * A fresh {@link SchemaTreeField}, defaulting to an optional unnamed string field. The id is a
852
+ * tagged counter, not a UUID: field identity is a UI concern with no persistence or
853
+ * cross-process meaning — exactly the guarantee a React key needs.
854
+ */
855
+ declare function newSchemaTreeField(overrides?: Partial<Omit<SchemaTreeField, "id">>): SchemaTreeField;
856
+ /**
857
+ * The expression scope a schema tree declares: each named field becomes a typed variable, so a
858
+ * host can hand the result straight to `<ExpressionInput variables={…}>` (or `analyzeTypes`)
859
+ * and complete against the declared shape. Blank draft rows are skipped, while blank property
860
+ * names preserved by {@link parseSchemaTree} remain part of the scope.
861
+ */
862
+ declare function schemaTreeToExpressionType(tree: SchemaTree): ExpressionType;
863
+ /**
864
+ * Infer a draft 2020-12 JSON Schema from a sample payload — the "generate from example" path of
865
+ * the visual schema builder. Deliberately emits only the subset {@link parseSchemaTree} hosts
866
+ * (`type` / `properties` / `items`): integers stay `number` (a sample's `5` rarely promises
867
+ * integers forever) and nothing is marked `required` (validation strictness is an authoring
868
+ * decision, not something a single sample can attest).
869
+ */
870
+ interface JsonObject {
871
+ [key: string]: Json;
872
+ }
873
+ type Json = null | boolean | number | string | Json[] | JsonObject;
874
+ /**
875
+ * The schema a sample value attests: scalars map to their type, objects carry every observed
876
+ * property, arrays take the merged schema of their elements (an empty or mixed array leaves the
877
+ * items open). `null` says nothing about the real type, so it infers `{}` (any).
878
+ */
879
+ declare function inferSchema(sample: Json): JsonObject;
880
+ /**
881
+ * Project a schema document onto the field tree, or refuse with a structured
882
+ * {@link SchemaTreeIssue} when it uses anything beyond the subset. A blank document parses as
883
+ * an empty tree.
884
+ */
885
+ declare function parseSchemaTree(text: string): SchemaTreeParseResult;
886
+ /**
887
+ * The field tree back as pretty-printed schema JSON. A parsed type-less object root stays
888
+ * type-less; a hand-built tree still emits an object root by default. Clearing the contract
889
+ * entirely (an empty document) stays a source-mode action.
890
+ */
891
+ declare function serializeSchemaTree(tree: SchemaTree): string;
892
+ export { type BranchSelection, type BuiltInExpressionLocale, CONDITION_OPERATORS, CONDITION_TREE_OPERATORS, type ConditionBranchInput, type ConditionGroupInput, type ConditionInput, type ConditionOperator, type ConditionOperatorArity, type ConditionScalar, type ConditionTreeGroup, type ConditionTreeNode, type ConditionTreeOperator, type ConditionTreeRule, type ConditionTreeValue, type ConfigureMessagesOptions, type ExpressionAnalysis, type ExpressionCompletion, type ExpressionConditionInput, type ExpressionContext, type ExpressionDiagnostic, type ExpressionEngine, ExpressionError, type ExpressionLocale, type ExpressionMessages, type ExpressionMessagesListener, type ExpressionMode, ExpressionNotReadyError, type ExpressionType, type ExpressionTypeSpan, type FieldConditionInput, type Json, type LoadEngineOptions, MAX_CONDITION_TREE_DEPTH, SCHEMA_DIALECT_2020_12, type SchemaTree, type SchemaTreeField, type SchemaTreeFieldType, type SchemaTreeIssue, type SchemaTreeParseResult, type TemplateHole, analyzeTemplate, analyzeTemplateSync, analyzeTypes, analyzeTypesSync, compileBranch, compileCondition, compileConditionTree, compileGroup, conditionOperatorArity, configureEngine, configureExpressionMessages, emptyConditionGroup, enMessages, ensureConditionNodeIds, evaluate, evaluateSync, evaluateUnary, evaluateUnarySync, getCompletionItems, getCompletionItemsSync, getDiagnostics, getDiagnosticsSync, getEngineError, getEngineSync, getExpressionMessages, getTemplateDiagnostics, getTemplateDiagnosticsSync, inferSchema, isEngineReady, isZenRepresentableNumber, liftConditionTree, loadEngine, newConditionNodeId, newSchemaTreeField, parseSchemaTree, parseTemplateHoles, registerExpressionLocale, resetEngine, satisfiesType, satisfiesTypeSync, schemaTreeToExpressionType, selectBranch, selectBranchWith, serializeSchemaTree, subscribeExpressionMessages, templateHoleAt, toZenLiteral, zhCNMessages };
package/dist/index.d.ts CHANGED
@@ -313,9 +313,9 @@ interface FieldConditionInput {
313
313
  /**
314
314
  * The field path the operator tests. Emitted **verbatim** into the compiled
315
315
  * ZEN source as a path expression (guarded by an identifier-path pattern that
316
- * also rejects ZEN reserved words such as `true` or `not` as segments), unlike
317
- * `value`, which is serialized to a ZEN literal — so callers must supply a
318
- * valid identifier path, not arbitrary user text.
316
+ * rejects keywords where ZEN cannot parse them as identifiers), unlike `value`,
317
+ * which is serialized to a ZEN literal — so callers must supply a valid
318
+ * identifier path, not arbitrary user text.
319
319
  */
320
320
  subject: string;
321
321
  operator: ConditionOperator;
@@ -382,8 +382,8 @@ declare function isZenRepresentableNumber(value: number): boolean;
382
382
  * {@link encodeZenString}; arrays become `[a, b, ...]`.
383
383
  *
384
384
  * Throws {@link ExpressionError} for a value with no faithful ZEN
385
- * representation — an object, symbol, or function, a string containing both
386
- * quote styles, a number failing {@link isZenRepresentableNumber} (outside
385
+ * representation — an object, symbol, or function, a string containing all
386
+ * three raw-string delimiters, a number failing {@link isZenRepresentableNumber} (outside
387
387
  * ZEN's decimal domain, or held differently by the engine's context
388
388
  * conversion), or a bigint outside the decimal domain. Callers that need a
389
389
  * sentinel instead of a throw go through {@link compileCondition}, which
@@ -630,6 +630,7 @@ declare const enMessages: ExpressionMessages;
630
630
  * Built-in Simplified Chinese message catalog.
631
631
  */
632
632
  declare const zhCNMessages: ExpressionMessages;
633
+ type ExpressionMessagesListener = (messages: ExpressionMessages) => void;
633
634
  /**
634
635
  * Register (or replace) the message catalog for a locale key, making it selectable
635
636
  * via {@link configureExpressionMessages}. This is how a host adds a language the
@@ -663,6 +664,11 @@ declare function configureExpressionMessages({
663
664
  * The active {@link ExpressionMessages} catalog (English by default).
664
665
  */
665
666
  declare function getExpressionMessages(): ExpressionMessages;
667
+ /**
668
+ * Subscribe to active message-catalog changes. Returns an idempotent unsubscribe
669
+ * function; listeners run synchronously after the new catalog becomes active.
670
+ */
671
+ declare function subscribeExpressionMessages(listener: ExpressionMessagesListener): () => void;
666
672
  /**
667
673
  * One `{{ expression }}` hole located in a template document. `from` / `to` are
668
674
  * the character offsets of the inner expression itself — the text between the
@@ -729,4 +735,158 @@ declare function getTemplateDiagnosticsSync(source: string): ExpressionDiagnosti
729
735
  * Async {@link getTemplateDiagnosticsSync}, loading the engine on first use.
730
736
  */
731
737
  declare function getTemplateDiagnostics(source: string): Promise<ExpressionDiagnostic[]>;
732
- export { type BranchSelection, type BuiltInExpressionLocale, CONDITION_OPERATORS, CONDITION_TREE_OPERATORS, type ConditionBranchInput, type ConditionGroupInput, type ConditionInput, type ConditionOperator, type ConditionOperatorArity, type ConditionScalar, type ConditionTreeGroup, type ConditionTreeNode, type ConditionTreeOperator, type ConditionTreeRule, type ConditionTreeValue, type ConfigureMessagesOptions, type ExpressionAnalysis, type ExpressionCompletion, type ExpressionConditionInput, type ExpressionContext, type ExpressionDiagnostic, type ExpressionEngine, ExpressionError, type ExpressionLocale, type ExpressionMessages, type ExpressionMode, ExpressionNotReadyError, type ExpressionType, type ExpressionTypeSpan, type FieldConditionInput, type LoadEngineOptions, MAX_CONDITION_TREE_DEPTH, type TemplateHole, analyzeTemplate, analyzeTemplateSync, analyzeTypes, analyzeTypesSync, compileBranch, compileCondition, compileConditionTree, compileGroup, conditionOperatorArity, configureEngine, configureExpressionMessages, emptyConditionGroup, enMessages, ensureConditionNodeIds, evaluate, evaluateSync, evaluateUnary, evaluateUnarySync, getCompletionItems, getCompletionItemsSync, getDiagnostics, getDiagnosticsSync, getEngineError, getEngineSync, getExpressionMessages, getTemplateDiagnostics, getTemplateDiagnosticsSync, isEngineReady, isZenRepresentableNumber, liftConditionTree, loadEngine, newConditionNodeId, parseTemplateHoles, registerExpressionLocale, resetEngine, satisfiesType, satisfiesTypeSync, selectBranch, selectBranchWith, templateHoleAt, toZenLiteral, zhCNMessages };
738
+ /**
739
+ * The field-tree model behind the visual JSON Schema builder: a lossless projection of the
740
+ * JSON Schema subset the tree can host (`type` / `properties` / `items`, plus `required`).
741
+ * The schema JSON stays the single source of truth: {@link parseSchemaTree} REFUSES anything
742
+ * outside the subset (never a lossy rewrite), so a hand-written `oneOf` or `format` keeps its
743
+ * document JSON-only instead of silently vanishing on the first visual edit.
744
+ */
745
+ /**
746
+ * The one dialect the tree round-trips: a document may omit `$schema` or declare exactly this.
747
+ */
748
+ declare const SCHEMA_DIALECT_2020_12 = "https://json-schema.org/draft/2020-12/schema";
749
+ type SchemaTreeFieldType = "any" | "array" | "boolean" | "integer" | "number" | "object" | "string";
750
+ interface SchemaTreeField {
751
+ /**
752
+ * Stable row identity for React keys and targeted edits — a UI concern, never serialized.
753
+ */
754
+ id: string;
755
+ /**
756
+ * The property name under its parent object; unused on an array-element node.
757
+ */
758
+ name: string;
759
+ type: SchemaTreeFieldType;
760
+ /**
761
+ * Listed in the parent object's `required`; unused on an array-element node.
762
+ */
763
+ required: boolean;
764
+ /**
765
+ * The schema's `description` annotation; blank means none (not serialized).
766
+ */
767
+ description: string;
768
+ /**
769
+ * Sub-fields, meaningful when `type` is `object`.
770
+ */
771
+ children: SchemaTreeField[];
772
+ /**
773
+ * The element node, meaningful when `type` is `array`; `null` means untyped elements.
774
+ */
775
+ items: SchemaTreeField | null;
776
+ /**
777
+ * For an object or array node parsed from JSON, whether its source explicitly
778
+ * declared that type. `false` preserves a type-less applicator; omitted keeps the
779
+ * historical hand-built-tree default of emitting the type.
780
+ */
781
+ explicitType?: boolean;
782
+ /**
783
+ * Whether a blank / whitespace-only name came from a real `properties` key and must be
784
+ * persisted. Omitted blank names are unfinished UI rows and do not serialize.
785
+ */
786
+ preserveBlankName?: boolean;
787
+ }
788
+ interface SchemaTree {
789
+ fields: SchemaTreeField[];
790
+ /**
791
+ * Whether the source declared `$schema` (re-emitted verbatim on serialize).
792
+ */
793
+ dialect: boolean;
794
+ /**
795
+ * The root schema's `description` annotation, preserved verbatim across the round trip
796
+ * (the field view offers no root-level editor); blank means none.
797
+ */
798
+ description: string;
799
+ /**
800
+ * For a tree parsed from JSON, whether the root explicitly declared `type: "object"`.
801
+ * `false` preserves a type-less root; omitted keeps the historical hand-built-tree default
802
+ * of emitting the type.
803
+ */
804
+ explicitType?: boolean;
805
+ }
806
+ /**
807
+ * Why a document cannot be projected onto the field tree — structured so a UI can localize
808
+ * the explanation. Every code names the offending part where one exists.
809
+ */
810
+ type SchemaTreeIssue = {
811
+ code: "invalid-description";
812
+ } | {
813
+ code: "invalid-field-definition";
814
+ field: string;
815
+ } | {
816
+ code: "invalid-field-type";
817
+ field: string;
818
+ } | {
819
+ code: "invalid-json";
820
+ } | {
821
+ code: "invalid-properties";
822
+ } | {
823
+ code: "invalid-required";
824
+ } | {
825
+ code: "misplaced-keyword";
826
+ keyword: string;
827
+ holder: "array" | "object";
828
+ } | {
829
+ code: "root-not-object";
830
+ } | {
831
+ code: "unknown-required-field";
832
+ field: string;
833
+ } | {
834
+ code: "unsupported-dialect";
835
+ } | {
836
+ code: "unsupported-field-type";
837
+ field: string;
838
+ type: string;
839
+ } | {
840
+ code: "unsupported-keyword";
841
+ keyword: string;
842
+ };
843
+ type SchemaTreeParseResult = {
844
+ ok: true;
845
+ tree: SchemaTree;
846
+ } | {
847
+ ok: false;
848
+ issue: SchemaTreeIssue;
849
+ };
850
+ /**
851
+ * A fresh {@link SchemaTreeField}, defaulting to an optional unnamed string field. The id is a
852
+ * tagged counter, not a UUID: field identity is a UI concern with no persistence or
853
+ * cross-process meaning — exactly the guarantee a React key needs.
854
+ */
855
+ declare function newSchemaTreeField(overrides?: Partial<Omit<SchemaTreeField, "id">>): SchemaTreeField;
856
+ /**
857
+ * The expression scope a schema tree declares: each named field becomes a typed variable, so a
858
+ * host can hand the result straight to `<ExpressionInput variables={…}>` (or `analyzeTypes`)
859
+ * and complete against the declared shape. Blank draft rows are skipped, while blank property
860
+ * names preserved by {@link parseSchemaTree} remain part of the scope.
861
+ */
862
+ declare function schemaTreeToExpressionType(tree: SchemaTree): ExpressionType;
863
+ /**
864
+ * Infer a draft 2020-12 JSON Schema from a sample payload — the "generate from example" path of
865
+ * the visual schema builder. Deliberately emits only the subset {@link parseSchemaTree} hosts
866
+ * (`type` / `properties` / `items`): integers stay `number` (a sample's `5` rarely promises
867
+ * integers forever) and nothing is marked `required` (validation strictness is an authoring
868
+ * decision, not something a single sample can attest).
869
+ */
870
+ interface JsonObject {
871
+ [key: string]: Json;
872
+ }
873
+ type Json = null | boolean | number | string | Json[] | JsonObject;
874
+ /**
875
+ * The schema a sample value attests: scalars map to their type, objects carry every observed
876
+ * property, arrays take the merged schema of their elements (an empty or mixed array leaves the
877
+ * items open). `null` says nothing about the real type, so it infers `{}` (any).
878
+ */
879
+ declare function inferSchema(sample: Json): JsonObject;
880
+ /**
881
+ * Project a schema document onto the field tree, or refuse with a structured
882
+ * {@link SchemaTreeIssue} when it uses anything beyond the subset. A blank document parses as
883
+ * an empty tree.
884
+ */
885
+ declare function parseSchemaTree(text: string): SchemaTreeParseResult;
886
+ /**
887
+ * The field tree back as pretty-printed schema JSON. A parsed type-less object root stays
888
+ * type-less; a hand-built tree still emits an object root by default. Clearing the contract
889
+ * entirely (an empty document) stays a source-mode action.
890
+ */
891
+ declare function serializeSchemaTree(tree: SchemaTree): string;
892
+ export { type BranchSelection, type BuiltInExpressionLocale, CONDITION_OPERATORS, CONDITION_TREE_OPERATORS, type ConditionBranchInput, type ConditionGroupInput, type ConditionInput, type ConditionOperator, type ConditionOperatorArity, type ConditionScalar, type ConditionTreeGroup, type ConditionTreeNode, type ConditionTreeOperator, type ConditionTreeRule, type ConditionTreeValue, type ConfigureMessagesOptions, type ExpressionAnalysis, type ExpressionCompletion, type ExpressionConditionInput, type ExpressionContext, type ExpressionDiagnostic, type ExpressionEngine, ExpressionError, type ExpressionLocale, type ExpressionMessages, type ExpressionMessagesListener, type ExpressionMode, ExpressionNotReadyError, type ExpressionType, type ExpressionTypeSpan, type FieldConditionInput, type Json, type LoadEngineOptions, MAX_CONDITION_TREE_DEPTH, SCHEMA_DIALECT_2020_12, type SchemaTree, type SchemaTreeField, type SchemaTreeFieldType, type SchemaTreeIssue, type SchemaTreeParseResult, type TemplateHole, analyzeTemplate, analyzeTemplateSync, analyzeTypes, analyzeTypesSync, compileBranch, compileCondition, compileConditionTree, compileGroup, conditionOperatorArity, configureEngine, configureExpressionMessages, emptyConditionGroup, enMessages, ensureConditionNodeIds, evaluate, evaluateSync, evaluateUnary, evaluateUnarySync, getCompletionItems, getCompletionItemsSync, getDiagnostics, getDiagnosticsSync, getEngineError, getEngineSync, getExpressionMessages, getTemplateDiagnostics, getTemplateDiagnosticsSync, inferSchema, isEngineReady, isZenRepresentableNumber, liftConditionTree, loadEngine, newConditionNodeId, newSchemaTreeField, parseSchemaTree, parseTemplateHoles, registerExpressionLocale, resetEngine, satisfiesType, satisfiesTypeSync, schemaTreeToExpressionType, selectBranch, selectBranchWith, serializeSchemaTree, subscribeExpressionMessages, templateHoleAt, toZenLiteral, zhCNMessages };