@fluidframework/tree 2.52.0 → 2.53.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/.eslintrc.cjs +14 -2
- package/CHANGELOG.md +125 -0
- package/api-report/tree.alpha.api.md +48 -41
- package/dist/alpha.d.ts +2 -1
- package/dist/core/tree/visitDelta.d.ts +1 -1
- package/dist/core/tree/visitDelta.d.ts.map +1 -1
- package/dist/core/tree/visitDelta.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/index.d.ts +1 -0
- package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/index.js +3 -1
- package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +2 -4
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js +3 -0
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +1 -0
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/default-schema/noChangeCodecs.d.ts +1 -1
- package/dist/feature-libraries/default-schema/noChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/noChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +4 -0
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +5 -5
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +1 -1
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +4 -2
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +7 -0
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.js +1 -0
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.js +1 -0
- package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +9 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +49 -20
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.js +3 -0
- package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldChangeRebaser.d.ts +1 -0
- package/dist/feature-libraries/sequence-field/sequenceFieldChangeRebaser.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldChangeRebaser.js +4 -0
- package/dist/feature-libraries/sequence-field/sequenceFieldChangeRebaser.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
- package/dist/feature-libraries/sequence-field/types.d.ts +1 -1
- package/dist/feature-libraries/sequence-field/types.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/types.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/jsonDomainSchema.d.ts +5 -3
- package/dist/jsonDomainSchema.d.ts.map +1 -1
- package/dist/jsonDomainSchema.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/shared-tree/independentView.d.ts.map +1 -1
- package/dist/shared-tree/independentView.js +1 -1
- package/dist/shared-tree/independentView.js.map +1 -1
- package/dist/shared-tree/index.d.ts +0 -1
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/schematizeTree.d.ts +23 -60
- package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
- package/dist/shared-tree/schematizeTree.js +59 -151
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +11 -11
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +9 -3
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree-core/defaultResubmitMachine.d.ts +2 -1
- package/dist/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
- package/dist/shared-tree-core/defaultResubmitMachine.js.map +1 -1
- package/dist/simple-tree/api/configuration.d.ts +3 -0
- package/dist/simple-tree/api/configuration.d.ts.map +1 -1
- package/dist/simple-tree/api/configuration.js +5 -1
- package/dist/simple-tree/api/configuration.js.map +1 -1
- package/dist/simple-tree/api/create.d.ts +4 -4
- package/dist/simple-tree/api/create.d.ts.map +1 -1
- package/dist/simple-tree/api/create.js +3 -6
- package/dist/simple-tree/api/create.js.map +1 -1
- package/dist/simple-tree/api/discrepancies.d.ts +5 -9
- package/dist/simple-tree/api/discrepancies.d.ts.map +1 -1
- package/dist/simple-tree/api/discrepancies.js +11 -10
- package/dist/simple-tree/api/discrepancies.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +3 -2
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +3 -2
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.js +3 -4
- package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts +9 -155
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +4 -47
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +157 -16
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js +33 -11
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +1 -3
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.js +1 -7
- package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/dist/simple-tree/api/schemaStatics.d.ts +158 -0
- package/dist/simple-tree/api/schemaStatics.d.ts.map +1 -0
- package/dist/simple-tree/api/schemaStatics.js +59 -0
- package/dist/simple-tree/api/schemaStatics.js.map +1 -0
- package/dist/simple-tree/api/storedSchema.d.ts +5 -3
- package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/storedSchema.js +4 -2
- package/dist/simple-tree/api/storedSchema.js.map +1 -1
- package/dist/simple-tree/api/treeBeta.d.ts.map +1 -1
- package/dist/simple-tree/api/treeBeta.js +12 -6
- package/dist/simple-tree/api/treeBeta.js.map +1 -1
- package/dist/simple-tree/core/allowedTypes.d.ts +46 -30
- package/dist/simple-tree/core/allowedTypes.d.ts.map +1 -1
- package/dist/simple-tree/core/allowedTypes.js +20 -12
- package/dist/simple-tree/core/allowedTypes.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +5 -3
- package/dist/simple-tree/core/index.d.ts.map +1 -1
- package/dist/simple-tree/core/index.js +6 -1
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/simpleNodeSchemaBase.d.ts +25 -0
- package/dist/simple-tree/core/simpleNodeSchemaBase.d.ts.map +1 -0
- package/dist/simple-tree/core/simpleNodeSchemaBase.js +7 -0
- package/dist/simple-tree/core/simpleNodeSchemaBase.js.map +1 -0
- package/dist/simple-tree/core/toStored.d.ts +32 -0
- package/dist/simple-tree/core/toStored.d.ts.map +1 -0
- package/dist/simple-tree/core/toStored.js +37 -0
- package/dist/simple-tree/core/toStored.js.map +1 -0
- package/dist/simple-tree/core/treeNode.d.ts +0 -3
- package/dist/simple-tree/core/treeNode.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNode.js +3 -3
- package/dist/simple-tree/core/treeNode.js.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts +7 -2
- package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/dist/simple-tree/core/treeNodeValid.d.ts +6 -1
- package/dist/simple-tree/core/treeNodeValid.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeValid.js +11 -6
- package/dist/simple-tree/core/treeNodeValid.js.map +1 -1
- package/dist/simple-tree/core/walkSchema.d.ts +19 -5
- package/dist/simple-tree/core/walkSchema.d.ts.map +1 -1
- package/dist/simple-tree/core/walkSchema.js +4 -2
- package/dist/simple-tree/core/walkSchema.js.map +1 -1
- package/dist/simple-tree/createContext.d.ts.map +1 -1
- package/dist/simple-tree/createContext.js +1 -1
- package/dist/simple-tree/createContext.js.map +1 -1
- package/dist/simple-tree/fieldSchema.d.ts +2 -1
- package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
- package/dist/simple-tree/fieldSchema.js +1 -1
- package/dist/simple-tree/fieldSchema.js.map +1 -1
- package/dist/simple-tree/index.d.ts +4 -4
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +9 -2
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js +1 -0
- package/dist/simple-tree/leafNodeSchema.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js +18 -4
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.js +9 -2
- package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts +2 -2
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.js +37 -26
- package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.js +9 -2
- package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/dist/simple-tree/prepareForInsertion.d.ts +5 -5
- package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
- package/dist/simple-tree/prepareForInsertion.js +10 -10
- package/dist/simple-tree/prepareForInsertion.js.map +1 -1
- package/dist/simple-tree/simpleSchema.d.ts +6 -21
- package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/simpleSchema.js.map +1 -1
- package/dist/simple-tree/toStoredSchema.d.ts +35 -11
- package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +68 -33
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/tableSchema.d.ts +25 -32
- package/dist/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +10 -24
- package/dist/tableSchema.js.map +1 -1
- package/docs/.attachments/cell-ordering/C-knows-of-ABC.png +0 -0
- package/docs/.attachments/cell-ordering/C-knows-of-C.png +0 -0
- package/docs/.attachments/cell-ordering/XvsA.png +0 -0
- package/docs/.attachments/cell-ordering/compose-a-b.png +0 -0
- package/docs/.attachments/cell-ordering/compose-a-ref-p1-b-ref-p2.png +0 -0
- package/docs/.attachments/cell-ordering/compose-b-no-ref-to-ca.png +0 -0
- package/docs/.attachments/cell-ordering/rebase-ab-over-x.png +0 -0
- package/docs/.attachments/cell-ordering/rebase-b-over-x.png +0 -0
- package/docs/.attachments/cell-ordering/rebase-b2-over-x.png +0 -0
- package/docs/.attachments/cell-ordering/rebase-b2.png +0 -0
- package/docs/.attachments/cell-ordering/rebase-to-abprime.png +0 -0
- package/docs/.attachments/cell-ordering/rebase-to-bprime.png +0 -0
- package/docs/main/cell-ordering.md +638 -0
- package/lib/alpha.d.ts +2 -1
- package/lib/core/tree/visitDelta.d.ts +1 -1
- package/lib/core/tree/visitDelta.d.ts.map +1 -1
- package/lib/core/tree/visitDelta.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/index.d.ts +1 -0
- package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/index.js +1 -0
- package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +2 -4
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js +4 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js +1 -0
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/lib/feature-libraries/default-schema/noChangeCodecs.d.ts +1 -1
- package/lib/feature-libraries/default-schema/noChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/noChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +4 -0
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +1 -1
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +1 -1
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +7 -0
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.js +1 -0
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.js +1 -0
- package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +9 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +50 -21
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalField.js +3 -0
- package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldChangeRebaser.d.ts +1 -0
- package/lib/feature-libraries/sequence-field/sequenceFieldChangeRebaser.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldChangeRebaser.js +4 -0
- package/lib/feature-libraries/sequence-field/sequenceFieldChangeRebaser.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
- package/lib/feature-libraries/sequence-field/types.d.ts +1 -1
- package/lib/feature-libraries/sequence-field/types.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/types.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/jsonDomainSchema.d.ts +5 -3
- package/lib/jsonDomainSchema.d.ts.map +1 -1
- package/lib/jsonDomainSchema.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/shared-tree/independentView.d.ts.map +1 -1
- package/lib/shared-tree/independentView.js +2 -2
- package/lib/shared-tree/independentView.js.map +1 -1
- package/lib/shared-tree/index.d.ts +0 -1
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/schematizeTree.d.ts +23 -60
- package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
- package/lib/shared-tree/schematizeTree.js +60 -150
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +14 -14
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +10 -4
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree-core/defaultResubmitMachine.d.ts +2 -1
- package/lib/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
- package/lib/shared-tree-core/defaultResubmitMachine.js.map +1 -1
- package/lib/simple-tree/api/configuration.d.ts +3 -0
- package/lib/simple-tree/api/configuration.d.ts.map +1 -1
- package/lib/simple-tree/api/configuration.js +6 -2
- package/lib/simple-tree/api/configuration.js.map +1 -1
- package/lib/simple-tree/api/create.d.ts +4 -4
- package/lib/simple-tree/api/create.d.ts.map +1 -1
- package/lib/simple-tree/api/create.js +3 -6
- package/lib/simple-tree/api/create.js.map +1 -1
- package/lib/simple-tree/api/discrepancies.d.ts +5 -9
- package/lib/simple-tree/api/discrepancies.d.ts.map +1 -1
- package/lib/simple-tree/api/discrepancies.js +11 -10
- package/lib/simple-tree/api/discrepancies.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +3 -2
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +2 -1
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.js +4 -5
- package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts +9 -155
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +2 -45
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +157 -16
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js +23 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +1 -3
- package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.js +0 -5
- package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/lib/simple-tree/api/schemaStatics.d.ts +158 -0
- package/lib/simple-tree/api/schemaStatics.d.ts.map +1 -0
- package/lib/simple-tree/api/schemaStatics.js +56 -0
- package/lib/simple-tree/api/schemaStatics.js.map +1 -0
- package/lib/simple-tree/api/storedSchema.d.ts +5 -3
- package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/storedSchema.js +6 -4
- package/lib/simple-tree/api/storedSchema.js.map +1 -1
- package/lib/simple-tree/api/treeBeta.d.ts.map +1 -1
- package/lib/simple-tree/api/treeBeta.js +8 -2
- package/lib/simple-tree/api/treeBeta.js.map +1 -1
- package/lib/simple-tree/core/allowedTypes.d.ts +46 -30
- package/lib/simple-tree/core/allowedTypes.d.ts.map +1 -1
- package/lib/simple-tree/core/allowedTypes.js +23 -12
- package/lib/simple-tree/core/allowedTypes.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +5 -3
- package/lib/simple-tree/core/index.d.ts.map +1 -1
- package/lib/simple-tree/core/index.js +3 -2
- package/lib/simple-tree/core/index.js.map +1 -1
- package/lib/simple-tree/core/simpleNodeSchemaBase.d.ts +25 -0
- package/lib/simple-tree/core/simpleNodeSchemaBase.d.ts.map +1 -0
- package/lib/simple-tree/core/simpleNodeSchemaBase.js +6 -0
- package/lib/simple-tree/core/simpleNodeSchemaBase.js.map +1 -0
- package/lib/simple-tree/core/toStored.d.ts +32 -0
- package/lib/simple-tree/core/toStored.d.ts.map +1 -0
- package/lib/simple-tree/core/toStored.js +32 -0
- package/lib/simple-tree/core/toStored.js.map +1 -0
- package/lib/simple-tree/core/treeNode.d.ts +0 -3
- package/lib/simple-tree/core/treeNode.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNode.js +3 -3
- package/lib/simple-tree/core/treeNode.js.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts +7 -2
- package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/lib/simple-tree/core/treeNodeValid.d.ts +6 -1
- package/lib/simple-tree/core/treeNodeValid.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeValid.js +9 -5
- package/lib/simple-tree/core/treeNodeValid.js.map +1 -1
- package/lib/simple-tree/core/walkSchema.d.ts +19 -5
- package/lib/simple-tree/core/walkSchema.d.ts.map +1 -1
- package/lib/simple-tree/core/walkSchema.js +4 -2
- package/lib/simple-tree/core/walkSchema.js.map +1 -1
- package/lib/simple-tree/createContext.d.ts.map +1 -1
- package/lib/simple-tree/createContext.js +2 -2
- package/lib/simple-tree/createContext.js.map +1 -1
- package/lib/simple-tree/fieldSchema.d.ts +2 -1
- package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
- package/lib/simple-tree/fieldSchema.js +1 -1
- package/lib/simple-tree/fieldSchema.js.map +1 -1
- package/lib/simple-tree/index.d.ts +4 -4
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +2 -2
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js +2 -1
- package/lib/simple-tree/leafNodeSchema.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js +21 -7
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.js +12 -5
- package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.d.ts +2 -2
- package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.js +16 -5
- package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNode.js +12 -5
- package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/lib/simple-tree/prepareForInsertion.d.ts +5 -5
- package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
- package/lib/simple-tree/prepareForInsertion.js +10 -10
- package/lib/simple-tree/prepareForInsertion.js.map +1 -1
- package/lib/simple-tree/simpleSchema.d.ts +6 -21
- package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/simpleSchema.js.map +1 -1
- package/lib/simple-tree/toStoredSchema.d.ts +35 -11
- package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +67 -34
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/tableSchema.d.ts +25 -32
- package/lib/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +11 -25
- package/lib/tableSchema.js.map +1 -1
- package/package.json +21 -21
- package/src/core/tree/visitDelta.ts +3 -1
- package/src/feature-libraries/chunked-forest/index.ts +1 -0
- package/src/feature-libraries/default-schema/defaultEditBuilder.ts +12 -5
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +1 -0
- package/src/feature-libraries/default-schema/noChangeCodecs.ts +1 -1
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +1 -1
- package/src/feature-libraries/index.ts +2 -0
- package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +9 -0
- package/src/feature-libraries/modular-schema/genericFieldKind.ts +1 -0
- package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +1 -0
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +61 -19
- package/src/feature-libraries/optional-field/optionalField.ts +4 -0
- package/src/feature-libraries/sequence-field/sequenceFieldChangeRebaser.ts +4 -0
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV1.ts +4 -2
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +4 -2
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +4 -2
- package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +1 -1
- package/src/feature-libraries/sequence-field/types.ts +1 -1
- package/src/index.ts +2 -1
- package/src/jsonDomainSchema.ts +4 -0
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/independentView.ts +6 -2
- package/src/shared-tree/index.ts +0 -2
- package/src/shared-tree/schematizeTree.ts +83 -199
- package/src/shared-tree/schematizingTreeView.ts +26 -12
- package/src/shared-tree/treeAlpha.ts +18 -4
- package/src/shared-tree-core/defaultResubmitMachine.ts +2 -1
- package/src/simple-tree/api/configuration.ts +10 -2
- package/src/simple-tree/api/create.ts +5 -10
- package/src/simple-tree/api/discrepancies.ts +18 -17
- package/src/simple-tree/api/index.ts +2 -3
- package/src/simple-tree/api/schemaCompatibilityTester.ts +5 -9
- package/src/simple-tree/api/schemaFactory.ts +6 -250
- package/src/simple-tree/api/schemaFactoryAlpha.ts +174 -1
- package/src/simple-tree/api/schemaFactoryRecursive.ts +1 -25
- package/src/simple-tree/api/schemaStatics.ts +291 -0
- package/src/simple-tree/api/storedSchema.ts +12 -5
- package/src/simple-tree/api/treeBeta.ts +9 -2
- package/src/simple-tree/core/allowedTypes.ts +71 -42
- package/src/simple-tree/core/index.ts +9 -1
- package/src/simple-tree/core/simpleNodeSchemaBase.ts +30 -0
- package/src/simple-tree/core/toStored.ts +58 -0
- package/src/simple-tree/core/treeNode.ts +3 -3
- package/src/simple-tree/core/treeNodeSchema.ts +8 -2
- package/src/simple-tree/core/treeNodeValid.ts +14 -5
- package/src/simple-tree/core/walkSchema.ts +23 -6
- package/src/simple-tree/createContext.ts +5 -2
- package/src/simple-tree/fieldSchema.ts +4 -2
- package/src/simple-tree/index.ts +15 -6
- package/src/simple-tree/leafNodeSchema.ts +2 -1
- package/src/simple-tree/node-kinds/array/arrayNode.ts +58 -37
- package/src/simple-tree/node-kinds/map/mapNode.ts +26 -2
- package/src/simple-tree/node-kinds/object/objectNode.ts +37 -4
- package/src/simple-tree/node-kinds/record/recordNode.ts +23 -2
- package/src/simple-tree/prepareForInsertion.ts +12 -7
- package/src/simple-tree/simpleSchema.ts +6 -26
- package/src/simple-tree/toStoredSchema.ts +107 -44
- package/src/tableSchema.ts +40 -35
|
@@ -8,13 +8,15 @@ export { type Unhydrated, type InternalTreeNode, } from "./types.js";
|
|
|
8
8
|
export { TreeNode, privateToken, inPrototypeChain, } from "./treeNode.js";
|
|
9
9
|
export { NodeKind, isTreeNodeSchemaClass, privateDataSymbol, getTreeNodeSchemaPrivateData, CompatibilityLevel, } from "./treeNodeSchema.js";
|
|
10
10
|
export type { TreeNodeSchema, TreeNodeSchemaClass, TreeNodeSchemaNonClass, TreeNodeSchemaCore, TreeNodeSchemaBoth, NodeSchemaMetadata, TreeLeafValue, InsertableTypedNode, NodeBuilderData, NodeFromSchema, TreeNodeSchemaCorePrivate, TreeNodeSchemaPrivateData, TreeNodeSchemaInitializedData, FlexContent, } from "./treeNodeSchema.js";
|
|
11
|
-
export { isAnnotatedAllowedTypes, isAnnotatedAllowedType, normalizeAllowedTypes, normalizeAnnotatedAllowedTypes, normalizeToAnnotatedAllowedType, unannotateImplicitAllowedTypes, markSchemaMostDerived, evaluateLazySchema, } from "./allowedTypes.js";
|
|
12
|
-
export type { AnnotatedAllowedType, NormalizedAnnotatedAllowedTypes, ImplicitAllowedTypes, ImplicitAnnotatedAllowedTypes, UnannotateImplicitAllowedTypes, AllowedTypesMetadata, AllowedTypes, TreeNodeFromImplicitAllowedTypes, InsertableTreeNodeFromImplicitAllowedTypes, InsertableTreeNodeFromAllowedTypes, Input, UnannotateAllowedTypes, UnannotateAllowedType, UnannotateAllowedTypesList,
|
|
11
|
+
export { isAnnotatedAllowedTypes, isAnnotatedAllowedType, normalizeAllowedTypes, normalizeAnnotatedAllowedTypes, normalizeToAnnotatedAllowedType, unannotateImplicitAllowedTypes, markSchemaMostDerived, evaluateLazySchema, createSchemaUpgrade, type SchemaUpgrade, } from "./allowedTypes.js";
|
|
12
|
+
export type { AnnotatedAllowedType, NormalizedAnnotatedAllowedTypes, ImplicitAllowedTypes, ImplicitAnnotatedAllowedTypes, UnannotateImplicitAllowedTypes, AllowedTypesMetadata, AllowedTypes, TreeNodeFromImplicitAllowedTypes, InsertableTreeNodeFromImplicitAllowedTypes, InsertableTreeNodeFromAllowedTypes, Input, UnannotateAllowedTypes, UnannotateAllowedType, UnannotateAllowedTypesList, AllowedTypeMetadata, AnnotatedAllowedTypes, } from "./allowedTypes.js";
|
|
13
13
|
export { walkAllowedTypes, walkNodeSchema, type SchemaVisitor } from "./walkSchema.js";
|
|
14
14
|
export { Context, HydratedContext } from "./context.js";
|
|
15
15
|
export { getOrCreateNodeFromInnerNode, getOrCreateNodeFromInnerUnboxedNode, } from "./getOrCreateNode.js";
|
|
16
16
|
export { UnhydratedFlexTreeField, UnhydratedFlexTreeNode, UnhydratedSequenceField, UnhydratedContext, createField, } from "./unhydratedFlexTree.js";
|
|
17
17
|
export type { LazyItem, FlexList, FlexListToUnion, ExtractItemType, } from "./flexList.js";
|
|
18
18
|
export { isLazy } from "./flexList.js";
|
|
19
|
-
export { TreeNodeValid, type MostDerivedData, createTreeNodeSchemaPrivateData, } from "./treeNodeValid.js";
|
|
19
|
+
export { TreeNodeValid, type MostDerivedData, createTreeNodeSchemaPrivateData, isClassBasedSchema, } from "./treeNodeValid.js";
|
|
20
|
+
export type { SimpleNodeSchemaBase } from "./simpleNodeSchemaBase.js";
|
|
21
|
+
export { type StoredSchemaGenerationOptions, convertAllowedTypes, allowedTypeFilter, } from "./toStored.js";
|
|
20
22
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/core/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,UAAU,EACV,cAAc,EACd,SAAS,EACT,oBAAoB,EACpB,KAAK,SAAS,EACd,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,gCAAgC,EAChC,iBAAiB,GACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,QAAQ,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,EACN,KAAK,UAAU,EACf,KAAK,gBAAgB,GACrB,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,QAAQ,EACR,YAAY,EACZ,gBAAgB,GAChB,MAAM,eAAe,CAAC;AACvB,OAAO,EACN,QAAQ,EACR,qBAAqB,EACrB,iBAAiB,EACjB,4BAA4B,EAC5B,kBAAkB,GAClB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACX,cAAc,EACd,mBAAmB,EACnB,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,yBAAyB,EACzB,yBAAyB,EACzB,6BAA6B,EAC7B,WAAW,GACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,EACrB,8BAA8B,EAC9B,+BAA+B,EAC/B,8BAA8B,EAC9B,qBAAqB,EACrB,kBAAkB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACX,oBAAoB,EACpB,+BAA+B,EAC/B,oBAAoB,EACpB,6BAA6B,EAC7B,8BAA8B,EAC9B,oBAAoB,EACpB,YAAY,EACZ,gCAAgC,EAChC,0CAA0C,EAC1C,kCAAkC,EAClC,KAAK,EACL,sBAAsB,EACtB,qBAAqB,EACrB,0BAA0B,EAC1B
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/core/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,UAAU,EACV,cAAc,EACd,SAAS,EACT,oBAAoB,EACpB,KAAK,SAAS,EACd,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,gCAAgC,EAChC,iBAAiB,GACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,QAAQ,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,EACN,KAAK,UAAU,EACf,KAAK,gBAAgB,GACrB,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,QAAQ,EACR,YAAY,EACZ,gBAAgB,GAChB,MAAM,eAAe,CAAC;AACvB,OAAO,EACN,QAAQ,EACR,qBAAqB,EACrB,iBA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EACpB,+BAA+B,EAC/B,kBAAkB,GAClB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EACN,KAAK,6BAA6B,EAClC,mBAAmB,EACnB,iBAAiB,GACjB,MAAM,eAAe,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.createTreeNodeSchemaPrivateData = exports.TreeNodeValid = exports.isLazy = exports.createField = exports.UnhydratedContext = exports.UnhydratedSequenceField = exports.UnhydratedFlexTreeNode = exports.UnhydratedFlexTreeField = exports.getOrCreateNodeFromInnerUnboxedNode = exports.getOrCreateNodeFromInnerNode = exports.HydratedContext = exports.Context = exports.walkNodeSchema = exports.walkAllowedTypes = exports.evaluateLazySchema = exports.markSchemaMostDerived = exports.unannotateImplicitAllowedTypes = exports.normalizeToAnnotatedAllowedType = exports.normalizeAnnotatedAllowedTypes = exports.normalizeAllowedTypes = exports.isAnnotatedAllowedType = exports.isAnnotatedAllowedTypes = exports.CompatibilityLevel = exports.getTreeNodeSchemaPrivateData = exports.privateDataSymbol = exports.isTreeNodeSchemaClass = exports.NodeKind = exports.inPrototypeChain = exports.privateToken = exports.TreeNode = exports.typeSchemaSymbol = exports.typeNameSymbol = exports.SimpleContextSlot = exports.getSimpleNodeSchemaFromInnerNode = exports.treeNodeFromAnchor = exports.getOrCreateInnerNode = exports.tryDisposeTreeNode = exports.tryGetTreeNodeSchema = exports.getKernel = exports.TreeNodeKernel = exports.isTreeNode = void 0;
|
|
7
|
+
exports.allowedTypeFilter = exports.convertAllowedTypes = exports.isClassBasedSchema = exports.createTreeNodeSchemaPrivateData = exports.TreeNodeValid = exports.isLazy = exports.createField = exports.UnhydratedContext = exports.UnhydratedSequenceField = exports.UnhydratedFlexTreeNode = exports.UnhydratedFlexTreeField = exports.getOrCreateNodeFromInnerUnboxedNode = exports.getOrCreateNodeFromInnerNode = exports.HydratedContext = exports.Context = exports.walkNodeSchema = exports.walkAllowedTypes = exports.createSchemaUpgrade = exports.evaluateLazySchema = exports.markSchemaMostDerived = exports.unannotateImplicitAllowedTypes = exports.normalizeToAnnotatedAllowedType = exports.normalizeAnnotatedAllowedTypes = exports.normalizeAllowedTypes = exports.isAnnotatedAllowedType = exports.isAnnotatedAllowedTypes = exports.CompatibilityLevel = exports.getTreeNodeSchemaPrivateData = exports.privateDataSymbol = exports.isTreeNodeSchemaClass = exports.NodeKind = exports.inPrototypeChain = exports.privateToken = exports.TreeNode = exports.typeSchemaSymbol = exports.typeNameSymbol = exports.SimpleContextSlot = exports.getSimpleNodeSchemaFromInnerNode = exports.treeNodeFromAnchor = exports.getOrCreateInnerNode = exports.tryDisposeTreeNode = exports.tryGetTreeNodeSchema = exports.getKernel = exports.TreeNodeKernel = exports.isTreeNode = void 0;
|
|
8
8
|
var treeNodeKernel_js_1 = require("./treeNodeKernel.js");
|
|
9
9
|
Object.defineProperty(exports, "isTreeNode", { enumerable: true, get: function () { return treeNodeKernel_js_1.isTreeNode; } });
|
|
10
10
|
Object.defineProperty(exports, "TreeNodeKernel", { enumerable: true, get: function () { return treeNodeKernel_js_1.TreeNodeKernel; } });
|
|
@@ -37,6 +37,7 @@ Object.defineProperty(exports, "normalizeToAnnotatedAllowedType", { enumerable:
|
|
|
37
37
|
Object.defineProperty(exports, "unannotateImplicitAllowedTypes", { enumerable: true, get: function () { return allowedTypes_js_1.unannotateImplicitAllowedTypes; } });
|
|
38
38
|
Object.defineProperty(exports, "markSchemaMostDerived", { enumerable: true, get: function () { return allowedTypes_js_1.markSchemaMostDerived; } });
|
|
39
39
|
Object.defineProperty(exports, "evaluateLazySchema", { enumerable: true, get: function () { return allowedTypes_js_1.evaluateLazySchema; } });
|
|
40
|
+
Object.defineProperty(exports, "createSchemaUpgrade", { enumerable: true, get: function () { return allowedTypes_js_1.createSchemaUpgrade; } });
|
|
40
41
|
var walkSchema_js_1 = require("./walkSchema.js");
|
|
41
42
|
Object.defineProperty(exports, "walkAllowedTypes", { enumerable: true, get: function () { return walkSchema_js_1.walkAllowedTypes; } });
|
|
42
43
|
Object.defineProperty(exports, "walkNodeSchema", { enumerable: true, get: function () { return walkSchema_js_1.walkNodeSchema; } });
|
|
@@ -57,4 +58,8 @@ Object.defineProperty(exports, "isLazy", { enumerable: true, get: function () {
|
|
|
57
58
|
var treeNodeValid_js_1 = require("./treeNodeValid.js");
|
|
58
59
|
Object.defineProperty(exports, "TreeNodeValid", { enumerable: true, get: function () { return treeNodeValid_js_1.TreeNodeValid; } });
|
|
59
60
|
Object.defineProperty(exports, "createTreeNodeSchemaPrivateData", { enumerable: true, get: function () { return treeNodeValid_js_1.createTreeNodeSchemaPrivateData; } });
|
|
61
|
+
Object.defineProperty(exports, "isClassBasedSchema", { enumerable: true, get: function () { return treeNodeValid_js_1.isClassBasedSchema; } });
|
|
62
|
+
var toStored_js_1 = require("./toStored.js");
|
|
63
|
+
Object.defineProperty(exports, "convertAllowedTypes", { enumerable: true, get: function () { return toStored_js_1.convertAllowedTypes; } });
|
|
64
|
+
Object.defineProperty(exports, "allowedTypeFilter", { enumerable: true, get: function () { return toStored_js_1.allowedTypeFilter; } });
|
|
60
65
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/simple-tree/core/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,yDAW6B;AAV5B,+GAAA,UAAU,OAAA;AACV,mHAAA,cAAc,OAAA;AACd,8GAAA,SAAS,OAAA;AACT,yHAAA,oBAAoB,OAAA;AAEpB,uHAAA,kBAAkB,OAAA;AAClB,yHAAA,oBAAoB,OAAA;AACpB,uHAAA,kBAAkB,OAAA;AAClB,qIAAA,gCAAgC,OAAA;AAChC,sHAAA,iBAAiB,OAAA;AAElB,6CAAgF;AAAxD,6GAAA,cAAc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A;AAqBpB,iDAAuF;AAA9E,iHAAA,gBAAgB,OAAA;AAAE,+GAAA,cAAc,OAAA;AACzC,2CAAwD;AAA/C,qGAAA,OAAO,OAAA;AAAE,6GAAA,eAAe,OAAA;AACjC,2DAG8B;AAF7B,kIAAA,4BAA4B,OAAA;AAC5B,yIAAA,mCAAmC,OAAA;AAEpC,iEAMiC;AALhC,gIAAA,uBAAuB,OAAA;AACvB,+HAAA,sBAAsB,OAAA;AACtB,gIAAA,uBAAuB,OAAA;AACvB,0HAAA,iBAAiB,OAAA;AACjB,oHAAA,WAAW,OAAA;AAQZ,6CAAuC;AAA9B,qGAAA,MAAM,OAAA;AACf,uDAK4B;AAJ3B,iHAAA,aAAa,OAAA;AAEb,mIAAA,+BAA+B,OAAA;AAC/B,sHAAA,kBAAkB,OAAA;AAGnB,6CAIuB;AAFtB,kHAAA,mBAAmB,OAAA;AACnB,gHAAA,iBAAiB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tisTreeNode,\n\tTreeNodeKernel,\n\tgetKernel,\n\ttryGetTreeNodeSchema,\n\ttype InnerNode,\n\ttryDisposeTreeNode,\n\tgetOrCreateInnerNode,\n\ttreeNodeFromAnchor,\n\tgetSimpleNodeSchemaFromInnerNode,\n\tSimpleContextSlot,\n} from \"./treeNodeKernel.js\";\nexport { type WithType, typeNameSymbol, typeSchemaSymbol } from \"./withType.js\";\nexport {\n\ttype Unhydrated,\n\ttype InternalTreeNode,\n} from \"./types.js\";\nexport {\n\tTreeNode,\n\tprivateToken,\n\tinPrototypeChain,\n} from \"./treeNode.js\";\nexport {\n\tNodeKind,\n\tisTreeNodeSchemaClass,\n\tprivateDataSymbol,\n\tgetTreeNodeSchemaPrivateData,\n\tCompatibilityLevel,\n} from \"./treeNodeSchema.js\";\nexport type {\n\tTreeNodeSchema,\n\tTreeNodeSchemaClass,\n\tTreeNodeSchemaNonClass,\n\tTreeNodeSchemaCore,\n\tTreeNodeSchemaBoth,\n\tNodeSchemaMetadata,\n\tTreeLeafValue,\n\tInsertableTypedNode,\n\tNodeBuilderData,\n\tNodeFromSchema,\n\tTreeNodeSchemaCorePrivate,\n\tTreeNodeSchemaPrivateData,\n\tTreeNodeSchemaInitializedData,\n\tFlexContent,\n} from \"./treeNodeSchema.js\";\nexport {\n\tisAnnotatedAllowedTypes,\n\tisAnnotatedAllowedType,\n\tnormalizeAllowedTypes,\n\tnormalizeAnnotatedAllowedTypes,\n\tnormalizeToAnnotatedAllowedType,\n\tunannotateImplicitAllowedTypes,\n\tmarkSchemaMostDerived,\n\tevaluateLazySchema,\n\tcreateSchemaUpgrade,\n\ttype SchemaUpgrade,\n} from \"./allowedTypes.js\";\nexport type {\n\tAnnotatedAllowedType,\n\tNormalizedAnnotatedAllowedTypes,\n\tImplicitAllowedTypes,\n\tImplicitAnnotatedAllowedTypes,\n\tUnannotateImplicitAllowedTypes,\n\tAllowedTypesMetadata,\n\tAllowedTypes,\n\tTreeNodeFromImplicitAllowedTypes,\n\tInsertableTreeNodeFromImplicitAllowedTypes,\n\tInsertableTreeNodeFromAllowedTypes,\n\tInput,\n\tUnannotateAllowedTypes,\n\tUnannotateAllowedType,\n\tUnannotateAllowedTypesList,\n\tAllowedTypeMetadata,\n\tAnnotatedAllowedTypes,\n} from \"./allowedTypes.js\";\nexport { walkAllowedTypes, walkNodeSchema, type SchemaVisitor } from \"./walkSchema.js\";\nexport { Context, HydratedContext } from \"./context.js\";\nexport {\n\tgetOrCreateNodeFromInnerNode,\n\tgetOrCreateNodeFromInnerUnboxedNode,\n} from \"./getOrCreateNode.js\";\nexport {\n\tUnhydratedFlexTreeField,\n\tUnhydratedFlexTreeNode,\n\tUnhydratedSequenceField,\n\tUnhydratedContext,\n\tcreateField,\n} from \"./unhydratedFlexTree.js\";\nexport type {\n\tLazyItem,\n\tFlexList,\n\tFlexListToUnion,\n\tExtractItemType,\n} from \"./flexList.js\";\nexport { isLazy } from \"./flexList.js\";\nexport {\n\tTreeNodeValid,\n\ttype MostDerivedData,\n\tcreateTreeNodeSchemaPrivateData,\n\tisClassBasedSchema,\n} from \"./treeNodeValid.js\";\nexport type { SimpleNodeSchemaBase } from \"./simpleNodeSchemaBase.js\";\nexport {\n\ttype StoredSchemaGenerationOptions,\n\tconvertAllowedTypes,\n\tallowedTypeFilter,\n} from \"./toStored.js\";\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import type { NodeKind, NodeSchemaMetadata } from "./treeNodeSchema.js";
|
|
6
|
+
/**
|
|
7
|
+
* Base interface for {@link TreeNodeSchema} and {@link SimpleNodeSchema} types.
|
|
8
|
+
* Once simple schema is stable this doesn't have a reason to be kept `@system`, but it could be.
|
|
9
|
+
* @system
|
|
10
|
+
* @public
|
|
11
|
+
* @sealed
|
|
12
|
+
*/
|
|
13
|
+
export interface SimpleNodeSchemaBase<out TNodeKind extends NodeKind, out TCustomMetadata = unknown> {
|
|
14
|
+
/**
|
|
15
|
+
* The {@link NodeKind}.
|
|
16
|
+
*
|
|
17
|
+
* @remarks can be used to type-switch between implementations.
|
|
18
|
+
*/
|
|
19
|
+
readonly kind: TNodeKind;
|
|
20
|
+
/**
|
|
21
|
+
* User-provided {@link NodeSchemaMetadata} for this schema.
|
|
22
|
+
*/
|
|
23
|
+
readonly metadata: NodeSchemaMetadata<TCustomMetadata>;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=simpleNodeSchemaBase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simpleNodeSchemaBase.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/core/simpleNodeSchemaBase.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAExE;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB,CACpC,GAAG,CAAC,SAAS,SAAS,QAAQ,EAC9B,GAAG,CAAC,eAAe,GAAG,OAAO;IAE7B;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAEzB;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC,eAAe,CAAC,CAAC;CACvD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simpleNodeSchemaBase.js","sourceRoot":"","sources":["../../../src/simple-tree/core/simpleNodeSchemaBase.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { NodeKind, NodeSchemaMetadata } from \"./treeNodeSchema.js\";\n\n/**\n * Base interface for {@link TreeNodeSchema} and {@link SimpleNodeSchema} types.\n * Once simple schema is stable this doesn't have a reason to be kept `@system`, but it could be.\n * @system\n * @public\n * @sealed\n */\nexport interface SimpleNodeSchemaBase<\n\tout TNodeKind extends NodeKind,\n\tout TCustomMetadata = unknown,\n> {\n\t/**\n\t * The {@link NodeKind}.\n\t *\n\t * @remarks can be used to type-switch between implementations.\n\t */\n\treadonly kind: TNodeKind;\n\n\t/**\n\t * User-provided {@link NodeSchemaMetadata} for this schema.\n\t */\n\treadonly metadata: NodeSchemaMetadata<TCustomMetadata>;\n}\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { type AnnotatedAllowedType, type ImplicitAnnotatedAllowedTypes, type SchemaUpgrade } from "./allowedTypes.js";
|
|
6
|
+
import type { TreeTypeSet } from "../../core/index.js";
|
|
7
|
+
/**
|
|
8
|
+
* Options for generating a {@link TreeStoredSchema} from view schema.
|
|
9
|
+
*/
|
|
10
|
+
export interface StoredSchemaGenerationOptions {
|
|
11
|
+
/**
|
|
12
|
+
* Determines whether to include staged schema in the resulting stored schema.
|
|
13
|
+
* @remarks
|
|
14
|
+
* Due to caching, the behavior of this function must be pure.
|
|
15
|
+
*/
|
|
16
|
+
includeStaged(upgrade: SchemaUpgrade): boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Filters an allowed type based on the provided options.
|
|
20
|
+
* @param allowedType - The allowed type to filter.
|
|
21
|
+
* @param options - The options to use for filtering.
|
|
22
|
+
* @returns Whether the allowed type passes the filter.
|
|
23
|
+
*/
|
|
24
|
+
export declare function allowedTypeFilter(allowedType: AnnotatedAllowedType, options: StoredSchemaGenerationOptions): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Converts an ImplicitAnnotatedAllowedTypes to a stored schema.
|
|
27
|
+
* @param schema - The schema to convert.
|
|
28
|
+
* @param options - The options to use for filtering.
|
|
29
|
+
* @returns The converted stored schema.
|
|
30
|
+
*/
|
|
31
|
+
export declare function convertAllowedTypes(schema: ImplicitAnnotatedAllowedTypes, options: StoredSchemaGenerationOptions): TreeTypeSet;
|
|
32
|
+
//# sourceMappingURL=toStored.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toStored.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/core/toStored.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAEN,KAAK,oBAAoB,EACzB,KAAK,6BAA6B,EAClC,KAAK,aAAa,EAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAA4B,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEjF;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC7C;;;;OAIG;IACH,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC;CAC/C;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAChC,WAAW,EAAE,oBAAoB,EACjC,OAAO,EAAE,6BAA6B,GACpC,OAAO,CAMT;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAClC,MAAM,EAAE,6BAA6B,EACrC,OAAO,EAAE,6BAA6B,GACpC,WAAW,CAKb"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.convertAllowedTypes = exports.allowedTypeFilter = void 0;
|
|
8
|
+
const index_js_1 = require("../../util/index.js");
|
|
9
|
+
const allowedTypes_js_1 = require("./allowedTypes.js");
|
|
10
|
+
/**
|
|
11
|
+
* Filters an allowed type based on the provided options.
|
|
12
|
+
* @param allowedType - The allowed type to filter.
|
|
13
|
+
* @param options - The options to use for filtering.
|
|
14
|
+
* @returns Whether the allowed type passes the filter.
|
|
15
|
+
*/
|
|
16
|
+
function allowedTypeFilter(allowedType, options) {
|
|
17
|
+
// If the allowed type is staged, only include it if the options allow it.
|
|
18
|
+
if (allowedType.metadata.stagedSchemaUpgrade !== undefined) {
|
|
19
|
+
return options.includeStaged(allowedType.metadata.stagedSchemaUpgrade);
|
|
20
|
+
}
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
exports.allowedTypeFilter = allowedTypeFilter;
|
|
24
|
+
/**
|
|
25
|
+
* Converts an ImplicitAnnotatedAllowedTypes to a stored schema.
|
|
26
|
+
* @param schema - The schema to convert.
|
|
27
|
+
* @param options - The options to use for filtering.
|
|
28
|
+
* @returns The converted stored schema.
|
|
29
|
+
*/
|
|
30
|
+
function convertAllowedTypes(schema, options) {
|
|
31
|
+
const filtered = (0, allowedTypes_js_1.normalizeAnnotatedAllowedTypes)(schema)
|
|
32
|
+
.types.filter((allowedType) => allowedTypeFilter(allowedType, options))
|
|
33
|
+
.map((a) => (0, index_js_1.brand)(a.type.identifier));
|
|
34
|
+
return new Set(filtered);
|
|
35
|
+
}
|
|
36
|
+
exports.convertAllowedTypes = convertAllowedTypes;
|
|
37
|
+
//# sourceMappingURL=toStored.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toStored.js","sourceRoot":"","sources":["../../../src/simple-tree/core/toStored.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kDAA4C;AAC5C,uDAK2B;AAe3B;;;;;GAKG;AACH,SAAgB,iBAAiB,CAChC,WAAiC,EACjC,OAAsC;IAEtC,0EAA0E;IAC1E,IAAI,WAAW,CAAC,QAAQ,CAAC,mBAAmB,KAAK,SAAS,EAAE,CAAC;QAC5D,OAAO,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC;IACxE,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AATD,8CASC;AAED;;;;;GAKG;AACH,SAAgB,mBAAmB,CAClC,MAAqC,EACrC,OAAsC;IAEtC,MAAM,QAAQ,GAA+B,IAAA,gDAA8B,EAAC,MAAM,CAAC;SACjF,KAAK,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,iBAAiB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;SACtE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,gBAAK,EAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IACvC,OAAO,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AARD,kDAQC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { brand } from \"../../util/index.js\";\nimport {\n\tnormalizeAnnotatedAllowedTypes,\n\ttype AnnotatedAllowedType,\n\ttype ImplicitAnnotatedAllowedTypes,\n\ttype SchemaUpgrade,\n} from \"./allowedTypes.js\";\nimport type { TreeNodeSchemaIdentifier, TreeTypeSet } from \"../../core/index.js\";\n\n/**\n * Options for generating a {@link TreeStoredSchema} from view schema.\n */\nexport interface StoredSchemaGenerationOptions {\n\t/**\n\t * Determines whether to include staged schema in the resulting stored schema.\n\t * @remarks\n\t * Due to caching, the behavior of this function must be pure.\n\t */\n\tincludeStaged(upgrade: SchemaUpgrade): boolean;\n}\n\n/**\n * Filters an allowed type based on the provided options.\n * @param allowedType - The allowed type to filter.\n * @param options - The options to use for filtering.\n * @returns Whether the allowed type passes the filter.\n */\nexport function allowedTypeFilter(\n\tallowedType: AnnotatedAllowedType,\n\toptions: StoredSchemaGenerationOptions,\n): boolean {\n\t// If the allowed type is staged, only include it if the options allow it.\n\tif (allowedType.metadata.stagedSchemaUpgrade !== undefined) {\n\t\treturn options.includeStaged(allowedType.metadata.stagedSchemaUpgrade);\n\t}\n\treturn true;\n}\n\n/**\n * Converts an ImplicitAnnotatedAllowedTypes to a stored schema.\n * @param schema - The schema to convert.\n * @param options - The options to use for filtering.\n * @returns The converted stored schema.\n */\nexport function convertAllowedTypes(\n\tschema: ImplicitAnnotatedAllowedTypes,\n\toptions: StoredSchemaGenerationOptions,\n): TreeTypeSet {\n\tconst filtered: TreeNodeSchemaIdentifier[] = normalizeAnnotatedAllowedTypes(schema)\n\t\t.types.filter((allowedType) => allowedTypeFilter(allowedType, options))\n\t\t.map((a) => brand(a.type.identifier));\n\treturn new Set(filtered);\n}\n"]}
|
|
@@ -30,13 +30,10 @@ import { type WithType, typeNameSymbol, type typeSchemaSymbol } from "./withType
|
|
|
30
30
|
* @privateRemarks
|
|
31
31
|
* This is a class not an interface to enable stricter type checking (see {@link TreeNode.#brand})
|
|
32
32
|
* and some runtime enforcement of schema class policy (see the the validation in the constructor).
|
|
33
|
-
* This class is however only `type` exported not value exported, preventing the class object from being used,
|
|
34
|
-
* similar to how interfaces work.
|
|
35
33
|
*
|
|
36
34
|
* Not all node implementations include this in their prototype chain (some hide it with a proxy),
|
|
37
35
|
* and thus cause the default/built in `instanceof` to return false despite our type checking and all other APIs treating them as TreeNodes.
|
|
38
36
|
* This class provides a custom `Symbol.hasInstance` to fix `instanceof` for this class and all classes extending it.
|
|
39
|
-
* For now the type-only export prevents use of `instanceof` on this class (but allows it in subclasses like schema classes).
|
|
40
37
|
* @sealed @public
|
|
41
38
|
*/
|
|
42
39
|
export declare abstract class TreeNode implements WithType {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treeNode.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/core/treeNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EAAY,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAEzE,OAAO,EAAE,KAAK,QAAQ,EAAE,cAAc,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"treeNode.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/core/treeNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EAAY,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAEzE,OAAO,EAAE,KAAK,QAAQ,EAAE,cAAc,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGrF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,8BAAsB,QAAS,YAAW,QAAQ;;IA6BjD;;;;;OAKG;IAEH,aAAoB,CAAC,cAAc,CAAC,IAAI,MAAM,CAAC;IAE/C;;;;OAIG;IACH,aAAoB,CAAC,gBAAgB,CAAC,IAAI,mBAAmB,CAAC;IAE9D;;;;;;OAMG;WACW,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ;IAErE;;;;;;OAMG;WACW,CAAC,MAAM,CAAC,WAAW,CAAC,CACjC,OAAO,SAAS,QAAQ,MACvB,GAAG,IAAI,EAAE,GAAG,EAAE,KACV,QAAQ,EACZ,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAAC,OAAO,CAAC;IAahE;;;;;;;OAOG;IACH,SAAS,aAAa,KAAK,EAAE,OAAO;CAKpC;AAID;;GAEG;AACH,eAAO,MAAM,YAAY,IAAK,CAAC;AAE/B;;;;;GAKG;AAEH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAS9E"}
|
|
@@ -12,6 +12,7 @@ const treeNodeKernel_js_1 = require("./treeNodeKernel.js");
|
|
|
12
12
|
const treeNodeSchema_js_1 = require("./treeNodeSchema.js");
|
|
13
13
|
// eslint-disable-next-line import/no-deprecated
|
|
14
14
|
const withType_js_1 = require("./withType.js");
|
|
15
|
+
const flexList_js_1 = require("./flexList.js");
|
|
15
16
|
/**
|
|
16
17
|
* A non-{@link NodeKind.Leaf|leaf} SharedTree node. Includes objects, arrays, and maps.
|
|
17
18
|
*
|
|
@@ -38,13 +39,10 @@ const withType_js_1 = require("./withType.js");
|
|
|
38
39
|
* @privateRemarks
|
|
39
40
|
* This is a class not an interface to enable stricter type checking (see {@link TreeNode.#brand})
|
|
40
41
|
* and some runtime enforcement of schema class policy (see the the validation in the constructor).
|
|
41
|
-
* This class is however only `type` exported not value exported, preventing the class object from being used,
|
|
42
|
-
* similar to how interfaces work.
|
|
43
42
|
*
|
|
44
43
|
* Not all node implementations include this in their prototype chain (some hide it with a proxy),
|
|
45
44
|
* and thus cause the default/built in `instanceof` to return false despite our type checking and all other APIs treating them as TreeNodes.
|
|
46
45
|
* This class provides a custom `Symbol.hasInstance` to fix `instanceof` for this class and all classes extending it.
|
|
47
|
-
* For now the type-only export prevents use of `instanceof` on this class (but allows it in subclasses like schema classes).
|
|
48
46
|
* @sealed @public
|
|
49
47
|
*/
|
|
50
48
|
class TreeNode {
|
|
@@ -98,6 +96,8 @@ class TreeNode {
|
|
|
98
96
|
}
|
|
99
97
|
}
|
|
100
98
|
exports.TreeNode = TreeNode;
|
|
99
|
+
// Class objects are functions (callable), so we need a strong way to distinguish between `schema` and `() => schema` when used as a `LazyItem`.
|
|
100
|
+
(0, flexList_js_1.markEager)(TreeNode);
|
|
101
101
|
/**
|
|
102
102
|
* `token` to pass to {@link TreeNode}'s constructor used to detect invalid subclasses.
|
|
103
103
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treeNode.js","sourceRoot":"","sources":["../../../src/simple-tree/core/treeNode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,kEAA6D;AAC7D,uEAAsE;AAEtE,2DAA2D;AAC3D,2DAAyE;AACzE,gDAAgD;AAChD,+CAAqF;
|
|
1
|
+
{"version":3,"file":"treeNode.js","sourceRoot":"","sources":["../../../src/simple-tree/core/treeNode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,kEAA6D;AAC7D,uEAAsE;AAEtE,2DAA2D;AAC3D,2DAAyE;AACzE,gDAAgD;AAChD,+CAAqF;AACrF,+CAA0C;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAsB,QAAQ;IAmEtB,MAAM,CAAC,mCAAC,MAAM,CAAC,WAAW,EAAC,CAA8B,KAAc;QAC7E,MAAM,MAAM,GAAG,IAAA,wCAAoB,EAAC,KAAK,CAAC,CAAC;QAE3C,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,KAAK,4BAAQ,CAAC,IAAI,EAAE,CAAC;YAC3D,OAAO,KAAK,CAAC;QACd,CAAC;QAED,IAAA,iBAAM,EAAC,WAAW,IAAI,MAAM,EAAE,KAAK,CAAC,iCAAiC,CAAC,CAAC;QACvE,OAAO,gBAAgB,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IAC3D,CAAC;IAED;;;;;;;OAOG;IACH,YAAsB,KAAc;QArFpC;;;;;;;;;;;;;;;;;;;;;;;;;WAyBG;QACM,kCAAiB;QA4DzB,IAAI,KAAK,KAAK,oBAAY,EAAE,CAAC;YAC5B,MAAM,IAAI,qBAAU,CAAC,+DAA+D,CAAC,CAAC;QACvF,CAAC;IACF,CAAC;CACD;AA3FD,4BA2FC;AACD,gJAAgJ;AAChJ,IAAA,uBAAS,EAAC,QAAQ,CAAC,CAAC;AAEpB;;GAEG;AACU,QAAA,YAAY,GAAG,EAAE,CAAC;AAE/B;;;;;GAKG;AACH,kDAAkD;AAClD,SAAgB,gBAAgB,CAAC,OAAsB,EAAE,IAAY;IACpE,IAAI,QAAQ,GAAG,OAAO,CAAC;IACvB,OAAO,QAAQ,KAAK,IAAI,EAAE,CAAC;QAC1B,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;YACvB,OAAO,IAAI,CAAC;QACb,CAAC;QACD,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC;AATD,4CASC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { tryGetTreeNodeSchema } from \"./treeNodeKernel.js\";\nimport { NodeKind, type TreeNodeSchemaClass } from \"./treeNodeSchema.js\";\n// eslint-disable-next-line import/no-deprecated\nimport { type WithType, typeNameSymbol, type typeSchemaSymbol } from \"./withType.js\";\nimport { markEager } from \"./flexList.js\";\n\n/**\n * A non-{@link NodeKind.Leaf|leaf} SharedTree node. Includes objects, arrays, and maps.\n *\n * @remarks\n * Base type which all nodes extend.\n *\n * This type can be used as a type to indicate/document values which should be tree nodes.\n * Runtime use of this class object (for example when used with `instanceof` or extending it), is not currently supported.\n *\n * There are three ways to get instances of TreeNode:\n *\n * 1. From a {@link TreeView} loading nodes from an existing document, or creating local copies of nodes inserted by a remote collaborator.\n * This case provides an {@link InternalTreeNode} to the constructor: subclasses must not modify how the constructor handles this case.\n *\n * 2. Explicit construction of {@link Unhydrated} nodes using either {@link TreeNodeSchemaClass} as a constructor or {@link TreeNodeSchemaNonClass|TreeNodeSchemaNonClass.create}.\n * Either way the {@link TreeNodeSchema} produced must be produced using a {@link SchemaFactory}.\n *\n * 3. Implicit construction: Several APIs which logically require an unhydrated TreeNode also allow passing in a value which could be used to explicitly construct the node instead.\n * These APIs internally call the constructor with the provided value, so it's really just a special case of the above option.\n * Note that when constructing nodes, sometimes implicit construction is not allowed\n * (either at runtime due to ambiguous types or at compile time due to TypeScript limitations):\n * in such cases, explicit construction must be used.\n *\n * @privateRemarks\n * This is a class not an interface to enable stricter type checking (see {@link TreeNode.#brand})\n * and some runtime enforcement of schema class policy (see the the validation in the constructor).\n *\n * Not all node implementations include this in their prototype chain (some hide it with a proxy),\n * and thus cause the default/built in `instanceof` to return false despite our type checking and all other APIs treating them as TreeNodes.\n * This class provides a custom `Symbol.hasInstance` to fix `instanceof` for this class and all classes extending it.\n * @sealed @public\n */\nexport abstract class TreeNode implements WithType {\n\t/**\n\t * This is added to prevent TypeScript from implicitly allowing non-TreeNode types to be used as TreeNodes.\n\t * @remarks\n\t * This field forces TypeScript to use nominal instead of structural typing,\n\t * preventing compiler error messages and tools like \"add missing properties\"\n\t * from adding the [type] field as a solution when using a non-TreeNode object where a TreeNode is required.\n\t * Instead TreeNodes must be created through the appropriate APIs, see the documentation on {@link TreeNode} for details.\n\t *\n\t * @privateRemarks\n\t * This is a JavaScript private field, so is not accessible from outside this class.\n\t * This prevents it from having name collisions with object fields.\n\t * Since this is private, the type of this field is stripped in the d.ts file.\n\t * To get matching type checking within and from outside the package, the least informative type (`unknown`) is used.\n\t * To avoid this having any runtime impact, the field is uninitialized.\n\t *\n\t * Making this field optional results in different type checking within this project than outside of it, since the d.ts file drops the optional aspect of the field.\n\t * This is extra confusing since since the tests get in-project typing for intellisense and separate project checking at build time.\n\t * To avoid all this mess, this field is required, not optional.\n\t *\n\t * Another option would be to use a symbol (possibly as a private field).\n\t * That approach ran into some strange difficulties causing SchemaFactory to fail to compile, and was not investigated further.\n\t *\n\t * The [type] symbol provides a lot of the value this private brand does, but is not all of it:\n\t * someone could manually (or via Intellisense auto-implement completion, or in response to a type error)\n\t * make an object literal with the [type] field and pass it off as a node: this private brand prevents that.\n\t */\n\treadonly #brand!: unknown;\n\n\t/**\n\t * Adds a type symbol for stronger typing.\n\t * @privateRemarks\n\t * Subclasses provide more specific strings for this to get strong typing of otherwise type compatible nodes.\n\t * @deprecated Use {@link typeSchemaSymbol} instead.\n\t */\n\t// eslint-disable-next-line import/no-deprecated\n\tpublic abstract get [typeNameSymbol](): string;\n\n\t/**\n\t * Adds a type symbol for stronger typing.\n\t * @privateRemarks\n\t * Subclasses provide more specific strings for this to get strong typing of otherwise type compatible nodes.\n\t */\n\tpublic abstract get [typeSchemaSymbol](): TreeNodeSchemaClass;\n\n\t/**\n\t * Provides `instanceof` support for testing if a value is a `TreeNode`.\n\t * @remarks\n\t * For more options, like including leaf values or narrowing to collections of schema, use `is` or `schema` from {@link TreeNodeApi}.\n\t * @privateRemarks\n\t * Due to type-only export, this functionality is not available outside the package.\n\t */\n\tpublic static [Symbol.hasInstance](value: unknown): value is TreeNode;\n\n\t/**\n\t * Provides `instanceof` support for all schema classes with public constructors.\n\t * @remarks\n\t * For more options, like including leaf values or narrowing to collections of schema, use `is` or `schema` from {@link TreeNodeApi}.\n\t * @privateRemarks\n\t * Despite type-only export, this functionality is available outside the package since it is inherited by subclasses.\n\t */\n\tpublic static [Symbol.hasInstance]<\n\t\tTSchema extends abstract new (\n\t\t\t...args: any[]\n\t\t) => TreeNode,\n\t>(this: TSchema, value: unknown): value is InstanceType<TSchema>;\n\n\tpublic static [Symbol.hasInstance](this: { prototype: object }, value: unknown): boolean {\n\t\tconst schema = tryGetTreeNodeSchema(value);\n\n\t\tif (schema === undefined || schema.kind === NodeKind.Leaf) {\n\t\t\treturn false;\n\t\t}\n\n\t\tassert(\"prototype\" in schema, 0x98a /* expected class based schema */);\n\t\treturn inPrototypeChain(schema.prototype, this.prototype);\n\t}\n\n\t/**\n\t * TreeNodes must extend schema classes created by SchemaFactory, and therefore this constructor should not be invoked directly by code outside this package.\n\t * @privateRemarks\n\t * `token` must be the {@link privateToken} value, which is not package exported.\n\t * This is used to detect invalid subclasses.\n\t *\n\t * All valid subclass should use {@link TreeNodeValid}, but this code doesn't directly reference it to avoid cyclic dependencies.\n\t */\n\tprotected constructor(token: unknown) {\n\t\tif (token !== privateToken) {\n\t\t\tthrow new UsageError(\"TreeNodes must extend schema classes created by SchemaFactory\");\n\t\t}\n\t}\n}\n// Class objects are functions (callable), so we need a strong way to distinguish between `schema` and `() => schema` when used as a `LazyItem`.\nmarkEager(TreeNode);\n\n/**\n * `token` to pass to {@link TreeNode}'s constructor used to detect invalid subclasses.\n */\nexport const privateToken = {};\n\n/**\n * Check if the prototype derived's prototype chain contains `base`.\n * @param derived - prototype to check\n * @param base - prototype to search for\n * @returns true iff `base` is in the prototype chain starting at `derived`.\n */\n// eslint-disable-next-line @rushstack/no-new-null\nexport function inPrototypeChain(derived: object | null, base: object): boolean {\n\tlet checking = derived;\n\twhile (checking !== null) {\n\t\tif (base === checking) {\n\t\t\treturn true;\n\t\t}\n\t\tchecking = Reflect.getPrototypeOf(checking);\n\t}\n\treturn false;\n}\n"]}
|
|
@@ -3,15 +3,16 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import type { IFluidHandle } from "@fluidframework/core-interfaces";
|
|
6
|
-
import type { SimpleNodeSchemaBase } from "
|
|
6
|
+
import type { SimpleNodeSchemaBase } from "./simpleNodeSchemaBase.js";
|
|
7
7
|
import type { TreeNode } from "./treeNode.js";
|
|
8
8
|
import type { InternalTreeNode, Unhydrated } from "./types.js";
|
|
9
9
|
import type { UnionToIntersection } from "../../util/index.js";
|
|
10
10
|
import type { ImplicitAnnotatedAllowedTypes, NormalizedAnnotatedAllowedTypes } from "./allowedTypes.js";
|
|
11
11
|
import type { Context } from "./context.js";
|
|
12
|
-
import type { FieldKey, NodeData } from "../../core/index.js";
|
|
12
|
+
import type { FieldKey, NodeData, TreeNodeStoredSchema } from "../../core/index.js";
|
|
13
13
|
import type { UnhydratedFlexTreeField } from "./unhydratedFlexTree.js";
|
|
14
14
|
import type { FactoryContent } from "../unhydratedFlexTreeFromInsertable.js";
|
|
15
|
+
import type { StoredSchemaGenerationOptions } from "./toStored.js";
|
|
15
16
|
/**
|
|
16
17
|
* Schema for a {@link TreeNode} or {@link TreeLeafValue}.
|
|
17
18
|
*
|
|
@@ -256,6 +257,10 @@ export interface TreeNodeSchemaPrivateData {
|
|
|
256
257
|
* Idempotent initialization function that pre-caches data and can dereference lazy schema references.
|
|
257
258
|
*/
|
|
258
259
|
idempotentInitialize(): TreeNodeSchemaInitializedData;
|
|
260
|
+
/**
|
|
261
|
+
* Converts a the schema into a {@link TreeNodeStoredSchema}.
|
|
262
|
+
*/
|
|
263
|
+
toStored(options: StoredSchemaGenerationOptions): TreeNodeStoredSchema;
|
|
259
264
|
}
|
|
260
265
|
/**
|
|
261
266
|
* Additional data about a given schema which is private to this package.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treeNodeSchema.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/core/treeNodeSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"treeNodeSchema.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/core/treeNodeSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2B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":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAwU7D;;GAEG;AACU,QAAA,iBAAiB,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AAkHvD;;;;;;;;;;;;;;;GAeG;AACH,IAAY,kBAaX;AAbD,WAAY,kBAAkB;IAC7B;;OAEG;IACH,2DAAQ,CAAA;IACR;;OAEG;IACH,yDAAO,CAAA;IACP;;OAEG;IACH,+DAAU,CAAA;AACX,CAAC,EAbW,kBAAkB,kCAAlB,kBAAkB,QAa7B;AAED;;GAEG;AACH,SAAgB,4BAA4B,CAC3C,MAAqD;IAErD,IAAA,iBAAM,EACL,yBAAiB,IAAI,MAAM,EAC3B,KAAK,CAAC,6FAA6F,CACnG,CAAC;IACF,MAAM,WAAW,GAAG,MAAmC,CAAC;IACxD,OAAO,WAAW,CAAC,yBAAiB,CAAC,CAAC;AACvC,CAAC;AATD,oEASC;AAED;;;;;GAKG;AACH,IAAY,QAuBX;AAvBD,WAAY,QAAQ;IACnB;;OAEG;IACH,qCAAO,CAAA;IACP;;OAEG;IACH,yCAAS,CAAA;IACT;;;;OAIG;IACH,2CAAU,CAAA;IACV;;OAEG;IACH,uCAAQ,CAAA;IACR;;OAEG;IACH,2CAAU,CAAA;AACX,CAAC,EAvBW,QAAQ,wBAAR,QAAQ,QAuBnB;AA4BD;;;GAGG;AACH,SAAgB,qBAAqB,CAQpC,MAE2F;IAS3F,OAAO,MAAM,CAAC,WAAW,KAAK,SAAS,CAAC;AACzC,CAAC;AApBD,sDAoBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { IFluidHandle } from \"@fluidframework/core-interfaces\";\n\nimport type { SimpleNodeSchemaBase } from \"../simpleSchema.js\";\nimport type { TreeNode } from \"./treeNode.js\";\nimport type { InternalTreeNode, Unhydrated } from \"./types.js\";\nimport type { UnionToIntersection } from \"../../util/index.js\";\nimport type {\n\tImplicitAnnotatedAllowedTypes,\n\tNormalizedAnnotatedAllowedTypes,\n} from \"./allowedTypes.js\";\nimport type { Context } from \"./context.js\";\nimport type { FieldKey, NodeData } from \"../../core/index.js\";\nimport type { UnhydratedFlexTreeField } from \"./unhydratedFlexTree.js\";\nimport type { FactoryContent } from \"../unhydratedFlexTreeFromInsertable.js\";\n\n/**\n * Schema for a {@link TreeNode} or {@link TreeLeafValue}.\n *\n * @typeParam Name - The full (including scope) name/identifier for the schema.\n * @typeParam Kind - Which kind of node this schema is for.\n * @typeParam TNode - API for nodes that use this schema.\n * @typeParam TBuild - Data which can be used to construct an {@link Unhydrated} node of this type.\n * @typeParam Info - Data used when defining this schema.\n * @remarks\n * Captures the schema both as runtime data and compile time type information.\n * Use {@link SchemaFactory} to define schema.\n * Use `Tree.schema(value)` to lookup the schema for a {@link TreeNode} or {@link TreeLeafValue}.\n * @privateRemarks\n * TODO:\n * The long lists of type parameters here are awkward to deal with.\n * Switching to (or adding an option to use)\n * an interface based pattern with unordered named parameters for types like this would be a good idea.\n * The related `@system` types should be simple to port to the new pattern, but stable public one like this will need to support both:\n * the new one could either be added as a system type, or be recommended to replace this one (deprecating it).\n * @sealed @public\n */\nexport type TreeNodeSchema<\n\tName extends string = string,\n\tKind extends NodeKind = NodeKind,\n\tTNode extends TreeNode | TreeLeafValue = TreeNode | TreeLeafValue,\n\tTBuild = never,\n\tImplicitlyConstructable extends boolean = boolean,\n\tInfo = unknown,\n\tTCustomMetadata = unknown,\n> =\n\t| (TNode extends TreeNode\n\t\t\t? TreeNodeSchemaClass<\n\t\t\t\t\tName,\n\t\t\t\t\tKind,\n\t\t\t\t\tTNode,\n\t\t\t\t\tTBuild,\n\t\t\t\t\tImplicitlyConstructable,\n\t\t\t\t\tInfo,\n\t\t\t\t\tnever,\n\t\t\t\t\tTCustomMetadata\n\t\t\t\t>\n\t\t\t: never)\n\t| TreeNodeSchemaNonClass<\n\t\t\tName,\n\t\t\tKind,\n\t\t\tTNode,\n\t\t\tTBuild,\n\t\t\tImplicitlyConstructable,\n\t\t\tInfo,\n\t\t\tnever,\n\t\t\tTCustomMetadata\n\t >;\n\n/**\n * Schema which is not a class.\n * @remarks\n * This is used for schema which cannot have their instances constructed using constructors, like leaf schema.\n * @privateRemarks\n * Non-class based schema can have issues with recursive types due to https://github.com/microsoft/TypeScript/issues/55832.\n * @system @sealed @public\n */\nexport type TreeNodeSchemaNonClass<\n\tName extends string = string,\n\tKind extends NodeKind = NodeKind,\n\tTNode extends TreeNode | TreeLeafValue = TreeNode | TreeLeafValue,\n\tTInsertable = never,\n\tImplicitlyConstructable extends boolean = boolean,\n\tInfo = unknown,\n\tTConstructorExtra = never,\n\tTCustomMetadata = unknown,\n> = TreeNodeSchemaCore<\n\tName,\n\tKind,\n\tImplicitlyConstructable,\n\tInfo,\n\tTInsertable,\n\tTCustomMetadata\n> &\n\t(undefined extends TConstructorExtra\n\t\t? {\n\t\t\t\t/**\n\t\t\t\t * Constructs an {@link Unhydrated} node with this schema.\n\t\t\t\t * @privateRemarks\n\t\t\t\t * Also allows InternalTreeNode.\n\t\t\t\t * @sealed\n\t\t\t\t */\n\t\t\t\tcreate(data?: TInsertable | TConstructorExtra): TNode;\n\t\t\t}\n\t\t: {\n\t\t\t\t/**\n\t\t\t\t * Constructs an {@link Unhydrated} node with this schema.\n\t\t\t\t * @privateRemarks\n\t\t\t\t * Also allows InternalTreeNode.\n\t\t\t\t * @sealed\n\t\t\t\t */\n\t\t\t\tcreate(data: TInsertable | TConstructorExtra): TNode;\n\t\t\t});\n\n/**\n * Tree node schema which is implemented using a class.\n * @remarks\n * Instances of this class are nodes in the tree.\n * This is also a constructor so that it can be subclassed.\n *\n * Using classes in this way allows introducing a named type and a named value at the same time, helping keep the runtime and compile time information together and easy to refer to un a uniform way.\n * Additionally, this works around https://github.com/microsoft/TypeScript/issues/55832 which causes similar patterns with less explicit types to infer \"any\" in the d.ts file.\n *\n * When sub-classing a a `TreeNodeSchemaClass`, some extra rules must be followed:\n *\n * - Only ever use a single class from the schema's class hierarchy within a document and its schema.\n * For example, if using {@link SchemaFactory.object} you can do:\n * ```typescript\n * // Recommended \"customizable\" object schema pattern.\n * class Good extends schemaFactory.object(\"A\", {\n * \texampleField: schemaFactory.number,\n * }) {\n * \tpublic exampleCustomMethod(): void {\n * \t\tthis.exampleField++;\n * \t}\n * }\n * ```\n * But should avoid:\n * ```typescript\n * // This by itself is ok, and opts into \"POJO mode\".\n * const base = schemaFactory.object(\"A\", {});\n * // This is a bad pattern since it leaves two classes in scope which derive from the same SchemaFactory defined class.\n * // If both get used, its an error!\n * class Invalid extends base {}\n * ```\n *\n * - Do not modify the constructor input parameter types or values:\n * ```typescript\n * class Invalid extends schemaFactory.object(\"A\", {\n * \texampleField: schemaFactory.number,\n * }) {\n * \t// This Modifies the type of the constructor input.\n * \t// This is unsupported due to programmatic access to the constructor being used internally.\n * \tpublic constructor(a: number) {\n * \t\tsuper({ exampleField: a });\n * \t}\n * }\n * ```\n * @sealed @public\n */\nexport type TreeNodeSchemaClass<\n\tName extends string = string,\n\tKind extends NodeKind = NodeKind,\n\tTNode extends TreeNode = TreeNode,\n\tTInsertable = never,\n\tImplicitlyConstructable extends boolean = boolean,\n\tInfo = unknown,\n\tTConstructorExtra = never,\n\tTCustomMetadata = unknown,\n> = TreeNodeSchemaCore<\n\tName,\n\tKind,\n\tImplicitlyConstructable,\n\tInfo,\n\tTInsertable,\n\tTCustomMetadata\n> &\n\t(undefined extends TConstructorExtra\n\t\t? {\n\t\t\t\t/**\n\t\t\t\t * Constructs an {@link Unhydrated} node with this schema.\n\t\t\t\t * @remarks\n\t\t\t\t * This constructor is also used internally to construct hydrated nodes with a different parameter type.\n\t\t\t\t * Therefore, overriding this constructor with different argument types is not type-safe and is not supported.\n\t\t\t\t * @sealed\n\t\t\t\t */\n\t\t\t\t// The approach suggested by the linter here is more concise, but ir break intellisense for the constructor.\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/prefer-function-type\n\t\t\t\tnew (data?: TInsertable | InternalTreeNode | TConstructorExtra): Unhydrated<TNode>;\n\t\t\t}\n\t\t: {\n\t\t\t\t/**\n\t\t\t\t * Constructs an {@link Unhydrated} node with this schema.\n\t\t\t\t * @remarks\n\t\t\t\t * This constructor is also used internally to construct hydrated nodes with a different parameter type.\n\t\t\t\t * Therefore, overriding this constructor with different argument types is not type-safe and is not supported.\n\t\t\t\t * @sealed\n\t\t\t\t */\n\t\t\t\t// The approach suggested by the linter here is more concise, but ir break intellisense for the constructor.\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/prefer-function-type\n\t\t\t\tnew (data: TInsertable | InternalTreeNode | TConstructorExtra): Unhydrated<TNode>;\n\t\t\t});\n\n/**\n * Internal helper for utilities that return schema which can be used in class and non class formats depending on the API exposing it.\n */\nexport type TreeNodeSchemaBoth<\n\tName extends string = string,\n\tKind extends NodeKind = NodeKind,\n\tTNode extends TreeNode = TreeNode,\n\tTInsertable = never,\n\tImplicitlyConstructable extends boolean = boolean,\n\tInfo = unknown,\n\tTConstructorExtra = never,\n\tTCustomMetadata = unknown,\n> = TreeNodeSchemaClass<\n\tName,\n\tKind,\n\tTNode,\n\tTInsertable,\n\tImplicitlyConstructable,\n\tInfo,\n\tTConstructorExtra,\n\tTCustomMetadata\n> &\n\tTreeNodeSchemaNonClass<\n\t\tName,\n\t\tKind,\n\t\tTNode,\n\t\tTInsertable,\n\t\tImplicitlyConstructable,\n\t\tInfo,\n\t\tTConstructorExtra,\n\t\tTCustomMetadata\n\t>;\n\n/**\n * Data common to all tree node schema.\n *\n * @remarks\n * Implementation detail of {@link TreeNodeSchema} which should be accessed instead of referring to this type directly.\n *\n * @privateRemarks\n * All implementations must implement {@link TreeNodeSchemaCorePrivate} as well.\n *\n * @sealed @public\n */\nexport interface TreeNodeSchemaCore<\n\tout Name extends string,\n\tout Kind extends NodeKind,\n\tout ImplicitlyConstructable extends boolean,\n\tout Info = unknown,\n\tout TInsertable = never,\n\tout TCustomMetadata = unknown,\n> extends SimpleNodeSchemaBase<Kind, TCustomMetadata> {\n\t/**\n\t * Unique (within a document's schema) identifier used to associate nodes with their schema.\n\t * @remarks\n\t * This is used when encoding nodes, and when decoding nodes to re-associate them with the schema.\n\t * Since this decoding may happen in a different version of the application (or even a different application altogether),\n\t * this identifier should generally correspond to some specific semantics for the data (how to interpret the node with this identifier).\n\t * Any time the semantics change such that data would be misinterpreted if the old semantics were applied\n\t * (for example the units of a value are changed),\n\t * it is best practice to pick a new identifier.\n\t */\n\treadonly identifier: Name;\n\n\t/**\n\t * Data used to define this schema.\n\t *\n\t * @remarks\n\t * The format depends on the kind of node it is for.\n\t * For example, the \"object\" node kind could store the field schema here.\n\t */\n\treadonly info: Info;\n\n\t/**\n\t * When constructing insertable content,\n\t * data that could be passed to the node's constructor can be used instead of an {@link Unhydrated} node\n\t * iff implicitlyConstructable is true.\n\t * @privateRemarks\n\t * Currently the logic for traversing insertable content,\n\t * both to build trees and to hydrate them does not defer to the schema classes to handle the policy,\n\t * so if their constructors differ from what is supported, some cases will not work.\n\t * Setting this to false adjusts the insertable types to disallow cases which could be impacted by these inconsistencies.\n\t */\n\treadonly implicitlyConstructable: ImplicitlyConstructable;\n\n\t/**\n\t * All possible schema that a direct child of a node with this schema could have.\n\t *\n\t * Equivalently, this is also all schema directly referenced when defining this schema's allowed child types,\n\t * which is also the same as the set of schema referenced directly by the `Info` type parameter and the `info` property.\n\t * This property is simply re-exposing that information in an easier to traverse format consistent across all node kinds.\n\t * @remarks\n\t * Some kinds of nodes may have additional restrictions on children:\n\t * this set simply enumerates all directly referenced schema, and can be use to walk over all referenced schema types.\n\t *\n\t * This set cannot be used before the schema in it have been defined:\n\t * more specifically, when using lazy schema references (for example to make foreword references to schema which have not yet been defined),\n\t * users must wait until after the schema are defined to access this set.\n\t * @privateRemarks\n\t * Currently there isn't much use for this in the public API,\n\t * and it's possible this will want to be tweaked or renamed as part of a larger schema reflection API surface that might be added later.\n\t * To keep options option, this is marked `@system` for now.\n\t * @system\n\t */\n\treadonly childTypes: ReadonlySet<TreeNodeSchema>;\n\n\t/**\n\t * Constructs an instance of this node type.\n\t * @remarks\n\t * Due to TypeScript limitations, the return type of this method can not be very specific.\n\t * For {@link TreeNodeSchemaClass} prefer using the constructor directly for better typing.\n\t * For {@link TreeNodeSchemaNonClass} use `create`.\n\t *\n\t * @privateRemarks\n\t * This method signature provides a way to infer `TInsertable` without relying on the constructor, and to construct nodes from schema of unknown kind.\n\t * This makes customizations of the constructor not impact the typing of insertable content, allowing customization of the constructor,\n\t * as long as doing so only adds additional supported cases.\n\t *\n\t * This cannot be required to return `TNode`:\n\t * doing so breaks sub-classing of schema since they don't overload this method with a more specific return type.\n\t * @sealed @system\n\t */\n\tcreateFromInsertable(data: TInsertable): Unhydrated<TreeNode | TreeLeafValue>;\n}\n\n/**\n * Symbol for use by {@link TreeNodeSchemaCorePrivate}.\n */\nexport const privateDataSymbol = Symbol(\"PrivateData\");\n\n/**\n * {@link TreeNodeSchemaCore} extended with some non-exported APIs.\n */\nexport interface TreeNodeSchemaCorePrivate<\n\tName extends string = string,\n\tKind extends NodeKind = NodeKind,\n\tTInsertable = never,\n\tImplicitlyConstructable extends boolean = boolean,\n\tInfo = unknown,\n\tTCustomMetadata = unknown,\n> extends TreeNodeSchemaCore<\n\t\tName,\n\t\tKind,\n\t\tImplicitlyConstructable,\n\t\tInfo,\n\t\tTInsertable,\n\t\tTCustomMetadata\n\t> {\n\t/**\n\t * Package private data provided by all {@link TreeNodeSchema}.\n\t * @remarks\n\t * Users can add custom statics to schema classes.\n\t * To reduce the risk of such statics colliding with properties used to implement the schema,\n\t * some of the private APIs are grouped together under this symbol.\n\t *\n\t * Note that there are still some properties which are not under a symbol and thus expose some risk of name collisions.\n\t * See {@link TreeNodeValid} for some such properties.\n\t */\n\treadonly [privateDataSymbol]: TreeNodeSchemaPrivateData;\n}\n\n/**\n * Package private data provided by all {@link TreeNodeSchema}.\n * @remarks\n * This data needs to be available before lazy schema references are resolved.\n * For data which is only available after lazy schema references are resolved,\n * see {@link TreeNodeSchemaInitializedData}, which can be accessed via {@link TreeNodeSchemaPrivateData.idempotentInitialize}.\n */\nexport interface TreeNodeSchemaPrivateData {\n\t/**\n\t * All possible annotated allowed types that a field under a node with this schema could have.\n\t * @remarks\n\t * In this case \"field\" includes anything that is a field in the internal (flex-tree) abstraction layer.\n\t * This includes the content field for arrays, and all the fields for map nodes.\n\t * If this node does not have fields (and thus is a leaf), the array will be empty.\n\t *\n\t * This set cannot be used before the schema in it have been defined:\n\t * more specifically, when using lazy schema references (for example to make foreword references to schema which have not yet been defined),\n\t * users must wait until after the schema are defined to access this array.\n\t *\n\t * @privateRemarks\n\t * If this is stabilized, it will live alongside the childTypes property on {@link TreeNodeSchemaCore}.\n\t * @system\n\t */\n\treadonly childAnnotatedAllowedTypes: readonly ImplicitAnnotatedAllowedTypes[];\n\n\t/**\n\t * Idempotent initialization function that pre-caches data and can dereference lazy schema references.\n\t */\n\tidempotentInitialize(): TreeNodeSchemaInitializedData;\n}\n\n/**\n * Additional data about a given schema which is private to this package.\n * @remarks\n * Created by {@link TreeNodeValid.oneTimeSetup} and can involve dereferencing lazy schema references.\n */\nexport interface TreeNodeSchemaInitializedData {\n\t/**\n\t * All possible annotated allowed types that a field under a node with this schema could have.\n\t * @remarks\n\t * In this case \"field\" includes anything that is a field in the internal (flex-tree) abstraction layer.\n\t * This includes the content field for arrays, and all the fields for map nodes.\n\t * If this node does not have fields (and thus is a leaf), the array will be empty.\n\t *\n\t * This set cannot be used before the schema in it have been defined:\n\t * more specifically, when using lazy schema references (for example to make foreword references to schema which have not yet been defined),\n\t * users must wait until after the schema are defined to access this array.\n\t *\n\t * @privateRemarks\n\t * If this is stabilized, it will live alongside the childTypes property on {@link TreeNodeSchemaCore}.\n\t * @system\n\t */\n\treadonly childAnnotatedAllowedTypes: readonly NormalizedAnnotatedAllowedTypes[];\n\n\t/**\n\t * A {@link Context} which can be used for unhydrated nodes of this schema.\n\t */\n\treadonly context: Context;\n\n\t/**\n\t * Checks if data might be schema-compatible.\n\t *\n\t * @returns false if `data` is incompatible with `type` based on a cheap/shallow check.\n\t *\n\t * Note that this may return true for cases where data is incompatible, but it must not return false in cases where the data is compatible.\n\t */\n\tshallowCompatibilityTest(data: FactoryContent): CompatibilityLevel;\n\n\t/**\n\t * Convert data to a {@link FlexContent} representation.\n\t * @remarks\n\t * Data must be compatible with the schema according to {@link shallowCompatibilityTest}.\n\t *\n\t * TODO: use of `allowedTypes` is for fallbacks (for example NaN -\\> null).\n\t * This behavior should be moved to shallowCompatibilityTest instead.\n\t */\n\ttoFlexContent(data: FactoryContent, allowedTypes: ReadonlySet<TreeNodeSchema>): FlexContent;\n}\n\nexport type FlexContent = [NodeData, Map<FieldKey, UnhydratedFlexTreeField>];\n\n/**\n * Indicates a compatibility level for inferring a schema to apply to insertable data.\n * @remarks\n * Each schema allowed at a location in the tree has its compatibility level checked against the data being inserted.\n * The compatibility is considered unambiguous if there is a single schema with a higher compatibility than all others.\n *\n * This approach allows adding new compatible formats as a non breaking change.\n * If the new format was already compatible with some other schema, it can still be added as non-breaking as long as a lower compatibility level is used.\n * For example, support for constructing maps from record like objects was added in Fluid Framework 2.2.\n * This format (an object with fields) was already compatible with Object nodes at compatibility level Normal so the new format support for maps was added at compatibility level Low.\n * This ensures that existing code that was using object literals as insertable content where both objects and maps were allowed will continue to work,\n * assuming the objects are intended as ObjectNodes.\n * However new code can now be written using record like objects to construct maps, as long as the schema does not also allow Object nodes which are compatible with the data in that location.\n *\n * @see {@link ITreeConfigurationOptions.preventAmbiguity} for a related setting which interacts with this in a somewhat complex way.\n */\nexport enum CompatibilityLevel {\n\t/**\n\t * Not compatible. Constructor typing indicates incompatibility.\n\t */\n\tNone = 0,\n\t/**\n\t * Additional compatibility cases added in Fluid Framework 2.2.\n\t */\n\tLow = 1,\n\t/**\n\t * Compatible in Fluid Framework 2.0.\n\t */\n\tNormal = 2,\n}\n\n/**\n * Downcasts a {@link TreeNodeSchemaCore} to {@link TreeNodeSchemaCorePrivate} and get its {@link TreeNodeSchemaPrivateData}.\n */\nexport function getTreeNodeSchemaPrivateData(\n\tschema: TreeNodeSchemaCore<string, NodeKind, boolean>,\n): TreeNodeSchemaPrivateData {\n\tassert(\n\t\tprivateDataSymbol in schema,\n\t\t0xbc9 /* All implementations of TreeNodeSchemaCore must also implement TreeNodeSchemaCorePrivate */,\n\t);\n\tconst schemaValid = schema as TreeNodeSchemaCorePrivate;\n\treturn schemaValid[privateDataSymbol];\n}\n\n/**\n * Kind of tree node.\n * @remarks\n * More kinds may be added over time, so do not assume this is an exhaustive set.\n * @public\n */\nexport enum NodeKind {\n\t/**\n\t * A node which serves as a map, storing children under string keys.\n\t */\n\tMap = 0,\n\t/**\n\t * A node which serves as an array, storing children in an ordered sequence.\n\t */\n\tArray = 1,\n\t/**\n\t * A node which stores a heterogenous collection of children in named fields.\n\t * @remarks\n\t * Each field gets its own schema.\n\t */\n\tObject = 2,\n\t/**\n\t * A node which stores a single leaf value.\n\t */\n\tLeaf = 3,\n\t/**\n\t * A node which serves as a record, storing children under string keys.\n\t */\n\tRecord = 4,\n}\n\n/**\n * Metadata associated with a Node Schema.\n *\n * @remarks Specified via {@link NodeSchemaOptions.metadata}.\n *\n * @sealed\n * @public\n */\nexport interface NodeSchemaMetadata<out TCustomMetadata = unknown> {\n\t/**\n\t * User-defined metadata.\n\t */\n\treadonly custom?: TCustomMetadata | undefined;\n\n\t/**\n\t * The description of the Node Schema.\n\t *\n\t * @remarks\n\t *\n\t * If provided, will be used by the system in scenarios where a description of the kind of node is useful.\n\t * E.g., when converting a Node Schema to {@link https://json-schema.org/ | JSON Schema}, this description will be\n\t * used as the `description` property.\n\t */\n\treadonly description?: string | undefined;\n}\n\n/**\n * Returns true if the given schema is a {@link TreeNodeSchemaClass}, or otherwise false if it is a {@link TreeNodeSchemaNonClass}.\n * @internal\n */\nexport function isTreeNodeSchemaClass<\n\tName extends string,\n\tKind extends NodeKind,\n\tTNode extends TreeNode | TreeLeafValue,\n\tTBuild,\n\tImplicitlyConstructable extends boolean,\n\tInfo,\n>(\n\tschema:\n\t\t| TreeNodeSchema<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info>\n\t\t| TreeNodeSchemaClass<Name, Kind, TNode & TreeNode, TBuild, ImplicitlyConstructable, Info>,\n): schema is TreeNodeSchemaClass<\n\tName,\n\tKind,\n\tTNode & TreeNode,\n\tTBuild,\n\tImplicitlyConstructable,\n\tInfo\n> {\n\treturn schema.constructor !== undefined;\n}\n\n/**\n * Takes in `TreeNodeSchema[]` and returns a TypedNode union.\n * @privateRemarks\n * If a schema is both TreeNodeSchemaClass and TreeNodeSchemaNonClass, prefer TreeNodeSchemaClass since that includes subclasses properly.\n * @public\n */\nexport type NodeFromSchema<T extends TreeNodeSchema> = T extends TreeNodeSchemaClass<\n\tstring,\n\tNodeKind,\n\tinfer TNode\n>\n\t? TNode\n\t: T extends TreeNodeSchemaNonClass<string, NodeKind, infer TNode>\n\t\t? TNode\n\t\t: never;\n\n/**\n * Data which can be used as a node to be inserted.\n * Either an unhydrated node, or content to build a new node.\n *\n * @see {@link Input}\n *\n * @typeparam TSchemaInput - Schema to process.\n * @typeparam T - Do not specify: default value used as implementation detail.\n * @privateRemarks\n * This can't really be fully correct, since TreeNodeSchema's TNode is generally use covariantly but this code uses it contravariantly.\n * That makes this TreeNodeSchema actually invariant with respect to TNode, but doing that would break all `extends TreeNodeSchema` clauses.\n * As is, this works correctly in most realistic use-cases.\n *\n * One special case this makes is if the result of NodeFromSchema contains TreeNode, this must be an under constrained schema, so the result is set to never.\n * Note that applying UnionToIntersection on the result of NodeFromSchema<T> does not work since it breaks booleans.\n *\n * @public\n */\nexport type InsertableTypedNode<\n\tTSchema extends TreeNodeSchema,\n\tT = UnionToIntersection<TSchema>,\n> =\n\t| (T extends TreeNodeSchema<string, NodeKind, TreeNode | TreeLeafValue, never, true>\n\t\t\t? NodeBuilderData<T>\n\t\t\t: never)\n\t| (T extends TreeNodeSchema\n\t\t\t? Unhydrated<TreeNode extends NodeFromSchema<T> ? never : NodeFromSchema<T>>\n\t\t\t: never);\n\n/**\n * Given a node's schema, return the corresponding object from which the node could be built.\n * @privateRemarks\n * This uses TreeNodeSchemaCore, and thus depends on TreeNodeSchemaCore.createFromInsertable for the typing.\n * This works almost the same as using TreeNodeSchema,\n * except that the more complex typing in TreeNodeSchema case breaks for non-class schema and leaks in `undefined` from optional crete parameters.\n * @system @public\n */\nexport type NodeBuilderData<T extends TreeNodeSchemaCore<string, NodeKind, boolean>> =\n\tT extends TreeNodeSchemaCore<string, NodeKind, boolean, unknown, infer TBuild>\n\t\t? TBuild\n\t\t: never;\n\n/**\n * Value that may be stored as a leaf node.\n * @remarks\n * Some limitations apply, see the documentation for {@link SchemaStatics.number} and {@link SchemaStatics.string} for those restrictions.\n * @public\n */\n// eslint-disable-next-line @rushstack/no-new-null\nexport type TreeLeafValue = number | string | boolean | IFluidHandle | null;\n"]}
|
|
1
|
+
{"version":3,"file":"treeNodeSchema.js","sourceRoot":"","sources":["../../../src/simple-tree/core/treeNodeSchema.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAyU7D;;GAEG;AACU,QAAA,iBAAiB,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AAuHvD;;;;;;;;;;;;;;;GAeG;AACH,IAAY,kBAaX;AAbD,WAAY,kBAAkB;IAC7B;;OAEG;IACH,2DAAQ,CAAA;IACR;;OAEG;IACH,yDAAO,CAAA;IACP;;OAEG;IACH,+DAAU,CAAA;AACX,CAAC,EAbW,kBAAkB,kCAAlB,kBAAkB,QAa7B;AAED;;GAEG;AACH,SAAgB,4BAA4B,CAC3C,MAAqD;IAErD,IAAA,iBAAM,EACL,yBAAiB,IAAI,MAAM,EAC3B,KAAK,CAAC,6FAA6F,CACnG,CAAC;IACF,MAAM,WAAW,GAAG,MAAmC,CAAC;IACxD,OAAO,WAAW,CAAC,yBAAiB,CAAC,CAAC;AACvC,CAAC;AATD,oEASC;AAED;;;;;GAKG;AACH,IAAY,QAuBX;AAvBD,WAAY,QAAQ;IACnB;;OAEG;IACH,qCAAO,CAAA;IACP;;OAEG;IACH,yCAAS,CAAA;IACT;;;;OAIG;IACH,2CAAU,CAAA;IACV;;OAEG;IACH,uCAAQ,CAAA;IACR;;OAEG;IACH,2CAAU,CAAA;AACX,CAAC,EAvBW,QAAQ,wBAAR,QAAQ,QAuBnB;AA4BD;;;GAGG;AACH,SAAgB,qBAAqB,CAQpC,MAE2F;IAS3F,OAAO,MAAM,CAAC,WAAW,KAAK,SAAS,CAAC;AACzC,CAAC;AApBD,sDAoBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { IFluidHandle } from \"@fluidframework/core-interfaces\";\n\nimport type { SimpleNodeSchemaBase } from \"./simpleNodeSchemaBase.js\";\nimport type { TreeNode } from \"./treeNode.js\";\nimport type { InternalTreeNode, Unhydrated } from \"./types.js\";\nimport type { UnionToIntersection } from \"../../util/index.js\";\nimport type {\n\tImplicitAnnotatedAllowedTypes,\n\tNormalizedAnnotatedAllowedTypes,\n} from \"./allowedTypes.js\";\nimport type { Context } from \"./context.js\";\nimport type { FieldKey, NodeData, TreeNodeStoredSchema } from \"../../core/index.js\";\nimport type { UnhydratedFlexTreeField } from \"./unhydratedFlexTree.js\";\nimport type { FactoryContent } from \"../unhydratedFlexTreeFromInsertable.js\";\nimport type { StoredSchemaGenerationOptions } from \"./toStored.js\";\n\n/**\n * Schema for a {@link TreeNode} or {@link TreeLeafValue}.\n *\n * @typeParam Name - The full (including scope) name/identifier for the schema.\n * @typeParam Kind - Which kind of node this schema is for.\n * @typeParam TNode - API for nodes that use this schema.\n * @typeParam TBuild - Data which can be used to construct an {@link Unhydrated} node of this type.\n * @typeParam Info - Data used when defining this schema.\n * @remarks\n * Captures the schema both as runtime data and compile time type information.\n * Use {@link SchemaFactory} to define schema.\n * Use `Tree.schema(value)` to lookup the schema for a {@link TreeNode} or {@link TreeLeafValue}.\n * @privateRemarks\n * TODO:\n * The long lists of type parameters here are awkward to deal with.\n * Switching to (or adding an option to use)\n * an interface based pattern with unordered named parameters for types like this would be a good idea.\n * The related `@system` types should be simple to port to the new pattern, but stable public one like this will need to support both:\n * the new one could either be added as a system type, or be recommended to replace this one (deprecating it).\n * @sealed @public\n */\nexport type TreeNodeSchema<\n\tName extends string = string,\n\tKind extends NodeKind = NodeKind,\n\tTNode extends TreeNode | TreeLeafValue = TreeNode | TreeLeafValue,\n\tTBuild = never,\n\tImplicitlyConstructable extends boolean = boolean,\n\tInfo = unknown,\n\tTCustomMetadata = unknown,\n> =\n\t| (TNode extends TreeNode\n\t\t\t? TreeNodeSchemaClass<\n\t\t\t\t\tName,\n\t\t\t\t\tKind,\n\t\t\t\t\tTNode,\n\t\t\t\t\tTBuild,\n\t\t\t\t\tImplicitlyConstructable,\n\t\t\t\t\tInfo,\n\t\t\t\t\tnever,\n\t\t\t\t\tTCustomMetadata\n\t\t\t\t>\n\t\t\t: never)\n\t| TreeNodeSchemaNonClass<\n\t\t\tName,\n\t\t\tKind,\n\t\t\tTNode,\n\t\t\tTBuild,\n\t\t\tImplicitlyConstructable,\n\t\t\tInfo,\n\t\t\tnever,\n\t\t\tTCustomMetadata\n\t >;\n\n/**\n * Schema which is not a class.\n * @remarks\n * This is used for schema which cannot have their instances constructed using constructors, like leaf schema.\n * @privateRemarks\n * Non-class based schema can have issues with recursive types due to https://github.com/microsoft/TypeScript/issues/55832.\n * @system @sealed @public\n */\nexport type TreeNodeSchemaNonClass<\n\tName extends string = string,\n\tKind extends NodeKind = NodeKind,\n\tTNode extends TreeNode | TreeLeafValue = TreeNode | TreeLeafValue,\n\tTInsertable = never,\n\tImplicitlyConstructable extends boolean = boolean,\n\tInfo = unknown,\n\tTConstructorExtra = never,\n\tTCustomMetadata = unknown,\n> = TreeNodeSchemaCore<\n\tName,\n\tKind,\n\tImplicitlyConstructable,\n\tInfo,\n\tTInsertable,\n\tTCustomMetadata\n> &\n\t(undefined extends TConstructorExtra\n\t\t? {\n\t\t\t\t/**\n\t\t\t\t * Constructs an {@link Unhydrated} node with this schema.\n\t\t\t\t * @privateRemarks\n\t\t\t\t * Also allows InternalTreeNode.\n\t\t\t\t * @sealed\n\t\t\t\t */\n\t\t\t\tcreate(data?: TInsertable | TConstructorExtra): TNode;\n\t\t\t}\n\t\t: {\n\t\t\t\t/**\n\t\t\t\t * Constructs an {@link Unhydrated} node with this schema.\n\t\t\t\t * @privateRemarks\n\t\t\t\t * Also allows InternalTreeNode.\n\t\t\t\t * @sealed\n\t\t\t\t */\n\t\t\t\tcreate(data: TInsertable | TConstructorExtra): TNode;\n\t\t\t});\n\n/**\n * Tree node schema which is implemented using a class.\n * @remarks\n * Instances of this class are nodes in the tree.\n * This is also a constructor so that it can be subclassed.\n *\n * Using classes in this way allows introducing a named type and a named value at the same time, helping keep the runtime and compile time information together and easy to refer to un a uniform way.\n * Additionally, this works around https://github.com/microsoft/TypeScript/issues/55832 which causes similar patterns with less explicit types to infer \"any\" in the d.ts file.\n *\n * When sub-classing a a `TreeNodeSchemaClass`, some extra rules must be followed:\n *\n * - Only ever use a single class from the schema's class hierarchy within a document and its schema.\n * For example, if using {@link SchemaFactory.object} you can do:\n * ```typescript\n * // Recommended \"customizable\" object schema pattern.\n * class Good extends schemaFactory.object(\"A\", {\n * \texampleField: schemaFactory.number,\n * }) {\n * \tpublic exampleCustomMethod(): void {\n * \t\tthis.exampleField++;\n * \t}\n * }\n * ```\n * But should avoid:\n * ```typescript\n * // This by itself is ok, and opts into \"POJO mode\".\n * const base = schemaFactory.object(\"A\", {});\n * // This is a bad pattern since it leaves two classes in scope which derive from the same SchemaFactory defined class.\n * // If both get used, its an error!\n * class Invalid extends base {}\n * ```\n *\n * - Do not modify the constructor input parameter types or values:\n * ```typescript\n * class Invalid extends schemaFactory.object(\"A\", {\n * \texampleField: schemaFactory.number,\n * }) {\n * \t// This Modifies the type of the constructor input.\n * \t// This is unsupported due to programmatic access to the constructor being used internally.\n * \tpublic constructor(a: number) {\n * \t\tsuper({ exampleField: a });\n * \t}\n * }\n * ```\n * @sealed @public\n */\nexport type TreeNodeSchemaClass<\n\tName extends string = string,\n\tKind extends NodeKind = NodeKind,\n\tTNode extends TreeNode = TreeNode,\n\tTInsertable = never,\n\tImplicitlyConstructable extends boolean = boolean,\n\tInfo = unknown,\n\tTConstructorExtra = never,\n\tTCustomMetadata = unknown,\n> = TreeNodeSchemaCore<\n\tName,\n\tKind,\n\tImplicitlyConstructable,\n\tInfo,\n\tTInsertable,\n\tTCustomMetadata\n> &\n\t(undefined extends TConstructorExtra\n\t\t? {\n\t\t\t\t/**\n\t\t\t\t * Constructs an {@link Unhydrated} node with this schema.\n\t\t\t\t * @remarks\n\t\t\t\t * This constructor is also used internally to construct hydrated nodes with a different parameter type.\n\t\t\t\t * Therefore, overriding this constructor with different argument types is not type-safe and is not supported.\n\t\t\t\t * @sealed\n\t\t\t\t */\n\t\t\t\t// The approach suggested by the linter here is more concise, but ir break intellisense for the constructor.\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/prefer-function-type\n\t\t\t\tnew (data?: TInsertable | InternalTreeNode | TConstructorExtra): Unhydrated<TNode>;\n\t\t\t}\n\t\t: {\n\t\t\t\t/**\n\t\t\t\t * Constructs an {@link Unhydrated} node with this schema.\n\t\t\t\t * @remarks\n\t\t\t\t * This constructor is also used internally to construct hydrated nodes with a different parameter type.\n\t\t\t\t * Therefore, overriding this constructor with different argument types is not type-safe and is not supported.\n\t\t\t\t * @sealed\n\t\t\t\t */\n\t\t\t\t// The approach suggested by the linter here is more concise, but ir break intellisense for the constructor.\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/prefer-function-type\n\t\t\t\tnew (data: TInsertable | InternalTreeNode | TConstructorExtra): Unhydrated<TNode>;\n\t\t\t});\n\n/**\n * Internal helper for utilities that return schema which can be used in class and non class formats depending on the API exposing it.\n */\nexport type TreeNodeSchemaBoth<\n\tName extends string = string,\n\tKind extends NodeKind = NodeKind,\n\tTNode extends TreeNode = TreeNode,\n\tTInsertable = never,\n\tImplicitlyConstructable extends boolean = boolean,\n\tInfo = unknown,\n\tTConstructorExtra = never,\n\tTCustomMetadata = unknown,\n> = TreeNodeSchemaClass<\n\tName,\n\tKind,\n\tTNode,\n\tTInsertable,\n\tImplicitlyConstructable,\n\tInfo,\n\tTConstructorExtra,\n\tTCustomMetadata\n> &\n\tTreeNodeSchemaNonClass<\n\t\tName,\n\t\tKind,\n\t\tTNode,\n\t\tTInsertable,\n\t\tImplicitlyConstructable,\n\t\tInfo,\n\t\tTConstructorExtra,\n\t\tTCustomMetadata\n\t>;\n\n/**\n * Data common to all tree node schema.\n *\n * @remarks\n * Implementation detail of {@link TreeNodeSchema} which should be accessed instead of referring to this type directly.\n *\n * @privateRemarks\n * All implementations must implement {@link TreeNodeSchemaCorePrivate} as well.\n *\n * @sealed @public\n */\nexport interface TreeNodeSchemaCore<\n\tout Name extends string,\n\tout Kind extends NodeKind,\n\tout ImplicitlyConstructable extends boolean,\n\tout Info = unknown,\n\tout TInsertable = never,\n\tout TCustomMetadata = unknown,\n> extends SimpleNodeSchemaBase<Kind, TCustomMetadata> {\n\t/**\n\t * Unique (within a document's schema) identifier used to associate nodes with their schema.\n\t * @remarks\n\t * This is used when encoding nodes, and when decoding nodes to re-associate them with the schema.\n\t * Since this decoding may happen in a different version of the application (or even a different application altogether),\n\t * this identifier should generally correspond to some specific semantics for the data (how to interpret the node with this identifier).\n\t * Any time the semantics change such that data would be misinterpreted if the old semantics were applied\n\t * (for example the units of a value are changed),\n\t * it is best practice to pick a new identifier.\n\t */\n\treadonly identifier: Name;\n\n\t/**\n\t * Data used to define this schema.\n\t *\n\t * @remarks\n\t * The format depends on the kind of node it is for.\n\t * For example, the \"object\" node kind could store the field schema here.\n\t */\n\treadonly info: Info;\n\n\t/**\n\t * When constructing insertable content,\n\t * data that could be passed to the node's constructor can be used instead of an {@link Unhydrated} node\n\t * iff implicitlyConstructable is true.\n\t * @privateRemarks\n\t * Currently the logic for traversing insertable content,\n\t * both to build trees and to hydrate them does not defer to the schema classes to handle the policy,\n\t * so if their constructors differ from what is supported, some cases will not work.\n\t * Setting this to false adjusts the insertable types to disallow cases which could be impacted by these inconsistencies.\n\t */\n\treadonly implicitlyConstructable: ImplicitlyConstructable;\n\n\t/**\n\t * All possible schema that a direct child of a node with this schema could have.\n\t *\n\t * Equivalently, this is also all schema directly referenced when defining this schema's allowed child types,\n\t * which is also the same as the set of schema referenced directly by the `Info` type parameter and the `info` property.\n\t * This property is simply re-exposing that information in an easier to traverse format consistent across all node kinds.\n\t * @remarks\n\t * Some kinds of nodes may have additional restrictions on children:\n\t * this set simply enumerates all directly referenced schema, and can be use to walk over all referenced schema types.\n\t *\n\t * This set cannot be used before the schema in it have been defined:\n\t * more specifically, when using lazy schema references (for example to make foreword references to schema which have not yet been defined),\n\t * users must wait until after the schema are defined to access this set.\n\t * @privateRemarks\n\t * Currently there isn't much use for this in the public API,\n\t * and it's possible this will want to be tweaked or renamed as part of a larger schema reflection API surface that might be added later.\n\t * To keep options option, this is marked `@system` for now.\n\t * @system\n\t */\n\treadonly childTypes: ReadonlySet<TreeNodeSchema>;\n\n\t/**\n\t * Constructs an instance of this node type.\n\t * @remarks\n\t * Due to TypeScript limitations, the return type of this method can not be very specific.\n\t * For {@link TreeNodeSchemaClass} prefer using the constructor directly for better typing.\n\t * For {@link TreeNodeSchemaNonClass} use `create`.\n\t *\n\t * @privateRemarks\n\t * This method signature provides a way to infer `TInsertable` without relying on the constructor, and to construct nodes from schema of unknown kind.\n\t * This makes customizations of the constructor not impact the typing of insertable content, allowing customization of the constructor,\n\t * as long as doing so only adds additional supported cases.\n\t *\n\t * This cannot be required to return `TNode`:\n\t * doing so breaks sub-classing of schema since they don't overload this method with a more specific return type.\n\t * @sealed @system\n\t */\n\tcreateFromInsertable(data: TInsertable): Unhydrated<TreeNode | TreeLeafValue>;\n}\n\n/**\n * Symbol for use by {@link TreeNodeSchemaCorePrivate}.\n */\nexport const privateDataSymbol = Symbol(\"PrivateData\");\n\n/**\n * {@link TreeNodeSchemaCore} extended with some non-exported APIs.\n */\nexport interface TreeNodeSchemaCorePrivate<\n\tName extends string = string,\n\tKind extends NodeKind = NodeKind,\n\tTInsertable = never,\n\tImplicitlyConstructable extends boolean = boolean,\n\tInfo = unknown,\n\tTCustomMetadata = unknown,\n> extends TreeNodeSchemaCore<\n\t\tName,\n\t\tKind,\n\t\tImplicitlyConstructable,\n\t\tInfo,\n\t\tTInsertable,\n\t\tTCustomMetadata\n\t> {\n\t/**\n\t * Package private data provided by all {@link TreeNodeSchema}.\n\t * @remarks\n\t * Users can add custom statics to schema classes.\n\t * To reduce the risk of such statics colliding with properties used to implement the schema,\n\t * some of the private APIs are grouped together under this symbol.\n\t *\n\t * Note that there are still some properties which are not under a symbol and thus expose some risk of name collisions.\n\t * See {@link TreeNodeValid} for some such properties.\n\t */\n\treadonly [privateDataSymbol]: TreeNodeSchemaPrivateData;\n}\n\n/**\n * Package private data provided by all {@link TreeNodeSchema}.\n * @remarks\n * This data needs to be available before lazy schema references are resolved.\n * For data which is only available after lazy schema references are resolved,\n * see {@link TreeNodeSchemaInitializedData}, which can be accessed via {@link TreeNodeSchemaPrivateData.idempotentInitialize}.\n */\nexport interface TreeNodeSchemaPrivateData {\n\t/**\n\t * All possible annotated allowed types that a field under a node with this schema could have.\n\t * @remarks\n\t * In this case \"field\" includes anything that is a field in the internal (flex-tree) abstraction layer.\n\t * This includes the content field for arrays, and all the fields for map nodes.\n\t * If this node does not have fields (and thus is a leaf), the array will be empty.\n\t *\n\t * This set cannot be used before the schema in it have been defined:\n\t * more specifically, when using lazy schema references (for example to make foreword references to schema which have not yet been defined),\n\t * users must wait until after the schema are defined to access this array.\n\t *\n\t * @privateRemarks\n\t * If this is stabilized, it will live alongside the childTypes property on {@link TreeNodeSchemaCore}.\n\t * @system\n\t */\n\treadonly childAnnotatedAllowedTypes: readonly ImplicitAnnotatedAllowedTypes[];\n\n\t/**\n\t * Idempotent initialization function that pre-caches data and can dereference lazy schema references.\n\t */\n\tidempotentInitialize(): TreeNodeSchemaInitializedData;\n\n\t/**\n\t * Converts a the schema into a {@link TreeNodeStoredSchema}.\n\t */\n\ttoStored(options: StoredSchemaGenerationOptions): TreeNodeStoredSchema;\n}\n\n/**\n * Additional data about a given schema which is private to this package.\n * @remarks\n * Created by {@link TreeNodeValid.oneTimeSetup} and can involve dereferencing lazy schema references.\n */\nexport interface TreeNodeSchemaInitializedData {\n\t/**\n\t * All possible annotated allowed types that a field under a node with this schema could have.\n\t * @remarks\n\t * In this case \"field\" includes anything that is a field in the internal (flex-tree) abstraction layer.\n\t * This includes the content field for arrays, and all the fields for map nodes.\n\t * If this node does not have fields (and thus is a leaf), the array will be empty.\n\t *\n\t * This set cannot be used before the schema in it have been defined:\n\t * more specifically, when using lazy schema references (for example to make foreword references to schema which have not yet been defined),\n\t * users must wait until after the schema are defined to access this array.\n\t *\n\t * @privateRemarks\n\t * If this is stabilized, it will live alongside the childTypes property on {@link TreeNodeSchemaCore}.\n\t * @system\n\t */\n\treadonly childAnnotatedAllowedTypes: readonly NormalizedAnnotatedAllowedTypes[];\n\n\t/**\n\t * A {@link Context} which can be used for unhydrated nodes of this schema.\n\t */\n\treadonly context: Context;\n\n\t/**\n\t * Checks if data might be schema-compatible.\n\t *\n\t * @returns false if `data` is incompatible with `type` based on a cheap/shallow check.\n\t *\n\t * Note that this may return true for cases where data is incompatible, but it must not return false in cases where the data is compatible.\n\t */\n\tshallowCompatibilityTest(data: FactoryContent): CompatibilityLevel;\n\n\t/**\n\t * Convert data to a {@link FlexContent} representation.\n\t * @remarks\n\t * Data must be compatible with the schema according to {@link shallowCompatibilityTest}.\n\t *\n\t * TODO: use of `allowedTypes` is for fallbacks (for example NaN -\\> null).\n\t * This behavior should be moved to shallowCompatibilityTest instead.\n\t */\n\ttoFlexContent(data: FactoryContent, allowedTypes: ReadonlySet<TreeNodeSchema>): FlexContent;\n}\n\nexport type FlexContent = [NodeData, Map<FieldKey, UnhydratedFlexTreeField>];\n\n/**\n * Indicates a compatibility level for inferring a schema to apply to insertable data.\n * @remarks\n * Each schema allowed at a location in the tree has its compatibility level checked against the data being inserted.\n * The compatibility is considered unambiguous if there is a single schema with a higher compatibility than all others.\n *\n * This approach allows adding new compatible formats as a non breaking change.\n * If the new format was already compatible with some other schema, it can still be added as non-breaking as long as a lower compatibility level is used.\n * For example, support for constructing maps from record like objects was added in Fluid Framework 2.2.\n * This format (an object with fields) was already compatible with Object nodes at compatibility level Normal so the new format support for maps was added at compatibility level Low.\n * This ensures that existing code that was using object literals as insertable content where both objects and maps were allowed will continue to work,\n * assuming the objects are intended as ObjectNodes.\n * However new code can now be written using record like objects to construct maps, as long as the schema does not also allow Object nodes which are compatible with the data in that location.\n *\n * @see {@link ITreeConfigurationOptions.preventAmbiguity} for a related setting which interacts with this in a somewhat complex way.\n */\nexport enum CompatibilityLevel {\n\t/**\n\t * Not compatible. Constructor typing indicates incompatibility.\n\t */\n\tNone = 0,\n\t/**\n\t * Additional compatibility cases added in Fluid Framework 2.2.\n\t */\n\tLow = 1,\n\t/**\n\t * Compatible in Fluid Framework 2.0.\n\t */\n\tNormal = 2,\n}\n\n/**\n * Downcasts a {@link TreeNodeSchemaCore} to {@link TreeNodeSchemaCorePrivate} and get its {@link TreeNodeSchemaPrivateData}.\n */\nexport function getTreeNodeSchemaPrivateData(\n\tschema: TreeNodeSchemaCore<string, NodeKind, boolean>,\n): TreeNodeSchemaPrivateData {\n\tassert(\n\t\tprivateDataSymbol in schema,\n\t\t0xbc9 /* All implementations of TreeNodeSchemaCore must also implement TreeNodeSchemaCorePrivate */,\n\t);\n\tconst schemaValid = schema as TreeNodeSchemaCorePrivate;\n\treturn schemaValid[privateDataSymbol];\n}\n\n/**\n * Kind of tree node.\n * @remarks\n * More kinds may be added over time, so do not assume this is an exhaustive set.\n * @public\n */\nexport enum NodeKind {\n\t/**\n\t * A node which serves as a map, storing children under string keys.\n\t */\n\tMap = 0,\n\t/**\n\t * A node which serves as an array, storing children in an ordered sequence.\n\t */\n\tArray = 1,\n\t/**\n\t * A node which stores a heterogenous collection of children in named fields.\n\t * @remarks\n\t * Each field gets its own schema.\n\t */\n\tObject = 2,\n\t/**\n\t * A node which stores a single leaf value.\n\t */\n\tLeaf = 3,\n\t/**\n\t * A node which serves as a record, storing children under string keys.\n\t */\n\tRecord = 4,\n}\n\n/**\n * Metadata associated with a Node Schema.\n *\n * @remarks Specified via {@link NodeSchemaOptions.metadata}.\n *\n * @sealed\n * @public\n */\nexport interface NodeSchemaMetadata<out TCustomMetadata = unknown> {\n\t/**\n\t * User-defined metadata.\n\t */\n\treadonly custom?: TCustomMetadata | undefined;\n\n\t/**\n\t * The description of the Node Schema.\n\t *\n\t * @remarks\n\t *\n\t * If provided, will be used by the system in scenarios where a description of the kind of node is useful.\n\t * E.g., when converting a Node Schema to {@link https://json-schema.org/ | JSON Schema}, this description will be\n\t * used as the `description` property.\n\t */\n\treadonly description?: string | undefined;\n}\n\n/**\n * Returns true if the given schema is a {@link TreeNodeSchemaClass}, or otherwise false if it is a {@link TreeNodeSchemaNonClass}.\n * @internal\n */\nexport function isTreeNodeSchemaClass<\n\tName extends string,\n\tKind extends NodeKind,\n\tTNode extends TreeNode | TreeLeafValue,\n\tTBuild,\n\tImplicitlyConstructable extends boolean,\n\tInfo,\n>(\n\tschema:\n\t\t| TreeNodeSchema<Name, Kind, TNode, TBuild, ImplicitlyConstructable, Info>\n\t\t| TreeNodeSchemaClass<Name, Kind, TNode & TreeNode, TBuild, ImplicitlyConstructable, Info>,\n): schema is TreeNodeSchemaClass<\n\tName,\n\tKind,\n\tTNode & TreeNode,\n\tTBuild,\n\tImplicitlyConstructable,\n\tInfo\n> {\n\treturn schema.constructor !== undefined;\n}\n\n/**\n * Takes in `TreeNodeSchema[]` and returns a TypedNode union.\n * @privateRemarks\n * If a schema is both TreeNodeSchemaClass and TreeNodeSchemaNonClass, prefer TreeNodeSchemaClass since that includes subclasses properly.\n * @public\n */\nexport type NodeFromSchema<T extends TreeNodeSchema> = T extends TreeNodeSchemaClass<\n\tstring,\n\tNodeKind,\n\tinfer TNode\n>\n\t? TNode\n\t: T extends TreeNodeSchemaNonClass<string, NodeKind, infer TNode>\n\t\t? TNode\n\t\t: never;\n\n/**\n * Data which can be used as a node to be inserted.\n * Either an unhydrated node, or content to build a new node.\n *\n * @see {@link Input}\n *\n * @typeparam TSchemaInput - Schema to process.\n * @typeparam T - Do not specify: default value used as implementation detail.\n * @privateRemarks\n * This can't really be fully correct, since TreeNodeSchema's TNode is generally use covariantly but this code uses it contravariantly.\n * That makes this TreeNodeSchema actually invariant with respect to TNode, but doing that would break all `extends TreeNodeSchema` clauses.\n * As is, this works correctly in most realistic use-cases.\n *\n * One special case this makes is if the result of NodeFromSchema contains TreeNode, this must be an under constrained schema, so the result is set to never.\n * Note that applying UnionToIntersection on the result of NodeFromSchema<T> does not work since it breaks booleans.\n *\n * @public\n */\nexport type InsertableTypedNode<\n\tTSchema extends TreeNodeSchema,\n\tT = UnionToIntersection<TSchema>,\n> =\n\t| (T extends TreeNodeSchema<string, NodeKind, TreeNode | TreeLeafValue, never, true>\n\t\t\t? NodeBuilderData<T>\n\t\t\t: never)\n\t| (T extends TreeNodeSchema\n\t\t\t? Unhydrated<TreeNode extends NodeFromSchema<T> ? never : NodeFromSchema<T>>\n\t\t\t: never);\n\n/**\n * Given a node's schema, return the corresponding object from which the node could be built.\n * @privateRemarks\n * This uses TreeNodeSchemaCore, and thus depends on TreeNodeSchemaCore.createFromInsertable for the typing.\n * This works almost the same as using TreeNodeSchema,\n * except that the more complex typing in TreeNodeSchema case breaks for non-class schema and leaks in `undefined` from optional crete parameters.\n * @system @public\n */\nexport type NodeBuilderData<T extends TreeNodeSchemaCore<string, NodeKind, boolean>> =\n\tT extends TreeNodeSchemaCore<string, NodeKind, boolean, unknown, infer TBuild>\n\t\t? TBuild\n\t\t: never;\n\n/**\n * Value that may be stored as a leaf node.\n * @remarks\n * Some limitations apply, see the documentation for {@link SchemaStatics.number} and {@link SchemaStatics.string} for those restrictions.\n * @public\n */\n// eslint-disable-next-line @rushstack/no-new-null\nexport type TreeLeafValue = number | string | boolean | IFluidHandle | null;\n"]}
|
|
@@ -8,6 +8,7 @@ import { UnhydratedFlexTreeNode } from "./unhydratedFlexTree.js";
|
|
|
8
8
|
import { NodeKind, type TreeNodeSchema, type TreeNodeSchemaCore, type TreeNodeSchemaInitializedData, type TreeNodeSchemaPrivateData } from "./treeNodeSchema.js";
|
|
9
9
|
import type { InternalTreeNode } from "./types.js";
|
|
10
10
|
import type { ImplicitAnnotatedAllowedTypes } from "./allowedTypes.js";
|
|
11
|
+
import type { SimpleNodeSchemaBase } from "./simpleNodeSchemaBase.js";
|
|
11
12
|
/**
|
|
12
13
|
* Class which all {@link TreeNode}s must extend.
|
|
13
14
|
* Since this is not exported, it allows robust detection of attempts to create TreeNodes which do not go through SchemaFactory which is the only place which exposes classes that extend this.
|
|
@@ -97,10 +98,14 @@ export interface MostDerivedData {
|
|
|
97
98
|
* Cast `schema` to a {@link TreeNodeValid}, asserting it actually extends it.
|
|
98
99
|
*/
|
|
99
100
|
export declare function schemaAsTreeNodeValid(schema: TreeNodeSchemaCore<string, NodeKind, boolean>): typeof TreeNodeValid & TreeNodeSchema;
|
|
101
|
+
/**
|
|
102
|
+
* Check if a schema is a {@link TreeNodeValid}.
|
|
103
|
+
*/
|
|
104
|
+
export declare function isClassBasedSchema(schema: SimpleNodeSchemaBase<NodeKind>): schema is typeof TreeNodeValid & TreeNodeSchema;
|
|
100
105
|
/**
|
|
101
106
|
* Provides the {@link TreeNodeSchemaPrivateData} for class based implementations of {@link asTreeNodeSchemaCorePrivate}.
|
|
102
107
|
* @remarks
|
|
103
108
|
* Such schema must extends {@link TreeNodeValid}.
|
|
104
109
|
*/
|
|
105
|
-
export declare function createTreeNodeSchemaPrivateData(schema: TreeNodeSchemaCore<string, NodeKind, boolean>, childAnnotatedAllowedTypes: readonly ImplicitAnnotatedAllowedTypes[]): TreeNodeSchemaPrivateData;
|
|
110
|
+
export declare function createTreeNodeSchemaPrivateData(schema: TreeNodeSchemaCore<string, NodeKind, boolean>, childAnnotatedAllowedTypes: readonly ImplicitAnnotatedAllowedTypes[], toStored: TreeNodeSchemaPrivateData["toStored"]): TreeNodeSchemaPrivateData;
|
|
106
111
|
//# sourceMappingURL=treeNodeValid.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treeNodeValid.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/core/treeNodeValid.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,KAAK,YAAY,EAAkB,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"treeNodeValid.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/core/treeNodeValid.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,KAAK,YAAY,EAAkB,MAAM,kCAAkC,CAAC;AAErF,OAAO,EAAkC,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EACN,QAAQ,EACR,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,6BAA6B,EAClC,KAAK,yBAAyB,EAC9B,MAAM,qBAAqB,CAAC;AAO7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEtE;;;;;;;GAOG;AACH,8BAAsB,aAAa,CAAC,MAAM,CAAE,SAAQ,QAAQ;IAC3D;;;;;;;OAOG;IACH,SAAS,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,EACjC,IAAI,EA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