@fluidframework/tree 2.110.0 → 2.112.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 +193 -0
- package/api-report/tree.alpha.api.md +96 -36
- package/api-report/tree.beta.api.md +39 -1
- package/api-report/tree.legacy.beta.api.md +39 -1
- package/api-report/tree.legacy.public.api.md +1 -1
- package/api-report/tree.public.api.md +1 -1
- package/dist/componentApi.d.ts +198 -0
- package/dist/componentApi.d.ts.map +1 -0
- package/dist/componentApi.js +138 -0
- package/dist/componentApi.js.map +1 -0
- 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.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/entrypoints/alpha.d.ts +1 -1
- package/dist/entrypoints/alpha.d.ts.map +1 -1
- package/dist/entrypoints/alpha.js +4 -2
- 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/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/codec/chunkDecoding.d.ts +1 -20
- 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/chunkDecodingGeneric.d.ts +1 -2
- 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/codec/codecs.d.ts +73 -28
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +76 -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/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/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/index.d.ts +3 -3
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +4 -2
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/index.d.ts +1 -0
- package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/index.js +3 -1
- package/dist/feature-libraries/modular-schema/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/minimizeModularChange.d.ts +25 -0
- package/dist/feature-libraries/modular-schema/minimizeModularChange.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/minimizeModularChange.js +29 -0
- package/dist/feature-libraries/modular-schema/minimizeModularChange.js.map +1 -0
- 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/schemaChecker.d.ts +22 -3
- package/dist/feature-libraries/schemaChecker.d.ts.map +1 -1
- package/dist/feature-libraries/schemaChecker.js +48 -5
- package/dist/feature-libraries/schemaChecker.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- 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 +17 -4
- package/dist/shared-tree/independentView.d.ts.map +1 -1
- package/dist/shared-tree/independentView.js +15 -12
- package/dist/shared-tree/independentView.js.map +1 -1
- package/dist/shared-tree/index.d.ts +3 -2
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js +3 -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 +6 -3
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/serializedChange.d.ts +41 -0
- package/dist/shared-tree/serializedChange.d.ts.map +1 -0
- package/dist/shared-tree/serializedChange.js +87 -0
- package/dist/shared-tree/serializedChange.js.map +1 -0
- package/dist/shared-tree/sharedTree.d.ts +18 -0
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +9 -4
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts +7 -0
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js +8 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/transactionMinimize.d.ts +35 -0
- package/dist/shared-tree/transactionMinimize.d.ts.map +1 -0
- package/dist/shared-tree/transactionMinimize.js +65 -0
- package/dist/shared-tree/transactionMinimize.js.map +1 -0
- 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 +19 -13
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +54 -71
- 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/editManager.d.ts +6 -3
- package/dist/shared-tree-core/editManager.d.ts.map +1 -1
- package/dist/shared-tree-core/editManager.js +35 -14
- package/dist/shared-tree-core/editManager.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.d.ts +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts +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.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.js +8 -2
- package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/messageFormat.d.ts +1 -1
- package/dist/shared-tree-core/messageFormat.js +1 -1
- package/dist/shared-tree-core/messageFormat.js.map +1 -1
- package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts +10 -1
- package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormatVSharedBranches.js +1 -0
- package/dist/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/messageTypes.d.ts +1 -0
- package/dist/shared-tree-core/messageTypes.d.ts.map +1 -1
- package/dist/shared-tree-core/messageTypes.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts +9 -3
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +27 -12
- 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 +88 -7
- package/dist/shared-tree-core/transaction.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +2 -2
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +2 -2
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +9 -24
- package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.js +31 -44
- package/dist/simple-tree/api/schemaCompatibilityTester.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/schemaFactoryAlpha.d.ts +56 -15
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryBeta.d.ts +0 -3
- package/dist/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +2 -2
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js +3 -4
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/storedSchema.js +1 -2
- package/dist/simple-tree/api/storedSchema.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 +108 -24
- 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/api/typesUnsafe.d.ts +2 -2
- package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.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/index.d.ts +1 -1
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +2 -2
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +83 -4
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js +39 -0
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/simpleSchemaFormatV1.js +1 -1
- package/dist/simple-tree/simpleSchemaFormatV1.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/treeFactory.js +1 -1
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/breakable.d.ts +16 -1
- package/dist/util/breakable.d.ts.map +1 -1
- package/dist/util/breakable.js +9 -1
- package/dist/util/breakable.js.map +1 -1
- package/dist/util/compressedIds.d.ts +185 -0
- package/dist/util/compressedIds.d.ts.map +1 -0
- package/dist/util/compressedIds.js +164 -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 +10 -2
- package/dist/util/index.js.map +1 -1
- package/dist/util/nestedMap.d.ts.map +1 -1
- package/dist/util/nestedMap.js +16 -3
- package/dist/util/nestedMap.js.map +1 -1
- package/dist/util/nestedSet.d.ts +1 -1
- package/dist/util/nestedSet.d.ts.map +1 -1
- package/dist/util/nestedSet.js.map +1 -1
- package/dist/util/utils.d.ts +0 -6
- package/dist/util/utils.d.ts.map +1 -1
- package/dist/util/utils.js +1 -15
- package/dist/util/utils.js.map +1 -1
- package/lib/componentApi.d.ts +198 -0
- package/lib/componentApi.d.ts.map +1 -0
- package/lib/componentApi.js +135 -0
- package/lib/componentApi.js.map +1 -0
- 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/entrypoints/alpha.d.ts +1 -1
- package/lib/entrypoints/alpha.d.ts.map +1 -1
- package/lib/entrypoints/alpha.js +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/codec/chunkDecoding.d.ts +1 -20
- 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/chunkDecodingGeneric.d.ts +1 -2
- 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/codec/codecs.d.ts +73 -28
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +75 -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/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 +3 -3
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +2 -2
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/index.d.ts +1 -0
- package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/index.js +1 -0
- package/lib/feature-libraries/modular-schema/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts +25 -0
- package/lib/feature-libraries/modular-schema/minimizeModularChange.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/minimizeModularChange.js +25 -0
- package/lib/feature-libraries/modular-schema/minimizeModularChange.js.map +1 -0
- 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/schemaChecker.d.ts +22 -3
- package/lib/feature-libraries/schemaChecker.d.ts.map +1 -1
- package/lib/feature-libraries/schemaChecker.js +48 -5
- package/lib/feature-libraries/schemaChecker.js.map +1 -1
- package/lib/index.d.ts +4 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -2
- 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 +17 -4
- package/lib/shared-tree/independentView.d.ts.map +1 -1
- package/lib/shared-tree/independentView.js +13 -10
- package/lib/shared-tree/independentView.js.map +1 -1
- package/lib/shared-tree/index.d.ts +3 -2
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js +1 -0
- 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 +7 -4
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/serializedChange.d.ts +41 -0
- package/lib/shared-tree/serializedChange.d.ts.map +1 -0
- package/lib/shared-tree/serializedChange.js +84 -0
- package/lib/shared-tree/serializedChange.js.map +1 -0
- package/lib/shared-tree/sharedTree.d.ts +18 -0
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +10 -5
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts +7 -0
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js +7 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/transactionMinimize.d.ts +35 -0
- package/lib/shared-tree/transactionMinimize.d.ts.map +1 -0
- package/lib/shared-tree/transactionMinimize.js +62 -0
- package/lib/shared-tree/transactionMinimize.js.map +1 -0
- 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 +19 -13
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +36 -53
- 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/editManager.d.ts +6 -3
- package/lib/shared-tree-core/editManager.d.ts.map +1 -1
- package/lib/shared-tree-core/editManager.js +36 -15
- package/lib/shared-tree-core/editManager.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/editManagerFormatCommons.d.ts +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.js +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts +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/messageCodecVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecVSharedBranches.js +8 -2
- package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/messageFormat.d.ts +1 -1
- package/lib/shared-tree-core/messageFormat.js +1 -1
- package/lib/shared-tree-core/messageFormat.js.map +1 -1
- package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts +10 -1
- package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormatVSharedBranches.js +1 -0
- package/lib/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/messageTypes.d.ts +1 -0
- package/lib/shared-tree-core/messageTypes.d.ts.map +1 -1
- package/lib/shared-tree-core/messageTypes.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts +9 -3
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +28 -13
- 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 +87 -6
- package/lib/shared-tree-core/transaction.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +2 -2
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +1 -1
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +9 -24
- package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.js +29 -42
- package/lib/simple-tree/api/schemaCompatibilityTester.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/schemaFactoryAlpha.d.ts +56 -15
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryBeta.d.ts +0 -3
- package/lib/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +2 -2
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js +4 -5
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/storedSchema.js +2 -3
- package/lib/simple-tree/api/storedSchema.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 +108 -24
- 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/api/typesUnsafe.d.ts +2 -2
- package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.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/index.d.ts +1 -1
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +1 -1
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +83 -4
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js +39 -0
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/simpleSchemaFormatV1.js +1 -1
- package/lib/simple-tree/simpleSchemaFormatV1.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/treeFactory.js +1 -1
- package/lib/treeFactory.js.map +1 -1
- package/lib/util/breakable.d.ts +16 -1
- package/lib/util/breakable.d.ts.map +1 -1
- package/lib/util/breakable.js +9 -1
- package/lib/util/breakable.js.map +1 -1
- package/lib/util/compressedIds.d.ts +185 -0
- package/lib/util/compressedIds.d.ts.map +1 -0
- package/lib/util/compressedIds.js +154 -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/nestedMap.d.ts.map +1 -1
- package/lib/util/nestedMap.js +17 -4
- package/lib/util/nestedMap.js.map +1 -1
- package/lib/util/nestedSet.d.ts +1 -1
- package/lib/util/nestedSet.d.ts.map +1 -1
- package/lib/util/nestedSet.js.map +1 -1
- package/lib/util/utils.d.ts +0 -6
- package/lib/util/utils.d.ts.map +1 -1
- package/lib/util/utils.js +0 -13
- package/lib/util/utils.js.map +1 -1
- package/package.json +23 -23
- package/src/componentApi.ts +354 -0
- 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 +15 -8
- package/src/entrypoints/beta.ts +8 -0
- package/src/entrypoints/legacy.ts +8 -0
- package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +22 -72
- package/src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts +1 -2
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +110 -41
- 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 +5 -0
- package/src/feature-libraries/modular-schema/index.ts +1 -0
- package/src/feature-libraries/modular-schema/minimizeModularChange.ts +33 -0
- package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +13 -9
- package/src/feature-libraries/schemaChecker.ts +86 -9
- package/src/index.ts +16 -8
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/independentView.ts +40 -15
- package/src/shared-tree/index.ts +4 -0
- package/src/shared-tree/schematizingTreeView.ts +40 -30
- package/src/shared-tree/serializedChange.ts +127 -0
- package/src/shared-tree/sharedTree.ts +32 -4
- package/src/shared-tree/sharedTreeChangeFamily.ts +7 -1
- package/src/shared-tree/transactionMinimize.ts +74 -0
- package/src/shared-tree/transactionPostProcessor.ts +40 -0
- package/src/shared-tree/treeAlpha.ts +3 -3
- package/src/shared-tree/treeCheckout.ts +103 -101
- package/src/shared-tree/unhydratedTreeContext.ts +18 -15
- package/src/shared-tree-core/editManager.ts +42 -6
- 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/editManagerFormatCommons.ts +1 -1
- package/src/shared-tree-core/editManagerSummarizer.ts +5 -9
- package/src/shared-tree-core/index.ts +8 -5
- package/src/shared-tree-core/messageCodecVSharedBranches.ts +8 -1
- package/src/shared-tree-core/messageFormat.ts +1 -1
- package/src/shared-tree-core/messageFormatVSharedBranches.ts +10 -0
- package/src/shared-tree-core/messageTypes.ts +1 -0
- package/src/shared-tree-core/sharedTreeCore.ts +36 -12
- package/src/shared-tree-core/transaction.ts +165 -18
- package/src/simple-tree/api/index.ts +14 -10
- package/src/simple-tree/api/schemaCompatibilityTester.ts +36 -48
- package/src/simple-tree/api/schemaCreationUtilities.ts +3 -3
- package/src/simple-tree/api/schemaFactory.ts +2 -2
- package/src/simple-tree/api/schemaFactoryAlpha.ts +56 -15
- package/src/simple-tree/api/schemaFactoryBeta.ts +0 -3
- package/src/simple-tree/api/snapshotCompatibilityChecker.ts +4 -5
- package/src/simple-tree/api/storedSchema.ts +2 -3
- package/src/simple-tree/api/transactionTypes.ts +111 -39
- package/src/simple-tree/api/tree.ts +165 -49
- package/src/simple-tree/api/treeBeta.ts +2 -0
- package/src/simple-tree/api/typesUnsafe.ts +2 -1
- package/src/simple-tree/core/treeNodeSchema.ts +7 -7
- package/src/simple-tree/index.ts +13 -9
- package/src/simple-tree/node-kinds/array/arrayNode.ts +168 -4
- package/src/simple-tree/simpleSchemaFormatV1.ts +1 -1
- package/src/text/index.ts +1 -0
- package/src/text/textDomainFormatted.ts +520 -415
- package/src/text/textDomainFormattedDefault.ts +150 -0
- package/src/treeFactory.ts +1 -1
- package/src/util/breakable.ts +8 -1
- package/src/util/compressedIds.ts +304 -0
- package/src/util/index.ts +18 -1
- package/src/util/nestedMap.ts +21 -4
- package/src/util/nestedSet.ts +1 -1
- package/src/util/utils.ts +0 -18
package/.vscode/settings.json
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,198 @@
|
|
|
1
1
|
# @fluidframework/tree
|
|
2
2
|
|
|
3
|
+
## 2.112.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Add Component utilities for composing open-polymorphic schema ([#27628](https://github.com/microsoft/FluidFramework/pull/27628)) [7a56d096bf](https://github.com/microsoft/FluidFramework/commit/7a56d096bffab133ab4e7ab9c8f9c465b7ba9e81)
|
|
8
|
+
|
|
9
|
+
A new `@alpha` `Component` namespace is now exported from `@fluidframework/tree` (and re-exported from `fluid-framework`). It provides utilities for composing independently authored application "components" that contribute to a shared configuration, which is useful for implementing ["open polymorphism"](<https://en.wikipedia.org/wiki/Polymorphism_(computer_science)>) schema patterns where the set of allowed types for a field or collection can be extended by separate libraries.
|
|
10
|
+
|
|
11
|
+
Each component is expressed as a `Component.Factory`: a function which receives a lazy reference to the composed configuration and returns the content that component contributes. Because the configuration is provided lazily, components may reference (including recursively) types contributed by other components. `Component.compose` combines a set of components into a `Component.Composed`, from which the aggregated configuration and per-component content can be read.
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
/** Example application component content type. */
|
|
15
|
+
interface MyAppComponentContent {
|
|
16
|
+
/**
|
|
17
|
+
* Item types contributed by this component.
|
|
18
|
+
* We are just typing them as TreeNodeSchema here to keep things simple.
|
|
19
|
+
* Real use would often provide some static factory to be able to create instances, as well as some APIs all item nodes should implement.
|
|
20
|
+
*/
|
|
21
|
+
readonly items: Component.LazyArray<TreeNodeSchema>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
type MyAppComponent = Component.Factory<MyAppComponentContent>;
|
|
25
|
+
|
|
26
|
+
// A simple component, which does not depend on any other context.
|
|
27
|
+
const textComponent: MyAppComponent = () => ({
|
|
28
|
+
items: () => [() => TextItem],
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
// A component which creates an item type which recursively depends on all item types.
|
|
32
|
+
const containerComponent: MyAppComponent = (config) => ({
|
|
33
|
+
items: () => [
|
|
34
|
+
() =>
|
|
35
|
+
class extends sf.array("Container", config().getComposed("items")) {},
|
|
36
|
+
],
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
const appConfig = Component.compose([containerComponent, textComponent]);
|
|
40
|
+
|
|
41
|
+
// The config's items can now be used to create a TreeViewConfiguration, root schema, or whatever else is needed.
|
|
42
|
+
class Root extends sf.object("Root", {
|
|
43
|
+
content: appConfig.getComposed("items"),
|
|
44
|
+
}) {}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
See the worked examples in [openPolymorphism.integration.ts](https://github.com/microsoft/FluidFramework/blob/main/packages/dds/tree/src/test/openPolymorphism.integration.ts) for end-to-end usage with SharedTree schema.
|
|
48
|
+
|
|
49
|
+
- Independent tree views now accept an optional telemetry logger ([#27567](https://github.com/microsoft/FluidFramework/pull/27567)) [5fbbcab0af](https://github.com/microsoft/FluidFramework/commit/5fbbcab0aff87519ae6f112611f0c1e62f30d97e)
|
|
50
|
+
|
|
51
|
+
The alpha `independentView`, `independentInitializedView`, and `createIndependentTreeAlpha` APIs now accept an optional `logger` on their options.
|
|
52
|
+
Previously these standalone (non-`SharedTree`) views had no way to surface telemetry,
|
|
53
|
+
so internal events—including those emitted when the tree enters a broken state—were dropped.
|
|
54
|
+
Passing a logger forwards those events to the caller's telemetry pipeline.
|
|
55
|
+
This makes it possible to diagnose failures in scenarios that use independent tree views, such as snapshot import/export, schema migration, and other out-of-container workflows.
|
|
56
|
+
|
|
57
|
+
Events emitted by an independent tree view are tagged with the `independentView` namespace.
|
|
58
|
+
If no logger is provided, behavior is unchanged and telemetry events continue to be dropped.
|
|
59
|
+
|
|
60
|
+
The `logger` option is typed as `ITelemetryBaseLogger` from `@fluidframework/core-interfaces`,
|
|
61
|
+
so any standard Fluid telemetry logger can be passed directly.
|
|
62
|
+
|
|
63
|
+
```typescript
|
|
64
|
+
// ...
|
|
65
|
+
const view = independentView(
|
|
66
|
+
new TreeViewConfiguration({ schema: MySchema }),
|
|
67
|
+
{
|
|
68
|
+
logger: myTelemetryLogger,
|
|
69
|
+
},
|
|
70
|
+
);
|
|
71
|
+
// ...
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
- Shared branch names ([#27708](https://github.com/microsoft/FluidFramework/pull/27708)) [1f08b9210b](https://github.com/microsoft/FluidFramework/commit/1f08b9210bf7ba3adbc98c45b02ab8a6a58929f5)
|
|
75
|
+
|
|
76
|
+
The existing [`createSharedBranch`](https://fluidframework.com/docs/api/tree/itreealpha-interface#createsharedbranch-methodsignature) alpha API now takes an optional `name` string parameter that is associated with the shared branch.
|
|
77
|
+
This name can be retrieved by passing the shared branch ID to `getSharedBranchName`.
|
|
78
|
+
|
|
79
|
+
Note that, unlike the shared branch IDs, shared branch names are not guaranteed to be unique.
|
|
80
|
+
|
|
81
|
+
#### Compatibility Implications
|
|
82
|
+
|
|
83
|
+
This change breaks compatibility in the following ways:
|
|
84
|
+
- A document written by a client running an earlier FF version cannot be opened by a client running this version.
|
|
85
|
+
- A document written by a client running this version cannot be opened by a client running an earlier FF version.
|
|
86
|
+
- Clients running earlier FF versions will crash upon receiving ops from clients running this version.
|
|
87
|
+
- Clients running this version will crash upon receiving ops from clients running earlier FF versions.
|
|
88
|
+
|
|
89
|
+
These breaks are only applicable for clients with `enableSharedBranches` turned on. Other clients are unaffected.
|
|
90
|
+
|
|
91
|
+
- Add at, pop, shift, unshift, findLast, and findLastIndex methods to TreeArrayNodeAlpha ([#27686](https://github.com/microsoft/FluidFramework/pull/27686)) [59669008b9](https://github.com/microsoft/FluidFramework/commit/59669008b9f9f70ccb94030a6382afcdf8f28cd4)
|
|
92
|
+
|
|
93
|
+
`TreeArrayNodeAlpha` now has `at`, `pop`, `shift`, `unshift`, `findLast`, and `findLastIndex` methods, further aligning it with JavaScript's built-in Array API:
|
|
94
|
+
- `at(index)` `at` was already implemented at runtime, and consumers compiling with `lib: ES2022` or later could already see it through the inherited `ReadonlyArray` typings. This change adds no new runtime behavior, but makes `at` an explicitly declared, documented part of the API, independent of the consumer's TypeScript `lib` configuration.
|
|
95
|
+
- `unshift(...items)` is an alias for `insertAtStart`, mirroring how `push` aliases `insertAtEnd`: it inserts new item(s) at the start of the array. Unlike `Array.prototype.unshift`, it does not return the new length of the array.
|
|
96
|
+
- `pop()` removes and returns the last item in the array, or returns `undefined` (without modifying the array) if it is empty.
|
|
97
|
+
- `shift()` removes and returns the first item in the array, or returns `undefined` (without modifying the array) if it is empty.
|
|
98
|
+
- `findLast(predicate, thisArg?)` and `findLastIndex(predicate, thisArg?)` search the array from the last item to the first, returning the last matching item (or `undefined`) and its index (or `-1`) respectively, like their `Array.prototype` equivalents. As with `Array.prototype.findLast`, passing a type guard as the `findLast` predicate narrows the returned item's type.
|
|
99
|
+
|
|
100
|
+
These methods are available on `TreeArrayNodeAlpha`, which can be obtained from an existing `TreeArrayNode` via `asAlpha`, or by declaring the schema with `SchemaFactoryAlpha`'s `arrayAlpha`.
|
|
101
|
+
|
|
102
|
+
#### Usage
|
|
103
|
+
|
|
104
|
+
```typescript
|
|
105
|
+
import { SchemaFactory, asAlpha } from "@fluidframework/tree/alpha";
|
|
106
|
+
|
|
107
|
+
const sf = new SchemaFactory("example");
|
|
108
|
+
const Inventory = sf.array("Inventory", sf.string);
|
|
109
|
+
const inventory = asAlpha(new Inventory(["Apples", "Bananas", "Pears"]));
|
|
110
|
+
|
|
111
|
+
// inventory: ["Apples", "Bananas", "Pears"]
|
|
112
|
+
inventory.unshift("Oranges", "Grapes");
|
|
113
|
+
// inventory: ["Oranges", "Grapes", "Apples", "Bananas", "Pears"]
|
|
114
|
+
|
|
115
|
+
inventory.at(0); // "Oranges"
|
|
116
|
+
inventory.at(-1); // "Pears"
|
|
117
|
+
inventory.at(10); // undefined
|
|
118
|
+
|
|
119
|
+
inventory.findLast((item) => item.startsWith("G")); // "Grapes"
|
|
120
|
+
inventory.findLastIndex((item) => item.startsWith("G")); // 1
|
|
121
|
+
|
|
122
|
+
// inventory: ["Oranges", "Grapes", "Apples", "Bananas", "Pears"]
|
|
123
|
+
inventory.pop(); // "Pears"
|
|
124
|
+
// inventory ["Oranges", "Grapes", "Apples", "Bananas"]
|
|
125
|
+
|
|
126
|
+
inventory.shift(); // "Oranges"
|
|
127
|
+
// inventory: ["Grapes", "Apples", "Bananas"]
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
- Retain history option ([#27696](https://github.com/microsoft/FluidFramework/pull/27696)) [2fa44c6ed2](https://github.com/microsoft/FluidFramework/commit/2fa44c6ed222a8ed88a632a0bf3cad0c26e72514)
|
|
131
|
+
|
|
132
|
+
Adds a new `retainHistory` flag to [`SharedTreeOptions`](https://fluidframework.com/docs/api/tree/sharedtreeoptions-interface) (defaults to `false`).
|
|
133
|
+
Setting `retainHistory` to `true` will prevent SharedTree from garbage-collecting historical data about old changes.
|
|
134
|
+
Note that this will cause unbounded growth both in memory on the client and in summaries/snapshots (the at-rest data representing a Fluid document).
|
|
135
|
+
For these reasons, this option is only intended for debugging and experimentation.
|
|
136
|
+
|
|
137
|
+
### Patch Changes
|
|
138
|
+
|
|
139
|
+
- Fix insertable types when using typesRecursive with multiple allowed types ([#27698](https://github.com/microsoft/FluidFramework/pull/27698)) [b72f836d09](https://github.com/microsoft/FluidFramework/commit/b72f836d09437654e0ef5787625073f9da41cf9f)
|
|
140
|
+
|
|
141
|
+
The allowed types produced by `SchemaFactoryBeta.typesRecursive` (and `SchemaFactoryAlpha.typesRecursive`) are now processed correctly when used in a recursive schema that permits more than one type.
|
|
142
|
+
|
|
143
|
+
Previously, passing their output to a recursive schema (for example `factory.arrayRecursive` or `factory.mapRecursive`) computed the node's insertable content type as `never`.
|
|
144
|
+
This caused valid insertions to fail to compile.
|
|
145
|
+
Recursive schemas built from a `typesRecursive` list with two or more types now accept insertable content for each of the allowed types as expected.
|
|
146
|
+
Recursive schemas that use a single type were unaffected.
|
|
147
|
+
|
|
148
|
+
## 2.111.0
|
|
149
|
+
|
|
150
|
+
### Minor Changes
|
|
151
|
+
|
|
152
|
+
- Add an opt-in postProcessor option when running a transaction ([#27610](https://github.com/microsoft/FluidFramework/pull/27610)) [ee981100f3f](https://github.com/microsoft/FluidFramework/commit/ee981100f3fa5fb9b5ea26b9ef62efa7e0691b69)
|
|
153
|
+
|
|
154
|
+
`RunTransactionParams` now accepts an optional `postProcessor` (used by `runTransaction` and `runTransactionAsync`). When supplied, the edits made during the transaction are post-processed when the transaction is committed, transforming the resulting squashed change. For example, post-processing could be used to "minimize" the change so that it contains no extraneous information. Such extraneous information includes data for nodes that were both created and removed within the transaction, or changes whose effects cancel out to nothing.
|
|
155
|
+
|
|
156
|
+
`postProcessor` is a type-erased handle (`TransactionPostProcessor`) whose concrete representation is an implementation detail of `@fluidframework/tree`. It is opt-in: when it is omitted the existing behavior is preserved.
|
|
157
|
+
|
|
158
|
+
Note: minimization is the first intended implementation and use of post-processing, but it is not yet available.
|
|
159
|
+
|
|
160
|
+
- TreeView transaction APIs have been promoted to beta ([#27592](https://github.com/microsoft/FluidFramework/pull/27592)) [1ed11dbeddd](https://github.com/microsoft/FluidFramework/commit/1ed11dbeddd98fd0b788aad6f74b6d480249ce28)
|
|
161
|
+
|
|
162
|
+
The [TreeViewBeta](https://fluidframework.com/docs/api/fluid-framework/treeviewbeta-interface) interface exposes `runTransaction` and `runTransactionAsync` methods.
|
|
163
|
+
|
|
164
|
+
The [asBeta](https://fluidframework.com/docs/api/fluid-framework/#asbeta-function) helper function can be used to down-cast a `TreeView` to a `TreeViewBeta`.
|
|
165
|
+
|
|
166
|
+
```typescript
|
|
167
|
+
import { asBeta } from "fluid-framework/beta";
|
|
168
|
+
// ...
|
|
169
|
+
const view = asBeta(tree.viewWith(config));
|
|
170
|
+
const result = view.runTransaction(() => {
|
|
171
|
+
// ... make edits to the tree ...
|
|
172
|
+
});
|
|
173
|
+
if (result.success === false) {
|
|
174
|
+
// ... handle the failed transaction ...
|
|
175
|
+
}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
> [!IMPORTANT]
|
|
179
|
+
> Transaction constraints are not yet available as a part of the beta transaction APIs.
|
|
180
|
+
> These capabilities can still be accessed via the updated alpha APIs.
|
|
181
|
+
|
|
182
|
+
**Type Name Changes**
|
|
183
|
+
|
|
184
|
+
With the introduction of new beta types, existing alpha types have been replaced with new alpha and beta variants.
|
|
185
|
+
|
|
186
|
+
| Old | New Alpha | New Beta |
|
|
187
|
+
| ------------------------------- | ------------------------------------ | ----------------------------------- |
|
|
188
|
+
| `RunTransactionParams` | `RunTransactionParamsAlpha` | `RunTransactionParamsBeta` |
|
|
189
|
+
| `TransactionCallbackStatus` | `TransactionCallbackStatusAlpha` | `TransactionCallbackStatusBeta` |
|
|
190
|
+
| `VoidTransactionCallbackStatus` | `VoidTransactionCallbackStatusAlpha` | `VoidTransactionCallbackStatusBeta` |
|
|
191
|
+
|
|
192
|
+
**Other Renames**
|
|
193
|
+
- `TransactionResult` (alpha) -> `TransactionVoidResult` (beta)
|
|
194
|
+
- `TransactionResultExt` (alpha) -> `TransactionValueResult` (beta)
|
|
195
|
+
|
|
3
196
|
## 2.110.0
|
|
4
197
|
|
|
5
198
|
### Minor Changes
|
|
@@ -218,6 +218,31 @@ export interface CommitMetadata {
|
|
|
218
218
|
// @alpha
|
|
219
219
|
export function comparePersistedSchema(persisted: JsonCompatible, view: ImplicitFieldSchema, options: ICodecOptions): Omit<SchemaCompatibilityStatus, "canInitialize">;
|
|
220
220
|
|
|
221
|
+
// @alpha
|
|
222
|
+
export namespace Component {
|
|
223
|
+
export function compose<TComponent>(allComponents: readonly Factory<TComponent>[]): Composed<TComponent>;
|
|
224
|
+
export function compose<TComponent, TConfig>(allComponents: readonly Factory<TComponent, TConfig>[], lazyConfiguration: (composed: Composed<TComponent, TConfig>) => TConfig): Composed<TComponent, TConfig>;
|
|
225
|
+
const memoize: <T>(factory: () => T) => (() => T);
|
|
226
|
+
// @sealed
|
|
227
|
+
export interface Composed<TComponent, TConfig = ComposedDefault<TComponent>> {
|
|
228
|
+
readonly components: readonly TComponent[];
|
|
229
|
+
readonly config: TConfig;
|
|
230
|
+
getComponent<TFactory extends Factory<TComponent, TConfig>>(factory: TFactory): ReturnType<TFactory>;
|
|
231
|
+
getComposed<TKey extends keyof {
|
|
232
|
+
[Property in keyof TComponent as TComponent[Property] extends LazyArray<unknown> | undefined ? Property : never]: boolean;
|
|
233
|
+
}>(property: TKey): readonly (Exclude<TComponent[TKey], undefined> extends LazyArray<infer U> ? () => U : never)[];
|
|
234
|
+
getConfigured<TConfigurable extends Configurable<TConfig, unknown, TComponent>>(configurable: TConfigurable): ReturnType<TConfigurable["configure"]>;
|
|
235
|
+
}
|
|
236
|
+
// @sealed
|
|
237
|
+
export type ComposedDefault<TComponent> = Composed<TComponent, ComposedDefault<TComponent>>;
|
|
238
|
+
export interface Configurable<TConfigPartial, out TResult, TComponent> {
|
|
239
|
+
configure(config: TConfigPartial, components: Composed<TComponent, TConfigPartial>): TResult;
|
|
240
|
+
}
|
|
241
|
+
// @input
|
|
242
|
+
export type Factory<TComponent, TConfig = ComposedDefault<TComponent>> = (lazyConfiguration: () => TConfig) => TComponent;
|
|
243
|
+
export type LazyArray<T> = () => readonly (() => T)[];
|
|
244
|
+
}
|
|
245
|
+
|
|
221
246
|
// @beta
|
|
222
247
|
export type ConciseTree<THandle = IFluidHandle> = Exclude<TreeLeafValue, IFluidHandle> | THandle | ConciseTree<THandle>[] | {
|
|
223
248
|
[key: string]: ConciseTree<THandle>;
|
|
@@ -242,7 +267,7 @@ export function createIdentifierIndex<TSchema extends ImplicitFieldSchema>(view:
|
|
|
242
267
|
export function createIndependentTreeAlpha<const TSchema extends ImplicitFieldSchema>(options?: CreateIndependentTreeAlphaOptions): ViewableTree & Pick<ITreeAlpha, "exportVerbose" | "exportSimpleSchema">;
|
|
243
268
|
|
|
244
269
|
// @alpha
|
|
245
|
-
export type CreateIndependentTreeAlphaOptions = ForestOptions & ((IndependentViewOptions & {
|
|
270
|
+
export type CreateIndependentTreeAlphaOptions = ForestOptions & IndependentViewTelemetryOptions & ((IndependentViewOptions & {
|
|
246
271
|
content?: never;
|
|
247
272
|
}) | (ICodecOptions & {
|
|
248
273
|
content: ViewContent;
|
|
@@ -538,16 +563,21 @@ export function incrementalEncodingPolicyForAllowedTypes(rootSchema: TreeSchema)
|
|
|
538
563
|
export const incrementalSummaryHint: unique symbol;
|
|
539
564
|
|
|
540
565
|
// @alpha
|
|
541
|
-
export function independentInitializedView<const TSchema extends ImplicitFieldSchema>(config: TreeViewConfiguration<TSchema>, options: ForestOptions & ICodecOptions, content: ViewContent): TreeViewAlpha<TSchema>;
|
|
566
|
+
export function independentInitializedView<const TSchema extends ImplicitFieldSchema>(config: TreeViewConfiguration<TSchema>, options: ForestOptions & ICodecOptions & IndependentViewTelemetryOptions, content: ViewContent): TreeViewAlpha<TSchema>;
|
|
542
567
|
|
|
543
568
|
// @alpha
|
|
544
569
|
export function independentView<const TSchema extends ImplicitFieldSchema>(config: TreeViewConfiguration<TSchema>, options?: IndependentViewOptions): TreeViewAlpha<TSchema>;
|
|
545
570
|
|
|
546
571
|
// @alpha @input
|
|
547
|
-
export interface IndependentViewOptions extends ForestOptions, Partial<CodecWriteOptions
|
|
572
|
+
export interface IndependentViewOptions extends ForestOptions, Partial<CodecWriteOptions>, IndependentViewTelemetryOptions {
|
|
548
573
|
idCompressor?: IIdCompressor | undefined;
|
|
549
574
|
}
|
|
550
575
|
|
|
576
|
+
// @alpha @input
|
|
577
|
+
export interface IndependentViewTelemetryOptions {
|
|
578
|
+
readonly logger?: ITelemetryBaseLogger | undefined;
|
|
579
|
+
}
|
|
580
|
+
|
|
551
581
|
// @public @system
|
|
552
582
|
type _InlineTrick = 0;
|
|
553
583
|
|
|
@@ -648,10 +678,11 @@ export interface ITree extends ViewableTree, IFluidLoadable {
|
|
|
648
678
|
|
|
649
679
|
// @alpha @sealed
|
|
650
680
|
export interface ITreeAlpha extends ITree {
|
|
651
|
-
createSharedBranch(): string;
|
|
681
|
+
createSharedBranch(name?: string): string;
|
|
652
682
|
exportSimpleSchema(): SimpleTreeSchema;
|
|
653
683
|
exportVerbose(): VerboseTree | undefined;
|
|
654
684
|
getSharedBranchIds(): string[];
|
|
685
|
+
getSharedBranchName(branchId: string): string | undefined;
|
|
655
686
|
viewSharedBranchWith<TRoot extends ImplicitFieldSchema>(branchId: string, config: TreeViewConfiguration<TRoot>): TreeView<TRoot>;
|
|
656
687
|
}
|
|
657
688
|
|
|
@@ -844,6 +875,9 @@ export const MapNodeSchema: {
|
|
|
844
875
|
readonly [Symbol.hasInstance]: (value: TreeNodeSchema) => value is MapNodeSchema;
|
|
845
876
|
};
|
|
846
877
|
|
|
878
|
+
// @alpha @deprecated
|
|
879
|
+
export const minimize: TransactionPostProcessor;
|
|
880
|
+
|
|
847
881
|
// @alpha
|
|
848
882
|
export interface NoChangeConstraint {
|
|
849
883
|
// (undocumented)
|
|
@@ -1074,11 +1108,16 @@ export interface RunTransaction {
|
|
|
1074
1108
|
}
|
|
1075
1109
|
|
|
1076
1110
|
// @alpha @input
|
|
1077
|
-
export interface
|
|
1078
|
-
readonly
|
|
1111
|
+
export interface RunTransactionParamsAlpha extends RunTransactionParamsBeta {
|
|
1112
|
+
readonly postProcessor?: TransactionPostProcessor;
|
|
1079
1113
|
readonly preconditions?: readonly TransactionConstraintAlpha[];
|
|
1080
1114
|
}
|
|
1081
1115
|
|
|
1116
|
+
// @beta @input
|
|
1117
|
+
export interface RunTransactionParamsBeta {
|
|
1118
|
+
readonly label?: unknown;
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1082
1121
|
// @public @sealed
|
|
1083
1122
|
export interface SchemaCompatibilityStatus {
|
|
1084
1123
|
readonly canInitialize: boolean;
|
|
@@ -1243,6 +1282,7 @@ export interface SharedTreeFormatOptions {
|
|
|
1243
1282
|
// @alpha @input
|
|
1244
1283
|
export interface SharedTreeOptions extends SharedTreeOptionsBeta, Partial<CodecWriteOptions>, Partial<SharedTreeFormatOptions> {
|
|
1245
1284
|
readonly enableSharedBranches?: boolean;
|
|
1285
|
+
readonly retainHistory?: boolean;
|
|
1246
1286
|
shouldEncodeIncrementally?: IncrementalEncodingPolicy;
|
|
1247
1287
|
}
|
|
1248
1288
|
|
|
@@ -1449,7 +1489,7 @@ export namespace System_Unsafe {
|
|
|
1449
1489
|
// @system
|
|
1450
1490
|
export type InsertableTreeNodeFromAllowedTypesUnsafe<TList extends AllowedTypesUnsafe> = IsUnion<TList> extends true ? never : {
|
|
1451
1491
|
readonly [Property in keyof TList]: TList[Property] extends LazyItem<infer TSchema extends TreeNodeSchemaUnsafe> ? InsertableTypedNodeUnsafe<TSchema> : never;
|
|
1452
|
-
}[
|
|
1492
|
+
}[NumberKeys<TList>];
|
|
1453
1493
|
// @system
|
|
1454
1494
|
export type InsertableTreeNodeFromImplicitAllowedTypesUnsafe<TSchema extends ImplicitAllowedTypesUnsafe> = [TSchema] extends [TreeNodeSchemaUnsafe] ? InsertableTypedNodeUnsafe<TSchema> : [TSchema] extends [AllowedTypesUnsafe] ? InsertableTreeNodeFromAllowedTypesUnsafe<TSchema> : never;
|
|
1455
1495
|
// @system
|
|
@@ -1632,15 +1672,18 @@ export namespace TextAsTree {
|
|
|
1632
1672
|
// @alpha
|
|
1633
1673
|
export function trackDirtyNodes(view: TreeViewAlpha<ImplicitFieldSchema>, dirty: DirtyTreeMap): () => void;
|
|
1634
1674
|
|
|
1635
|
-
// @alpha
|
|
1636
|
-
export type
|
|
1637
|
-
|
|
1638
|
-
}) | (WithValue<TFailureValue> & {
|
|
1639
|
-
rollback: true;
|
|
1640
|
-
})) & {
|
|
1641
|
-
preconditionsOnRevert?: readonly TransactionConstraintAlpha[];
|
|
1675
|
+
// @alpha @input
|
|
1676
|
+
export type TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue> = TransactionCallbackStatusBeta<TSuccessValue, TFailureValue> & {
|
|
1677
|
+
readonly preconditionsOnRevert?: readonly TransactionConstraintAlpha[];
|
|
1642
1678
|
};
|
|
1643
1679
|
|
|
1680
|
+
// @beta @input
|
|
1681
|
+
export type TransactionCallbackStatusBeta<TSuccessValue, TFailureValue> = (WithValue<TSuccessValue> & {
|
|
1682
|
+
readonly rollback?: false;
|
|
1683
|
+
}) | (WithValue<TFailureValue> & {
|
|
1684
|
+
readonly rollback: true;
|
|
1685
|
+
});
|
|
1686
|
+
|
|
1644
1687
|
// @public
|
|
1645
1688
|
export type TransactionConstraint = NodeInDocumentConstraint;
|
|
1646
1689
|
|
|
@@ -1652,22 +1695,26 @@ export type TransactionLabels = Set<unknown> & {
|
|
|
1652
1695
|
tree?: LabelTree;
|
|
1653
1696
|
};
|
|
1654
1697
|
|
|
1655
|
-
// @alpha
|
|
1656
|
-
export
|
|
1657
|
-
|
|
1658
|
-
// @alpha
|
|
1659
|
-
export type TransactionResultExt<TSuccessValue, TFailureValue> = TransactionResultSuccess<TSuccessValue> | TransactionResultFailed<TFailureValue>;
|
|
1698
|
+
// @alpha @sealed @system
|
|
1699
|
+
export interface TransactionPostProcessor extends ErasedType<"@fluidframework/tree.TransactionPostProcessor"> {
|
|
1700
|
+
}
|
|
1660
1701
|
|
|
1661
|
-
// @
|
|
1702
|
+
// @beta @sealed
|
|
1662
1703
|
export interface TransactionResultFailed<TFailureValue> extends WithValue<TFailureValue> {
|
|
1663
|
-
success: false;
|
|
1704
|
+
readonly success: false;
|
|
1664
1705
|
}
|
|
1665
1706
|
|
|
1666
|
-
// @
|
|
1707
|
+
// @beta @sealed
|
|
1667
1708
|
export interface TransactionResultSuccess<TSuccessValue> extends WithValue<TSuccessValue> {
|
|
1668
|
-
success: true;
|
|
1709
|
+
readonly success: true;
|
|
1669
1710
|
}
|
|
1670
1711
|
|
|
1712
|
+
// @beta @sealed
|
|
1713
|
+
export type TransactionValueResult<TSuccessValue, TFailureValue> = TransactionResultSuccess<TSuccessValue> | TransactionResultFailed<TFailureValue>;
|
|
1714
|
+
|
|
1715
|
+
// @beta @sealed
|
|
1716
|
+
export type TransactionVoidResult = Omit<TransactionResultSuccess<unknown>, "value"> | Omit<TransactionResultFailed<unknown>, "value">;
|
|
1717
|
+
|
|
1671
1718
|
// @public @sealed
|
|
1672
1719
|
export interface Tree extends TreeNodeApi {
|
|
1673
1720
|
contains(node: TreeNode, other: TreeNode): boolean;
|
|
@@ -1737,7 +1784,14 @@ export const TreeArrayNode: {
|
|
|
1737
1784
|
|
|
1738
1785
|
// @alpha @sealed
|
|
1739
1786
|
export interface TreeArrayNodeAlpha<TAllowedTypes extends System_Unsafe.ImplicitAllowedTypesUnsafe = ImplicitAllowedTypes, out T = [TAllowedTypes] extends [ImplicitAllowedTypes] ? TreeNodeFromImplicitAllowedTypes<TAllowedTypes> : TreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>, in TNew = [TAllowedTypes] extends [ImplicitAllowedTypes] ? InsertableTreeNodeFromImplicitAllowedTypes<TAllowedTypes> : InsertableTreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>> extends TreeArrayNode<TAllowedTypes, T, TNew> {
|
|
1787
|
+
at(index: number): T | undefined;
|
|
1788
|
+
findLast<S extends T>(predicate: (value: T, index: number, array: readonly T[]) => value is S, thisArg?: unknown): S | undefined;
|
|
1789
|
+
findLast(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: unknown): T | undefined;
|
|
1790
|
+
findLastIndex(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: unknown): number;
|
|
1791
|
+
pop(): T | undefined;
|
|
1792
|
+
shift(): T | undefined;
|
|
1740
1793
|
splice(start: number, deleteCount?: number, ...items: readonly (TNew | IterableTreeArrayContent<TNew>)[]): T[];
|
|
1794
|
+
unshift(...value: readonly (TNew | IterableTreeArrayContent<TNew>)[]): void;
|
|
1741
1795
|
}
|
|
1742
1796
|
|
|
1743
1797
|
// @beta @sealed
|
|
@@ -1764,15 +1818,16 @@ export interface TreeBranch extends IDisposable {
|
|
|
1764
1818
|
// @alpha @sealed
|
|
1765
1819
|
export interface TreeBranchAlpha extends TreeBranch, TreeContextAlpha {
|
|
1766
1820
|
applyChange(change: JsonCompatibleReadOnly): void;
|
|
1821
|
+
computeNetChangeIfRebasedOnto(branch: TreeBranch): JsonCompatibleReadOnly | undefined;
|
|
1767
1822
|
readonly events: Listenable_2<TreeBranchEvents>;
|
|
1768
1823
|
// (undocumented)
|
|
1769
1824
|
fork(): TreeBranchAlpha;
|
|
1770
1825
|
hasRootSchema<TSchema extends ImplicitFieldSchema>(schema: TSchema): this is TreeViewAlpha<TSchema>;
|
|
1771
1826
|
isMissingEditsFrom(branch: TreeBranch): boolean;
|
|
1772
|
-
runTransaction<TSuccessValue, TFailureValue>(transaction: () =>
|
|
1773
|
-
runTransaction(transaction: () =>
|
|
1774
|
-
runTransactionAsync<TSuccessValue, TFailureValue>(transaction: () => Promise<
|
|
1775
|
-
runTransactionAsync(transaction: () => Promise<
|
|
1827
|
+
runTransaction<TSuccessValue, TFailureValue>(transaction: () => TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>, params?: RunTransactionParamsAlpha): TransactionValueResult<TSuccessValue, TFailureValue>;
|
|
1828
|
+
runTransaction(transaction: () => VoidTransactionCallbackStatusAlpha | void, params?: RunTransactionParamsAlpha): TransactionVoidResult;
|
|
1829
|
+
runTransactionAsync<TSuccessValue, TFailureValue>(transaction: () => Promise<TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>>, params?: RunTransactionParamsAlpha): Promise<TransactionValueResult<TSuccessValue, TFailureValue>>;
|
|
1830
|
+
runTransactionAsync(transaction: () => Promise<VoidTransactionCallbackStatusAlpha | void>, params?: RunTransactionParamsAlpha): Promise<TransactionVoidResult>;
|
|
1776
1831
|
}
|
|
1777
1832
|
|
|
1778
1833
|
// @alpha @sealed
|
|
@@ -1807,10 +1862,10 @@ export enum TreeCompressionStrategy {
|
|
|
1807
1862
|
// @alpha
|
|
1808
1863
|
export interface TreeContextAlpha {
|
|
1809
1864
|
isBranch(): this is TreeBranchAlpha;
|
|
1810
|
-
runTransaction<TValue>(transaction: () => WithValue<TValue>, params?:
|
|
1811
|
-
runTransaction(transaction: () => void, params?:
|
|
1812
|
-
runTransactionAsync<TValue>(transaction: () => Promise<WithValue<TValue>>, params?:
|
|
1813
|
-
runTransactionAsync(transaction: () => Promise<void>, params?:
|
|
1865
|
+
runTransaction<TValue>(transaction: () => WithValue<TValue>, params?: RunTransactionParamsAlpha): TransactionValueResult<TValue, TValue>;
|
|
1866
|
+
runTransaction(transaction: () => void, params?: RunTransactionParamsAlpha): TransactionVoidResult;
|
|
1867
|
+
runTransactionAsync<TValue>(transaction: () => Promise<WithValue<TValue>>, params?: RunTransactionParamsAlpha): Promise<TransactionValueResult<TValue, TValue>>;
|
|
1868
|
+
runTransactionAsync(transaction: () => Promise<void>, params?: RunTransactionParamsAlpha): Promise<TransactionVoidResult>;
|
|
1814
1869
|
}
|
|
1815
1870
|
|
|
1816
1871
|
// @beta @input
|
|
@@ -1964,7 +2019,7 @@ export interface TreeView<in out TSchema extends ImplicitFieldSchema> extends ID
|
|
|
1964
2019
|
}
|
|
1965
2020
|
|
|
1966
2021
|
// @alpha @sealed
|
|
1967
|
-
export interface TreeViewAlpha<in out TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema> extends Omit<TreeViewBeta<ReadSchema<TSchema>>, "root" | "initialize" | "fork">, TreeBranchAlpha {
|
|
2022
|
+
export interface TreeViewAlpha<in out TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema> extends Omit<TreeViewBeta<ReadSchema<TSchema>>, "root" | "initialize" | "fork" | "runTransaction" | "runTransactionAsync">, TreeBranchAlpha {
|
|
1968
2023
|
// (undocumented)
|
|
1969
2024
|
readonly events: Listenable_2<TreeViewEvents & TreeBranchEvents>;
|
|
1970
2025
|
// (undocumented)
|
|
@@ -1980,6 +2035,8 @@ export interface TreeViewAlpha<in out TSchema extends ImplicitFieldSchema | Unsa
|
|
|
1980
2035
|
export interface TreeViewBeta<in out TSchema extends ImplicitFieldSchema> extends TreeView<TSchema>, TreeBranch {
|
|
1981
2036
|
// (undocumented)
|
|
1982
2037
|
fork(): ReturnType<TreeBranch["fork"]> & TreeViewBeta<TSchema>;
|
|
2038
|
+
runTransaction<TOut extends TransactionCallbackStatusBeta<unknown, unknown> | VoidTransactionCallbackStatusBeta | void>(transaction: () => TOut, params?: RunTransactionParamsBeta): TOut extends TransactionCallbackStatusBeta<infer TSuccessValue, infer TFailureValue> ? TransactionValueResult<TSuccessValue, TFailureValue> : TransactionVoidResult;
|
|
2039
|
+
runTransactionAsync<TOut extends TransactionCallbackStatusBeta<unknown, unknown> | VoidTransactionCallbackStatusBeta | void>(transaction: () => Promise<TOut>, params?: RunTransactionParamsBeta): Promise<TOut extends TransactionCallbackStatusBeta<infer TSuccessValue, infer TFailureValue> ? TransactionValueResult<TSuccessValue, TFailureValue> : TransactionVoidResult>;
|
|
1983
2040
|
}
|
|
1984
2041
|
|
|
1985
2042
|
// @public @sealed
|
|
@@ -2104,8 +2161,11 @@ export interface ViewContent {
|
|
|
2104
2161
|
readonly tree: JsonCompatible<IFluidHandle>;
|
|
2105
2162
|
}
|
|
2106
2163
|
|
|
2107
|
-
// @alpha
|
|
2108
|
-
export type
|
|
2164
|
+
// @alpha @input
|
|
2165
|
+
export type VoidTransactionCallbackStatusAlpha = Omit<TransactionCallbackStatusAlpha<unknown, unknown>, "value">;
|
|
2166
|
+
|
|
2167
|
+
// @beta @input
|
|
2168
|
+
export type VoidTransactionCallbackStatusBeta = Omit<TransactionCallbackStatusBeta<unknown, unknown>, "value">;
|
|
2109
2169
|
|
|
2110
2170
|
// @public @sealed
|
|
2111
2171
|
export interface WithType<out TName extends string = string, out TKind extends NodeKind = NodeKind, out TInfo = unknown> {
|
|
@@ -2114,9 +2174,9 @@ export interface WithType<out TName extends string = string, out TKind extends N
|
|
|
2114
2174
|
get [typeSchemaSymbol](): TreeNodeSchemaClass<TName, TKind, TreeNode, never, boolean, TInfo>;
|
|
2115
2175
|
}
|
|
2116
2176
|
|
|
2117
|
-
// @
|
|
2177
|
+
// @beta @input
|
|
2118
2178
|
export interface WithValue<TValue> {
|
|
2119
|
-
value: TValue;
|
|
2179
|
+
readonly value: TValue;
|
|
2120
2180
|
}
|
|
2121
2181
|
|
|
2122
2182
|
// (No @packageDocumentation comment for this package)
|
|
@@ -501,6 +501,11 @@ export interface RunTransaction {
|
|
|
501
501
|
readonly rollback: typeof rollback;
|
|
502
502
|
}
|
|
503
503
|
|
|
504
|
+
// @beta @input
|
|
505
|
+
export interface RunTransactionParamsBeta {
|
|
506
|
+
readonly label?: unknown;
|
|
507
|
+
}
|
|
508
|
+
|
|
504
509
|
// @public @sealed
|
|
505
510
|
export interface SchemaCompatibilityStatus {
|
|
506
511
|
readonly canInitialize: boolean;
|
|
@@ -732,7 +737,7 @@ export namespace System_Unsafe {
|
|
|
732
737
|
// @system
|
|
733
738
|
export type InsertableTreeNodeFromAllowedTypesUnsafe<TList extends AllowedTypesUnsafe> = IsUnion<TList> extends true ? never : {
|
|
734
739
|
readonly [Property in keyof TList]: TList[Property] extends LazyItem<infer TSchema extends TreeNodeSchemaUnsafe> ? InsertableTypedNodeUnsafe<TSchema> : never;
|
|
735
|
-
}[
|
|
740
|
+
}[NumberKeys<TList>];
|
|
736
741
|
// @system
|
|
737
742
|
export type InsertableTreeNodeFromImplicitAllowedTypesUnsafe<TSchema extends ImplicitAllowedTypesUnsafe> = [TSchema] extends [TreeNodeSchemaUnsafe] ? InsertableTypedNodeUnsafe<TSchema> : [TSchema] extends [AllowedTypesUnsafe] ? InsertableTreeNodeFromAllowedTypesUnsafe<TSchema> : never;
|
|
738
743
|
// @system
|
|
@@ -876,9 +881,32 @@ export namespace TableSchema {
|
|
|
876
881
|
}
|
|
877
882
|
}
|
|
878
883
|
|
|
884
|
+
// @beta @input
|
|
885
|
+
export type TransactionCallbackStatusBeta<TSuccessValue, TFailureValue> = (WithValue<TSuccessValue> & {
|
|
886
|
+
readonly rollback?: false;
|
|
887
|
+
}) | (WithValue<TFailureValue> & {
|
|
888
|
+
readonly rollback: true;
|
|
889
|
+
});
|
|
890
|
+
|
|
879
891
|
// @public
|
|
880
892
|
export type TransactionConstraint = NodeInDocumentConstraint;
|
|
881
893
|
|
|
894
|
+
// @beta @sealed
|
|
895
|
+
export interface TransactionResultFailed<TFailureValue> extends WithValue<TFailureValue> {
|
|
896
|
+
readonly success: false;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
// @beta @sealed
|
|
900
|
+
export interface TransactionResultSuccess<TSuccessValue> extends WithValue<TSuccessValue> {
|
|
901
|
+
readonly success: true;
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
// @beta @sealed
|
|
905
|
+
export type TransactionValueResult<TSuccessValue, TFailureValue> = TransactionResultSuccess<TSuccessValue> | TransactionResultFailed<TFailureValue>;
|
|
906
|
+
|
|
907
|
+
// @beta @sealed
|
|
908
|
+
export type TransactionVoidResult = Omit<TransactionResultSuccess<unknown>, "value"> | Omit<TransactionResultFailed<unknown>, "value">;
|
|
909
|
+
|
|
882
910
|
// @public @sealed
|
|
883
911
|
export interface Tree extends TreeNodeApi {
|
|
884
912
|
contains(node: TreeNode, other: TreeNode): boolean;
|
|
@@ -1075,6 +1103,8 @@ export interface TreeView<in out TSchema extends ImplicitFieldSchema> extends ID
|
|
|
1075
1103
|
export interface TreeViewBeta<in out TSchema extends ImplicitFieldSchema> extends TreeView<TSchema>, TreeBranch {
|
|
1076
1104
|
// (undocumented)
|
|
1077
1105
|
fork(): ReturnType<TreeBranch["fork"]> & TreeViewBeta<TSchema>;
|
|
1106
|
+
runTransaction<TOut extends TransactionCallbackStatusBeta<unknown, unknown> | VoidTransactionCallbackStatusBeta | void>(transaction: () => TOut, params?: RunTransactionParamsBeta): TOut extends TransactionCallbackStatusBeta<infer TSuccessValue, infer TFailureValue> ? TransactionValueResult<TSuccessValue, TFailureValue> : TransactionVoidResult;
|
|
1107
|
+
runTransactionAsync<TOut extends TransactionCallbackStatusBeta<unknown, unknown> | VoidTransactionCallbackStatusBeta | void>(transaction: () => Promise<TOut>, params?: RunTransactionParamsBeta): Promise<TOut extends TransactionCallbackStatusBeta<infer TSuccessValue, infer TFailureValue> ? TransactionValueResult<TSuccessValue, TFailureValue> : TransactionVoidResult>;
|
|
1078
1108
|
}
|
|
1079
1109
|
|
|
1080
1110
|
// @public @sealed
|
|
@@ -1152,6 +1182,9 @@ export interface ViewableTree {
|
|
|
1152
1182
|
viewWith<TRoot extends ImplicitFieldSchema>(config: TreeViewConfiguration<TRoot>): TreeView<TRoot>;
|
|
1153
1183
|
}
|
|
1154
1184
|
|
|
1185
|
+
// @beta @input
|
|
1186
|
+
export type VoidTransactionCallbackStatusBeta = Omit<TransactionCallbackStatusBeta<unknown, unknown>, "value">;
|
|
1187
|
+
|
|
1155
1188
|
// @public @sealed
|
|
1156
1189
|
export interface WithType<out TName extends string = string, out TKind extends NodeKind = NodeKind, out TInfo = unknown> {
|
|
1157
1190
|
// @deprecated
|
|
@@ -1159,6 +1192,11 @@ export interface WithType<out TName extends string = string, out TKind extends N
|
|
|
1159
1192
|
get [typeSchemaSymbol](): TreeNodeSchemaClass<TName, TKind, TreeNode, never, boolean, TInfo>;
|
|
1160
1193
|
}
|
|
1161
1194
|
|
|
1195
|
+
// @beta @input
|
|
1196
|
+
export interface WithValue<TValue> {
|
|
1197
|
+
readonly value: TValue;
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1162
1200
|
// (No @packageDocumentation comment for this package)
|
|
1163
1201
|
|
|
1164
1202
|
```
|
|
@@ -504,6 +504,11 @@ export interface RunTransaction {
|
|
|
504
504
|
readonly rollback: typeof rollback;
|
|
505
505
|
}
|
|
506
506
|
|
|
507
|
+
// @beta @input
|
|
508
|
+
export interface RunTransactionParamsBeta {
|
|
509
|
+
readonly label?: unknown;
|
|
510
|
+
}
|
|
511
|
+
|
|
507
512
|
// @public @sealed
|
|
508
513
|
export interface SchemaCompatibilityStatus {
|
|
509
514
|
readonly canInitialize: boolean;
|
|
@@ -744,7 +749,7 @@ export namespace System_Unsafe {
|
|
|
744
749
|
// @system
|
|
745
750
|
export type InsertableTreeNodeFromAllowedTypesUnsafe<TList extends AllowedTypesUnsafe> = IsUnion<TList> extends true ? never : {
|
|
746
751
|
readonly [Property in keyof TList]: TList[Property] extends LazyItem<infer TSchema extends TreeNodeSchemaUnsafe> ? InsertableTypedNodeUnsafe<TSchema> : never;
|
|
747
|
-
}[
|
|
752
|
+
}[NumberKeys<TList>];
|
|
748
753
|
// @system
|
|
749
754
|
export type InsertableTreeNodeFromImplicitAllowedTypesUnsafe<TSchema extends ImplicitAllowedTypesUnsafe> = [TSchema] extends [TreeNodeSchemaUnsafe] ? InsertableTypedNodeUnsafe<TSchema> : [TSchema] extends [AllowedTypesUnsafe] ? InsertableTreeNodeFromAllowedTypesUnsafe<TSchema> : never;
|
|
750
755
|
// @system
|
|
@@ -888,9 +893,32 @@ export namespace TableSchema {
|
|
|
888
893
|
}
|
|
889
894
|
}
|
|
890
895
|
|
|
896
|
+
// @beta @input
|
|
897
|
+
export type TransactionCallbackStatusBeta<TSuccessValue, TFailureValue> = (WithValue<TSuccessValue> & {
|
|
898
|
+
readonly rollback?: false;
|
|
899
|
+
}) | (WithValue<TFailureValue> & {
|
|
900
|
+
readonly rollback: true;
|
|
901
|
+
});
|
|
902
|
+
|
|
891
903
|
// @public
|
|
892
904
|
export type TransactionConstraint = NodeInDocumentConstraint;
|
|
893
905
|
|
|
906
|
+
// @beta @sealed
|
|
907
|
+
export interface TransactionResultFailed<TFailureValue> extends WithValue<TFailureValue> {
|
|
908
|
+
readonly success: false;
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
// @beta @sealed
|
|
912
|
+
export interface TransactionResultSuccess<TSuccessValue> extends WithValue<TSuccessValue> {
|
|
913
|
+
readonly success: true;
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
// @beta @sealed
|
|
917
|
+
export type TransactionValueResult<TSuccessValue, TFailureValue> = TransactionResultSuccess<TSuccessValue> | TransactionResultFailed<TFailureValue>;
|
|
918
|
+
|
|
919
|
+
// @beta @sealed
|
|
920
|
+
export type TransactionVoidResult = Omit<TransactionResultSuccess<unknown>, "value"> | Omit<TransactionResultFailed<unknown>, "value">;
|
|
921
|
+
|
|
894
922
|
// @public @sealed
|
|
895
923
|
export interface Tree extends TreeNodeApi {
|
|
896
924
|
contains(node: TreeNode, other: TreeNode): boolean;
|
|
@@ -1087,6 +1115,8 @@ export interface TreeView<in out TSchema extends ImplicitFieldSchema> extends ID
|
|
|
1087
1115
|
export interface TreeViewBeta<in out TSchema extends ImplicitFieldSchema> extends TreeView<TSchema>, TreeBranch {
|
|
1088
1116
|
// (undocumented)
|
|
1089
1117
|
fork(): ReturnType<TreeBranch["fork"]> & TreeViewBeta<TSchema>;
|
|
1118
|
+
runTransaction<TOut extends TransactionCallbackStatusBeta<unknown, unknown> | VoidTransactionCallbackStatusBeta | void>(transaction: () => TOut, params?: RunTransactionParamsBeta): TOut extends TransactionCallbackStatusBeta<infer TSuccessValue, infer TFailureValue> ? TransactionValueResult<TSuccessValue, TFailureValue> : TransactionVoidResult;
|
|
1119
|
+
runTransactionAsync<TOut extends TransactionCallbackStatusBeta<unknown, unknown> | VoidTransactionCallbackStatusBeta | void>(transaction: () => Promise<TOut>, params?: RunTransactionParamsBeta): Promise<TOut extends TransactionCallbackStatusBeta<infer TSuccessValue, infer TFailureValue> ? TransactionValueResult<TSuccessValue, TFailureValue> : TransactionVoidResult>;
|
|
1090
1120
|
}
|
|
1091
1121
|
|
|
1092
1122
|
// @public @sealed
|
|
@@ -1164,6 +1194,9 @@ export interface ViewableTree {
|
|
|
1164
1194
|
viewWith<TRoot extends ImplicitFieldSchema>(config: TreeViewConfiguration<TRoot>): TreeView<TRoot>;
|
|
1165
1195
|
}
|
|
1166
1196
|
|
|
1197
|
+
// @beta @input
|
|
1198
|
+
export type VoidTransactionCallbackStatusBeta = Omit<TransactionCallbackStatusBeta<unknown, unknown>, "value">;
|
|
1199
|
+
|
|
1167
1200
|
// @public @sealed
|
|
1168
1201
|
export interface WithType<out TName extends string = string, out TKind extends NodeKind = NodeKind, out TInfo = unknown> {
|
|
1169
1202
|
// @deprecated
|
|
@@ -1171,6 +1204,11 @@ export interface WithType<out TName extends string = string, out TKind extends N
|
|
|
1171
1204
|
get [typeSchemaSymbol](): TreeNodeSchemaClass<TName, TKind, TreeNode, never, boolean, TInfo>;
|
|
1172
1205
|
}
|
|
1173
1206
|
|
|
1207
|
+
// @beta @input
|
|
1208
|
+
export interface WithValue<TValue> {
|
|
1209
|
+
readonly value: TValue;
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1174
1212
|
// (No @packageDocumentation comment for this package)
|
|
1175
1213
|
|
|
1176
1214
|
```
|