@fluidframework/tree 2.10.0 → 2.12.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 +29 -0
- package/api-report/tree.alpha.api.md +49 -18
- package/api-report/tree.beta.api.md +6 -15
- package/api-report/tree.legacy.alpha.api.md +6 -15
- package/api-report/tree.legacy.public.api.md +6 -15
- package/api-report/tree.public.api.md +6 -15
- package/dist/alpha.d.ts +9 -0
- package/dist/core/forest/forest.d.ts +10 -2
- package/dist/core/forest/forest.d.ts.map +1 -1
- package/dist/core/forest/forest.js.map +1 -1
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +6 -3
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/utils.d.ts +1 -1
- package/dist/core/rebase/utils.d.ts.map +1 -1
- package/dist/core/rebase/utils.js +13 -17
- package/dist/core/rebase/utils.js.map +1 -1
- package/dist/core/revertible.d.ts +30 -1
- package/dist/core/revertible.d.ts.map +1 -1
- package/dist/core/revertible.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-stored/storedSchemaRepository.d.ts +2 -2
- package/dist/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.js +5 -5
- package/dist/core/schema-stored/storedSchemaRepository.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/core/tree/anchorSet.d.ts +2 -2
- package/dist/core/tree/anchorSet.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.js +21 -21
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/{lib/feature-libraries/chunked-forest → dist/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/detachedFieldIndexCodec.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodec.js +3 -2
- package/dist/core/tree/detachedFieldIndexCodec.js.map +1 -1
- package/dist/core/tree/index.d.ts +2 -1
- package/dist/core/tree/index.d.ts.map +1 -1
- package/dist/core/tree/index.js +6 -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/core/tree/visitorUtils.d.ts +25 -1
- package/dist/core/tree/visitorUtils.d.ts.map +1 -1
- package/dist/core/tree/visitorUtils.js +29 -1
- package/dist/core/tree/visitorUtils.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 +5 -3
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.js +24 -14
- 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 +14 -14
- package/dist/feature-libraries/chunked-forest/uniformChunk.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/flex-tree/context.d.ts +1 -1
- package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/context.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +2 -1
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +9 -2
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts +139 -0
- package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -0
- package/dist/feature-libraries/indexing/anchorTreeIndex.js +387 -0
- package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -0
- package/dist/feature-libraries/indexing/index.d.ts +7 -0
- package/dist/feature-libraries/indexing/index.d.ts.map +1 -0
- package/dist/feature-libraries/indexing/index.js +11 -0
- package/dist/feature-libraries/indexing/index.js.map +1 -0
- package/dist/feature-libraries/indexing/types.d.ts +32 -0
- package/dist/feature-libraries/indexing/types.d.ts.map +1 -0
- package/dist/{events/interop.js → feature-libraries/indexing/types.js} +1 -1
- package/dist/feature-libraries/indexing/types.js.map +1 -0
- 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/index.d.ts +1 -1
- 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/object-forest/objectForest.d.ts +5 -2
- package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.js +21 -11
- package/dist/feature-libraries/object-forest/objectForest.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/invert.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/invert.js +2 -2
- package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +3 -2
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
- 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/index.d.ts +6 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -13
- package/dist/index.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/index.d.ts +2 -2
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js +1 -2
- 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 +7 -1
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +35 -38
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +27 -6
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +146 -21
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js +3 -3
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +59 -72
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +243 -188
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts +29 -107
- package/dist/shared-tree-core/branch.d.ts.map +1 -1
- package/dist/shared-tree-core/branch.js +51 -195
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/shared-tree-core/branchCommitEnricher.d.ts +24 -32
- package/dist/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
- package/dist/shared-tree-core/branchCommitEnricher.js +70 -53
- package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
- package/dist/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
- package/dist/shared-tree-core/defaultResubmitMachine.js +2 -1
- package/dist/shared-tree-core/defaultResubmitMachine.js.map +1 -1
- package/dist/shared-tree-core/editManager.d.ts.map +1 -1
- package/dist/shared-tree-core/editManager.js +4 -4
- 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 +5 -4
- package/dist/shared-tree-core/index.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts +3 -10
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +14 -67
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/shared-tree-core/transaction.d.ts +146 -0
- package/dist/shared-tree-core/transaction.d.ts.map +1 -0
- package/dist/shared-tree-core/transaction.js +211 -0
- package/dist/shared-tree-core/transaction.js.map +1 -0
- package/dist/shared-tree-core/transactionEnricher.d.ts +8 -13
- package/dist/shared-tree-core/transactionEnricher.d.ts.map +1 -1
- package/dist/shared-tree-core/transactionEnricher.js +41 -21
- package/dist/shared-tree-core/transactionEnricher.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/identifierIndex.d.ts +21 -0
- package/dist/simple-tree/api/identifierIndex.d.ts.map +1 -0
- package/dist/simple-tree/api/identifierIndex.js +45 -0
- package/dist/simple-tree/api/identifierIndex.js.map +1 -0
- package/dist/simple-tree/api/index.d.ts +4 -2
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +8 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts +48 -0
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +5 -2
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/simpleSchema.d.ts +3 -1
- 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 +9 -7
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/dist/simple-tree/api/simpleTreeIndex.d.ts +65 -0
- package/dist/simple-tree/api/simpleTreeIndex.d.ts.map +1 -0
- package/dist/simple-tree/api/simpleTreeIndex.js +93 -0
- package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -0
- 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/tree.d.ts +5 -5
- 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/treeNodeApi.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/core/index.d.ts +1 -1
- package/dist/simple-tree/core/index.d.ts.map +1 -1
- package/dist/simple-tree/core/index.js +2 -1
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.d.ts +6 -2
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +53 -22
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js +2 -2
- package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/dist/simple-tree/index.d.ts +2 -2
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +7 -2
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts +0 -15
- 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/objectNode.d.ts +15 -5
- package/dist/simple-tree/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/objectNode.js +18 -2
- package/dist/simple-tree/objectNode.js.map +1 -1
- package/dist/simple-tree/objectNodeTypes.d.ts +4 -0
- 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 +4 -2
- package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
- package/dist/simple-tree/schemaTypes.js.map +1 -1
- package/dist/simple-tree/toMapTree.js +3 -3
- package/dist/simple-tree/toMapTree.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 +1 -2
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +6 -4
- package/dist/util/index.js.map +1 -1
- package/dist/util/typeCheck.d.ts +6 -3
- package/dist/util/typeCheck.d.ts.map +1 -1
- package/dist/util/typeCheck.js.map +1 -1
- package/dist/util/typeCheckTests.d.ts +14 -2
- package/dist/util/typeCheckTests.d.ts.map +1 -1
- package/dist/util/typeCheckTests.js.map +1 -1
- package/dist/util/utils.d.ts +42 -0
- package/dist/util/utils.d.ts.map +1 -1
- package/dist/util/utils.js +35 -1
- package/dist/util/utils.js.map +1 -1
- package/lib/alpha.d.ts +9 -0
- package/lib/core/forest/forest.d.ts +10 -2
- package/lib/core/forest/forest.d.ts.map +1 -1
- package/lib/core/forest/forest.js.map +1 -1
- package/lib/core/index.d.ts +3 -3
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +3 -3
- package/lib/core/index.js.map +1 -1
- package/lib/core/rebase/utils.d.ts +1 -1
- package/lib/core/rebase/utils.d.ts.map +1 -1
- package/lib/core/rebase/utils.js +13 -17
- package/lib/core/rebase/utils.js.map +1 -1
- package/lib/core/revertible.d.ts +30 -1
- package/lib/core/revertible.d.ts.map +1 -1
- package/lib/core/revertible.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-stored/storedSchemaRepository.d.ts +2 -2
- package/lib/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.js +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.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/core/tree/anchorSet.d.ts +2 -2
- package/lib/core/tree/anchorSet.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.js +1 -1
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/{dist/feature-libraries/chunked-forest → lib/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/detachedFieldIndexCodec.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodec.js +4 -3
- package/lib/core/tree/detachedFieldIndexCodec.js.map +1 -1
- package/lib/core/tree/index.d.ts +2 -1
- package/lib/core/tree/index.d.ts.map +1 -1
- package/lib/core/tree/index.js +2 -1
- 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/core/tree/visitorUtils.d.ts +25 -1
- package/lib/core/tree/visitorUtils.d.ts.map +1 -1
- package/lib/core/tree/visitorUtils.js +27 -0
- package/lib/core/tree/visitorUtils.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 +5 -3
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.js +18 -8
- 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 +4 -4
- package/lib/feature-libraries/chunked-forest/uniformChunk.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/flex-tree/context.d.ts +1 -1
- package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/context.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +2 -1
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +2 -1
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts +139 -0
- package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -0
- package/lib/feature-libraries/indexing/anchorTreeIndex.js +382 -0
- package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -0
- package/lib/feature-libraries/indexing/index.d.ts +7 -0
- package/lib/feature-libraries/indexing/index.d.ts.map +1 -0
- package/lib/{events → feature-libraries/indexing}/index.js +1 -1
- package/lib/feature-libraries/indexing/index.js.map +1 -0
- package/lib/feature-libraries/indexing/types.d.ts +32 -0
- package/lib/feature-libraries/indexing/types.d.ts.map +1 -0
- package/lib/{events/interop.js → feature-libraries/indexing/types.js} +1 -1
- package/lib/feature-libraries/indexing/types.js.map +1 -0
- 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/index.d.ts +1 -1
- 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/object-forest/objectForest.d.ts +5 -2
- package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js +15 -5
- package/lib/feature-libraries/object-forest/objectForest.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/invert.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/invert.js +4 -4
- package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js +4 -3
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
- 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/index.d.ts +6 -7
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -4
- package/lib/index.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/index.d.ts +2 -2
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js +1 -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 +7 -1
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +12 -16
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +27 -6
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +135 -10
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js +5 -5
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +59 -72
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +233 -177
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts +29 -107
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +50 -193
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/shared-tree-core/branchCommitEnricher.d.ts +24 -32
- package/lib/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
- package/lib/shared-tree-core/branchCommitEnricher.js +71 -54
- package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
- package/lib/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
- package/lib/shared-tree-core/defaultResubmitMachine.js +3 -2
- package/lib/shared-tree-core/defaultResubmitMachine.js.map +1 -1
- package/lib/shared-tree-core/editManager.d.ts.map +1 -1
- package/lib/shared-tree-core/editManager.js +4 -4
- 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 +3 -10
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +15 -68
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/shared-tree-core/transaction.d.ts +146 -0
- package/lib/shared-tree-core/transaction.d.ts.map +1 -0
- package/lib/shared-tree-core/transaction.js +206 -0
- package/lib/shared-tree-core/transaction.js.map +1 -0
- package/lib/shared-tree-core/transactionEnricher.d.ts +8 -13
- package/lib/shared-tree-core/transactionEnricher.d.ts.map +1 -1
- package/lib/shared-tree-core/transactionEnricher.js +41 -21
- package/lib/shared-tree-core/transactionEnricher.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/identifierIndex.d.ts +21 -0
- package/lib/simple-tree/api/identifierIndex.d.ts.map +1 -0
- package/lib/simple-tree/api/identifierIndex.js +41 -0
- package/lib/simple-tree/api/identifierIndex.js.map +1 -0
- package/lib/simple-tree/api/index.d.ts +4 -2
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +4 -1
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts +48 -0
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +4 -1
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/simpleSchema.d.ts +3 -1
- 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 +11 -9
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/lib/simple-tree/api/simpleTreeIndex.d.ts +65 -0
- package/lib/simple-tree/api/simpleTreeIndex.d.ts.map +1 -0
- package/lib/simple-tree/api/simpleTreeIndex.js +89 -0
- package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -0
- 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/tree.d.ts +5 -5
- 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/treeNodeApi.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/core/index.d.ts +1 -1
- package/lib/simple-tree/core/index.d.ts.map +1 -1
- package/lib/simple-tree/core/index.js +1 -1
- package/lib/simple-tree/core/index.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.d.ts +6 -2
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +31 -1
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/lib/simple-tree/index.d.ts +2 -2
- 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 +0 -15
- 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/objectNode.d.ts +15 -5
- package/lib/simple-tree/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/objectNode.js +16 -1
- package/lib/simple-tree/objectNode.js.map +1 -1
- package/lib/simple-tree/objectNodeTypes.d.ts +4 -0
- 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 +4 -2
- package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
- package/lib/simple-tree/schemaTypes.js.map +1 -1
- package/lib/simple-tree/toMapTree.js +5 -5
- package/lib/simple-tree/toMapTree.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 +1 -2
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +1 -2
- package/lib/util/index.js.map +1 -1
- package/lib/util/typeCheck.d.ts +6 -3
- package/lib/util/typeCheck.d.ts.map +1 -1
- package/lib/util/typeCheck.js.map +1 -1
- package/lib/util/typeCheckTests.d.ts +14 -2
- package/lib/util/typeCheckTests.d.ts.map +1 -1
- package/lib/util/typeCheckTests.js.map +1 -1
- package/lib/util/utils.d.ts +42 -0
- package/lib/util/utils.d.ts.map +1 -1
- package/lib/util/utils.js +30 -0
- package/lib/util/utils.js.map +1 -1
- package/package.json +23 -23
- package/src/core/forest/forest.ts +12 -1
- package/src/core/index.ts +13 -2
- package/src/core/rebase/utils.ts +28 -29
- package/src/core/revertible.ts +35 -1
- package/src/core/schema-stored/format.ts +0 -3
- package/src/core/schema-stored/schema.ts +13 -10
- package/src/core/schema-stored/storedSchemaRepository.ts +2 -1
- package/src/core/schema-view/index.ts +0 -1
- package/src/core/schema-view/view.ts +0 -11
- package/src/core/tree/anchorSet.ts +2 -1
- package/src/{feature-libraries/chunked-forest → core/tree}/chunk.ts +4 -4
- package/src/core/tree/detachedFieldIndexCodec.ts +4 -3
- package/src/core/tree/index.ts +9 -0
- package/src/core/tree/treeTextFormat.ts +0 -5
- package/src/core/tree/types.ts +0 -5
- package/src/core/tree/visitorUtils.ts +56 -1
- 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 +35 -8
- 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 +7 -4
- package/src/feature-libraries/default-schema/defaultSchema.ts +1 -0
- package/src/feature-libraries/default-schema/schemaChecker.ts +4 -1
- package/src/feature-libraries/flex-tree/context.ts +1 -1
- package/src/feature-libraries/index.ts +22 -0
- package/src/feature-libraries/indexing/anchorTreeIndex.ts +482 -0
- package/src/feature-libraries/indexing/index.ts +11 -0
- package/src/feature-libraries/indexing/types.ts +37 -0
- package/src/feature-libraries/modular-schema/discrepancies.ts +76 -38
- package/src/feature-libraries/modular-schema/index.ts +13 -0
- package/src/feature-libraries/modular-schema/isNeverTree.ts +0 -2
- package/src/feature-libraries/object-forest/objectForest.ts +22 -4
- package/src/feature-libraries/sequence-field/invert.ts +4 -4
- package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +4 -4
- package/src/feature-libraries/sequence-field/types.ts +0 -1
- package/src/index.ts +17 -35
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/index.ts +1 -2
- package/src/shared-tree/schematizeTree.ts +6 -10
- package/src/shared-tree/schematizingTreeView.ts +18 -28
- package/src/shared-tree/sharedTree.ts +216 -30
- package/src/shared-tree/sharedTreeChangeFamily.ts +5 -4
- package/src/shared-tree/treeCheckout.ts +341 -299
- package/src/shared-tree-core/branch.ts +80 -300
- package/src/shared-tree-core/branchCommitEnricher.ts +66 -62
- package/src/shared-tree-core/defaultResubmitMachine.ts +3 -2
- package/src/shared-tree-core/editManager.ts +4 -9
- package/src/shared-tree-core/index.ts +11 -3
- package/src/shared-tree-core/sharedTreeCore.ts +23 -79
- package/src/shared-tree-core/transaction.ts +310 -0
- package/src/shared-tree-core/transactionEnricher.ts +30 -24
- 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/identifierIndex.ts +64 -0
- package/src/simple-tree/api/index.ts +17 -2
- package/src/simple-tree/api/schemaFactory.ts +62 -1
- package/src/simple-tree/api/simpleSchema.ts +3 -1
- package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +17 -18
- package/src/simple-tree/api/simpleTreeIndex.ts +233 -0
- package/src/simple-tree/api/storedSchema.ts +7 -22
- package/src/simple-tree/api/tree.ts +14 -5
- package/src/simple-tree/api/treeNodeApi.ts +1 -1
- package/src/simple-tree/api/verboseTree.ts +2 -2
- package/src/simple-tree/api/view.ts +197 -51
- package/src/simple-tree/core/index.ts +1 -0
- package/src/simple-tree/core/treeNodeKernel.ts +37 -2
- package/src/simple-tree/core/unhydratedFlexTree.ts +2 -1
- package/src/simple-tree/index.ts +10 -0
- package/src/simple-tree/leafNodeSchema.ts +0 -19
- package/src/simple-tree/objectNode.ts +45 -14
- package/src/simple-tree/objectNodeTypes.ts +5 -0
- package/src/simple-tree/schemaTypes.ts +7 -2
- package/src/simple-tree/toMapTree.ts +5 -5
- package/src/simple-tree/toStoredSchema.ts +25 -19
- package/src/util/brand.ts +0 -2
- package/src/util/index.ts +4 -1
- package/src/util/typeCheck.ts +6 -3
- package/src/util/typeCheckTests.ts +11 -1
- package/src/util/utils.ts +64 -0
- package/dist/events/emitter.d.ts +0 -139
- package/dist/events/emitter.d.ts.map +0 -1
- package/dist/events/emitter.js +0 -165
- package/dist/events/emitter.js.map +0 -1
- package/dist/events/index.d.ts +0 -7
- package/dist/events/index.d.ts.map +0 -1
- package/dist/events/index.js +0 -11
- package/dist/events/index.js.map +0 -1
- package/dist/events/interop.d.ts +0 -30
- package/dist/events/interop.d.ts.map +0 -1
- package/dist/events/interop.js.map +0 -1
- package/dist/events/listeners.d.ts +0 -76
- package/dist/events/listeners.d.ts.map +0 -1
- package/dist/events/listeners.js +0 -7
- package/dist/events/listeners.js.map +0 -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/shared-tree-core/transactionStack.d.ts +0 -29
- package/dist/shared-tree-core/transactionStack.d.ts.map +0 -1
- package/dist/shared-tree-core/transactionStack.js +0 -41
- package/dist/shared-tree-core/transactionStack.js.map +0 -1
- package/dist/util/transactionResult.d.ts +0 -19
- package/dist/util/transactionResult.d.ts.map +0 -1
- package/dist/util/transactionResult.js +0 -23
- package/dist/util/transactionResult.js.map +0 -1
- package/lib/events/emitter.d.ts +0 -139
- package/lib/events/emitter.d.ts.map +0 -1
- package/lib/events/emitter.js +0 -160
- package/lib/events/emitter.js.map +0 -1
- package/lib/events/index.d.ts +0 -7
- package/lib/events/index.d.ts.map +0 -1
- package/lib/events/index.js.map +0 -1
- package/lib/events/interop.d.ts +0 -30
- package/lib/events/interop.d.ts.map +0 -1
- package/lib/events/interop.js.map +0 -1
- package/lib/events/listeners.d.ts +0 -76
- package/lib/events/listeners.d.ts.map +0 -1
- package/lib/events/listeners.js +0 -6
- package/lib/events/listeners.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/shared-tree-core/transactionStack.d.ts +0 -29
- package/lib/shared-tree-core/transactionStack.d.ts.map +0 -1
- package/lib/shared-tree-core/transactionStack.js +0 -37
- package/lib/shared-tree-core/transactionStack.js.map +0 -1
- package/lib/util/transactionResult.d.ts +0 -19
- package/lib/util/transactionResult.d.ts.map +0 -1
- package/lib/util/transactionResult.js +0 -20
- package/lib/util/transactionResult.js.map +0 -1
- package/src/events/README.md +0 -3
- package/src/events/emitter.ts +0 -256
- package/src/events/index.ts +0 -19
- package/src/events/interop.ts +0 -38
- package/src/events/listeners.ts +0 -80
- package/src/shared-tree-core/transactionStack.ts +0 -45
- package/src/util/transactionResult.ts +0 -19
|
@@ -4,15 +4,16 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { isFluidHandle } from "@fluidframework/runtime-utils/internal";
|
|
6
6
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
7
|
-
import { EmptyKey, forEachField, inCursorField, mapCursorField, } from "../../core/index.js";
|
|
7
|
+
import { EmptyKey, forEachField, inCursorField, LeafNodeStoredSchema, mapCursorField, ObjectNodeStoredSchema, } from "../../core/index.js";
|
|
8
8
|
import { fail } from "../../util/index.js";
|
|
9
9
|
import { NodeKind } from "../core/index.js";
|
|
10
10
|
import { booleanSchema, handleSchema, nullSchema, numberSchema, stringSchema, } from "../leafNodeSchema.js";
|
|
11
11
|
import { isObjectNodeSchema } from "../objectNodeTypes.js";
|
|
12
|
+
import { FieldKinds, valueSchemaAllows } from "../../feature-libraries/index.js";
|
|
12
13
|
/**
|
|
13
14
|
* Builds an {@link CustomTree} from a cursor in Nodes mode.
|
|
14
15
|
*/
|
|
15
|
-
export function
|
|
16
|
+
export function customFromCursor(reader, options, schema, childHandler) {
|
|
16
17
|
const type = reader.type;
|
|
17
18
|
const nodeSchema = schema.get(type) ?? fail("missing schema for type in cursor");
|
|
18
19
|
switch (type) {
|
|
@@ -56,4 +57,51 @@ export function customFromCursorInner(reader, options, schema, childHandler) {
|
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* Builds an {@link CustomTree} from a cursor in Nodes mode.
|
|
62
|
+
* @remarks
|
|
63
|
+
* Uses stored keys and stored schema.
|
|
64
|
+
*/
|
|
65
|
+
export function customFromCursorStored(reader, schema, childHandler) {
|
|
66
|
+
const type = reader.type;
|
|
67
|
+
const nodeSchema = schema.get(type) ?? fail("missing schema for type in cursor");
|
|
68
|
+
if (nodeSchema instanceof LeafNodeStoredSchema) {
|
|
69
|
+
assert(valueSchemaAllows(nodeSchema.leafValue, reader.value), 0xa9c /* invalid value */);
|
|
70
|
+
return reader.value;
|
|
71
|
+
}
|
|
72
|
+
assert(reader.value === undefined, 0xa9d /* out of schema: unexpected value */);
|
|
73
|
+
const arrayTypes = tryStoredSchemaAsArray(nodeSchema);
|
|
74
|
+
if (arrayTypes !== undefined) {
|
|
75
|
+
const field = inCursorField(reader, EmptyKey, () => mapCursorField(reader, () => childHandler(reader, schema)));
|
|
76
|
+
return field;
|
|
77
|
+
}
|
|
78
|
+
const fields = {};
|
|
79
|
+
forEachField(reader, () => {
|
|
80
|
+
const children = mapCursorField(reader, () => childHandler(reader, schema));
|
|
81
|
+
if (children.length === 1) {
|
|
82
|
+
const storedKey = reader.getFieldKey();
|
|
83
|
+
// Length is checked above.
|
|
84
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
85
|
+
fields[storedKey] = children[0];
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
assert(children.length === 0, 0xa9e /* invalid children number */);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
return fields;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Assumes `schema` corresponds to a simple-tree schema.
|
|
95
|
+
* If it is an array schema, returns the allowed types for the array field.
|
|
96
|
+
* Otherwise returns `undefined`.
|
|
97
|
+
*/
|
|
98
|
+
export function tryStoredSchemaAsArray(schema) {
|
|
99
|
+
if (schema instanceof ObjectNodeStoredSchema) {
|
|
100
|
+
const empty = schema.getFieldSchema(EmptyKey);
|
|
101
|
+
if (empty.kind === FieldKinds.sequence.identifier) {
|
|
102
|
+
assert(schema.objectNodeFields.size === 1, 0xa9f /* invalid schema */);
|
|
103
|
+
return empty.types;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
59
107
|
//# sourceMappingURL=customTree.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customTree.js","sourceRoot":"","sources":["../../../src/simple-tree/api/customTree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACvE,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AAC,6BAA6B,CAAC,CAAC;oBACpE,CAAC;gBACF,CAAC,CAAC,CAAC;gBACH,OAAO,MAAM,CAAC;YACf,CAAC;QACF,CAAC;IACF,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport { isFluidHandle } from \"@fluidframework/runtime-utils/internal\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tEmptyKey,\n\tforEachField,\n\tinCursorField,\n\tmapCursorField,\n\ttype ITreeCursor,\n} from \"../../core/index.js\";\nimport { fail } from \"../../util/index.js\";\nimport type { TreeLeafValue } from \"../schemaTypes.js\";\nimport { NodeKind, type TreeNodeSchema } from \"../core/index.js\";\nimport {\n\tbooleanSchema,\n\thandleSchema,\n\tnullSchema,\n\tnumberSchema,\n\tstringSchema,\n} from \"../leafNodeSchema.js\";\nimport { isObjectNodeSchema } from \"../objectNodeTypes.js\";\n\n/**\n * Options for how to encode a tree.\n * @alpha\n */\nexport interface EncodeOptions<TCustom> {\n\t/**\n\t * How to encode any {@link @fluidframework/core-interfaces#IFluidHandle|IFluidHandles} in the tree.\n\t * @remarks\n\t * See note on {@link ParseOptions.valueConverter}.\n\t */\n\tvalueConverter(data: IFluidHandle): TCustom;\n\t/**\n\t * If true, interpret the input keys of object nodes as stored keys.\n\t * If false, interpret them as property keys.\n\t * @defaultValue false.\n\t */\n\treadonly useStoredKeys?: boolean;\n}\n\n/**\n * Tree representation with fields as properties and customized handle and child representations.\n */\nexport type CustomTree<TChild, THandle> = CustomTreeNode<TChild> | CustomTreeValue<THandle>;\n\n/**\n * TreeLeafValue except the handle type is customized.\n */\nexport type CustomTreeValue<THandle> = Exclude<TreeLeafValue, IFluidHandle> | THandle;\n\n/**\n * Tree node representation with fields as properties and customized child representation.\n */\nexport type CustomTreeNode<TChild> = TChild[] | { [key: string]: TChild };\n\n/**\n * Builds an {@link CustomTree} from a cursor in Nodes mode.\n */\nexport function customFromCursorInner<TChild, THandle>(\n\treader: ITreeCursor,\n\toptions: Required<EncodeOptions<THandle>>,\n\tschema: ReadonlyMap<string, TreeNodeSchema>,\n\tchildHandler: (\n\t\treader: ITreeCursor,\n\t\toptions: Required<EncodeOptions<THandle>>,\n\t\tschema: ReadonlyMap<string, TreeNodeSchema>,\n\t) => TChild,\n): CustomTree<TChild, THandle> {\n\tconst type = reader.type;\n\tconst nodeSchema = schema.get(type) ?? fail(\"missing schema for type in cursor\");\n\n\tswitch (type) {\n\t\tcase numberSchema.identifier:\n\t\tcase booleanSchema.identifier:\n\t\tcase nullSchema.identifier:\n\t\tcase stringSchema.identifier:\n\t\t\tassert(reader.value !== undefined, 0xa50 /* out of schema: missing value */);\n\t\t\tassert(!isFluidHandle(reader.value), 0xa51 /* out of schema: unexpected FluidHandle */);\n\t\t\treturn reader.value;\n\t\tcase handleSchema.identifier:\n\t\t\tassert(reader.value !== undefined, 0xa52 /* out of schema: missing value */);\n\t\t\tassert(isFluidHandle(reader.value), 0xa53 /* out of schema: expected FluidHandle */);\n\t\t\treturn options.valueConverter(reader.value);\n\t\tdefault: {\n\t\t\tassert(reader.value === undefined, 0xa54 /* out of schema: unexpected value */);\n\t\t\tif (nodeSchema.kind === NodeKind.Array) {\n\t\t\t\tconst fields = inCursorField(reader, EmptyKey, () =>\n\t\t\t\t\tmapCursorField(reader, () => childHandler(reader, options, schema)),\n\t\t\t\t);\n\t\t\t\treturn fields;\n\t\t\t} else {\n\t\t\t\tconst fields: Record<string, TChild> = {};\n\t\t\t\tforEachField(reader, () => {\n\t\t\t\t\tconst children = mapCursorField(reader, () => childHandler(reader, options, schema));\n\t\t\t\t\tif (children.length === 1) {\n\t\t\t\t\t\tconst storedKey = reader.getFieldKey();\n\t\t\t\t\t\tconst key =\n\t\t\t\t\t\t\tisObjectNodeSchema(nodeSchema) && !options.useStoredKeys\n\t\t\t\t\t\t\t\t? (nodeSchema.storedKeyToPropertyKey.get(storedKey) ??\n\t\t\t\t\t\t\t\t\tfail(\"missing property key\"))\n\t\t\t\t\t\t\t\t: storedKey;\n\t\t\t\t\t\t// Length is checked above.\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\t\t\tfields[key] = children[0]!;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tassert(children.length === 0, 0xa19 /* invalid children number */);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn fields;\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"customTree.js","sourceRoot":"","sources":["../../../src/simple-tree/api/customTree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAE7D,OAAO,EACN,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,sBAAsB,GAItB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE3C,OAAO,EAAE,QAAQ,EAAuB,MAAM,kBAAkB,CAAC;AACjE,OAAO,EACN,aAAa,EACb,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,YAAY,GACZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAoCjF;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC/B,MAAmB,EACnB,OAAyC,EACzC,MAA2C,EAC3C,YAIW;IAEX,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IACzB,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,mCAAmC,CAAC,CAAC;IAEjF,Q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AAK,CAAC,oBAAoB,CAAC,CAAC;YACvE,OAAO,KAAK,CAAC,KAAK,CAAC;QACpB,CAAC;IACF,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport { isFluidHandle } from \"@fluidframework/runtime-utils/internal\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tEmptyKey,\n\tforEachField,\n\tinCursorField,\n\tLeafNodeStoredSchema,\n\tmapCursorField,\n\tObjectNodeStoredSchema,\n\ttype ITreeCursor,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeNodeStoredSchema,\n} from \"../../core/index.js\";\nimport { fail } from \"../../util/index.js\";\nimport type { TreeLeafValue } from \"../schemaTypes.js\";\nimport { NodeKind, type TreeNodeSchema } from \"../core/index.js\";\nimport {\n\tbooleanSchema,\n\thandleSchema,\n\tnullSchema,\n\tnumberSchema,\n\tstringSchema,\n} from \"../leafNodeSchema.js\";\nimport { isObjectNodeSchema } from \"../objectNodeTypes.js\";\nimport { FieldKinds, valueSchemaAllows } from \"../../feature-libraries/index.js\";\n\n/**\n * Options for how to encode a tree.\n * @alpha\n */\nexport interface EncodeOptions<TCustom> {\n\t/**\n\t * How to encode any {@link @fluidframework/core-interfaces#IFluidHandle|IFluidHandles} in the tree.\n\t * @remarks\n\t * See note on {@link ParseOptions.valueConverter}.\n\t */\n\tvalueConverter(data: IFluidHandle): TCustom;\n\t/**\n\t * If true, interpret the input keys of object nodes as stored keys.\n\t * If false, interpret them as property keys.\n\t * @defaultValue false.\n\t */\n\treadonly useStoredKeys?: boolean;\n}\n\n/**\n * Tree representation with fields as properties and customized handle and child representations.\n */\nexport type CustomTree<TChild, THandle> = CustomTreeNode<TChild> | CustomTreeValue<THandle>;\n\n/**\n * TreeLeafValue except the handle type is customized.\n */\nexport type CustomTreeValue<THandle> = Exclude<TreeLeafValue, IFluidHandle> | THandle;\n\n/**\n * Tree node representation with fields as properties and customized child representation.\n */\nexport type CustomTreeNode<TChild> = TChild[] | { [key: string]: TChild };\n\n/**\n * Builds an {@link CustomTree} from a cursor in Nodes mode.\n */\nexport function customFromCursor<TChild, THandle>(\n\treader: ITreeCursor,\n\toptions: Required<EncodeOptions<THandle>>,\n\tschema: ReadonlyMap<string, TreeNodeSchema>,\n\tchildHandler: (\n\t\treader: ITreeCursor,\n\t\toptions: Required<EncodeOptions<THandle>>,\n\t\tschema: ReadonlyMap<string, TreeNodeSchema>,\n\t) => TChild,\n): CustomTree<TChild, THandle> {\n\tconst type = reader.type;\n\tconst nodeSchema = schema.get(type) ?? fail(\"missing schema for type in cursor\");\n\n\tswitch (type) {\n\t\tcase numberSchema.identifier:\n\t\tcase booleanSchema.identifier:\n\t\tcase nullSchema.identifier:\n\t\tcase stringSchema.identifier:\n\t\t\tassert(reader.value !== undefined, 0xa50 /* out of schema: missing value */);\n\t\t\tassert(!isFluidHandle(reader.value), 0xa51 /* out of schema: unexpected FluidHandle */);\n\t\t\treturn reader.value;\n\t\tcase handleSchema.identifier:\n\t\t\tassert(reader.value !== undefined, 0xa52 /* out of schema: missing value */);\n\t\t\tassert(isFluidHandle(reader.value), 0xa53 /* out of schema: expected FluidHandle */);\n\t\t\treturn options.valueConverter(reader.value);\n\t\tdefault: {\n\t\t\tassert(reader.value === undefined, 0xa54 /* out of schema: unexpected value */);\n\t\t\tif (nodeSchema.kind === NodeKind.Array) {\n\t\t\t\tconst fields = inCursorField(reader, EmptyKey, () =>\n\t\t\t\t\tmapCursorField(reader, () => childHandler(reader, options, schema)),\n\t\t\t\t);\n\t\t\t\treturn fields;\n\t\t\t} else {\n\t\t\t\tconst fields: Record<string, TChild> = {};\n\t\t\t\tforEachField(reader, () => {\n\t\t\t\t\tconst children = mapCursorField(reader, () => childHandler(reader, options, schema));\n\t\t\t\t\tif (children.length === 1) {\n\t\t\t\t\t\tconst storedKey = reader.getFieldKey();\n\t\t\t\t\t\tconst key =\n\t\t\t\t\t\t\tisObjectNodeSchema(nodeSchema) && !options.useStoredKeys\n\t\t\t\t\t\t\t\t? (nodeSchema.storedKeyToPropertyKey.get(storedKey) ??\n\t\t\t\t\t\t\t\t\tfail(\"missing property key\"))\n\t\t\t\t\t\t\t\t: storedKey;\n\t\t\t\t\t\t// Length is checked above.\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\t\t\tfields[key] = children[0]!;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tassert(children.length === 0, 0xa19 /* invalid children number */);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn fields;\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Builds an {@link CustomTree} from a cursor in Nodes mode.\n * @remarks\n * Uses stored keys and stored schema.\n */\nexport function customFromCursorStored<TChild>(\n\treader: ITreeCursor,\n\tschema: ReadonlyMap<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>,\n\tchildHandler: (\n\t\treader: ITreeCursor,\n\t\tschema: ReadonlyMap<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>,\n\t) => TChild,\n): CustomTree<TChild, IFluidHandle> {\n\tconst type = reader.type;\n\tconst nodeSchema = schema.get(type) ?? fail(\"missing schema for type in cursor\");\n\n\tif (nodeSchema instanceof LeafNodeStoredSchema) {\n\t\tassert(valueSchemaAllows(nodeSchema.leafValue, reader.value), 0xa9c /* invalid value */);\n\t\treturn reader.value;\n\t}\n\n\tassert(reader.value === undefined, 0xa9d /* out of schema: unexpected value */);\n\n\tconst arrayTypes = tryStoredSchemaAsArray(nodeSchema);\n\tif (arrayTypes !== undefined) {\n\t\tconst field = inCursorField(reader, EmptyKey, () =>\n\t\t\tmapCursorField(reader, () => childHandler(reader, schema)),\n\t\t);\n\t\treturn field;\n\t}\n\n\tconst fields: Record<string, TChild> = {};\n\tforEachField(reader, () => {\n\t\tconst children = mapCursorField(reader, () => childHandler(reader, schema));\n\t\tif (children.length === 1) {\n\t\t\tconst storedKey = reader.getFieldKey();\n\t\t\t// Length is checked above.\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tfields[storedKey] = children[0]!;\n\t\t} else {\n\t\t\tassert(children.length === 0, 0xa9e /* invalid children number */);\n\t\t}\n\t});\n\treturn fields;\n}\n\n/**\n * Assumes `schema` corresponds to a simple-tree schema.\n * If it is an array schema, returns the allowed types for the array field.\n * Otherwise returns `undefined`.\n */\nexport function tryStoredSchemaAsArray(\n\tschema: TreeNodeStoredSchema,\n): ReadonlySet<string> | undefined {\n\tif (schema instanceof ObjectNodeStoredSchema) {\n\t\tconst empty = schema.getFieldSchema(EmptyKey);\n\t\tif (empty.kind === FieldKinds.sequence.identifier) {\n\t\t\tassert(schema.objectNodeFields.size === 1, 0xa9f /* invalid schema */);\n\t\t\treturn empty.types;\n\t\t}\n\t}\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { type ImplicitFieldSchema } from "../schemaTypes.js";
|
|
6
|
+
import type { TreeNode } from "../core/index.js";
|
|
7
|
+
import type { TreeView } from "./tree.js";
|
|
8
|
+
import { type SimpleTreeIndex } from "./simpleTreeIndex.js";
|
|
9
|
+
/**
|
|
10
|
+
* An index that returns tree nodes given their associated identifiers.
|
|
11
|
+
*
|
|
12
|
+
* @alpha
|
|
13
|
+
*/
|
|
14
|
+
export type IdentifierIndex = SimpleTreeIndex<string, TreeNode>;
|
|
15
|
+
/**
|
|
16
|
+
* Creates an {@link IdentifierIndex} for a given {@link TreeView}.
|
|
17
|
+
*
|
|
18
|
+
* @alpha
|
|
19
|
+
*/
|
|
20
|
+
export declare function createIdentifierIndex<TSchema extends ImplicitFieldSchema>(view: TreeView<TSchema>): IdentifierIndex;
|
|
21
|
+
//# sourceMappingURL=identifierIndex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identifierIndex.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/identifierIndex.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAa,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEnF;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,eAAe,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAMhE;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,SAAS,mBAAmB,EACxE,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,GACrB,eAAe,CA+BjB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
6
|
+
import { FieldKind } from "../schemaTypes.js";
|
|
7
|
+
import { ObjectNodeSchema } from "../objectNodeTypes.js";
|
|
8
|
+
import { walkFieldSchema } from "../walkFieldSchema.js";
|
|
9
|
+
import { createSimpleTreeIndex } from "./simpleTreeIndex.js";
|
|
10
|
+
function isStringKey(key) {
|
|
11
|
+
return typeof key === "string";
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Creates an {@link IdentifierIndex} for a given {@link TreeView}.
|
|
15
|
+
*
|
|
16
|
+
* @alpha
|
|
17
|
+
*/
|
|
18
|
+
export function createIdentifierIndex(view) {
|
|
19
|
+
// For each node schema, find which field key the identifier field is under.
|
|
20
|
+
// This can be done easily because identifiers are their own field kinds.
|
|
21
|
+
const identifierFields = new Map();
|
|
22
|
+
walkFieldSchema(view.schema, {
|
|
23
|
+
node: (schemus) => {
|
|
24
|
+
if (schemus instanceof ObjectNodeSchema) {
|
|
25
|
+
for (const [fieldKey, fieldSchema] of schemus.fields.entries()) {
|
|
26
|
+
if (fieldSchema.kind === FieldKind.Identifier) {
|
|
27
|
+
identifierFields.set(schemus.identifier, fieldKey);
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
return createSimpleTreeIndex(view, (schemus) => identifierFields.get(schemus.identifier), (nodes) => {
|
|
35
|
+
if (nodes.length > 1) {
|
|
36
|
+
throw new UsageError("cannot retrieve node from index: there are multiple nodes with the same identifier");
|
|
37
|
+
}
|
|
38
|
+
return nodes[0];
|
|
39
|
+
}, isStringKey);
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=identifierIndex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identifierIndex.js","sourceRoot":"","sources":["../../../src/simple-tree/api/identifierIndex.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAEtE,OAAO,EAAE,SAAS,EAA4B,MAAM,mBAAmB,CAAC;AAExE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAwB,MAAM,sBAAsB,CAAC;AASnF,SAAS,WAAW,CAAC,GAAiB;IACrC,OAAO,OAAO,GAAG,KAAK,QAAQ,CAAC;AAChC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CACpC,IAAuB;IAEvB,4EAA4E;IAC5E,yEAAyE;IACzE,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAkB,CAAC;IACnD,eAAe,CAAC,IAAI,CAAC,MAAM,EAAE;QAC5B,IAAI,EAAE,CAAC,OAAO,EAAE,EAAE;YACjB,IAAI,OAAO,YAAY,gBAAgB,EAAE,CAAC;gBACzC,KAAK,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;oBAChE,IAAI,WAAW,CAAC,IAAI,KAAK,SAAS,CAAC,UAAU,EAAE,CAAC;wBAC/C,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;wBACnD,MAAM;oBACP,CAAC;gBACF,CAAC;YACF,CAAC;QACF,CAAC;KACD,CAAC,CAAC;IAEH,OAAO,qBAAqB,CAC3B,IAAI,EACJ,CAAC,OAAO,EAAE,EAAE,CAAC,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,EACrD,CAAC,KAAK,EAAE,EAAE;QACT,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtB,MAAM,IAAI,UAAU,CACnB,oFAAoF,CACpF,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC,EACD,WAAW,CACX,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport type { TreeIndexKey } from \"../../feature-libraries/index.js\";\nimport { FieldKind, type ImplicitFieldSchema } from \"../schemaTypes.js\";\nimport type { TreeNode } from \"../core/index.js\";\nimport { ObjectNodeSchema } from \"../objectNodeTypes.js\";\nimport type { TreeView } from \"./tree.js\";\nimport { walkFieldSchema } from \"../walkFieldSchema.js\";\nimport { createSimpleTreeIndex, type SimpleTreeIndex } from \"./simpleTreeIndex.js\";\n\n/**\n * An index that returns tree nodes given their associated identifiers.\n *\n * @alpha\n */\nexport type IdentifierIndex = SimpleTreeIndex<string, TreeNode>;\n\nfunction isStringKey(key: TreeIndexKey): key is string {\n\treturn typeof key === \"string\";\n}\n\n/**\n * Creates an {@link IdentifierIndex} for a given {@link TreeView}.\n *\n * @alpha\n */\nexport function createIdentifierIndex<TSchema extends ImplicitFieldSchema>(\n\tview: TreeView<TSchema>,\n): IdentifierIndex {\n\t// For each node schema, find which field key the identifier field is under.\n\t// This can be done easily because identifiers are their own field kinds.\n\tconst identifierFields = new Map<string, string>();\n\twalkFieldSchema(view.schema, {\n\t\tnode: (schemus) => {\n\t\t\tif (schemus instanceof ObjectNodeSchema) {\n\t\t\t\tfor (const [fieldKey, fieldSchema] of schemus.fields.entries()) {\n\t\t\t\t\tif (fieldSchema.kind === FieldKind.Identifier) {\n\t\t\t\t\t\tidentifierFields.set(schemus.identifier, fieldKey);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t});\n\n\treturn createSimpleTreeIndex(\n\t\tview,\n\t\t(schemus) => identifierFields.get(schemus.identifier),\n\t\t(nodes) => {\n\t\t\tif (nodes.length > 1) {\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\"cannot retrieve node from index: there are multiple nodes with the same identifier\",\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn nodes[0];\n\t\t},\n\t\tisStringKey,\n\t);\n}\n"]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
export { type ITree, type TreeView, type ViewableTree, type TreeViewEvents, TreeViewConfiguration, type ITreeViewConfiguration, type SchemaCompatibilityStatus, type ITreeConfigurationOptions, type TreeViewAlpha, type TreeBranch, type TreeBranchEvents, asTreeViewAlpha, } from "./tree.js";
|
|
6
|
-
export { SchemaFactory, type ScopedSchemaName } from "./schemaFactory.js";
|
|
6
|
+
export { SchemaFactory, type ScopedSchemaName, type SchemaFactoryObjectOptions, } from "./schemaFactory.js";
|
|
7
7
|
export type { ValidateRecursiveSchema, FixRecursiveArraySchema, } from "./schemaFactoryRecursive.js";
|
|
8
8
|
export { adaptEnum, enumFromStrings, singletonSchema, } from "./schemaCreationUtilities.js";
|
|
9
9
|
export { treeNodeApi, type TreeNodeApi, tryGetSchema } from "./treeNodeApi.js";
|
|
@@ -15,9 +15,11 @@ export { getSimpleSchema } from "./getSimpleSchema.js";
|
|
|
15
15
|
export { ViewSchema } from "./view.js";
|
|
16
16
|
export type { Unenforced, FieldHasDefaultUnsafe, ObjectFromSchemaRecordUnsafe, TreeObjectNodeUnsafe, TreeFieldFromImplicitFieldUnsafe, TreeNodeFromImplicitAllowedTypesUnsafe, FieldSchemaUnsafe, InsertableTreeNodeFromImplicitAllowedTypesUnsafe, TreeArrayNodeUnsafe, TreeMapNodeUnsafe, InsertableObjectFromSchemaRecordUnsafe, InsertableTreeFieldFromImplicitFieldUnsafe, InsertableTypedNodeUnsafe, NodeBuilderDataUnsafe, NodeFromSchemaUnsafe, ReadonlyMapInlined, TreeNodeSchemaClassUnsafe, TreeNodeSchemaUnsafe, AllowedTypesUnsafe, TreeNodeSchemaNonClassUnsafe, InsertableTreeNodeFromAllowedTypesUnsafe, } from "./typesUnsafe.js";
|
|
17
17
|
export { type VerboseTreeNode, type ParseOptions, type VerboseTree, applySchemaToParserOptions, cursorFromVerbose, verboseFromCursor, } from "./verboseTree.js";
|
|
18
|
-
export type
|
|
18
|
+
export { type EncodeOptions, customFromCursorStored, type CustomTreeNode, type CustomTreeValue, tryStoredSchemaAsArray, } from "./customTree.js";
|
|
19
19
|
export { type ConciseTree, conciseFromCursor } from "./conciseTree.js";
|
|
20
20
|
export { TreeBeta, type NodeChangedData, type TreeChangeEventsBeta } from "./treeApiBeta.js";
|
|
21
|
+
export { createSimpleTreeIndex, type SimpleTreeIndex } from "./simpleTreeIndex.js";
|
|
22
|
+
export { createIdentifierIndex, type IdentifierIndex, } from "./identifierIndex.js";
|
|
21
23
|
export { extractPersistedSchema, comparePersistedSchemaInternal, comparePersistedSchema, } from "./storedSchema.js";
|
|
22
24
|
export { RecursiveObject as test_RecursiveObject, base as test_RecursiveObject_base, RecursiveObjectPojoMode as test_RecursiveObjectPojoMode, } from "./testRecursiveDomain.js";
|
|
23
25
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,KAAK,EACV,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,qBAAqB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,eAAe,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,KAAK,EACV,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,qBAAqB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,eAAe,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,aAAa,EACb,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,GAC/B,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACX,uBAAuB,EACvB,uBAAuB,GACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACN,SAAS,EACT,eAAe,EACf,eAAe,GACf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC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ACpB,sBAAsB,GACtB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,KAAK,WAAW,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAEvE,OAAO,EAAE,QAAQ,EAAE,KAAK,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7F,OAAO,EAAE,qBAAqB,EAAE,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EACN,qBAAqB,EACrB,KAAK,eAAe,GACpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACN,sBAAsB,EACtB,8BAA8B,EAC9B,sBAAsB,GACtB,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EACN,eAAe,IAAI,oBAAoB,EACvC,IAAI,IAAI,yBAAyB,EACjC,uBAAuB,IAAI,4BAA4B,GACvD,MAAM,0BAA0B,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
export { TreeViewConfiguration, asTreeViewAlpha, } from "./tree.js";
|
|
6
|
-
export { SchemaFactory } from "./schemaFactory.js";
|
|
6
|
+
export { SchemaFactory, } from "./schemaFactory.js";
|
|
7
7
|
export { adaptEnum, enumFromStrings, singletonSchema, } from "./schemaCreationUtilities.js";
|
|
8
8
|
export { treeNodeApi, tryGetSchema } from "./treeNodeApi.js";
|
|
9
9
|
export { createFromInsertable, cursorFromInsertable, createFromCursor } from "./create.js";
|
|
@@ -11,8 +11,11 @@ export { getJsonSchema } from "./getJsonSchema.js";
|
|
|
11
11
|
export { getSimpleSchema } from "./getSimpleSchema.js";
|
|
12
12
|
export { ViewSchema } from "./view.js";
|
|
13
13
|
export { applySchemaToParserOptions, cursorFromVerbose, verboseFromCursor, } from "./verboseTree.js";
|
|
14
|
+
export { customFromCursorStored, tryStoredSchemaAsArray, } from "./customTree.js";
|
|
14
15
|
export { conciseFromCursor } from "./conciseTree.js";
|
|
15
16
|
export { TreeBeta } from "./treeApiBeta.js";
|
|
17
|
+
export { createSimpleTreeIndex } from "./simpleTreeIndex.js";
|
|
18
|
+
export { createIdentifierIndex, } from "./identifierIndex.js";
|
|
16
19
|
export { extractPersistedSchema, comparePersistedSchemaInternal, comparePersistedSchema, } from "./storedSchema.js";
|
|
17
20
|
// Exporting the schema (RecursiveObject) to test that recursive types are working correctly.
|
|
18
21
|
// These are `@internal` so they can't be included in the `InternalClassTreeTypes` due to https://github.com/microsoft/rushstack/issues/3639
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/simple-tree/api/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAKN,qBAAqB,EAOrB,eAAe,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/simple-tree/api/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAKN,qBAAqB,EAOrB,eAAe,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,aAAa,GAGb,MAAM,oBAAoB,CAAC;AAK5B,OAAO,EACN,SAAS,EACT,eAAe,EACf,eAAe,GACf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,WAAW,EAAoB,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AA0B3F,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAyBvC,OAAO,EAIN,0BAA0B,EAC1B,iBAAiB,EACjB,iBAAiB,GACjB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAEN,sBAAsB,EAGtB,sBAAsB,GACtB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAoB,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAEvE,OAAO,EAAE,QAAQ,EAAmD,MAAM,kBAAkB,CAAC;AAC7F,OAAO,EAAE,qBAAqB,EAAwB,MAAM,sBAAsB,CAAC;AACnF,OAAO,EACN,qBAAqB,GAErB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACN,sBAAsB,EACtB,8BAA8B,EAC9B,sBAAsB,GACtB,MAAM,mBAAmB,CAAC;AAE3B,6FAA6F;AAC7F,4IAA4I;AAC5I,OAAO,EACN,eAAe,IAAI,oBAAoB,EACvC,IAAI,IAAI,yBAAyB,EACjC,uBAAuB,IAAI,4BAA4B,GACvD,MAAM,0BAA0B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype ITree,\n\ttype TreeView,\n\ttype ViewableTree,\n\ttype TreeViewEvents,\n\tTreeViewConfiguration,\n\ttype ITreeViewConfiguration,\n\ttype SchemaCompatibilityStatus,\n\ttype ITreeConfigurationOptions,\n\ttype TreeViewAlpha,\n\ttype TreeBranch,\n\ttype TreeBranchEvents,\n\tasTreeViewAlpha,\n} from \"./tree.js\";\nexport {\n\tSchemaFactory,\n\ttype ScopedSchemaName,\n\ttype SchemaFactoryObjectOptions,\n} from \"./schemaFactory.js\";\nexport type {\n\tValidateRecursiveSchema,\n\tFixRecursiveArraySchema,\n} from \"./schemaFactoryRecursive.js\";\nexport {\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n} from \"./schemaCreationUtilities.js\";\nexport { treeNodeApi, type TreeNodeApi, tryGetSchema } from \"./treeNodeApi.js\";\nexport { createFromInsertable, cursorFromInsertable, createFromCursor } from \"./create.js\";\nexport type {\n\tSimpleTreeSchema,\n\tSimpleNodeSchema,\n\tSimpleFieldSchema,\n\tSimpleLeafNodeSchema,\n\tSimpleMapNodeSchema,\n\tSimpleArrayNodeSchema,\n\tSimpleObjectNodeSchema,\n\tSimpleNodeSchemaBase,\n} from \"./simpleSchema.js\";\nexport {\n\ttype JsonSchemaId,\n\ttype JsonSchemaType,\n\ttype JsonObjectNodeSchema,\n\ttype JsonArrayNodeSchema,\n\ttype JsonMapNodeSchema,\n\ttype JsonLeafNodeSchema,\n\ttype JsonSchemaRef,\n\ttype JsonRefPath,\n\ttype JsonNodeSchema,\n\ttype JsonNodeSchemaBase,\n\ttype JsonTreeSchema,\n\ttype JsonFieldSchema,\n\ttype JsonLeafSchemaType,\n} from \"./jsonSchema.js\";\nexport { getJsonSchema } from \"./getJsonSchema.js\";\nexport { getSimpleSchema } from \"./getSimpleSchema.js\";\nexport { ViewSchema } from \"./view.js\";\nexport type {\n\tUnenforced,\n\tFieldHasDefaultUnsafe,\n\tObjectFromSchemaRecordUnsafe,\n\tTreeObjectNodeUnsafe,\n\tTreeFieldFromImplicitFieldUnsafe,\n\tTreeNodeFromImplicitAllowedTypesUnsafe,\n\tFieldSchemaUnsafe,\n\tInsertableTreeNodeFromImplicitAllowedTypesUnsafe,\n\tTreeArrayNodeUnsafe,\n\tTreeMapNodeUnsafe,\n\tInsertableObjectFromSchemaRecordUnsafe,\n\tInsertableTreeFieldFromImplicitFieldUnsafe,\n\tInsertableTypedNodeUnsafe,\n\tNodeBuilderDataUnsafe,\n\tNodeFromSchemaUnsafe,\n\tReadonlyMapInlined,\n\tTreeNodeSchemaClassUnsafe,\n\tTreeNodeSchemaUnsafe,\n\tAllowedTypesUnsafe,\n\tTreeNodeSchemaNonClassUnsafe,\n\tInsertableTreeNodeFromAllowedTypesUnsafe,\n} from \"./typesUnsafe.js\";\n\nexport {\n\ttype VerboseTreeNode,\n\ttype ParseOptions,\n\ttype VerboseTree,\n\tapplySchemaToParserOptions,\n\tcursorFromVerbose,\n\tverboseFromCursor,\n} from \"./verboseTree.js\";\n\nexport {\n\ttype EncodeOptions,\n\tcustomFromCursorStored,\n\ttype CustomTreeNode,\n\ttype CustomTreeValue,\n\ttryStoredSchemaAsArray,\n} from \"./customTree.js\";\n\nexport { type ConciseTree, conciseFromCursor } from \"./conciseTree.js\";\n\nexport { TreeBeta, type NodeChangedData, type TreeChangeEventsBeta } from \"./treeApiBeta.js\";\nexport { createSimpleTreeIndex, type SimpleTreeIndex } from \"./simpleTreeIndex.js\";\nexport {\n\tcreateIdentifierIndex,\n\ttype IdentifierIndex,\n} from \"./identifierIndex.js\";\n\nexport {\n\textractPersistedSchema,\n\tcomparePersistedSchemaInternal,\n\tcomparePersistedSchema,\n} from \"./storedSchema.js\";\n\n// Exporting the schema (RecursiveObject) to test that recursive types are working correctly.\n// These are `@internal` so they can't be included in the `InternalClassTreeTypes` due to https://github.com/microsoft/rushstack/issues/3639\nexport {\n\tRecursiveObject as test_RecursiveObject,\n\tbase as test_RecursiveObject_base,\n\tRecursiveObjectPojoMode as test_RecursiveObjectPojoMode,\n} from \"./testRecursiveDomain.js\";\n"]}
|
|
@@ -15,6 +15,54 @@ import type { FieldSchemaUnsafe, FieldHasDefaultUnsafe, InsertableTreeFieldFromI
|
|
|
15
15
|
* Gets the leaf domain schema compatible with a given {@link TreeValue}.
|
|
16
16
|
*/
|
|
17
17
|
export declare function schemaFromValue(value: TreeValue): TreeNodeSchema;
|
|
18
|
+
/**
|
|
19
|
+
* Options when declaring an {@link SchemaFactory.object|object node}'s schema
|
|
20
|
+
*/
|
|
21
|
+
export interface SchemaFactoryObjectOptions {
|
|
22
|
+
/**
|
|
23
|
+
* Opt in to viewing documents which have unknown optional fields for this object's identifier, i.e. optional fields
|
|
24
|
+
* in the document schema which are not present in this object schema declaration.
|
|
25
|
+
*
|
|
26
|
+
* @defaultValue `false`
|
|
27
|
+
* @remarks
|
|
28
|
+
* The advantage of enabling this option is that it allows an application ecosystem with staged rollout to more quickly
|
|
29
|
+
* upgrade documents to include schema for new optional features.
|
|
30
|
+
*
|
|
31
|
+
* However, it does come with trade-offs that applications should weigh carefully when it comes to interactions between
|
|
32
|
+
* code and documents.
|
|
33
|
+
* When opening such documents, the API presented is still determined by the view schema.
|
|
34
|
+
* This can have implications on the behavior of edits or code which uses portions of the view schema,
|
|
35
|
+
* since this may inadvertently drop data which is present in those optional fields in the document schema.
|
|
36
|
+
*
|
|
37
|
+
* Consider the following example:
|
|
38
|
+
*
|
|
39
|
+
* ```typescript
|
|
40
|
+
* const sf = new SchemaFactory("com.example");
|
|
41
|
+
* class PersonView extends sf.object("Person", { name: sf.string }, { allowUnknownOptionalFields: true }) {}
|
|
42
|
+
* class PersonStored extends sf.object("Person", { name: sf.string, nickname: sf.optional(sf.string) }) {}
|
|
43
|
+
*
|
|
44
|
+
* // Say we have a document which uses `PersonStored` in its schema, and application code constructs
|
|
45
|
+
* // a tree view using `PersonView`. If the application for some reason had implemented a function like this:
|
|
46
|
+
* function clonePerson(a: PersonView): PersonView {
|
|
47
|
+
* return new PersonView({ name: a.name });
|
|
48
|
+
* }
|
|
49
|
+
* // ...or even like this:
|
|
50
|
+
* function clonePerson(a: PersonView): PersonView {
|
|
51
|
+
* return new PersonView({ ...a})
|
|
52
|
+
* }
|
|
53
|
+
* // Then the alleged clone wouldn't actually clone the entire person in either case, it would drop the nickname.
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* If an application wants to be particularly careful to preserve all data on a node when editing it, it can use
|
|
57
|
+
* {@link TreeAlpha.(importVerbose:2)|import}/{@link TreeAlpha.(exportVerbose:2)|export} APIs with persistent keys.
|
|
58
|
+
*
|
|
59
|
+
* Note that public API methods which operate on entire nodes (such as `moveTo`, `moveToEnd`, etc. on arrays) do not encounter
|
|
60
|
+
* this problem as SharedTree's implementation stores the entire node in its lower layers. It's only when application code
|
|
61
|
+
* reaches into a node (either by accessing its fields, spreading it, or some other means) that this problem arises.
|
|
62
|
+
*/
|
|
63
|
+
allowUnknownOptionalFields?: boolean;
|
|
64
|
+
}
|
|
65
|
+
export declare const defaultSchemaFactoryObjectOptions: Required<SchemaFactoryObjectOptions>;
|
|
18
66
|
/**
|
|
19
67
|
* The name of a schema produced by {@link SchemaFactory}, including its optional scope prefix.
|
|
20
68
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemaFactory.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/schemaFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,YAAY,IAAI,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAIpF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EACN,KAAK,uBAAuB,EAG5B,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"schemaFactory.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/schemaFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,YAAY,IAAI,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAIpF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EACN,KAAK,uBAAuB,EAG5B,MAAM,qBAAqB,CAAC;AAa7B,OAAO,EACN,SAAS,EACT,KAAK,WAAW,EAChB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,0CAA0C,EAC/C,KAAK,UAAU,EAIf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EACX,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,mBAAmB,EACnB,sBAAsB,EAEtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,aAAa,EAAe,MAAM,iBAAiB,CAAC;AAClE,OAAO,EACN,KAAK,gCAAgC,EACrC,KAAK,cAAc,EAEnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,qBAAqB,EAAE,KAAK,WAAW,EAAa,MAAM,eAAe,CAAC;AACxF,OAAO,KAAK,EACX,iBAAiB,EAMjB,qBAAqB,EAErB,0CAA0C,EAE1C,gDAAgD,EAChD,mBAAmB,EACnB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;IAEI,cAAc,CACpB,KAAK,CAAC,IAAI,SAAS,KAAK,EACxB,KAAK,CAAC,CAAC,SAAS,UAAU,CAAC,oBAAoB,CAAC,EAC/C,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;QAa1B;;;;;;;;;;WAUG;6BACkB,SAAS,iDAAiD,CAAC,CAAC,CAAC;;IAQrF;;;;;;OAMG;IAEI,YAAY,CAAC,IAAI,SAAS,KAAK,EAAE,KAAK,CAAC,CAAC,SAAS,UAAU,CAAC,oBAAoB,CAAC,EACvF,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,CAAC;QAgBZ;;;;;;;;;;WAUG;6BACkB,SACpB;YAAC,MAAM;YAAE,iDAAiD,CAAC,CAAC;SAAC,CAC7D;;;;CAcL;AAED,wBAAgB,cAAc,CAAC,KAAK,CAAC,CAAC,SAAS,MAAM,EACpD,cAAc,EAAE,CAAC,EACjB,YAAY,EAAE,cAAc,GAAG,SAAS,cAAc,EAAE,GACtD,GAAG,CAAC,IAAI,MAAM,GAAG,CAmBnB;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAelE"}
|
|
@@ -37,6 +37,9 @@ export function schemaFromValue(value) {
|
|
|
37
37
|
unreachableCase(value);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
+
export const defaultSchemaFactoryObjectOptions = {
|
|
41
|
+
allowUnknownOptionalFields: false,
|
|
42
|
+
};
|
|
40
43
|
// > = `${TScope extends undefined ? "" : `${TScope}.`}${TName}`;
|
|
41
44
|
// TODO:
|
|
42
45
|
// SchemaFactory.array references should link to the correct overloads, however the syntax for this does not seems to work currently for methods unless the they are not qualified with the class.
|
|
@@ -238,7 +241,7 @@ export class SchemaFactory {
|
|
|
238
241
|
* @param fields - Schema for fields of the object node's schema. Defines what children can be placed under each key.
|
|
239
242
|
*/
|
|
240
243
|
object(name, fields) {
|
|
241
|
-
return objectSchema(this.scoped(name), fields, true);
|
|
244
|
+
return objectSchema(this.scoped(name), fields, true, defaultSchemaFactoryObjectOptions.allowUnknownOptionalFields);
|
|
242
245
|
}
|
|
243
246
|
/**
|
|
244
247
|
* @privateRemarks
|