@fluidframework/tree 2.11.0 → 2.13.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/CHANGELOG.md +140 -0
- package/api-report/tree.alpha.api.md +88 -12
- package/api-report/tree.beta.api.md +23 -11
- package/api-report/tree.legacy.alpha.api.md +23 -11
- package/api-report/tree.legacy.public.api.md +23 -11
- package/api-report/tree.public.api.md +23 -11
- package/dist/alpha.d.ts +11 -0
- package/dist/beta.d.ts +2 -0
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +5 -3
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/utils.d.ts.map +1 -1
- package/dist/core/rebase/utils.js +2 -9
- package/dist/core/rebase/utils.js.map +1 -1
- package/dist/core/schema-stored/format.d.ts +0 -3
- package/dist/core/schema-stored/format.d.ts.map +1 -1
- package/dist/core/schema-stored/format.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +12 -10
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +3 -5
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/schema-view/index.d.ts +1 -1
- package/dist/core/schema-view/index.d.ts.map +1 -1
- package/dist/core/schema-view/index.js +1 -2
- package/dist/core/schema-view/index.js.map +1 -1
- package/dist/core/schema-view/view.d.ts +0 -7
- package/dist/core/schema-view/view.d.ts.map +1 -1
- package/dist/core/schema-view/view.js +1 -12
- package/dist/core/schema-view/view.js.map +1 -1
- package/dist/{feature-libraries/chunked-forest → core/tree}/chunk.d.ts +2 -1
- package/dist/core/tree/chunk.d.ts.map +1 -0
- package/dist/{feature-libraries/chunked-forest → core/tree}/chunk.js +2 -2
- package/dist/core/tree/chunk.js.map +1 -0
- package/dist/core/tree/index.d.ts +1 -0
- package/dist/core/tree/index.d.ts.map +1 -1
- package/dist/core/tree/index.js +5 -1
- package/dist/core/tree/index.js.map +1 -1
- package/dist/core/tree/treeTextFormat.d.ts +0 -5
- package/dist/core/tree/treeTextFormat.d.ts.map +1 -1
- package/dist/core/tree/treeTextFormat.js.map +1 -1
- package/dist/core/tree/types.d.ts +0 -5
- package/dist/core/tree/types.d.ts.map +1 -1
- package/dist/core/tree/types.js +0 -1
- package/dist/core/tree/types.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.d.ts +1 -2
- package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.js +14 -14
- package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +1 -2
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js +2 -3
- package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts +1 -2
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts +1 -2
- package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +1 -2
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/emptyChunk.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/emptyChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/emptyChunk.js +2 -3
- package/dist/feature-libraries/chunked-forest/emptyChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/index.js +5 -5
- package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/sequenceChunk.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/sequenceChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/sequenceChunk.js +2 -2
- package/dist/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts +1 -2
- package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.js +13 -13
- package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +10 -0
- 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/defaultSchema.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultSchema.js +1 -0
- package/dist/feature-libraries/default-schema/defaultSchema.js.map +1 -1
- package/dist/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/schemaChecker.js +2 -1
- package/dist/feature-libraries/default-schema/schemaChecker.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +1 -2
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +6 -4
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts +8 -1
- package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
- package/dist/feature-libraries/indexing/anchorTreeIndex.js +31 -5
- package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +1 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.js +8 -2
- package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
- package/dist/feature-libraries/modular-schema/discrepancies.d.ts +84 -24
- package/dist/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/discrepancies.js +32 -33
- package/dist/feature-libraries/modular-schema/discrepancies.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +12 -5
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- 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 +2 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/index.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/index.js +5 -1
- package/dist/feature-libraries/modular-schema/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/isNeverTree.d.ts +0 -1
- package/dist/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/isNeverTree.js +0 -1
- package/dist/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +89 -25
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +12 -0
- package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.js +24 -4
- package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +6 -6
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +7 -7
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +12 -12
- package/dist/feature-libraries/sequence-field/formatV1.d.ts +99 -99
- package/dist/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV2.d.ts +76 -76
- package/dist/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV3.d.ts +54 -54
- package/dist/feature-libraries/sequence-field/types.d.ts +0 -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/feature-libraries/sequence-field/utils.d.ts +2 -2
- package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/utils.js +14 -5
- package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
- package/dist/index.d.ts +4 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -14
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +2 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/public.d.ts +2 -0
- package/dist/shared-tree/index.d.ts +3 -2
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js +2 -1
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/schematizeTree.d.ts +1 -1
- package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
- package/dist/shared-tree/schematizeTree.js +6 -6
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +10 -1
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +51 -12
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +31 -10
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +106 -15
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/transactionTypes.d.ts +105 -0
- package/dist/shared-tree/transactionTypes.d.ts.map +1 -0
- package/dist/shared-tree/transactionTypes.js +13 -0
- package/dist/shared-tree/transactionTypes.js.map +1 -0
- package/dist/shared-tree/treeApi.d.ts +1 -25
- package/dist/shared-tree/treeApi.d.ts.map +1 -1
- package/dist/shared-tree/treeApi.js +4 -8
- package/dist/shared-tree/treeApi.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +39 -13
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +275 -128
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts +13 -35
- package/dist/shared-tree-core/branch.d.ts.map +1 -1
- package/dist/shared-tree-core/branch.js +12 -77
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/shared-tree-core/branchCommitEnricher.d.ts +7 -1
- package/dist/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
- package/dist/shared-tree-core/branchCommitEnricher.js +16 -18
- package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
- package/dist/shared-tree-core/editManager.d.ts.map +1 -1
- package/dist/shared-tree-core/editManager.js +2 -2
- package/dist/shared-tree-core/editManager.js.map +1 -1
- package/dist/shared-tree-core/index.d.ts +3 -3
- package/dist/shared-tree-core/index.d.ts.map +1 -1
- package/dist/shared-tree-core/index.js +2 -2
- package/dist/shared-tree-core/index.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts +2 -9
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +4 -16
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/shared-tree-core/transaction.d.ts +38 -0
- package/dist/shared-tree-core/transaction.d.ts.map +1 -1
- package/dist/shared-tree-core/transaction.js +118 -6
- package/dist/shared-tree-core/transaction.js.map +1 -1
- package/dist/simple-tree/api/conciseTree.d.ts.map +1 -1
- package/dist/simple-tree/api/conciseTree.js +1 -1
- package/dist/simple-tree/api/conciseTree.js.map +1 -1
- package/dist/simple-tree/api/create.d.ts.map +1 -1
- package/dist/simple-tree/api/create.js +5 -1
- package/dist/simple-tree/api/create.js.map +1 -1
- package/dist/simple-tree/api/customTree.d.ts +14 -2
- package/dist/simple-tree/api/customTree.d.ts.map +1 -1
- package/dist/simple-tree/api/customTree.js +53 -3
- package/dist/simple-tree/api/customTree.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 +6 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/jsonSchema.d.ts +6 -0
- package/dist/simple-tree/api/jsonSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/jsonSchema.js.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts +65 -8
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +10 -4
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +83 -0
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -0
- package/dist/simple-tree/api/schemaFactoryAlpha.js +90 -0
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -0
- package/dist/simple-tree/api/simpleSchema.d.ts +8 -2
- package/dist/simple-tree/api/simpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/simpleSchema.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +13 -10
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/dist/simple-tree/api/simpleTreeIndex.js +3 -1
- package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
- package/dist/simple-tree/api/storedSchema.d.ts +4 -4
- package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/storedSchema.js +8 -21
- package/dist/simple-tree/api/storedSchema.js.map +1 -1
- package/dist/simple-tree/api/testRecursiveDomain.d.ts +5 -5
- package/dist/simple-tree/api/tree.d.ts +61 -0
- package/dist/simple-tree/api/tree.d.ts.map +1 -1
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/verboseTree.js +1 -1
- package/dist/simple-tree/api/verboseTree.js.map +1 -1
- package/dist/simple-tree/api/view.d.ts +14 -9
- package/dist/simple-tree/api/view.d.ts.map +1 -1
- package/dist/simple-tree/api/view.js +129 -40
- package/dist/simple-tree/api/view.js.map +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +11 -11
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
- package/dist/simple-tree/arrayNode.d.ts +2 -2
- package/dist/simple-tree/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/arrayNode.js +2 -1
- package/dist/simple-tree/arrayNode.js.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts +10 -6
- 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/index.d.ts +3 -3
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +6 -2
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts +5 -20
- package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js +0 -15
- package/dist/simple-tree/leafNodeSchema.js.map +1 -1
- package/dist/simple-tree/mapNode.d.ts +2 -2
- package/dist/simple-tree/mapNode.d.ts.map +1 -1
- package/dist/simple-tree/mapNode.js +2 -1
- package/dist/simple-tree/mapNode.js.map +1 -1
- package/dist/simple-tree/objectNode.d.ts +9 -4
- package/dist/simple-tree/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/objectNode.js +19 -2
- package/dist/simple-tree/objectNode.js.map +1 -1
- package/dist/simple-tree/objectNodeTypes.d.ts +6 -2
- package/dist/simple-tree/objectNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/objectNodeTypes.js.map +1 -1
- package/dist/simple-tree/schemaTypes.d.ts +51 -3
- package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
- package/dist/simple-tree/schemaTypes.js.map +1 -1
- package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +18 -13
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/util/brand.d.ts +0 -2
- package/dist/util/brand.d.ts.map +1 -1
- package/dist/util/brand.js +0 -1
- package/dist/util/brand.js.map +1 -1
- package/dist/util/index.d.ts +2 -2
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +4 -5
- package/dist/util/index.js.map +1 -1
- package/dist/util/rangeMap.d.ts +72 -42
- package/dist/util/rangeMap.d.ts.map +1 -1
- package/dist/util/rangeMap.js +161 -151
- package/dist/util/rangeMap.js.map +1 -1
- package/dist/util/typeCheck.d.ts +0 -2
- package/dist/util/typeCheck.d.ts.map +1 -1
- package/dist/util/typeCheck.js.map +1 -1
- package/dist/util/utils.d.ts +35 -1
- package/dist/util/utils.d.ts.map +1 -1
- package/dist/util/utils.js +32 -1
- package/dist/util/utils.js.map +1 -1
- package/lib/alpha.d.ts +11 -0
- package/lib/beta.d.ts +2 -0
- package/lib/core/index.d.ts +2 -2
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +2 -2
- package/lib/core/index.js.map +1 -1
- package/lib/core/rebase/utils.d.ts.map +1 -1
- package/lib/core/rebase/utils.js +3 -10
- package/lib/core/rebase/utils.js.map +1 -1
- package/lib/core/schema-stored/format.d.ts +0 -3
- package/lib/core/schema-stored/format.d.ts.map +1 -1
- package/lib/core/schema-stored/format.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +12 -10
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +3 -5
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/schema-view/index.d.ts +1 -1
- package/lib/core/schema-view/index.d.ts.map +1 -1
- package/lib/core/schema-view/index.js +1 -1
- package/lib/core/schema-view/index.js.map +1 -1
- package/lib/core/schema-view/view.d.ts +0 -7
- package/lib/core/schema-view/view.d.ts.map +1 -1
- package/lib/core/schema-view/view.js +0 -11
- package/lib/core/schema-view/view.js.map +1 -1
- package/lib/{feature-libraries/chunked-forest → core/tree}/chunk.d.ts +2 -1
- package/lib/core/tree/chunk.d.ts.map +1 -0
- package/lib/{feature-libraries/chunked-forest → core/tree}/chunk.js +1 -1
- package/lib/core/tree/chunk.js.map +1 -0
- package/lib/core/tree/index.d.ts +1 -0
- package/lib/core/tree/index.d.ts.map +1 -1
- package/lib/core/tree/index.js +1 -0
- package/lib/core/tree/index.js.map +1 -1
- package/lib/core/tree/treeTextFormat.d.ts +0 -5
- package/lib/core/tree/treeTextFormat.d.ts.map +1 -1
- package/lib/core/tree/treeTextFormat.js.map +1 -1
- package/lib/core/tree/types.d.ts +0 -5
- package/lib/core/tree/types.d.ts.map +1 -1
- package/lib/core/tree/types.js +0 -1
- package/lib/core/tree/types.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.d.ts +1 -2
- package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.js +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +1 -2
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js +1 -2
- package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts +1 -2
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts +1 -2
- package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +1 -2
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/emptyChunk.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/emptyChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/emptyChunk.js +1 -2
- package/lib/feature-libraries/chunked-forest/emptyChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/index.js +1 -1
- package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/sequenceChunk.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/sequenceChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/sequenceChunk.js +1 -1
- package/lib/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts +1 -2
- package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +10 -0
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js +3 -0
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultSchema.js +1 -0
- package/lib/feature-libraries/default-schema/defaultSchema.js.map +1 -1
- package/lib/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/schemaChecker.js +2 -1
- package/lib/feature-libraries/default-schema/schemaChecker.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +1 -2
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +1 -2
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts +8 -1
- package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
- package/lib/feature-libraries/indexing/anchorTreeIndex.js +31 -5
- package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
- package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +1 -1
- package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/crossFieldQueries.js +9 -3
- package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
- package/lib/feature-libraries/modular-schema/discrepancies.d.ts +84 -24
- package/lib/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/discrepancies.js +25 -28
- package/lib/feature-libraries/modular-schema/discrepancies.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +12 -5
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- 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 +2 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/index.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/index.js +1 -1
- package/lib/feature-libraries/modular-schema/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/isNeverTree.d.ts +0 -1
- package/lib/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/isNeverTree.js +0 -1
- package/lib/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +89 -25
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +12 -0
- package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalField.js +24 -4
- package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +6 -6
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +7 -7
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +12 -12
- package/lib/feature-libraries/sequence-field/formatV1.d.ts +99 -99
- package/lib/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV2.d.ts +76 -76
- package/lib/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV3.d.ts +54 -54
- package/lib/feature-libraries/sequence-field/types.d.ts +0 -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/feature-libraries/sequence-field/utils.d.ts +2 -2
- package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/utils.js +14 -5
- package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
- package/lib/index.d.ts +4 -5
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -4
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +2 -0
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/public.d.ts +2 -0
- package/lib/shared-tree/index.d.ts +3 -2
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js +2 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/schematizeTree.d.ts +1 -1
- package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
- package/lib/shared-tree/schematizeTree.js +7 -7
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +10 -1
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +56 -17
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +31 -10
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +107 -16
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/transactionTypes.d.ts +105 -0
- package/lib/shared-tree/transactionTypes.d.ts.map +1 -0
- package/lib/shared-tree/transactionTypes.js +10 -0
- package/lib/shared-tree/transactionTypes.js.map +1 -0
- package/lib/shared-tree/treeApi.d.ts +1 -25
- package/lib/shared-tree/treeApi.d.ts.map +1 -1
- package/lib/shared-tree/treeApi.js +1 -5
- package/lib/shared-tree/treeApi.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +39 -13
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +277 -130
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts +13 -35
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +12 -76
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/shared-tree-core/branchCommitEnricher.d.ts +7 -1
- package/lib/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
- package/lib/shared-tree-core/branchCommitEnricher.js +16 -18
- package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
- package/lib/shared-tree-core/editManager.d.ts.map +1 -1
- package/lib/shared-tree-core/editManager.js +3 -3
- package/lib/shared-tree-core/editManager.js.map +1 -1
- package/lib/shared-tree-core/index.d.ts +3 -3
- package/lib/shared-tree-core/index.d.ts.map +1 -1
- package/lib/shared-tree-core/index.js +2 -2
- package/lib/shared-tree-core/index.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts +2 -9
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +4 -16
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/shared-tree-core/transaction.d.ts +38 -0
- package/lib/shared-tree-core/transaction.d.ts.map +1 -1
- package/lib/shared-tree-core/transaction.js +112 -1
- package/lib/shared-tree-core/transaction.js.map +1 -1
- package/lib/simple-tree/api/conciseTree.d.ts.map +1 -1
- package/lib/simple-tree/api/conciseTree.js +2 -2
- package/lib/simple-tree/api/conciseTree.js.map +1 -1
- package/lib/simple-tree/api/create.d.ts.map +1 -1
- package/lib/simple-tree/api/create.js +5 -1
- package/lib/simple-tree/api/create.js.map +1 -1
- package/lib/simple-tree/api/customTree.d.ts +14 -2
- package/lib/simple-tree/api/customTree.d.ts.map +1 -1
- package/lib/simple-tree/api/customTree.js +50 -2
- package/lib/simple-tree/api/customTree.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 +3 -1
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/jsonSchema.d.ts +6 -0
- package/lib/simple-tree/api/jsonSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/jsonSchema.js.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts +65 -8
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +9 -3
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +83 -0
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -0
- package/lib/simple-tree/api/schemaFactoryAlpha.js +86 -0
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -0
- package/lib/simple-tree/api/simpleSchema.d.ts +8 -2
- package/lib/simple-tree/api/simpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/simpleSchema.js.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js +14 -11
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/lib/simple-tree/api/simpleTreeIndex.js +3 -1
- package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
- package/lib/simple-tree/api/storedSchema.d.ts +4 -4
- package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/storedSchema.js +5 -18
- package/lib/simple-tree/api/storedSchema.js.map +1 -1
- package/lib/simple-tree/api/testRecursiveDomain.d.ts +5 -5
- package/lib/simple-tree/api/tree.d.ts +61 -0
- package/lib/simple-tree/api/tree.d.ts.map +1 -1
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/verboseTree.js +2 -2
- package/lib/simple-tree/api/verboseTree.js.map +1 -1
- package/lib/simple-tree/api/view.d.ts +14 -9
- package/lib/simple-tree/api/view.d.ts.map +1 -1
- package/lib/simple-tree/api/view.js +131 -42
- package/lib/simple-tree/api/view.js.map +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +12 -12
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
- package/lib/simple-tree/arrayNode.d.ts +2 -2
- package/lib/simple-tree/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/arrayNode.js +2 -1
- package/lib/simple-tree/arrayNode.js.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts +10 -6
- 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/index.d.ts +3 -3
- 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 +5 -20
- package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js +0 -15
- package/lib/simple-tree/leafNodeSchema.js.map +1 -1
- package/lib/simple-tree/mapNode.d.ts +2 -2
- package/lib/simple-tree/mapNode.d.ts.map +1 -1
- package/lib/simple-tree/mapNode.js +2 -1
- package/lib/simple-tree/mapNode.js.map +1 -1
- package/lib/simple-tree/objectNode.d.ts +9 -4
- package/lib/simple-tree/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/objectNode.js +17 -1
- package/lib/simple-tree/objectNode.js.map +1 -1
- package/lib/simple-tree/objectNodeTypes.d.ts +6 -2
- package/lib/simple-tree/objectNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/objectNodeTypes.js.map +1 -1
- package/lib/simple-tree/schemaTypes.d.ts +51 -3
- package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
- package/lib/simple-tree/schemaTypes.js.map +1 -1
- package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +19 -14
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/util/brand.d.ts +0 -2
- package/lib/util/brand.d.ts.map +1 -1
- package/lib/util/brand.js +0 -1
- package/lib/util/brand.js.map +1 -1
- package/lib/util/index.d.ts +2 -2
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +2 -2
- package/lib/util/index.js.map +1 -1
- package/lib/util/rangeMap.d.ts +72 -42
- package/lib/util/rangeMap.d.ts.map +1 -1
- package/lib/util/rangeMap.js +159 -146
- package/lib/util/rangeMap.js.map +1 -1
- package/lib/util/typeCheck.d.ts +0 -2
- package/lib/util/typeCheck.d.ts.map +1 -1
- package/lib/util/typeCheck.js.map +1 -1
- package/lib/util/utils.d.ts +35 -1
- package/lib/util/utils.d.ts.map +1 -1
- package/lib/util/utils.js +29 -0
- package/lib/util/utils.js.map +1 -1
- package/package.json +23 -23
- package/src/core/index.ts +5 -1
- package/src/core/rebase/utils.ts +17 -20
- package/src/core/schema-stored/format.ts +0 -3
- package/src/core/schema-stored/schema.ts +13 -10
- package/src/core/schema-view/index.ts +0 -1
- package/src/core/schema-view/view.ts +0 -11
- package/src/{feature-libraries/chunked-forest → core/tree}/chunk.ts +4 -4
- package/src/core/tree/index.ts +8 -0
- package/src/core/tree/treeTextFormat.ts +0 -5
- package/src/core/tree/types.ts +0 -5
- package/src/feature-libraries/chunked-forest/basicChunk.ts +4 -2
- package/src/feature-libraries/chunked-forest/chunkTree.ts +2 -1
- package/src/feature-libraries/chunked-forest/chunkedForest.ts +2 -1
- package/src/feature-libraries/chunked-forest/codec/chunkCodecUtilities.ts +1 -2
- package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +6 -2
- package/src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts +1 -1
- package/src/feature-libraries/chunked-forest/emptyChunk.ts +4 -2
- package/src/feature-libraries/chunked-forest/index.ts +1 -1
- package/src/feature-libraries/chunked-forest/sequenceChunk.ts +1 -1
- package/src/feature-libraries/chunked-forest/uniformChunk.ts +4 -1
- package/src/feature-libraries/default-schema/defaultEditBuilder.ts +14 -1
- package/src/feature-libraries/default-schema/defaultSchema.ts +1 -0
- package/src/feature-libraries/default-schema/schemaChecker.ts +4 -1
- package/src/feature-libraries/index.ts +13 -1
- package/src/feature-libraries/indexing/anchorTreeIndex.ts +34 -5
- package/src/feature-libraries/modular-schema/crossFieldQueries.ts +9 -9
- package/src/feature-libraries/modular-schema/discrepancies.ts +76 -38
- package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +13 -9
- package/src/feature-libraries/modular-schema/genericFieldKind.ts +4 -2
- package/src/feature-libraries/modular-schema/index.ts +14 -0
- package/src/feature-libraries/modular-schema/isNeverTree.ts +0 -2
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +124 -31
- package/src/feature-libraries/modular-schema/modularChangeTypes.ts +12 -0
- package/src/feature-libraries/optional-field/optionalField.ts +34 -5
- package/src/feature-libraries/sequence-field/types.ts +0 -1
- package/src/feature-libraries/sequence-field/utils.ts +18 -7
- package/src/index.ts +12 -29
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/index.ts +13 -2
- package/src/shared-tree/schematizeTree.ts +6 -10
- package/src/shared-tree/schematizingTreeView.ts +102 -23
- package/src/shared-tree/sharedTree.ts +181 -44
- package/src/shared-tree/transactionTypes.ts +125 -0
- package/src/shared-tree/treeApi.ts +1 -28
- package/src/shared-tree/treeCheckout.ts +358 -175
- package/src/shared-tree-core/branch.ts +29 -122
- package/src/shared-tree-core/branchCommitEnricher.ts +19 -20
- package/src/shared-tree-core/editManager.ts +3 -8
- package/src/shared-tree-core/index.ts +2 -1
- package/src/shared-tree-core/sharedTreeCore.ts +8 -19
- package/src/shared-tree-core/transaction.ts +145 -0
- package/src/simple-tree/api/conciseTree.ts +2 -2
- package/src/simple-tree/api/create.ts +5 -1
- package/src/simple-tree/api/customTree.ts +69 -1
- package/src/simple-tree/api/index.ts +13 -2
- package/src/simple-tree/api/jsonSchema.ts +7 -0
- package/src/simple-tree/api/schemaFactory.ts +91 -3
- package/src/simple-tree/api/schemaFactoryAlpha.ts +253 -0
- package/src/simple-tree/api/simpleSchema.ts +9 -2
- package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +22 -12
- package/src/simple-tree/api/simpleTreeIndex.ts +2 -0
- package/src/simple-tree/api/storedSchema.ts +7 -22
- package/src/simple-tree/api/tree.ts +78 -0
- package/src/simple-tree/api/verboseTree.ts +2 -2
- package/src/simple-tree/api/view.ts +197 -51
- package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +19 -13
- package/src/simple-tree/arrayNode.ts +7 -1
- package/src/simple-tree/core/treeNodeSchema.ts +51 -7
- package/src/simple-tree/index.ts +9 -0
- package/src/simple-tree/leafNodeSchema.ts +0 -19
- package/src/simple-tree/mapNode.ts +7 -1
- package/src/simple-tree/objectNode.ts +33 -3
- package/src/simple-tree/objectNodeTypes.ts +9 -1
- package/src/simple-tree/schemaTypes.ts +57 -3
- package/src/simple-tree/toStoredSchema.ts +25 -19
- package/src/util/brand.ts +0 -2
- package/src/util/index.ts +3 -6
- package/src/util/rangeMap.ts +199 -189
- package/src/util/typeCheck.ts +0 -2
- package/src/util/utils.ts +73 -1
- package/dist/feature-libraries/chunked-forest/chunk.d.ts.map +0 -1
- package/dist/feature-libraries/chunked-forest/chunk.js.map +0 -1
- package/dist/feature-libraries/memoizedIdRangeAllocator.d.ts +0 -38
- package/dist/feature-libraries/memoizedIdRangeAllocator.d.ts.map +0 -1
- package/dist/feature-libraries/memoizedIdRangeAllocator.js +0 -74
- package/dist/feature-libraries/memoizedIdRangeAllocator.js.map +0 -1
- package/lib/feature-libraries/chunked-forest/chunk.d.ts.map +0 -1
- package/lib/feature-libraries/chunked-forest/chunk.js.map +0 -1
- package/lib/feature-libraries/memoizedIdRangeAllocator.d.ts +0 -38
- package/lib/feature-libraries/memoizedIdRangeAllocator.d.ts.map +0 -1
- package/lib/feature-libraries/memoizedIdRangeAllocator.js +0 -71
- package/lib/feature-libraries/memoizedIdRangeAllocator.js.map +0 -1
- package/src/feature-libraries/memoizedIdRangeAllocator.ts +0 -112
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type { TreeLeafValue } from "../schemaTypes.js";
|
|
6
|
+
import type { NodeSchemaMetadata, TreeLeafValue } from "../schemaTypes.js";
|
|
7
7
|
import type { InternalTreeNode, TreeNode, Unhydrated } from "./types.js";
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -27,11 +27,30 @@ export type TreeNodeSchema<
|
|
|
27
27
|
TBuild = never,
|
|
28
28
|
ImplicitlyConstructable extends boolean = boolean,
|
|
29
29
|
Info = unknown,
|
|
30
|
+
TCustomMetadata = unknown,
|
|
30
31
|
> =
|
|
31
32
|
| (TNode extends TreeNode
|
|
32
|
-
? TreeNodeSchemaClass<
|
|
33
|
+
? TreeNodeSchemaClass<
|
|
34
|
+
Name,
|
|
35
|
+
Kind,
|
|
36
|
+
TNode,
|
|
37
|
+
TBuild,
|
|
38
|
+
ImplicitlyConstructable,
|
|
39
|
+
Info,
|
|
40
|
+
never,
|
|
41
|
+
TCustomMetadata
|
|
42
|
+
>
|
|
33
43
|
: never)
|
|
34
|
-
| TreeNodeSchemaNonClass<
|
|
44
|
+
| TreeNodeSchemaNonClass<
|
|
45
|
+
Name,
|
|
46
|
+
Kind,
|
|
47
|
+
TNode,
|
|
48
|
+
TBuild,
|
|
49
|
+
ImplicitlyConstructable,
|
|
50
|
+
Info,
|
|
51
|
+
never,
|
|
52
|
+
TCustomMetadata
|
|
53
|
+
>;
|
|
35
54
|
|
|
36
55
|
/**
|
|
37
56
|
* Schema which is not a class.
|
|
@@ -49,7 +68,15 @@ export type TreeNodeSchemaNonClass<
|
|
|
49
68
|
ImplicitlyConstructable extends boolean = boolean,
|
|
50
69
|
Info = unknown,
|
|
51
70
|
TConstructorExtra = never,
|
|
52
|
-
|
|
71
|
+
TCustomMetadata = unknown,
|
|
72
|
+
> = TreeNodeSchemaCore<
|
|
73
|
+
Name,
|
|
74
|
+
Kind,
|
|
75
|
+
ImplicitlyConstructable,
|
|
76
|
+
Info,
|
|
77
|
+
TInsertable,
|
|
78
|
+
TCustomMetadata
|
|
79
|
+
> &
|
|
53
80
|
(undefined extends TConstructorExtra
|
|
54
81
|
? {
|
|
55
82
|
/**
|
|
@@ -119,7 +146,15 @@ export type TreeNodeSchemaClass<
|
|
|
119
146
|
ImplicitlyConstructable extends boolean = boolean,
|
|
120
147
|
Info = unknown,
|
|
121
148
|
TConstructorExtra = never,
|
|
122
|
-
|
|
149
|
+
TCustomMetadata = unknown,
|
|
150
|
+
> = TreeNodeSchemaCore<
|
|
151
|
+
Name,
|
|
152
|
+
Kind,
|
|
153
|
+
ImplicitlyConstructable,
|
|
154
|
+
Info,
|
|
155
|
+
TInsertable,
|
|
156
|
+
TCustomMetadata
|
|
157
|
+
> &
|
|
123
158
|
(undefined extends TConstructorExtra
|
|
124
159
|
? {
|
|
125
160
|
/**
|
|
@@ -157,6 +192,7 @@ export type TreeNodeSchemaBoth<
|
|
|
157
192
|
ImplicitlyConstructable extends boolean = boolean,
|
|
158
193
|
Info = unknown,
|
|
159
194
|
TConstructorExtra = never,
|
|
195
|
+
TCustomMetadata = unknown,
|
|
160
196
|
> = TreeNodeSchemaClass<
|
|
161
197
|
Name,
|
|
162
198
|
Kind,
|
|
@@ -164,7 +200,8 @@ export type TreeNodeSchemaBoth<
|
|
|
164
200
|
TInsertable,
|
|
165
201
|
ImplicitlyConstructable,
|
|
166
202
|
Info,
|
|
167
|
-
TConstructorExtra
|
|
203
|
+
TConstructorExtra,
|
|
204
|
+
TCustomMetadata
|
|
168
205
|
> &
|
|
169
206
|
TreeNodeSchemaNonClass<
|
|
170
207
|
Name,
|
|
@@ -173,7 +210,8 @@ export type TreeNodeSchemaBoth<
|
|
|
173
210
|
TInsertable,
|
|
174
211
|
ImplicitlyConstructable,
|
|
175
212
|
Info,
|
|
176
|
-
TConstructorExtra
|
|
213
|
+
TConstructorExtra,
|
|
214
|
+
TCustomMetadata
|
|
177
215
|
>;
|
|
178
216
|
|
|
179
217
|
/**
|
|
@@ -188,6 +226,7 @@ export interface TreeNodeSchemaCore<
|
|
|
188
226
|
out ImplicitlyConstructable extends boolean,
|
|
189
227
|
out Info = unknown,
|
|
190
228
|
out TInsertable = never,
|
|
229
|
+
out TCustomMetadata = unknown,
|
|
191
230
|
> {
|
|
192
231
|
/**
|
|
193
232
|
* Unique (within a document's schema) identifier used to associate nodes with their schema.
|
|
@@ -244,6 +283,11 @@ export interface TreeNodeSchemaCore<
|
|
|
244
283
|
*/
|
|
245
284
|
readonly childTypes: ReadonlySet<TreeNodeSchema>;
|
|
246
285
|
|
|
286
|
+
/**
|
|
287
|
+
* User-provided {@link NodeSchemaMetadata} for this schema.
|
|
288
|
+
*/
|
|
289
|
+
readonly metadata?: NodeSchemaMetadata<TCustomMetadata> | undefined;
|
|
290
|
+
|
|
247
291
|
/**
|
|
248
292
|
* Constructs an instance of this node type.
|
|
249
293
|
* @remarks
|
package/src/simple-tree/index.ts
CHANGED
|
@@ -35,6 +35,8 @@ export {
|
|
|
35
35
|
type SchemaCompatibilityStatus,
|
|
36
36
|
type ITreeConfigurationOptions,
|
|
37
37
|
SchemaFactory,
|
|
38
|
+
SchemaFactoryAlpha,
|
|
39
|
+
type SchemaFactoryObjectOptions,
|
|
38
40
|
type ScopedSchemaName,
|
|
39
41
|
type ValidateRecursiveSchema,
|
|
40
42
|
type FixRecursiveArraySchema,
|
|
@@ -118,6 +120,10 @@ export {
|
|
|
118
120
|
conciseFromCursor,
|
|
119
121
|
createFromCursor,
|
|
120
122
|
asTreeViewAlpha,
|
|
123
|
+
customFromCursorStored,
|
|
124
|
+
type CustomTreeNode,
|
|
125
|
+
type CustomTreeValue,
|
|
126
|
+
tryStoredSchemaAsArray,
|
|
121
127
|
} from "./api/index.js";
|
|
122
128
|
export {
|
|
123
129
|
type NodeFromSchema,
|
|
@@ -150,6 +156,8 @@ export {
|
|
|
150
156
|
type Input,
|
|
151
157
|
type ReadableField,
|
|
152
158
|
type ReadSchema,
|
|
159
|
+
type NodeSchemaOptions,
|
|
160
|
+
type NodeSchemaMetadata,
|
|
153
161
|
} from "./schemaTypes.js";
|
|
154
162
|
export {
|
|
155
163
|
getTreeNodeForField,
|
|
@@ -166,6 +174,7 @@ export {
|
|
|
166
174
|
type ObjectFromSchemaRecord,
|
|
167
175
|
type TreeObjectNode,
|
|
168
176
|
setField,
|
|
177
|
+
createUnknownOptionalFieldPolicy,
|
|
169
178
|
} from "./objectNode.js";
|
|
170
179
|
export type { TreeMapNode, MapNodeInsertableData } from "./mapNode.js";
|
|
171
180
|
export {
|
|
@@ -68,27 +68,8 @@ function makeLeaf<Name extends string, const T extends ValueSchema>(
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
// Leaf schema shared between all SchemaFactory instances.
|
|
71
|
-
/**
|
|
72
|
-
* @internal
|
|
73
|
-
*/
|
|
74
71
|
export const stringSchema = makeLeaf("string", ValueSchema.String);
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* @internal
|
|
78
|
-
*/
|
|
79
72
|
export const numberSchema = makeLeaf("number", ValueSchema.Number);
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* @internal
|
|
83
|
-
*/
|
|
84
73
|
export const booleanSchema = makeLeaf("boolean", ValueSchema.Boolean);
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* @internal
|
|
88
|
-
*/
|
|
89
74
|
export const nullSchema = makeLeaf("null", ValueSchema.Null);
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* @internal
|
|
93
|
-
*/
|
|
94
75
|
export const handleSchema = makeLeaf("handle", ValueSchema.FluidHandle);
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
normalizeAllowedTypes,
|
|
18
18
|
type ImplicitAllowedTypes,
|
|
19
19
|
type InsertableTreeNodeFromImplicitAllowedTypes,
|
|
20
|
+
type NodeSchemaMetadata,
|
|
20
21
|
type TreeNodeFromImplicitAllowedTypes,
|
|
21
22
|
} from "./schemaTypes.js";
|
|
22
23
|
import {
|
|
@@ -235,11 +236,13 @@ export function mapSchema<
|
|
|
235
236
|
TName extends string,
|
|
236
237
|
const T extends ImplicitAllowedTypes,
|
|
237
238
|
const ImplicitlyConstructable extends boolean,
|
|
239
|
+
const TCustomMetadata = unknown,
|
|
238
240
|
>(
|
|
239
241
|
identifier: TName,
|
|
240
242
|
info: T,
|
|
241
243
|
implicitlyConstructable: ImplicitlyConstructable,
|
|
242
244
|
useMapPrototype: boolean,
|
|
245
|
+
metadata?: NodeSchemaMetadata<TCustomMetadata>,
|
|
243
246
|
) {
|
|
244
247
|
const lazyChildTypes = new Lazy(() => normalizeAllowedTypes(info));
|
|
245
248
|
|
|
@@ -283,6 +286,8 @@ export function mapSchema<
|
|
|
283
286
|
public static get childTypes(): ReadonlySet<TreeNodeSchema> {
|
|
284
287
|
return lazyChildTypes.value;
|
|
285
288
|
}
|
|
289
|
+
public static readonly metadata: NodeSchemaMetadata<TCustomMetadata> | undefined =
|
|
290
|
+
metadata;
|
|
286
291
|
|
|
287
292
|
// eslint-disable-next-line import/no-deprecated
|
|
288
293
|
public get [typeNameSymbol](): TName {
|
|
@@ -299,7 +304,8 @@ export function mapSchema<
|
|
|
299
304
|
MapNodeInsertableData<T>,
|
|
300
305
|
ImplicitlyConstructable,
|
|
301
306
|
T,
|
|
302
|
-
undefined
|
|
307
|
+
undefined,
|
|
308
|
+
TCustomMetadata
|
|
303
309
|
> = Schema;
|
|
304
310
|
return schemaErased;
|
|
305
311
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { assert, Lazy } from "@fluidframework/core-utils/internal";
|
|
7
7
|
import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
8
8
|
|
|
9
|
-
import type { FieldKey } from "../core/index.js";
|
|
9
|
+
import type { FieldKey, SchemaPolicy } from "../core/index.js";
|
|
10
10
|
import {
|
|
11
11
|
FieldKinds,
|
|
12
12
|
type FlexTreeField,
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
normalizeFieldSchema,
|
|
27
27
|
type ImplicitAllowedTypes,
|
|
28
28
|
FieldKind,
|
|
29
|
+
type NodeSchemaMetadata,
|
|
29
30
|
} from "./schemaTypes.js";
|
|
30
31
|
import {
|
|
31
32
|
type TreeNodeSchema,
|
|
@@ -42,7 +43,11 @@ import {
|
|
|
42
43
|
} from "./core/index.js";
|
|
43
44
|
import { mapTreeFromNodeData, type InsertableContent } from "./toMapTree.js";
|
|
44
45
|
import { type RestrictiveStringRecord, fail, type FlattenKeys } from "../util/index.js";
|
|
45
|
-
import
|
|
46
|
+
import {
|
|
47
|
+
isObjectNodeSchema,
|
|
48
|
+
type ObjectNodeSchema,
|
|
49
|
+
type ObjectNodeSchemaInternalData,
|
|
50
|
+
} from "./objectNodeTypes.js";
|
|
46
51
|
import { TreeNodeValid, type MostDerivedData } from "./treeNodeValid.js";
|
|
47
52
|
import { getUnhydratedContext } from "./createContext.js";
|
|
48
53
|
|
|
@@ -326,11 +331,15 @@ export function objectSchema<
|
|
|
326
331
|
TName extends string,
|
|
327
332
|
const T extends RestrictiveStringRecord<ImplicitFieldSchema>,
|
|
328
333
|
const ImplicitlyConstructable extends boolean,
|
|
334
|
+
const TCustomMetadata = unknown,
|
|
329
335
|
>(
|
|
330
336
|
identifier: TName,
|
|
331
337
|
info: T,
|
|
332
338
|
implicitlyConstructable: ImplicitlyConstructable,
|
|
333
|
-
|
|
339
|
+
allowUnknownOptionalFields: boolean,
|
|
340
|
+
metadata?: NodeSchemaMetadata<TCustomMetadata>,
|
|
341
|
+
): ObjectNodeSchema<TName, T, ImplicitlyConstructable, TCustomMetadata> &
|
|
342
|
+
ObjectNodeSchemaInternalData {
|
|
334
343
|
// Ensure no collisions between final set of property keys, and final set of stored keys (including those
|
|
335
344
|
// implicitly derived from property keys)
|
|
336
345
|
assertUniqueKeys(identifier, info);
|
|
@@ -368,6 +377,7 @@ export function objectSchema<
|
|
|
368
377
|
]),
|
|
369
378
|
);
|
|
370
379
|
public static readonly identifierFieldKeys: readonly FieldKey[] = identifierFieldKeys;
|
|
380
|
+
public static readonly allowUnknownOptionalFields: boolean = allowUnknownOptionalFields;
|
|
371
381
|
|
|
372
382
|
public static override prepareInstance<T2>(
|
|
373
383
|
this: typeof TreeNodeValid<T2>,
|
|
@@ -454,6 +464,8 @@ export function objectSchema<
|
|
|
454
464
|
public static get childTypes(): ReadonlySet<TreeNodeSchema> {
|
|
455
465
|
return lazyChildTypes.value;
|
|
456
466
|
}
|
|
467
|
+
public static readonly metadata: NodeSchemaMetadata<TCustomMetadata> | undefined =
|
|
468
|
+
metadata;
|
|
457
469
|
|
|
458
470
|
// eslint-disable-next-line import/no-deprecated
|
|
459
471
|
public get [typeNameSymbol](): TName {
|
|
@@ -509,3 +521,21 @@ function assertUniqueKeys<
|
|
|
509
521
|
derivedStoredKeys.add(storedKey);
|
|
510
522
|
}
|
|
511
523
|
}
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* Creates a policy for allowing unknown optional fields on an object node which delegates to the policy defined
|
|
527
|
+
* on the object node's internal schema data.
|
|
528
|
+
*/
|
|
529
|
+
export function createUnknownOptionalFieldPolicy(
|
|
530
|
+
schema: ImplicitFieldSchema,
|
|
531
|
+
): SchemaPolicy["allowUnknownOptionalFields"] {
|
|
532
|
+
const context = getUnhydratedContext(schema);
|
|
533
|
+
return (identifier) => {
|
|
534
|
+
const storedSchema = context.schema.get(identifier);
|
|
535
|
+
return (
|
|
536
|
+
storedSchema !== undefined &&
|
|
537
|
+
isObjectNodeSchema(storedSchema) &&
|
|
538
|
+
storedSchema.allowUnknownOptionalFields
|
|
539
|
+
);
|
|
540
|
+
};
|
|
541
|
+
}
|
|
@@ -23,13 +23,16 @@ export interface ObjectNodeSchema<
|
|
|
23
23
|
T extends
|
|
24
24
|
RestrictiveStringRecord<ImplicitFieldSchema> = RestrictiveStringRecord<ImplicitFieldSchema>,
|
|
25
25
|
ImplicitlyConstructable extends boolean = boolean,
|
|
26
|
+
TCustomMetadata = unknown,
|
|
26
27
|
> extends TreeNodeSchemaClass<
|
|
27
28
|
TName,
|
|
28
29
|
NodeKind.Object,
|
|
29
30
|
TreeObjectNode<T, TName>,
|
|
30
31
|
object & InsertableObjectFromSchemaRecord<T>,
|
|
31
32
|
ImplicitlyConstructable,
|
|
32
|
-
T
|
|
33
|
+
T,
|
|
34
|
+
never,
|
|
35
|
+
TCustomMetadata
|
|
33
36
|
> {
|
|
34
37
|
/**
|
|
35
38
|
* From property keys to the associated schema.
|
|
@@ -55,6 +58,11 @@ export interface ObjectNodeSchemaInternalData {
|
|
|
55
58
|
* Stored keys which hold identifiers.
|
|
56
59
|
*/
|
|
57
60
|
readonly identifierFieldKeys: readonly FieldKey[];
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Whether to tolerate (and preserve) additional unknown optional fields in instances of this object node.
|
|
64
|
+
*/
|
|
65
|
+
readonly allowUnknownOptionalFields: boolean;
|
|
58
66
|
}
|
|
59
67
|
|
|
60
68
|
export const ObjectNodeSchema = {
|
|
@@ -24,6 +24,7 @@ import type {
|
|
|
24
24
|
TreeNodeSchemaClass,
|
|
25
25
|
TreeNode,
|
|
26
26
|
TreeNodeSchemaCore,
|
|
27
|
+
TreeNodeSchemaNonClass,
|
|
27
28
|
} from "./core/index.js";
|
|
28
29
|
import type { FieldKey } from "../core/index.js";
|
|
29
30
|
import type { InsertableContent } from "./toMapTree.js";
|
|
@@ -189,7 +190,10 @@ export interface FieldProps<TCustomMetadata = unknown> {
|
|
|
189
190
|
|
|
190
191
|
/**
|
|
191
192
|
* Optional metadata to associate with the field.
|
|
192
|
-
*
|
|
193
|
+
*
|
|
194
|
+
* @remarks
|
|
195
|
+
* Note: this metadata is not persisted nor made part of the collaborative state; it is strictly client-local.
|
|
196
|
+
* Different clients in the same collaborative session may see different metadata for the same field.
|
|
193
197
|
*/
|
|
194
198
|
readonly metadata?: FieldSchemaMetadata<TCustomMetadata>;
|
|
195
199
|
}
|
|
@@ -759,15 +763,19 @@ export type InsertableTreeNodeFromAllowedTypes<TList extends AllowedTypes> =
|
|
|
759
763
|
|
|
760
764
|
/**
|
|
761
765
|
* Takes in `TreeNodeSchema[]` and returns a TypedNode union.
|
|
766
|
+
* @privateRemarks
|
|
767
|
+
* If a schema is both TreeNodeSchemaClass and TreeNodeSchemaNonClass, prefer TreeNodeSchemaClass since that includes subclasses properly.
|
|
762
768
|
* @public
|
|
763
769
|
*/
|
|
764
|
-
export type NodeFromSchema<T extends TreeNodeSchema> = T extends
|
|
770
|
+
export type NodeFromSchema<T extends TreeNodeSchema> = T extends TreeNodeSchemaClass<
|
|
765
771
|
string,
|
|
766
772
|
NodeKind,
|
|
767
773
|
infer TNode
|
|
768
774
|
>
|
|
769
775
|
? TNode
|
|
770
|
-
:
|
|
776
|
+
: T extends TreeNodeSchemaNonClass<string, NodeKind, infer TNode>
|
|
777
|
+
? TNode
|
|
778
|
+
: never;
|
|
771
779
|
|
|
772
780
|
/**
|
|
773
781
|
* Data which can be used as a node to be inserted.
|
|
@@ -819,3 +827,49 @@ export type NodeBuilderData<T extends TreeNodeSchemaCore<string, NodeKind, boole
|
|
|
819
827
|
*/
|
|
820
828
|
// eslint-disable-next-line @rushstack/no-new-null
|
|
821
829
|
export type TreeLeafValue = number | string | boolean | IFluidHandle | null;
|
|
830
|
+
|
|
831
|
+
/**
|
|
832
|
+
* Additional information to provide to Node Schema creation.
|
|
833
|
+
*
|
|
834
|
+
* @typeParam TCustomMetadata - Custom metadata properties to associate with the Node Schema.
|
|
835
|
+
* See {@link NodeSchemaMetadata.custom}.
|
|
836
|
+
*
|
|
837
|
+
* @sealed
|
|
838
|
+
* @public
|
|
839
|
+
*/
|
|
840
|
+
export interface NodeSchemaOptions<out TCustomMetadata = unknown> {
|
|
841
|
+
/**
|
|
842
|
+
* Optional metadata to associate with the Node Schema.
|
|
843
|
+
*
|
|
844
|
+
* @remarks
|
|
845
|
+
* Note: this metadata is not persisted nor made part of the collaborative state; it is strictly client-local.
|
|
846
|
+
* Different clients in the same collaborative session may see different metadata for the same field.
|
|
847
|
+
*/
|
|
848
|
+
readonly metadata?: NodeSchemaMetadata<TCustomMetadata> | undefined;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
/**
|
|
852
|
+
* Metadata associated with a Node Schema.
|
|
853
|
+
*
|
|
854
|
+
* @remarks Specified via {@link NodeSchemaOptions.metadata}.
|
|
855
|
+
*
|
|
856
|
+
* @sealed
|
|
857
|
+
* @public
|
|
858
|
+
*/
|
|
859
|
+
export interface NodeSchemaMetadata<out TCustomMetadata = unknown> {
|
|
860
|
+
/**
|
|
861
|
+
* User-defined metadata.
|
|
862
|
+
*/
|
|
863
|
+
readonly custom?: TCustomMetadata | undefined;
|
|
864
|
+
|
|
865
|
+
/**
|
|
866
|
+
* The description of the Node Schema.
|
|
867
|
+
*
|
|
868
|
+
* @remarks
|
|
869
|
+
*
|
|
870
|
+
* If provided, will be used by the system in scenarios where a description of the kind of node is useful.
|
|
871
|
+
* E.g., when converting a Node Schema to {@link https://json-schema.org/ | JSON Schema}, this description will be
|
|
872
|
+
* used as the `description` property.
|
|
873
|
+
*/
|
|
874
|
+
readonly description?: string | undefined;
|
|
875
|
+
}
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
type TreeTypeSet,
|
|
21
21
|
} from "../core/index.js";
|
|
22
22
|
import { FieldKinds, type FlexFieldKind } from "../feature-libraries/index.js";
|
|
23
|
-
import { brand, fail, isReadonlyArray } from "../util/index.js";
|
|
23
|
+
import { brand, fail, getOrCreate, isReadonlyArray } from "../util/index.js";
|
|
24
24
|
import { NodeKind, type TreeNodeSchema } from "./core/index.js";
|
|
25
25
|
import {
|
|
26
26
|
FieldKind,
|
|
@@ -33,29 +33,35 @@ import { LeafNodeSchema } from "./leafNodeSchema.js";
|
|
|
33
33
|
import { isObjectNodeSchema } from "./objectNodeTypes.js";
|
|
34
34
|
import { normalizeFlexListEager } from "./flexList.js";
|
|
35
35
|
|
|
36
|
+
const viewToStoredCache = new WeakMap<ImplicitFieldSchema, TreeStoredSchema>();
|
|
37
|
+
|
|
36
38
|
/**
|
|
37
39
|
* Converts a {@link ImplicitFieldSchema} into a {@link TreeStoredSchema}.
|
|
38
40
|
*/
|
|
39
41
|
export function toStoredSchema(root: ImplicitFieldSchema): TreeStoredSchema {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
schema.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
42
|
+
return getOrCreate(viewToStoredCache, root, () => {
|
|
43
|
+
const nodeSchema: Map<TreeNodeSchemaIdentifier, TreeNodeStoredSchema> = new Map();
|
|
44
|
+
walkFieldSchema(root, {
|
|
45
|
+
node(schema) {
|
|
46
|
+
if (nodeSchema.has(brand(schema.identifier))) {
|
|
47
|
+
// Use JSON.stringify to quote and escape identifier string.
|
|
48
|
+
throw new UsageError(
|
|
49
|
+
`Multiple schema encountered with the identifier ${JSON.stringify(
|
|
50
|
+
schema.identifier,
|
|
51
|
+
)}. Remove or rename them to avoid the collision.`,
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
nodeSchema.set(brand(schema.identifier), getStoredSchema(schema));
|
|
55
|
+
},
|
|
56
|
+
});
|
|
54
57
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
const result: TreeStoredSchema = {
|
|
59
|
+
nodeSchema,
|
|
60
|
+
rootFieldSchema: convertField(root),
|
|
61
|
+
};
|
|
62
|
+
viewToStoredCache.set(root, result);
|
|
63
|
+
return result;
|
|
64
|
+
});
|
|
59
65
|
}
|
|
60
66
|
|
|
61
67
|
/**
|
package/src/util/brand.ts
CHANGED
|
@@ -18,7 +18,6 @@ import type { Covariant } from "./typeCheck.js";
|
|
|
18
18
|
* `Type 'Name1' is not assignable to type 'Name2'.`
|
|
19
19
|
*
|
|
20
20
|
* These branded types are not opaque: A `Brand<A, B>` can still be used as a `B`.
|
|
21
|
-
* @internal
|
|
22
21
|
*/
|
|
23
22
|
export type Brand<ValueType, Name> = ValueType & BrandedType<ValueType, Name>;
|
|
24
23
|
|
|
@@ -42,7 +41,6 @@ export type Brand<ValueType, Name> = ValueType & BrandedType<ValueType, Name>;
|
|
|
42
41
|
* - get nominal typing (so types produced without using this class can never be assignable to it).
|
|
43
42
|
*
|
|
44
43
|
* @sealed
|
|
45
|
-
* @internal
|
|
46
44
|
*/
|
|
47
45
|
export abstract class BrandedType<out ValueType, Name> {
|
|
48
46
|
protected _typeCheck?: Covariant<ValueType>;
|
package/src/util/index.ts
CHANGED
|
@@ -93,6 +93,8 @@ export {
|
|
|
93
93
|
getLast,
|
|
94
94
|
hasSome,
|
|
95
95
|
hasSingle,
|
|
96
|
+
defineLazyCachedProperty,
|
|
97
|
+
copyPropertyIfDefined as copyProperty,
|
|
96
98
|
} from "./utils.js";
|
|
97
99
|
export { ReferenceCountedBase, type ReferenceCounted } from "./referenceCounting.js";
|
|
98
100
|
|
|
@@ -119,13 +121,8 @@ export {
|
|
|
119
121
|
} from "./brandedMap.js";
|
|
120
122
|
|
|
121
123
|
export {
|
|
122
|
-
|
|
123
|
-
getFromRangeMap,
|
|
124
|
-
type RangeEntry,
|
|
125
|
-
type RangeMap,
|
|
124
|
+
RangeMap,
|
|
126
125
|
type RangeQueryResult,
|
|
127
|
-
setInRangeMap,
|
|
128
|
-
deleteFromRangeMap,
|
|
129
126
|
} from "./rangeMap.js";
|
|
130
127
|
|
|
131
128
|
export {
|