@fluidframework/tree 2.103.0 → 2.111.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/.vscode/settings.json +1 -0
- package/CHANGELOG.md +109 -0
- package/api-report/tree.alpha.api.md +60 -34
- package/api-report/tree.beta.api.md +49 -3
- package/api-report/tree.legacy.beta.api.md +49 -3
- package/dist/codec/versioned/format.js +2 -24
- package/dist/codec/versioned/format.js.map +1 -1
- package/dist/core/change-family/changeFamily.d.ts +3 -10
- package/dist/core/change-family/changeFamily.d.ts.map +1 -1
- package/dist/core/change-family/changeFamily.js.map +1 -1
- package/dist/core/rebase/types.d.ts +2 -2
- package/dist/core/rebase/types.js +2 -24
- package/dist/core/rebase/types.js.map +1 -1
- package/dist/core/schema-stored/formatV1.js +2 -24
- package/dist/core/schema-stored/formatV1.js.map +1 -1
- package/dist/core/schema-stored/formatV2.js +2 -24
- package/dist/core/schema-stored/formatV2.js.map +1 -1
- package/dist/core/schema-stored/index.js +3 -25
- package/dist/core/schema-stored/index.js.map +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.d.ts +2 -2
- package/dist/core/schema-stored/storedSchemaRepository.js.map +1 -1
- package/dist/core/tree/anchorSet.js +4 -8
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.js +2 -24
- package/dist/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatV2.js +2 -24
- package/dist/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
- package/dist/core/tree/persistedTreeTextFormat.js +2 -24
- package/dist/core/tree/persistedTreeTextFormat.js.map +1 -1
- package/dist/entrypoints/alpha.d.ts +1 -1
- package/dist/entrypoints/alpha.d.ts.map +1 -1
- package/dist/entrypoints/alpha.js.map +1 -1
- package/dist/entrypoints/beta.d.ts +1 -1
- package/dist/entrypoints/beta.d.ts.map +1 -1
- package/dist/entrypoints/beta.js.map +1 -1
- package/dist/entrypoints/internal.js +2 -15
- package/dist/entrypoints/internal.js.map +1 -1
- package/dist/entrypoints/legacy.d.ts +1 -1
- package/dist/entrypoints/legacy.d.ts.map +1 -1
- package/dist/entrypoints/legacy.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.js +7 -11
- package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +19 -14
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +13 -32
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +85 -28
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +83 -9
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +4 -2
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +11 -0
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.js +2 -24
- package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format/formatV1.js +2 -24
- package/dist/feature-libraries/chunked-forest/codec/format/formatV1.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format/formatV2.js +2 -24
- package/dist/feature-libraries/chunked-forest/codec/format/formatV2.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format/formatVText.js +2 -24
- package/dist/feature-libraries/chunked-forest/codec/format/formatVText.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.js +2 -1
- package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js +3 -15
- package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.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 +2 -1
- package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyEntity.js +9 -19
- package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.js +3 -13
- package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.d.ts +3 -3
- package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +3 -2
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +4 -6
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/forest-summary/formatCommon.js +2 -24
- package/dist/feature-libraries/forest-summary/formatCommon.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +1 -1
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +4 -25
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindFormat.js +2 -24
- package/dist/feature-libraries/modular-schema/genericFieldKindFormat.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +9 -9
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +10 -30
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js +2 -24
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js +2 -24
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +0 -5
- 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/object-forest/objectForest.js +11 -55
- package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.js +2 -24
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.js +2 -24
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.js +2 -24
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
- package/dist/feature-libraries/schema-index/formatV1.js +2 -24
- package/dist/feature-libraries/schema-index/formatV1.js.map +1 -1
- package/dist/feature-libraries/schema-index/formatV2.js +2 -24
- package/dist/feature-libraries/schema-index/formatV2.js.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV1.js +2 -24
- package/dist/feature-libraries/sequence-field/formatV1.js.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV2.js +2 -24
- package/dist/feature-libraries/sequence-field/formatV2.js.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV3.js +2 -24
- package/dist/feature-libraries/sequence-field/formatV3.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -25
- 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/independentView.d.ts.map +1 -1
- package/dist/shared-tree/independentView.js +4 -7
- package/dist/shared-tree/independentView.js.map +1 -1
- package/dist/shared-tree/index.d.ts +1 -1
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +6 -5
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +7 -41
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +5 -1
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +13 -49
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFormat.js +2 -24
- package/dist/shared-tree/sharedTreeChangeFormat.js.map +1 -1
- package/dist/shared-tree/transactionPostProcessor.d.ts +28 -0
- package/dist/shared-tree/transactionPostProcessor.d.ts.map +1 -0
- package/dist/shared-tree/transactionPostProcessor.js +28 -0
- package/dist/shared-tree/transactionPostProcessor.js.map +1 -0
- package/dist/shared-tree/treeAlpha.js +3 -3
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +28 -15
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +124 -145
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree/unhydratedTreeContext.d.ts +5 -5
- package/dist/shared-tree/unhydratedTreeContext.d.ts.map +1 -1
- package/dist/shared-tree/unhydratedTreeContext.js.map +1 -1
- package/dist/shared-tree-core/branch.js +13 -17
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts +3 -2
- package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +3 -9
- package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.js +2 -4
- package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts +3 -3
- package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +3 -3
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js +2 -24
- package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.js +2 -24
- package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.js +2 -24
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.d.ts +5 -9
- package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.js +5 -10
- package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/dist/shared-tree-core/index.d.ts +1 -1
- package/dist/shared-tree-core/index.d.ts.map +1 -1
- package/dist/shared-tree-core/index.js +3 -2
- package/dist/shared-tree-core/index.js.map +1 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.js +2 -24
- package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.js +2 -24
- package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/messageFormatVSharedBranches.js +2 -24
- package/dist/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +9 -44
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/shared-tree-core/transaction.d.ts +84 -9
- package/dist/shared-tree-core/transaction.d.ts.map +1 -1
- package/dist/shared-tree-core/transaction.js +94 -37
- package/dist/shared-tree-core/transaction.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +1 -1
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaCreationUtilities.d.ts +3 -3
- package/dist/simple-tree/api/schemaCreationUtilities.js +3 -3
- package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts +1 -1
- package/dist/simple-tree/api/schemaFactory.js +2 -2
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaCodec.js +2 -24
- package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +2 -2
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js +4 -26
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/dist/simple-tree/api/transactionTypes.d.ts +91 -28
- package/dist/simple-tree/api/transactionTypes.d.ts.map +1 -1
- package/dist/simple-tree/api/transactionTypes.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +96 -22
- 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/treeBeta.d.ts.map +1 -1
- package/dist/simple-tree/api/treeBeta.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +83 -93
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts +7 -7
- package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js +6 -10
- package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/dist/simple-tree/index.d.ts +1 -1
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js +2 -12
- package/dist/simple-tree/leafNodeSchema.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js +2 -6
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/simpleSchemaFormatV1.js +2 -24
- package/dist/simple-tree/simpleSchemaFormatV1.js.map +1 -1
- package/dist/tableSchema.d.ts +50 -4
- package/dist/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +202 -106
- package/dist/tableSchema.js.map +1 -1
- package/dist/text/index.d.ts +1 -0
- package/dist/text/index.d.ts.map +1 -1
- package/dist/text/index.js +3 -1
- package/dist/text/index.js.map +1 -1
- package/dist/text/textDomainFormatted.d.ts +69 -758
- package/dist/text/textDomainFormatted.d.ts.map +1 -1
- package/dist/text/textDomainFormatted.js +275 -322
- package/dist/text/textDomainFormatted.js.map +1 -1
- package/dist/text/textDomainFormattedDefault.d.ts +273 -0
- package/dist/text/textDomainFormattedDefault.d.ts.map +1 -0
- package/dist/text/textDomainFormattedDefault.js +94 -0
- package/dist/text/textDomainFormattedDefault.js.map +1 -0
- package/dist/util/arrayUtilities.d.ts +20 -0
- package/dist/util/arrayUtilities.d.ts.map +1 -1
- package/dist/util/arrayUtilities.js +24 -1
- package/dist/util/arrayUtilities.js.map +1 -1
- package/dist/util/compressedIds.d.ts +118 -0
- package/dist/util/compressedIds.d.ts.map +1 -0
- package/dist/util/compressedIds.js +133 -0
- package/dist/util/compressedIds.js.map +1 -0
- package/dist/util/index.d.ts +2 -1
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +11 -2
- package/dist/util/index.js.map +1 -1
- package/dist/util/rangeMap.d.ts +13 -0
- package/dist/util/rangeMap.d.ts.map +1 -1
- package/dist/util/rangeMap.js +69 -8
- package/dist/util/rangeMap.js.map +1 -1
- package/dist/util/typeboxBrand.js +2 -24
- package/dist/util/typeboxBrand.js.map +1 -1
- package/dist/util/utils.js +2 -24
- package/dist/util/utils.js.map +1 -1
- package/eslint.config.mts +0 -30
- package/lib/core/change-family/changeFamily.d.ts +3 -10
- package/lib/core/change-family/changeFamily.d.ts.map +1 -1
- package/lib/core/change-family/changeFamily.js.map +1 -1
- package/lib/core/rebase/types.d.ts +2 -2
- package/lib/core/rebase/types.js.map +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.d.ts +2 -2
- package/lib/core/schema-stored/storedSchemaRepository.js.map +1 -1
- package/lib/core/tree/anchorSet.js +1 -5
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/entrypoints/alpha.d.ts +1 -1
- package/lib/entrypoints/alpha.d.ts.map +1 -1
- package/lib/entrypoints/alpha.js.map +1 -1
- package/lib/entrypoints/beta.d.ts +1 -1
- package/lib/entrypoints/beta.d.ts.map +1 -1
- package/lib/entrypoints/beta.js.map +1 -1
- package/lib/entrypoints/legacy.d.ts +1 -1
- package/lib/entrypoints/legacy.d.ts.map +1 -1
- package/lib/entrypoints/legacy.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.js +1 -5
- package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +19 -14
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +14 -33
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +85 -28
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +82 -9
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +4 -2
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +12 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.js +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js +3 -15
- package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.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/flex-tree/lazyEntity.js +1 -11
- package/lib/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.js +1 -11
- package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.d.ts +3 -3
- package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +3 -2
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +4 -6
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +1 -1
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +1 -1
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +10 -10
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +10 -30
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +0 -5
- 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/object-forest/objectForest.js +1 -45
- package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- 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/independentView.d.ts.map +1 -1
- package/lib/shared-tree/independentView.js +5 -8
- package/lib/shared-tree/independentView.js.map +1 -1
- package/lib/shared-tree/index.d.ts +1 -1
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +6 -5
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +4 -38
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +5 -1
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +9 -45
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/transactionPostProcessor.d.ts +28 -0
- package/lib/shared-tree/transactionPostProcessor.d.ts.map +1 -0
- package/lib/shared-tree/transactionPostProcessor.js +23 -0
- package/lib/shared-tree/transactionPostProcessor.js.map +1 -0
- package/lib/shared-tree/treeAlpha.js +3 -3
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +28 -15
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +80 -101
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree/unhydratedTreeContext.d.ts +5 -5
- package/lib/shared-tree/unhydratedTreeContext.d.ts.map +1 -1
- package/lib/shared-tree/unhydratedTreeContext.js.map +1 -1
- package/lib/shared-tree-core/branch.js +1 -5
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts +3 -2
- package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +3 -9
- package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.js +3 -5
- package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts +3 -3
- package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +3 -3
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.d.ts +5 -9
- package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.js +5 -10
- package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/lib/shared-tree-core/index.d.ts +1 -1
- package/lib/shared-tree-core/index.d.ts.map +1 -1
- package/lib/shared-tree-core/index.js +1 -1
- package/lib/shared-tree-core/index.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +4 -39
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/shared-tree-core/transaction.d.ts +84 -9
- package/lib/shared-tree-core/transaction.d.ts.map +1 -1
- package/lib/shared-tree-core/transaction.js +74 -17
- package/lib/shared-tree-core/transaction.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +1 -1
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaCreationUtilities.d.ts +3 -3
- package/lib/simple-tree/api/schemaCreationUtilities.js +3 -3
- package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts +1 -1
- package/lib/simple-tree/api/schemaFactory.js +2 -2
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +2 -2
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js +2 -2
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/lib/simple-tree/api/transactionTypes.d.ts +91 -28
- package/lib/simple-tree/api/transactionTypes.d.ts.map +1 -1
- package/lib/simple-tree/api/transactionTypes.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +96 -22
- 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/treeBeta.d.ts.map +1 -1
- package/lib/simple-tree/api/treeBeta.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +1 -11
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts +7 -7
- package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js +1 -5
- package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/lib/simple-tree/index.d.ts +1 -1
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js +1 -11
- package/lib/simple-tree/leafNodeSchema.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js +1 -5
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/tableSchema.d.ts +50 -4
- package/lib/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +171 -75
- package/lib/tableSchema.js.map +1 -1
- package/lib/text/index.d.ts +1 -0
- package/lib/text/index.d.ts.map +1 -1
- package/lib/text/index.js +1 -0
- package/lib/text/index.js.map +1 -1
- package/lib/text/textDomainFormatted.d.ts +69 -758
- package/lib/text/textDomainFormatted.d.ts.map +1 -1
- package/lib/text/textDomainFormatted.js +277 -324
- package/lib/text/textDomainFormatted.js.map +1 -1
- package/lib/text/textDomainFormattedDefault.d.ts +273 -0
- package/lib/text/textDomainFormattedDefault.d.ts.map +1 -0
- package/lib/text/textDomainFormattedDefault.js +91 -0
- package/lib/text/textDomainFormattedDefault.js.map +1 -0
- package/lib/util/arrayUtilities.d.ts +20 -0
- package/lib/util/arrayUtilities.d.ts.map +1 -1
- package/lib/util/arrayUtilities.js +22 -0
- package/lib/util/arrayUtilities.js.map +1 -1
- package/lib/util/compressedIds.d.ts +118 -0
- package/lib/util/compressedIds.d.ts.map +1 -0
- package/lib/util/compressedIds.js +124 -0
- package/lib/util/compressedIds.js.map +1 -0
- package/lib/util/index.d.ts +2 -1
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +2 -1
- package/lib/util/index.js.map +1 -1
- package/lib/util/rangeMap.d.ts +13 -0
- package/lib/util/rangeMap.d.ts.map +1 -1
- package/lib/util/rangeMap.js +69 -8
- package/lib/util/rangeMap.js.map +1 -1
- package/package.json +25 -24
- package/src/core/change-family/changeFamily.ts +3 -12
- package/src/core/rebase/types.ts +2 -2
- package/src/core/schema-stored/storedSchemaRepository.ts +2 -2
- package/src/entrypoints/alpha.ts +12 -8
- package/src/entrypoints/beta.ts +8 -0
- package/src/entrypoints/legacy.ts +8 -0
- package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +35 -64
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +138 -42
- package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +32 -4
- package/src/feature-libraries/chunked-forest/codec/index.ts +1 -0
- package/src/feature-libraries/chunked-forest/codec/nodeEncoder.ts +7 -19
- package/src/feature-libraries/chunked-forest/index.ts +3 -0
- package/src/feature-libraries/forest-summary/codec.ts +5 -3
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +4 -5
- package/src/feature-libraries/index.ts +3 -0
- package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +13 -9
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +14 -47
- package/src/feature-libraries/modular-schema/modularChangeTypes.ts +0 -5
- package/src/index.ts +13 -8
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/independentView.ts +5 -10
- package/src/shared-tree/index.ts +1 -0
- package/src/shared-tree/schematizingTreeView.ts +29 -25
- package/src/shared-tree/sharedTree.ts +18 -10
- package/src/shared-tree/transactionPostProcessor.ts +40 -0
- package/src/shared-tree/treeAlpha.ts +3 -3
- package/src/shared-tree/treeCheckout.ts +120 -95
- package/src/shared-tree/unhydratedTreeContext.ts +18 -15
- package/src/shared-tree-core/editManagerCodecs.ts +3 -2
- package/src/shared-tree-core/editManagerCodecsCommons.ts +10 -14
- package/src/shared-tree-core/editManagerCodecsV1toV4.ts +3 -2
- package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +3 -2
- package/src/shared-tree-core/editManagerSummarizer.ts +5 -9
- package/src/shared-tree-core/index.ts +8 -5
- package/src/shared-tree-core/sharedTreeCore.ts +3 -2
- package/src/shared-tree-core/transaction.ts +148 -18
- package/src/simple-tree/api/index.ts +13 -9
- package/src/simple-tree/api/schemaCreationUtilities.ts +3 -3
- package/src/simple-tree/api/schemaFactory.ts +2 -2
- package/src/simple-tree/api/snapshotCompatibilityChecker.ts +2 -2
- package/src/simple-tree/api/transactionTypes.ts +111 -39
- package/src/simple-tree/api/tree.ts +152 -47
- package/src/simple-tree/api/treeBeta.ts +2 -0
- package/src/simple-tree/core/treeNodeSchema.ts +7 -7
- package/src/simple-tree/index.ts +12 -8
- package/src/tableSchema.ts +306 -80
- package/src/text/index.ts +1 -0
- package/src/text/textDomainFormatted.ts +520 -415
- package/src/text/textDomainFormattedDefault.ts +150 -0
- package/src/util/arrayUtilities.ts +35 -0
- package/src/util/compressedIds.ts +216 -0
- package/src/util/index.ts +17 -0
- package/src/util/rangeMap.ts +108 -9
- package/tsconfig.json +5 -0
|
@@ -11,17 +11,14 @@ import type {
|
|
|
11
11
|
RevertibleAlphaFactory,
|
|
12
12
|
RevertibleFactory,
|
|
13
13
|
} from "../../core/index.js";
|
|
14
|
-
// This is referenced by doc comments.
|
|
15
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- This is referenced by doc comments.
|
|
16
15
|
import type { TreeStatus } from "../../feature-libraries/index.js";
|
|
17
16
|
import type {
|
|
18
|
-
// This is referenced by doc comments.
|
|
19
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-imports
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-imports -- This is referenced by doc comments.
|
|
20
18
|
TreeAlpha,
|
|
21
19
|
} from "../../shared-tree/index.js";
|
|
22
20
|
import type { JsonCompatibleReadOnly } from "../../util/index.js";
|
|
23
|
-
// This is referenced by doc comments.
|
|
24
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- This is referenced by doc comments.
|
|
25
22
|
import type { Unhydrated } from "../core/index.js";
|
|
26
23
|
import type {
|
|
27
24
|
ImplicitFieldSchema,
|
|
@@ -36,11 +33,14 @@ import type { UnsafeUnknownSchema } from "../unsafeUnknownSchema.js";
|
|
|
36
33
|
|
|
37
34
|
import type { TreeViewConfiguration } from "./configuration.js";
|
|
38
35
|
import type {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
RunTransactionParamsAlpha,
|
|
37
|
+
RunTransactionParamsBeta,
|
|
38
|
+
TransactionCallbackStatusAlpha,
|
|
39
|
+
TransactionCallbackStatusBeta,
|
|
40
|
+
TransactionVoidResult,
|
|
41
|
+
TransactionValueResult,
|
|
42
|
+
VoidTransactionCallbackStatusAlpha,
|
|
43
|
+
VoidTransactionCallbackStatusBeta,
|
|
44
44
|
WithValue,
|
|
45
45
|
} from "./transactionTypes.js";
|
|
46
46
|
import type { VerboseTree } from "./verboseTree.js";
|
|
@@ -193,8 +193,8 @@ export interface TreeContextAlpha {
|
|
|
193
193
|
* Run a synchronous transaction which groups sequential edits to the tree into a single atomic edit if possible.
|
|
194
194
|
* @param transaction - A callback run during the transaction to perform user-supplied operations.
|
|
195
195
|
* It may optionally return a {@link WithValue | value }, which will be returned by the `runTransaction` call.
|
|
196
|
-
* @param params - Optional {@link
|
|
197
|
-
* @returns A {@link
|
|
196
|
+
* @param params - Optional {@link RunTransactionParamsAlpha | parameters} for the transaction.
|
|
197
|
+
* @returns A {@link TransactionValueResult | value } indicating whether or not the transaction succeeded, and containing the value returned by `transaction`.
|
|
198
198
|
* @remarks
|
|
199
199
|
* All of the changes in the transaction are applied synchronously and therefore no other changes from a remote client can be interleaved with those changes.
|
|
200
200
|
* Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.
|
|
@@ -215,11 +215,20 @@ export interface TreeContextAlpha {
|
|
|
215
215
|
*/
|
|
216
216
|
runTransaction<TValue>(
|
|
217
217
|
transaction: () => WithValue<TValue>,
|
|
218
|
-
params?:
|
|
219
|
-
):
|
|
218
|
+
params?: RunTransactionParamsAlpha,
|
|
219
|
+
): TransactionValueResult<TValue, TValue>;
|
|
220
220
|
|
|
221
|
-
/**
|
|
222
|
-
|
|
221
|
+
/**
|
|
222
|
+
* An overload of {@link TreeContextAlpha.(runTransaction:1) | runTransaction } which does not return a value.
|
|
223
|
+
*
|
|
224
|
+
* @privateRemarks
|
|
225
|
+
* TODO: Consider updating these methods to avoid the need for overloads.
|
|
226
|
+
* See {@link TreeViewBeta.runTransaction} for an example of how to do this.
|
|
227
|
+
*/
|
|
228
|
+
runTransaction(
|
|
229
|
+
transaction: () => void,
|
|
230
|
+
params?: RunTransactionParamsAlpha,
|
|
231
|
+
): TransactionVoidResult;
|
|
223
232
|
|
|
224
233
|
/**
|
|
225
234
|
* An asynchronous version of {@link TreeContextAlpha.(runTransaction:1) | runTransaction}.
|
|
@@ -234,14 +243,20 @@ export interface TreeContextAlpha {
|
|
|
234
243
|
*/
|
|
235
244
|
runTransactionAsync<TValue>(
|
|
236
245
|
transaction: () => Promise<WithValue<TValue>>,
|
|
237
|
-
params?:
|
|
238
|
-
): Promise<
|
|
246
|
+
params?: RunTransactionParamsAlpha,
|
|
247
|
+
): Promise<TransactionValueResult<TValue, TValue>>;
|
|
239
248
|
|
|
240
|
-
/**
|
|
249
|
+
/**
|
|
250
|
+
* An overload of {@link TreeContextAlpha.(runTransactionAsync:1) | runTransactionAsync } which does not return a value.
|
|
251
|
+
*
|
|
252
|
+
* @privateRemarks
|
|
253
|
+
* TODO: Consider updating these methods to avoid the need for overloads.
|
|
254
|
+
* See {@link TreeViewBeta.runTransactionAsync} for an example of how to do this.
|
|
255
|
+
*/
|
|
241
256
|
runTransactionAsync(
|
|
242
257
|
transaction: () => Promise<void>,
|
|
243
|
-
params?:
|
|
244
|
-
): Promise<
|
|
258
|
+
params?: RunTransactionParamsAlpha,
|
|
259
|
+
): Promise<TransactionVoidResult>;
|
|
245
260
|
|
|
246
261
|
/**
|
|
247
262
|
* True if this context is associated with a {@link TreeBranchAlpha | branch} and false if it is associated with an {@link Unhydrated | unhydrated } node.
|
|
@@ -295,22 +310,26 @@ export interface TreeBranchAlpha extends TreeBranch, TreeContextAlpha {
|
|
|
295
310
|
|
|
296
311
|
/**
|
|
297
312
|
* {@link TreeContextAlpha.(runTransaction:1) | Run a transaction} on a branch of the SharedTree.
|
|
298
|
-
* @param transaction - The function to run as the body of the transaction, which may optionally return a {@link
|
|
313
|
+
* @param transaction - The function to run as the body of the transaction, which may optionally return a {@link TransactionCallbackStatusAlpha | value or rollback signal}.
|
|
299
314
|
* @remarks
|
|
300
315
|
* If the transaction is rolled back, a corresponding {@link TreeBranchEvents.changed | `changed`} event will also be emitted for the rollback.
|
|
301
316
|
*/
|
|
302
317
|
runTransaction<TSuccessValue, TFailureValue>(
|
|
303
|
-
transaction: () =>
|
|
304
|
-
params?:
|
|
305
|
-
):
|
|
318
|
+
transaction: () => TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>,
|
|
319
|
+
params?: RunTransactionParamsAlpha,
|
|
320
|
+
): TransactionValueResult<TSuccessValue, TFailureValue>;
|
|
306
321
|
|
|
307
322
|
/**
|
|
308
323
|
* An overload of {@link TreeBranchAlpha.(runTransaction:1) | runTransaction } which does not return a value.
|
|
324
|
+
*
|
|
325
|
+
* @privateRemarks
|
|
326
|
+
* TODO: Consider updating these methods to avoid the need for overloads.
|
|
327
|
+
* See {@link TreeViewBeta.runTransaction} for an example of how to do this.
|
|
309
328
|
*/
|
|
310
329
|
runTransaction(
|
|
311
|
-
transaction: () =>
|
|
312
|
-
params?:
|
|
313
|
-
):
|
|
330
|
+
transaction: () => VoidTransactionCallbackStatusAlpha | void,
|
|
331
|
+
params?: RunTransactionParamsAlpha,
|
|
332
|
+
): TransactionVoidResult;
|
|
314
333
|
|
|
315
334
|
/**
|
|
316
335
|
* An asynchronous version of {@link TreeBranchAlpha.(runTransaction:1) | runTransaction}.
|
|
@@ -318,17 +337,21 @@ export interface TreeBranchAlpha extends TreeBranch, TreeContextAlpha {
|
|
|
318
337
|
*/
|
|
319
338
|
|
|
320
339
|
runTransactionAsync<TSuccessValue, TFailureValue>(
|
|
321
|
-
transaction: () => Promise<
|
|
322
|
-
params?:
|
|
323
|
-
): Promise<
|
|
340
|
+
transaction: () => Promise<TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>>,
|
|
341
|
+
params?: RunTransactionParamsAlpha,
|
|
342
|
+
): Promise<TransactionValueResult<TSuccessValue, TFailureValue>>;
|
|
324
343
|
|
|
325
344
|
/**
|
|
326
345
|
* An overload of {@link TreeBranchAlpha.(runTransactionAsync:1) | runTransactionAsync } which does not return a value.
|
|
346
|
+
*
|
|
347
|
+
* @privateRemarks
|
|
348
|
+
* TODO: Consider updating these methods to avoid the need for overloads.
|
|
349
|
+
* See {@link TreeViewBeta.runTransactionAsync} for an example of how to do this.
|
|
327
350
|
*/
|
|
328
351
|
runTransactionAsync(
|
|
329
|
-
transaction: () => Promise<
|
|
330
|
-
params?:
|
|
331
|
-
): Promise<
|
|
352
|
+
transaction: () => Promise<VoidTransactionCallbackStatusAlpha | void>,
|
|
353
|
+
params?: RunTransactionParamsAlpha,
|
|
354
|
+
): Promise<TransactionVoidResult>;
|
|
332
355
|
|
|
333
356
|
/**
|
|
334
357
|
* Apply a serialized change to this branch.
|
|
@@ -342,6 +365,17 @@ export interface TreeBranchAlpha extends TreeBranch, TreeContextAlpha {
|
|
|
342
365
|
* Update the tests and docs to match when that is done.
|
|
343
366
|
*/
|
|
344
367
|
applyChange(change: JsonCompatibleReadOnly): void;
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* Determines if there are changes on the given branch that are not present on this branch.
|
|
371
|
+
* @param branch - The branch to compare to.
|
|
372
|
+
*
|
|
373
|
+
* The new edits, if any, can be applied to this branch by {@link TreeBranch.rebaseOnto | rebasing this branch onto the given branch}
|
|
374
|
+
* or by {@link TreeBranch.merge | merging the given branch into this branch}.
|
|
375
|
+
*
|
|
376
|
+
* @throws UsageError if the branches are unrelated.
|
|
377
|
+
*/
|
|
378
|
+
isMissingEditsFrom(branch: TreeBranch): boolean;
|
|
345
379
|
}
|
|
346
380
|
|
|
347
381
|
/**
|
|
@@ -438,13 +472,92 @@ export interface TreeView<in out TSchema extends ImplicitFieldSchema> extends ID
|
|
|
438
472
|
readonly schema: TSchema;
|
|
439
473
|
}
|
|
440
474
|
|
|
475
|
+
/**
|
|
476
|
+
* {@link TreeView} with additional beta APIs.
|
|
477
|
+
* @sealed @beta
|
|
478
|
+
*/
|
|
479
|
+
export interface TreeViewBeta<in out TSchema extends ImplicitFieldSchema>
|
|
480
|
+
extends TreeView<TSchema>,
|
|
481
|
+
TreeBranch {
|
|
482
|
+
// Override the base branch method to return a typed view rather than merely a branch.
|
|
483
|
+
fork(): ReturnType<TreeBranch["fork"]> & TreeViewBeta<TSchema>;
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* Run a synchronous transaction which groups sequential edits to the tree into a single atomic edit if possible.
|
|
487
|
+
*
|
|
488
|
+
* @param transaction - The function to run as the body of the transaction, which may optionally return a {@link TransactionCallbackStatusBeta | value or rollback signal}.
|
|
489
|
+
* It may optionally return a {@link WithValue | value }, which will be returned by the `runTransaction` call.
|
|
490
|
+
*
|
|
491
|
+
* @param params - Optional {@link RunTransactionParamsBeta | parameters} for the transaction.
|
|
492
|
+
*
|
|
493
|
+
* @returns A {@link TransactionValueResult | value } indicating whether or not the transaction succeeded, and containing the value returned by `transaction`.
|
|
494
|
+
*
|
|
495
|
+
* @remarks
|
|
496
|
+
* All of the changes in the transaction are applied synchronously and therefore no other changes from a remote client can be interleaved with those changes.
|
|
497
|
+
* Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.
|
|
498
|
+
*
|
|
499
|
+
* {@link (TreeBeta:interface).on | Change events } will be emitted for changed nodes on this client _as each edit happens_, just as they would be if the changes were made outside of a transaction.
|
|
500
|
+
* Any other/future clients or contexts will process the transaction "squashed", i.e. they will apply its changes all at once, emitting only a single event per node (even if that node was edited multiple times in the transaction).
|
|
501
|
+
* Edits to the tree are not permitted within these event callbacks, therefore no other local changes from this client will be interleaved with the changes in this transaction.
|
|
502
|
+
*
|
|
503
|
+
* Using a transaction has the following additional consequences:
|
|
504
|
+
*
|
|
505
|
+
* - If {@link Revertible | reverted } (e.g. via an "undo" operation), all the changes in the transaction are reverted together.
|
|
506
|
+
* Only the "outermost" transaction commits a change to the synchronized tree state and therefore only the outermost transaction can be reverted.
|
|
507
|
+
* If a transaction is started and completed while another transaction is already in progress, then the inner transaction will be reverted together with the outer transaction.
|
|
508
|
+
* - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.
|
|
509
|
+
*
|
|
510
|
+
* If the transaction is rolled back, a corresponding {@link TreeBranchEvents.changed | `changed`} event will also be emitted for the rollback.
|
|
511
|
+
*/
|
|
512
|
+
runTransaction<
|
|
513
|
+
TOut extends
|
|
514
|
+
| TransactionCallbackStatusBeta<unknown, unknown>
|
|
515
|
+
| VoidTransactionCallbackStatusBeta
|
|
516
|
+
| void,
|
|
517
|
+
>(
|
|
518
|
+
transaction: () => TOut,
|
|
519
|
+
params?: RunTransactionParamsBeta,
|
|
520
|
+
): TOut extends TransactionCallbackStatusBeta<infer TSuccessValue, infer TFailureValue>
|
|
521
|
+
? TransactionValueResult<TSuccessValue, TFailureValue>
|
|
522
|
+
: TransactionVoidResult;
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* An asynchronous version of {@link TreeViewBeta.runTransaction | runTransaction}.
|
|
526
|
+
*
|
|
527
|
+
* @remarks
|
|
528
|
+
* As with synchronous transactions, all of the changes in an asynchronous transaction are treated as a unit.
|
|
529
|
+
* Therefore, no other changes (either from this client or from a remote client) can be interleaved with the transaction changes.
|
|
530
|
+
*
|
|
531
|
+
* Unlike with synchronous transactions, it is possible that other changes (e.g. from a remote client) may be applied to the branch while this transaction is in progress.
|
|
532
|
+
* Those other changes will be not be reflected on the branch until after this transaction completes, at which point the transaction changes will be applied after those other changes.
|
|
533
|
+
*
|
|
534
|
+
* An asynchronous transaction may not be started while any other transaction is in progress in this view.
|
|
535
|
+
*/
|
|
536
|
+
runTransactionAsync<
|
|
537
|
+
TOut extends
|
|
538
|
+
| TransactionCallbackStatusBeta<unknown, unknown>
|
|
539
|
+
| VoidTransactionCallbackStatusBeta
|
|
540
|
+
| void,
|
|
541
|
+
>(
|
|
542
|
+
transaction: () => Promise<TOut>,
|
|
543
|
+
params?: RunTransactionParamsBeta,
|
|
544
|
+
): Promise<
|
|
545
|
+
TOut extends TransactionCallbackStatusBeta<infer TSuccessValue, infer TFailureValue>
|
|
546
|
+
? TransactionValueResult<TSuccessValue, TFailureValue>
|
|
547
|
+
: TransactionVoidResult
|
|
548
|
+
>;
|
|
549
|
+
}
|
|
550
|
+
|
|
441
551
|
/**
|
|
442
552
|
* {@link TreeView} with proposed changes to the schema aware typing to allow use with `UnsafeUnknownSchema`.
|
|
443
553
|
* @sealed @alpha
|
|
444
554
|
*/
|
|
445
555
|
export interface TreeViewAlpha<
|
|
446
556
|
in out TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema,
|
|
447
|
-
> extends Omit<
|
|
557
|
+
> extends Omit<
|
|
558
|
+
TreeViewBeta<ReadSchema<TSchema>>,
|
|
559
|
+
"root" | "initialize" | "fork" | "runTransaction" | "runTransactionAsync"
|
|
560
|
+
>,
|
|
448
561
|
TreeBranchAlpha {
|
|
449
562
|
get root(): ReadableField<TSchema>;
|
|
450
563
|
|
|
@@ -458,23 +571,15 @@ export interface TreeViewAlpha<
|
|
|
458
571
|
fork(): ReturnType<TreeBranch["fork"]> & TreeViewAlpha<TSchema>;
|
|
459
572
|
}
|
|
460
573
|
|
|
461
|
-
/**
|
|
462
|
-
* {@link TreeView} with additional beta APIs.
|
|
463
|
-
* @sealed @beta
|
|
464
|
-
*/
|
|
465
|
-
export interface TreeViewBeta<in out TSchema extends ImplicitFieldSchema>
|
|
466
|
-
extends TreeView<TSchema>,
|
|
467
|
-
TreeBranch {
|
|
468
|
-
// Override the base branch method to return a typed view rather than merely a branch.
|
|
469
|
-
fork(): ReturnType<TreeBranch["fork"]> & TreeViewBeta<TSchema>;
|
|
470
|
-
}
|
|
471
|
-
|
|
472
574
|
/**
|
|
473
575
|
* Information about a view schema's compatibility with the document's stored schema.
|
|
474
576
|
*
|
|
577
|
+
* @see
|
|
475
578
|
* See SharedTree's README for more information about choosing a compatibility policy.
|
|
579
|
+
*
|
|
476
580
|
* @privateRemarks
|
|
477
581
|
* See {@link SchemaCompatibilityTester} for the implementation of this compatibility checking.
|
|
582
|
+
*
|
|
478
583
|
* @sealed @public
|
|
479
584
|
*/
|
|
480
585
|
export interface SchemaCompatibilityStatus {
|
|
@@ -37,6 +37,8 @@ import type { InsertableField, UnsafeUnknownSchema } from "../unsafeUnknownSchem
|
|
|
37
37
|
import { conciseFromCursor, type ConciseTree } from "./conciseTree.js";
|
|
38
38
|
import { createFromCursor } from "./create.js";
|
|
39
39
|
import type { TreeEncodingOptions } from "./customTree.js";
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- Used by docs
|
|
41
|
+
import type { ObjectSchemaOptions } from "./schemaFactory.js";
|
|
40
42
|
import type { TreeChangeEvents } from "./treeChangeEvents.js";
|
|
41
43
|
import { treeNodeApi } from "./treeNodeApi.js";
|
|
42
44
|
import { cursorFromVerbose } from "./verboseTree.js";
|
|
@@ -290,18 +290,18 @@ export interface TreeNodeSchemaCore<
|
|
|
290
290
|
readonly implicitlyConstructable: ImplicitlyConstructable;
|
|
291
291
|
|
|
292
292
|
/**
|
|
293
|
-
* All possible
|
|
293
|
+
* All possible schemas that a direct child of a node with this schema could have.
|
|
294
294
|
*
|
|
295
|
-
* Equivalently, this is also all
|
|
296
|
-
* which is also the same as the set of
|
|
295
|
+
* Equivalently, this is also all schemas directly referenced when defining this schema's allowed child types,
|
|
296
|
+
* which is also the same as the set of schemas referenced directly by the `Info` type parameter and the `info` property.
|
|
297
297
|
* This property is simply re-exposing that information in an easier to traverse format consistent across all node kinds.
|
|
298
298
|
* @remarks
|
|
299
299
|
* Some kinds of nodes may have additional restrictions on children:
|
|
300
|
-
* this set simply enumerates all directly referenced
|
|
300
|
+
* this set simply enumerates all directly referenced schemas, and can be use to walk over all referenced schema types.
|
|
301
301
|
*
|
|
302
|
-
* This set cannot be used before the
|
|
303
|
-
* more specifically, when using lazy schema references (for example to make foreword references to
|
|
304
|
-
* users must wait until after the
|
|
302
|
+
* This set cannot be used before the schemas in it have been defined:
|
|
303
|
+
* more specifically, when using lazy schema references (for example to make foreword references to schemas which have not yet been defined),
|
|
304
|
+
* users must wait until after the schemas are defined to access this set.
|
|
305
305
|
* @privateRemarks
|
|
306
306
|
* Currently there isn't much use for this in the public API,
|
|
307
307
|
* and it's possible this will want to be tweaked or renamed as part of a larger schema reflection API surface that might be added later.
|
package/src/simple-tree/index.ts
CHANGED
|
@@ -175,17 +175,21 @@ export {
|
|
|
175
175
|
tryStoredSchemaAsArray,
|
|
176
176
|
type SchemaStatics,
|
|
177
177
|
type ITreeAlpha,
|
|
178
|
+
type NoChangeConstraint,
|
|
179
|
+
type NodeInDocumentConstraint,
|
|
180
|
+
type RunTransactionParamsAlpha,
|
|
181
|
+
type RunTransactionParamsBeta,
|
|
182
|
+
type TransactionCallbackStatusAlpha,
|
|
183
|
+
type TransactionCallbackStatusBeta,
|
|
178
184
|
type TransactionConstraint,
|
|
179
185
|
type TransactionConstraintAlpha,
|
|
180
|
-
type
|
|
181
|
-
type NoChangeConstraint,
|
|
182
|
-
type RunTransactionParams,
|
|
183
|
-
type VoidTransactionCallbackStatus,
|
|
184
|
-
type TransactionCallbackStatus,
|
|
185
|
-
type TransactionResult,
|
|
186
|
-
type TransactionResultExt,
|
|
187
|
-
type TransactionResultSuccess,
|
|
186
|
+
type TransactionPostProcessor,
|
|
188
187
|
type TransactionResultFailed,
|
|
188
|
+
type TransactionResultSuccess,
|
|
189
|
+
type TransactionValueResult,
|
|
190
|
+
type TransactionVoidResult,
|
|
191
|
+
type VoidTransactionCallbackStatusAlpha,
|
|
192
|
+
type VoidTransactionCallbackStatusBeta,
|
|
189
193
|
rollback,
|
|
190
194
|
generateSchemaFromSimpleSchema,
|
|
191
195
|
replaceConciseTreeHandles,
|