@fluidframework/tree 2.116.1 → 2.118.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +202 -0
- package/api-report/tree.alpha.api.md +122 -31
- package/api-report/tree.beta.api.md +50 -9
- package/api-report/tree.legacy.beta.api.md +50 -9
- package/dist/codec/codec.d.ts +18 -0
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +18 -0
- package/dist/codec/codec.js.map +1 -1
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +3 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/index.d.ts +1 -1
- package/dist/core/rebase/index.d.ts.map +1 -1
- package/dist/core/rebase/index.js +2 -1
- package/dist/core/rebase/index.js.map +1 -1
- package/dist/core/rebase/types.d.ts +39 -2
- package/dist/core/rebase/types.d.ts.map +1 -1
- package/dist/core/rebase/types.js +37 -2
- package/dist/core/rebase/types.js.map +1 -1
- package/dist/core/rebase/utils.d.ts.map +1 -1
- package/dist/core/rebase/utils.js +1 -0
- package/dist/core/rebase/utils.js.map +1 -1
- package/dist/core/revertible.d.ts +62 -6
- package/dist/core/revertible.d.ts.map +1 -1
- package/dist/core/revertible.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/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/index.d.ts +1 -1
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/indexing/types.d.ts +1 -1
- package/dist/feature-libraries/indexing/types.js.map +1 -1
- package/dist/feature-libraries/schemaChecker.d.ts +9 -19
- package/dist/feature-libraries/schemaChecker.d.ts.map +1 -1
- package/dist/feature-libraries/schemaChecker.js +130 -46
- package/dist/feature-libraries/schemaChecker.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- 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/history.d.ts +22 -0
- package/dist/shared-tree/history.d.ts.map +1 -0
- package/dist/shared-tree/history.js +66 -0
- package/dist/shared-tree/history.js.map +1 -0
- package/dist/shared-tree/schematizingTreeView.d.ts +24 -9
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +61 -11
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +3 -2
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +2 -0
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/tree.js +1 -1
- package/dist/shared-tree/tree.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts +8 -20
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +9 -12
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +16 -9
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +122 -25
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree/unhydratedTreeContext.d.ts +3 -2
- package/dist/shared-tree/unhydratedTreeContext.d.ts.map +1 -1
- package/dist/shared-tree/unhydratedTreeContext.js +3 -0
- package/dist/shared-tree/unhydratedTreeContext.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts +16 -2
- package/dist/shared-tree-core/branch.d.ts.map +1 -1
- package/dist/shared-tree-core/branch.js +20 -2
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/shared-tree-core/branchCommitCounter.d.ts +31 -0
- package/dist/shared-tree-core/branchCommitCounter.d.ts.map +1 -0
- package/dist/shared-tree-core/branchCommitCounter.js +79 -0
- package/dist/shared-tree-core/branchCommitCounter.js.map +1 -0
- package/dist/shared-tree-core/customMetadataCodec.d.ts +9 -0
- package/dist/shared-tree-core/customMetadataCodec.d.ts.map +1 -0
- package/dist/shared-tree-core/customMetadataCodec.js +37 -0
- package/dist/shared-tree-core/customMetadataCodec.js.map +1 -0
- package/dist/shared-tree-core/customMetadataFormat.d.ts +18 -0
- package/dist/shared-tree-core/customMetadataFormat.d.ts.map +1 -0
- package/dist/shared-tree-core/customMetadataFormat.js +15 -0
- package/dist/shared-tree-core/customMetadataFormat.js.map +1 -0
- package/dist/shared-tree-core/editManager.d.ts.map +1 -1
- package/dist/shared-tree-core/editManager.js +15 -3
- package/dist/shared-tree-core/editManager.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js +5 -0
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.js +17 -5
- package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsV1toV4.js +4 -2
- package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js +2 -2
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts +17 -6
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js +18 -8
- package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +7 -5
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.js +4 -3
- package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts +4 -0
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.js +2 -2
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/index.d.ts +2 -1
- package/dist/shared-tree-core/index.d.ts.map +1 -1
- package/dist/shared-tree-core/index.js +3 -1
- package/dist/shared-tree-core/index.js.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +2 -2
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.js +12 -3
- package/dist/shared-tree-core/messageCodecV1ToV4.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/messageCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js +5 -0
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/messageFormat.d.ts +1 -0
- package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormat.js +6 -0
- package/dist/shared-tree-core/messageFormat.js.map +1 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +10 -3
- package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.js +10 -2
- package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts +7 -0
- package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormatVSharedBranches.js +2 -0
- 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 +4 -2
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/shared-tree-core/transaction.d.ts +9 -0
- package/dist/shared-tree-core/transaction.d.ts.map +1 -1
- package/dist/shared-tree-core/transaction.js +26 -4
- package/dist/shared-tree-core/transaction.js.map +1 -1
- package/dist/simple-tree/api/configuration.d.ts +4 -4
- package/dist/simple-tree/api/configuration.d.ts.map +1 -1
- package/dist/simple-tree/api/configuration.js.map +1 -1
- package/dist/simple-tree/api/discrepancies.d.ts +36 -3
- package/dist/simple-tree/api/discrepancies.d.ts.map +1 -1
- package/dist/simple-tree/api/discrepancies.js +40 -14
- package/dist/simple-tree/api/discrepancies.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +3 -2
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +3 -2
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +22 -3
- package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.js +140 -10
- package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/dist/simple-tree/api/transactionTypes.d.ts +28 -2
- 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 +353 -68
- 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/core/toStored.d.ts +7 -0
- package/dist/simple-tree/core/toStored.d.ts.map +1 -1
- package/dist/simple-tree/core/toStored.js.map +1 -1
- package/dist/simple-tree/core/treeNodeValid.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeValid.js +2 -2
- package/dist/simple-tree/core/treeNodeValid.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 +4 -3
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/tableSchema.js +10 -10
- package/dist/tableSchema.js.map +1 -1
- package/docs/main/glossary.md +163 -0
- package/lib/codec/codec.d.ts +18 -0
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +18 -0
- package/lib/codec/codec.js.map +1 -1
- package/lib/core/index.d.ts +2 -2
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +1 -1
- package/lib/core/index.js.map +1 -1
- package/lib/core/rebase/index.d.ts +1 -1
- package/lib/core/rebase/index.d.ts.map +1 -1
- package/lib/core/rebase/index.js +1 -1
- package/lib/core/rebase/index.js.map +1 -1
- package/lib/core/rebase/types.d.ts +39 -2
- package/lib/core/rebase/types.d.ts.map +1 -1
- package/lib/core/rebase/types.js +35 -1
- package/lib/core/rebase/types.js.map +1 -1
- package/lib/core/rebase/utils.d.ts.map +1 -1
- package/lib/core/rebase/utils.js +1 -0
- package/lib/core/rebase/utils.js.map +1 -1
- package/lib/core/revertible.d.ts +62 -6
- package/lib/core/revertible.d.ts.map +1 -1
- package/lib/core/revertible.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/index.d.ts +1 -1
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/indexing/types.d.ts +1 -1
- package/lib/feature-libraries/indexing/types.js.map +1 -1
- package/lib/feature-libraries/schemaChecker.d.ts +9 -19
- package/lib/feature-libraries/schemaChecker.d.ts.map +1 -1
- package/lib/feature-libraries/schemaChecker.js +133 -49
- package/lib/feature-libraries/schemaChecker.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +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/history.d.ts +22 -0
- package/lib/shared-tree/history.d.ts.map +1 -0
- package/lib/shared-tree/history.js +62 -0
- package/lib/shared-tree/history.js.map +1 -0
- package/lib/shared-tree/schematizingTreeView.d.ts +24 -9
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +62 -12
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +3 -2
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +2 -0
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/tree.js +1 -1
- package/lib/shared-tree/tree.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts +8 -20
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +9 -12
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +16 -9
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +123 -26
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree/unhydratedTreeContext.d.ts +3 -2
- package/lib/shared-tree/unhydratedTreeContext.d.ts.map +1 -1
- package/lib/shared-tree/unhydratedTreeContext.js +3 -0
- package/lib/shared-tree/unhydratedTreeContext.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts +16 -2
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +20 -2
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/shared-tree-core/branchCommitCounter.d.ts +31 -0
- package/lib/shared-tree-core/branchCommitCounter.d.ts.map +1 -0
- package/lib/shared-tree-core/branchCommitCounter.js +75 -0
- package/lib/shared-tree-core/branchCommitCounter.js.map +1 -0
- package/lib/shared-tree-core/customMetadataCodec.d.ts +9 -0
- package/lib/shared-tree-core/customMetadataCodec.d.ts.map +1 -0
- package/lib/shared-tree-core/customMetadataCodec.js +32 -0
- package/lib/shared-tree-core/customMetadataCodec.js.map +1 -0
- package/lib/shared-tree-core/customMetadataFormat.d.ts +18 -0
- package/lib/shared-tree-core/customMetadataFormat.d.ts.map +1 -0
- package/lib/shared-tree-core/customMetadataFormat.js +11 -0
- package/lib/shared-tree-core/customMetadataFormat.js.map +1 -0
- package/lib/shared-tree-core/editManager.d.ts.map +1 -1
- package/lib/shared-tree-core/editManager.js +16 -4
- package/lib/shared-tree-core/editManager.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js +5 -0
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.js +17 -5
- package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsV1toV4.js +4 -2
- package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js +2 -2
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts +17 -6
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.js +18 -8
- package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +7 -5
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.js +4 -3
- package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts +4 -0
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.js +2 -2
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/index.d.ts +2 -1
- package/lib/shared-tree-core/index.d.ts.map +1 -1
- package/lib/shared-tree-core/index.js +1 -0
- package/lib/shared-tree-core/index.js.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +2 -2
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.js +12 -3
- package/lib/shared-tree-core/messageCodecV1ToV4.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/messageCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecs.js +5 -0
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/messageFormat.d.ts +1 -0
- package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormat.js +6 -0
- package/lib/shared-tree-core/messageFormat.js.map +1 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +10 -3
- package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.js +10 -2
- package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
- package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts +7 -0
- package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormatVSharedBranches.js +2 -0
- package/lib/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +5 -3
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/shared-tree-core/transaction.d.ts +9 -0
- package/lib/shared-tree-core/transaction.d.ts.map +1 -1
- package/lib/shared-tree-core/transaction.js +27 -5
- package/lib/shared-tree-core/transaction.js.map +1 -1
- package/lib/simple-tree/api/configuration.d.ts +4 -4
- package/lib/simple-tree/api/configuration.d.ts.map +1 -1
- package/lib/simple-tree/api/configuration.js.map +1 -1
- package/lib/simple-tree/api/discrepancies.d.ts +36 -3
- package/lib/simple-tree/api/discrepancies.d.ts.map +1 -1
- package/lib/simple-tree/api/discrepancies.js +40 -14
- package/lib/simple-tree/api/discrepancies.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +3 -2
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +1 -1
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +22 -3
- package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.js +136 -7
- package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/lib/simple-tree/api/transactionTypes.d.ts +28 -2
- 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 +353 -68
- 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/core/toStored.d.ts +7 -0
- package/lib/simple-tree/core/toStored.d.ts.map +1 -1
- package/lib/simple-tree/core/toStored.js.map +1 -1
- package/lib/simple-tree/core/treeNodeValid.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeValid.js +3 -3
- package/lib/simple-tree/core/treeNodeValid.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/tableSchema.js +10 -10
- package/lib/tableSchema.js.map +1 -1
- package/package.json +22 -22
- package/src/codec/codec.ts +19 -0
- package/src/core/index.ts +4 -0
- package/src/core/rebase/index.ts +2 -0
- package/src/core/rebase/types.ts +72 -2
- package/src/core/rebase/utils.ts +1 -0
- package/src/core/revertible.ts +67 -6
- package/src/entrypoints/alpha.ts +11 -0
- package/src/entrypoints/beta.ts +3 -0
- package/src/entrypoints/legacy.ts +3 -0
- package/src/feature-libraries/index.ts +1 -1
- package/src/feature-libraries/indexing/types.ts +1 -1
- package/src/feature-libraries/schemaChecker.ts +198 -82
- package/src/index.ts +11 -0
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/history.ts +99 -0
- package/src/shared-tree/schematizingTreeView.ts +100 -29
- package/src/shared-tree/sharedTree.ts +5 -2
- package/src/shared-tree/tree.ts +1 -1
- package/src/shared-tree/treeAlpha.ts +17 -35
- package/src/shared-tree/treeCheckout.ts +170 -31
- package/src/shared-tree/unhydratedTreeContext.ts +6 -2
- package/src/shared-tree-core/branch.ts +34 -2
- package/src/shared-tree-core/branchCommitCounter.ts +103 -0
- package/src/shared-tree-core/customMetadataCodec.ts +42 -0
- package/src/shared-tree-core/customMetadataFormat.ts +39 -0
- package/src/shared-tree-core/editManager.ts +22 -3
- package/src/shared-tree-core/editManagerCodecs.ts +12 -0
- package/src/shared-tree-core/editManagerCodecsCommons.ts +41 -15
- package/src/shared-tree-core/editManagerCodecsV1toV4.ts +7 -1
- package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +2 -0
- package/src/shared-tree-core/editManagerFormatCommons.ts +46 -12
- package/src/shared-tree-core/editManagerFormatV1toV4.ts +13 -5
- package/src/shared-tree-core/editManagerFormatVSharedBranches.ts +2 -2
- package/src/shared-tree-core/index.ts +3 -0
- package/src/shared-tree-core/messageCodecV1ToV4.ts +18 -5
- package/src/shared-tree-core/messageCodecVSharedBranches.ts +9 -2
- package/src/shared-tree-core/messageCodecs.ts +12 -0
- package/src/shared-tree-core/messageFormat.ts +6 -0
- package/src/shared-tree-core/messageFormatV1ToV4.ts +21 -3
- package/src/shared-tree-core/messageFormatVSharedBranches.ts +8 -0
- package/src/shared-tree-core/sharedTreeCore.ts +5 -2
- package/src/shared-tree-core/transaction.ts +56 -4
- package/src/simple-tree/api/configuration.ts +4 -4
- package/src/simple-tree/api/discrepancies.ts +100 -5
- package/src/simple-tree/api/index.ts +12 -1
- package/src/simple-tree/api/schemaCompatibilityTester.ts +185 -11
- package/src/simple-tree/api/transactionTypes.ts +29 -2
- package/src/simple-tree/api/tree.ts +384 -68
- package/src/simple-tree/core/toStored.ts +8 -0
- package/src/simple-tree/core/treeNodeValid.ts +3 -1
- package/src/simple-tree/index.ts +9 -0
- package/src/tableSchema.ts +9 -9
- package/docs/main/runtime-schema-upgrade.md +0 -208
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,207 @@
|
|
|
1
1
|
# @fluidframework/tree
|
|
2
2
|
|
|
3
|
+
## 2.118.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Preserve enabled staged schema upgrades by default ([#28155](https://github.com/microsoft/FluidFramework/pull/28155)) [9b61289e943](https://github.com/microsoft/FluidFramework/commit/9b61289e9432a4e84e18d834b76d1d6818a3a6a7)
|
|
8
|
+
|
|
9
|
+
[`TreeView.upgradeSchema()`](https://fluidframework.com/docs/api/tree/treeview-interface#upgradeschema-method) now includes staged schema upgrades that are already enabled in the document, even when the view's staged upgrade policy does not select them.
|
|
10
|
+
This prevents a schema upgrade from accidentally attempting to narrow stored schema enabled by another client.
|
|
11
|
+
|
|
12
|
+
Set [`includeAlreadyEnabledUpgrades`](https://fluidframework.com/docs/api/tree/stagedschemaupgradepolicy-interface#includealreadyenabledupgrades-property) to `false` when creating the staged upgrade policy to require upgrades to be selected explicitly:
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
const config = new TreeViewConfigurationAlpha({
|
|
16
|
+
schema: AppSchema,
|
|
17
|
+
stagedUpgradePolicy: {
|
|
18
|
+
includeAlreadyEnabledUpgrades: false,
|
|
19
|
+
...StagedSchemaUpgradePolicy.enabledStagedUpgrades(myUpgrade),
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
- Expose schema incompatibility details on TreeViewBeta ([#28155](https://github.com/microsoft/FluidFramework/pull/28155)) [9b61289e943](https://github.com/microsoft/FluidFramework/commit/9b61289e9432a4e84e18d834b76d1d6818a3a6a7)
|
|
25
|
+
|
|
26
|
+
`TreeViewBeta.compatibility.discrepancies` now provides typed `SchemaDiscrepancy` objects when a view cannot access a tree because its view schema is incompatible with the stored schema.
|
|
27
|
+
The readonly array may include application-defined schema identifiers and field keys.
|
|
28
|
+
Each entry includes a `mismatch` discriminator so consumers can distinguish allowed-type, field-kind, value-schema, and node-kind differences.
|
|
29
|
+
Allowed-type discrepancies include staged types that are absent from the stored schema in `stagedView`, while discrepancies on staged optional fields include `viewIsStagedOptional: true`.
|
|
30
|
+
Staged-only differences remain compatible and do not produce discrepancies by themselves.
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
const sf = new SchemaFactory("com.example");
|
|
34
|
+
class Todo extends sf.object("Todo", {
|
|
35
|
+
title: sf.number,
|
|
36
|
+
}) {}
|
|
37
|
+
|
|
38
|
+
const view = asBeta(
|
|
39
|
+
tree.viewWith(new TreeViewConfiguration({ schema: Todo })),
|
|
40
|
+
);
|
|
41
|
+
if (!view.compatibility.canView) {
|
|
42
|
+
console.error(view.compatibility.discrepancies);
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
If the stored schema allows `string` for `Todo.title`, the output is:
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
[
|
|
50
|
+
{
|
|
51
|
+
"mismatch": "allowedTypes",
|
|
52
|
+
"location": { "nodeType": "com.example.Todo", "fieldKey": "title" },
|
|
53
|
+
"view": ["com.fluidframework.leaf.number"],
|
|
54
|
+
"stored": ["com.fluidframework.leaf.string"]
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Applications can see from `mismatch: "allowedTypes"` that the schemas differ in their allowed types, compare `view` with `stored` to determine which types each schema permits, and use `location` to find the field where the mismatch occurs.
|
|
60
|
+
|
|
61
|
+
- SharedTree schema errors now explain the mismatch ([#28153](https://github.com/microsoft/FluidFramework/pull/28153)) [850aa1f1c47](https://github.com/microsoft/FluidFramework/commit/850aa1f1c47ea737b0c8a34e826f8caac97f0a7b)
|
|
62
|
+
|
|
63
|
+
Schema validation errors now report the mismatch category and attach relevant diagnostic context. Depending on the mismatch, tagged telemetry properties identify the node type, field kind, child count, expected leaf value type, actual value type, unexpected fields, or path, making invalid content easier to diagnose while allowing consumers to filter potentially sensitive user data.
|
|
64
|
+
|
|
65
|
+
When a view schema cannot access a document's stored schema, the error now reports the first schema mismatch and explains whether to initialize the document, upgrade its stored schema, use a compatible view schema, or explicitly migrate the document.
|
|
66
|
+
|
|
67
|
+
- TreeViewAlpha can now query whether a staged schema upgrade has been applied ([#28154](https://github.com/microsoft/FluidFramework/pull/28154)) [0ea7aa88589](https://github.com/microsoft/FluidFramework/commit/0ea7aa885896ba58fb063fdbc3ee1c66dbd6b8e1)
|
|
68
|
+
|
|
69
|
+
A new [`isStagedUpgradeEnabled`](https://fluidframework.com/docs/api/tree/treeviewalpha-interface#isstagedupgradeenabled-methodsignature) method on [`TreeViewAlpha`](https://fluidframework.com/docs/api/tree/treeviewalpha-interface) checks whether a given [`SchemaUpgrade`](https://fluidframework.com/docs/api/tree/schemaupgrade-typealias) token has already been applied to a document's stored schema.
|
|
70
|
+
|
|
71
|
+
This is useful when gradually rolling out a staged schema upgrade via feature flags — for example, to conditionally include the upgrade token in the view configuration after a flag rollback, or to show UI that depends on the upgraded schema.
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
const view = tree.viewWith(
|
|
75
|
+
new TreeViewConfigurationAlpha({
|
|
76
|
+
schema: mySchema,
|
|
77
|
+
stagedUpgradePolicy: featureFlag.isEnabled
|
|
78
|
+
? StagedSchemaUpgradePolicy.enabledStagedUpgrades(myUpgrade)
|
|
79
|
+
: StagedSchemaUpgradePolicy.restrictive,
|
|
80
|
+
}),
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
// Show a "create poll" button only if the document supports the new poll schema
|
|
84
|
+
if (view.isStagedUpgradeEnabled(myUpgrade)) {
|
|
85
|
+
showCreatePollButton();
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## 2.117.0
|
|
90
|
+
|
|
91
|
+
### Minor Changes
|
|
92
|
+
|
|
93
|
+
- Rename TreeBranch and TreeBranchAlpha to UntypedTreeView ([#28104](https://github.com/microsoft/FluidFramework/pull/28104)) [e75bc54fa2](https://github.com/microsoft/FluidFramework/commit/e75bc54fa2cd24f8331e05e094c09ff602337c50)
|
|
94
|
+
|
|
95
|
+
`UntypedTreeView` and `UntypedTreeViewAlpha` replace the beta `TreeBranch` and alpha `TreeBranchAlpha` interfaces, clarifying that they represent tree views without known schemas. The old names remain available as deprecated compatibility aliases and will be removed in a future release.
|
|
96
|
+
|
|
97
|
+
Update API imports and type annotations to use the new names:
|
|
98
|
+
|
|
99
|
+
```typescript
|
|
100
|
+
// Before
|
|
101
|
+
import type { TreeBranch } from "fluid-framework/beta";
|
|
102
|
+
import type { TreeBranchAlpha } from "fluid-framework/alpha";
|
|
103
|
+
const betaBranch: TreeBranch = betaView.fork();
|
|
104
|
+
const alphaBranch: TreeBranchAlpha = alphaView.fork();
|
|
105
|
+
|
|
106
|
+
// After
|
|
107
|
+
import type { UntypedTreeView } from "fluid-framework/beta";
|
|
108
|
+
import type { UntypedTreeViewAlpha } from "fluid-framework/alpha";
|
|
109
|
+
const betaForkedView: UntypedTreeView = betaView.fork();
|
|
110
|
+
const alphaForkedView: UntypedTreeViewAlpha = alphaView.fork();
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
- New alpha API for attaching custom metadata to commits ([#28104](https://github.com/microsoft/FluidFramework/pull/28104)) [e75bc54fa2](https://github.com/microsoft/FluidFramework/commit/e75bc54fa2cd24f8331e05e094c09ff602337c50)
|
|
114
|
+
|
|
115
|
+
Applications can now attach arbitrary, JSON-serializable metadata to a commit, replicate it to collaborating clients, and persist it in the document.
|
|
116
|
+
|
|
117
|
+
Supply it via the new `customMetadata` field on [`RunTransactionParamsAlpha`](https://fluidframework.com/docs/api/fluid-framework/runtransactionparamsalpha-interface):
|
|
118
|
+
|
|
119
|
+
```typescript
|
|
120
|
+
view.runTransaction(
|
|
121
|
+
() => {
|
|
122
|
+
view.root.insertAtEnd("new item");
|
|
123
|
+
},
|
|
124
|
+
{ customMetadata: { author: "alice", intent: "add-item" } },
|
|
125
|
+
);
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
The commit produced by reverting a `Revertible`, or by `revertTo`, can be annotated the same way via a new options argument:
|
|
129
|
+
|
|
130
|
+
```typescript
|
|
131
|
+
revertible.revert({
|
|
132
|
+
customMetadata: { author: "alice", intent: "undo-add" },
|
|
133
|
+
});
|
|
134
|
+
view.revertTo(revision, {
|
|
135
|
+
customMetadata: { author: "alice", intent: "undo-add" },
|
|
136
|
+
});
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Read it back while walking the branch's [history](https://fluidframework.com/docs/api/fluid-framework/treebranchhistory-interface), via the new `custom` property on `TreeBranchCommitMetadata`:
|
|
140
|
+
|
|
141
|
+
```typescript
|
|
142
|
+
for (
|
|
143
|
+
let commit = view.branchHistory.getHead();
|
|
144
|
+
commit !== undefined;
|
|
145
|
+
commit = commit.getParent()
|
|
146
|
+
) {
|
|
147
|
+
const metadata = commit.custom;
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Because a commit may be produced by nested transactions, each of which may supply metadata, `custom` is the flattened combination of them all, with the outermost transaction winning on conflicting properties.
|
|
152
|
+
The structural view is available as `commit.customTree`, a `CustomMetadataTree` mirroring the transaction nesting — the same relationship `labels.tree` has to a change's label set.
|
|
153
|
+
|
|
154
|
+
Metadata shares the lifetime of the commit it is attached to, so it is dropped when that commit is trimmed from the trunk, or lasts as long as the document under the `retainHistory` option on `SharedTreeOptions`.
|
|
155
|
+
It also travels on every annotated op and occupies summary space for as long as its commit survives, so it should be kept small.
|
|
156
|
+
|
|
157
|
+
Persisting the metadata requires new op and summary format versions, which are written only when `minVersionForCollab` is set to `2.117.0` or later; until then, metadata is kept in memory for the local session but is neither replicated nor persisted.
|
|
158
|
+
Raising that floor makes every subsequent op and summary use the new versions, whether or not any commit carries metadata, so deploy metadata-capable code everywhere first.
|
|
159
|
+
Lowering it again is lossy: a client configured to write the older format can still read metadata but strips it when encoding.
|
|
160
|
+
|
|
161
|
+
- Bug fix: forking during changed event callback is now safe ([#28074](https://github.com/microsoft/FluidFramework/pull/28074)) [ca9458aa1a](https://github.com/microsoft/FluidFramework/commit/ca9458aa1ae9061928c5c7ff837b61d888468174)
|
|
162
|
+
|
|
163
|
+
[Forking](https://fluidframework.com/docs/api/fluid-framework/treeviewbeta-interface#fork-methodsignature) (beta) a view during the callback for the ["changed" event](https://fluidframework.com/docs/api/fluid-framework/treebranchevents-interface#changed-methodsignature) (alpha) emitted when a transaction is committed would create a fork with malformed change data.
|
|
164
|
+
This could result in asserts being triggered when utilizing the fork (including, but not limited to, error code `0x7ce`).
|
|
165
|
+
|
|
166
|
+
- Remove the deprecated TreeAlpha.branch API ([#28104](https://github.com/microsoft/FluidFramework/pull/28104)) [e75bc54fa2](https://github.com/microsoft/FluidFramework/commit/e75bc54fa2cd24f8331e05e094c09ff602337c50)
|
|
167
|
+
|
|
168
|
+
The deprecated alpha `TreeAlpha.branch(node)` API has been removed. Use [`TreeAlpha.context(node)`](https://fluidframework.com/docs/api/fluid-framework/treealpha-interface#context-methodsignature) and check [`isView()`](https://fluidframework.com/docs/api/fluid-framework/treecontextalpha-interface#isview-methodsignature) to access the untyped view for a hydrated node:
|
|
169
|
+
|
|
170
|
+
```typescript
|
|
171
|
+
const context = TreeAlpha.context(node);
|
|
172
|
+
if (context.isView()) {
|
|
173
|
+
// `context` is an UntypedTreeViewAlpha here.
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
- retainHistory now retains history in summaries ([#28104](https://github.com/microsoft/FluidFramework/pull/28104)) [e75bc54fa2](https://github.com/microsoft/FluidFramework/commit/e75bc54fa2cd24f8331e05e094c09ff602337c50)
|
|
178
|
+
|
|
179
|
+
The `retainHistory` option on `SharedTreeOptions` is documented as causing growth in summaries/snapshots as well as in memory, but it only ever prevented trunk commits from being evicted from memory.
|
|
180
|
+
Summaries continued to contain just the collaboration window, so retained history was discarded at the next summary and was unavailable to clients that loaded from it.
|
|
181
|
+
|
|
182
|
+
Summaries produced by a client with `retainHistory` enabled now contain the full trunk, matching the option's documented behavior.
|
|
183
|
+
History accumulated while the flag is enabled survives summarization and is available to clients that join later.
|
|
184
|
+
History is only retained from the point at which the flag is enabled: commits that were already evicted by a prior session cannot be recovered.
|
|
185
|
+
|
|
186
|
+
There is no change to the default (`retainHistory: false`) behavior, and no change to the persisted format.
|
|
187
|
+
|
|
188
|
+
- New alpha APIs for inspecting history and restoring past states ([#28104](https://github.com/microsoft/FluidFramework/pull/28104)) [e75bc54fa2](https://github.com/microsoft/FluidFramework/commit/e75bc54fa2cd24f8331e05e094c09ff602337c50)
|
|
189
|
+
|
|
190
|
+
`UntypedTreeViewAlpha` (formerly [`TreeBranchAlpha`](https://fluidframework.com/docs/api/fluid-framework/treebranchalpha-interface)) now exposes a `branchHistory` property which returns a `TreeBranchHistory` object with:
|
|
191
|
+
- `commitCount`: the number of commits currently in the branch's history.
|
|
192
|
+
This number grows when a new edit is made on the branch, when a branch containing new commits is merged into it, or when it is rebased onto a branch containing new commits.
|
|
193
|
+
It shrinks when past commits are trimmed from the history.
|
|
194
|
+
- `getHeadCommit()`: returns the `TreeBranchCommitMetadata` for the branch's head commit, or `undefined` if the branch has no commits.
|
|
195
|
+
Each `TreeBranchCommitMetadata` exposes the commit's `revision` string and its `parent` commit metadata, so the history can be walked backwards from the head.
|
|
196
|
+
|
|
197
|
+
A `revision` obtained this way can be passed to either of two new methods on `UntypedTreeViewAlpha` implementations:
|
|
198
|
+
- `revertTo(revision)`: applies a new change which reverts all changes made since `revision`.
|
|
199
|
+
The generated change is subject to the same merge semantics as the reverts of individual commits, so concurrent changes sequenced before the revert which affect different parts of the document are not overwritten.
|
|
200
|
+
- `rewindTo(revision)`: switches the view to a new underlying branch whose head is the commit at `revision`, without applying a change.
|
|
201
|
+
The original underlying branch is disposed unless it is the main branch or a shared branch, so consider `fork()`ing before rewinding if it needs to be retained.
|
|
202
|
+
|
|
203
|
+
How much history is available depends on how many commits the client retains; see the `retainHistory` option on `SharedTreeOptions`.
|
|
204
|
+
|
|
3
205
|
## 2.116.0
|
|
4
206
|
|
|
5
207
|
### Minor Changes
|
|
@@ -223,6 +223,9 @@ export enum CommitOutcome {
|
|
|
223
223
|
NewContentOnly = 2
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
+
// @alpha
|
|
227
|
+
export type CommitRevision = string;
|
|
228
|
+
|
|
226
229
|
// @alpha
|
|
227
230
|
export function comparePersistedSchema(persisted: JsonCompatible, view: ImplicitFieldSchema, options: ICodecOptions): Omit<SchemaCompatibilityStatus, "canInitialize">;
|
|
228
231
|
|
|
@@ -297,6 +300,12 @@ export function createTreeIndex<TFieldSchema extends ImplicitFieldSchema, TKey e
|
|
|
297
300
|
// @beta
|
|
298
301
|
export function createTreeIndex<TFieldSchema extends ImplicitFieldSchema, TKey extends TreeIndexKey, TValue, TSchema extends TreeNodeSchema>(view: TreeView<TFieldSchema>, indexer: Map<TreeNodeSchema, string>, getValue: (nodes: TreeIndexNodes<NodeFromSchema<TSchema>>) => TValue, isKeyValid: (key: TreeIndexKey) => key is TKey, indexableSchema: readonly TSchema[]): TreeIndex<TKey, TValue>;
|
|
299
302
|
|
|
303
|
+
// @alpha @sealed
|
|
304
|
+
export interface CustomMetadataTree {
|
|
305
|
+
readonly children: readonly CustomMetadataTree[];
|
|
306
|
+
readonly metadata: JsonCompatibleReadOnlyObject | undefined;
|
|
307
|
+
}
|
|
308
|
+
|
|
300
309
|
// @alpha
|
|
301
310
|
export function decodeSchemaCompatibilitySnapshot(encodedSchema: JsonCompatibleReadOnly, validator?: FormatValidator): SimpleTreeSchema;
|
|
302
311
|
|
|
@@ -478,6 +487,7 @@ export const FluidClientVersion: {
|
|
|
478
487
|
readonly v2_73: "2.73.0";
|
|
479
488
|
readonly v2_74: "2.74.0";
|
|
480
489
|
readonly v2_80: "2.80.0";
|
|
490
|
+
readonly v2_117: "2.117.0";
|
|
481
491
|
};
|
|
482
492
|
|
|
483
493
|
// @beta
|
|
@@ -761,7 +771,7 @@ export interface ITreeViewConfiguration<TSchema extends ImplicitFieldSchema = Im
|
|
|
761
771
|
readonly schema: TSchema;
|
|
762
772
|
}
|
|
763
773
|
|
|
764
|
-
// @alpha
|
|
774
|
+
// @alpha @input
|
|
765
775
|
export interface ITreeViewConfigurationAlpha<TSchema extends ImplicitFieldSchema = ImplicitFieldSchema> extends ITreeViewConfiguration<TSchema> {
|
|
766
776
|
readonly stagedUpgradePolicy?: StagedSchemaUpgradePolicy;
|
|
767
777
|
}
|
|
@@ -1183,7 +1193,10 @@ export interface Revertible {
|
|
|
1183
1193
|
|
|
1184
1194
|
// @alpha @sealed
|
|
1185
1195
|
export interface RevertibleAlpha extends Revertible {
|
|
1186
|
-
clone: (
|
|
1196
|
+
clone: (view: UntypedTreeView) => RevertibleAlpha;
|
|
1197
|
+
revert(): void;
|
|
1198
|
+
revert(dispose: boolean): void;
|
|
1199
|
+
revert(options: RevertOptionsAlpha): void;
|
|
1187
1200
|
}
|
|
1188
1201
|
|
|
1189
1202
|
// @alpha @sealed
|
|
@@ -1198,6 +1211,17 @@ export enum RevertibleStatus {
|
|
|
1198
1211
|
Valid = 0
|
|
1199
1212
|
}
|
|
1200
1213
|
|
|
1214
|
+
// @alpha @sealed
|
|
1215
|
+
export interface RevertOptionsAlpha {
|
|
1216
|
+
readonly customMetadata?: JsonCompatibleReadOnlyObject;
|
|
1217
|
+
readonly dispose?: boolean;
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
// @alpha @sealed
|
|
1221
|
+
export interface RevertToOptionsAlpha {
|
|
1222
|
+
readonly customMetadata?: JsonCompatibleReadOnlyObject;
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1201
1225
|
// @public
|
|
1202
1226
|
export const rollback: unique symbol;
|
|
1203
1227
|
|
|
@@ -1220,6 +1244,7 @@ export interface RunTransaction {
|
|
|
1220
1244
|
|
|
1221
1245
|
// @alpha @input
|
|
1222
1246
|
export interface RunTransactionParamsAlpha extends RunTransactionParamsBeta {
|
|
1247
|
+
readonly customMetadata?: JsonCompatibleReadOnlyObject;
|
|
1223
1248
|
readonly postProcessor?: TransactionPostProcessor;
|
|
1224
1249
|
readonly preconditions?: readonly TransactionConstraintAlpha[];
|
|
1225
1250
|
}
|
|
@@ -1237,6 +1262,43 @@ export interface SchemaCompatibilityStatus {
|
|
|
1237
1262
|
readonly isEquivalent: boolean;
|
|
1238
1263
|
}
|
|
1239
1264
|
|
|
1265
|
+
// @beta @sealed
|
|
1266
|
+
export interface SchemaCompatibilityStatusBeta extends SchemaCompatibilityStatus {
|
|
1267
|
+
readonly discrepancies: readonly SchemaDiscrepancy[] | undefined;
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
// @beta @sealed
|
|
1271
|
+
export type SchemaDiscrepancy = {
|
|
1272
|
+
readonly mismatch: "allowedTypes";
|
|
1273
|
+
readonly location: "root" | {
|
|
1274
|
+
readonly nodeType: string;
|
|
1275
|
+
readonly fieldKey: string | undefined;
|
|
1276
|
+
};
|
|
1277
|
+
readonly view: readonly string[];
|
|
1278
|
+
readonly stagedView?: readonly string[];
|
|
1279
|
+
readonly stored: readonly string[];
|
|
1280
|
+
readonly viewIsStagedOptional?: true;
|
|
1281
|
+
} | {
|
|
1282
|
+
readonly mismatch: "fieldKind";
|
|
1283
|
+
readonly location: "root" | {
|
|
1284
|
+
readonly nodeType: string;
|
|
1285
|
+
readonly fieldKey: string | undefined;
|
|
1286
|
+
};
|
|
1287
|
+
readonly view: string;
|
|
1288
|
+
readonly stored: string;
|
|
1289
|
+
readonly viewIsStagedOptional?: true;
|
|
1290
|
+
} | {
|
|
1291
|
+
readonly mismatch: "valueSchema";
|
|
1292
|
+
readonly nodeType: string;
|
|
1293
|
+
readonly view: string | undefined;
|
|
1294
|
+
readonly stored: string | undefined;
|
|
1295
|
+
} | {
|
|
1296
|
+
readonly mismatch: "nodeKind";
|
|
1297
|
+
readonly nodeType: string;
|
|
1298
|
+
readonly view: string;
|
|
1299
|
+
readonly stored: string;
|
|
1300
|
+
};
|
|
1301
|
+
|
|
1240
1302
|
// @public @sealed
|
|
1241
1303
|
export class SchemaFactory<out TScope extends string | undefined = string | undefined, TName extends number | string = string> extends SchemaFactory_base {
|
|
1242
1304
|
constructor(
|
|
@@ -1517,6 +1579,7 @@ export interface SnapshotSchemaCompatibilityOptions {
|
|
|
1517
1579
|
|
|
1518
1580
|
// @alpha @input
|
|
1519
1581
|
export interface StagedSchemaUpgradePolicy {
|
|
1582
|
+
readonly includeAlreadyEnabledUpgrades?: boolean;
|
|
1520
1583
|
includeStaged(upgrade: SchemaUpgrade): boolean;
|
|
1521
1584
|
includeStagedOptional(upgrade: SchemaUpgrade): boolean;
|
|
1522
1585
|
}
|
|
@@ -1531,6 +1594,9 @@ export interface StagedSchemaUpgradePolicyFactory {
|
|
|
1531
1594
|
readonly restrictive: StagedSchemaUpgradePolicy;
|
|
1532
1595
|
}
|
|
1533
1596
|
|
|
1597
|
+
// @alpha
|
|
1598
|
+
export type StagedUpgradeStatus = "disabled" | "partial" | "enabled";
|
|
1599
|
+
|
|
1534
1600
|
// @alpha @sealed @system
|
|
1535
1601
|
export type StringSchema = LeafSchema<"string", string> & SimpleLeafNodeSchema;
|
|
1536
1602
|
|
|
@@ -1825,8 +1891,6 @@ export const Tree: Tree;
|
|
|
1825
1891
|
|
|
1826
1892
|
// @alpha @sealed
|
|
1827
1893
|
export interface TreeAlpha {
|
|
1828
|
-
// @deprecated
|
|
1829
|
-
branch(node: TreeNode): TreeBranchAlpha | undefined;
|
|
1830
1894
|
child(node: TreeNode, key: string | number): TreeNode | TreeLeafValue | undefined;
|
|
1831
1895
|
children(node: TreeNode): Iterable<[propertyKey: string | number, child: TreeNode | TreeLeafValue]>;
|
|
1832
1896
|
context(node: TreeNode): TreeContextAlpha;
|
|
@@ -1906,27 +1970,18 @@ export interface TreeBeta {
|
|
|
1906
1970
|
// @beta
|
|
1907
1971
|
export const TreeBeta: TreeBeta;
|
|
1908
1972
|
|
|
1909
|
-
// @beta @
|
|
1910
|
-
export
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
rebaseOnto(branch: TreeBranch): void;
|
|
1915
|
-
}
|
|
1973
|
+
// @beta @deprecated
|
|
1974
|
+
export type TreeBranch = UntypedTreeView;
|
|
1975
|
+
|
|
1976
|
+
// @alpha @deprecated
|
|
1977
|
+
export type TreeBranchAlpha = UntypedTreeViewAlpha;
|
|
1916
1978
|
|
|
1917
1979
|
// @alpha @sealed
|
|
1918
|
-
export interface
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
fork(): TreeBranchAlpha;
|
|
1924
|
-
hasRootSchema<TSchema extends ImplicitFieldSchema>(schema: TSchema): this is TreeViewAlpha<TSchema>;
|
|
1925
|
-
isMissingEditsFrom(branch: TreeBranch): boolean;
|
|
1926
|
-
runTransaction<TSuccessValue, TFailureValue>(transaction: () => TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>, params?: RunTransactionParamsAlpha): TransactionValueResult<TSuccessValue, TFailureValue>;
|
|
1927
|
-
runTransaction(transaction: () => VoidTransactionCallbackStatusAlpha | void, params?: RunTransactionParamsAlpha): TransactionVoidResult;
|
|
1928
|
-
runTransactionAsync<TSuccessValue, TFailureValue>(transaction: () => Promise<TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>>, params?: RunTransactionParamsAlpha): Promise<TransactionValueResult<TSuccessValue, TFailureValue>>;
|
|
1929
|
-
runTransactionAsync(transaction: () => Promise<VoidTransactionCallbackStatusAlpha | void>, params?: RunTransactionParamsAlpha): Promise<TransactionVoidResult>;
|
|
1980
|
+
export interface TreeBranchCommitMetadata {
|
|
1981
|
+
readonly custom: JsonCompatibleReadOnlyObject | undefined;
|
|
1982
|
+
readonly customTree: CustomMetadataTree | undefined;
|
|
1983
|
+
getParent(): TreeBranchCommitMetadata | undefined;
|
|
1984
|
+
readonly revision: CommitRevision;
|
|
1930
1985
|
}
|
|
1931
1986
|
|
|
1932
1987
|
// @alpha @sealed
|
|
@@ -1934,6 +1989,12 @@ export interface TreeBranchEvents {
|
|
|
1934
1989
|
changed(data: ChangeMetadata, getRevertible?: RevertibleAlphaFactory): void;
|
|
1935
1990
|
}
|
|
1936
1991
|
|
|
1992
|
+
// @alpha @sealed
|
|
1993
|
+
export interface TreeBranchHistory {
|
|
1994
|
+
getHead(): TreeBranchCommitMetadata | undefined;
|
|
1995
|
+
readonly length: number;
|
|
1996
|
+
}
|
|
1997
|
+
|
|
1937
1998
|
// @public @sealed
|
|
1938
1999
|
export interface TreeChangeEvents {
|
|
1939
2000
|
nodeChanged(unstable?: unknown): void;
|
|
@@ -1960,7 +2021,9 @@ export enum TreeCompressionStrategy {
|
|
|
1960
2021
|
|
|
1961
2022
|
// @alpha
|
|
1962
2023
|
export interface TreeContextAlpha {
|
|
1963
|
-
|
|
2024
|
+
// @deprecated
|
|
2025
|
+
isBranch(): this is UntypedTreeViewAlpha;
|
|
2026
|
+
isView(): this is UntypedTreeViewAlpha;
|
|
1964
2027
|
runTransaction<TValue>(transaction: () => WithValue<TValue>, params?: RunTransactionParamsAlpha): TransactionValueResult<TValue, TValue>;
|
|
1965
2028
|
runTransaction(transaction: () => void, params?: RunTransactionParamsAlpha): TransactionVoidResult;
|
|
1966
2029
|
runTransactionAsync<TValue>(transaction: () => Promise<WithValue<TValue>>, params?: RunTransactionParamsAlpha): Promise<TransactionValueResult<TValue, TValue>>;
|
|
@@ -1987,10 +2050,10 @@ export type TreeFieldFromImplicitField<TSchema extends ImplicitFieldSchema = Fie
|
|
|
1987
2050
|
// @alpha @sealed
|
|
1988
2051
|
export interface TreeIdentifierUtils {
|
|
1989
2052
|
(node: TreeNode): string | undefined;
|
|
1990
|
-
create(
|
|
2053
|
+
create(view: UntypedTreeView): string;
|
|
1991
2054
|
getShort(node: TreeNode): number | undefined;
|
|
1992
|
-
lengthen(
|
|
1993
|
-
shorten(
|
|
2055
|
+
lengthen(view: UntypedTreeView, nodeIdentifier: number): string;
|
|
2056
|
+
shorten(view: UntypedTreeView, nodeIdentifier: string): number | undefined;
|
|
1994
2057
|
}
|
|
1995
2058
|
|
|
1996
2059
|
// @beta @sealed
|
|
@@ -2130,21 +2193,23 @@ export interface TreeView<in out TSchema extends ImplicitFieldSchema> extends ID
|
|
|
2130
2193
|
}
|
|
2131
2194
|
|
|
2132
2195
|
// @alpha @sealed
|
|
2133
|
-
export interface TreeViewAlpha<in out TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema> extends Omit<TreeViewBeta<ReadSchema<TSchema>>, "root" | "initialize" | "fork" | "runTransaction" | "runTransactionAsync">,
|
|
2196
|
+
export interface TreeViewAlpha<in out TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema> extends Omit<TreeViewBeta<ReadSchema<TSchema>>, "root" | "initialize" | "fork" | "runTransaction" | "runTransactionAsync">, UntypedTreeViewAlpha {
|
|
2134
2197
|
// (undocumented)
|
|
2135
2198
|
readonly events: Listenable_2<TreeViewEvents & TreeBranchEvents>;
|
|
2136
2199
|
// (undocumented)
|
|
2137
|
-
fork(): ReturnType<
|
|
2200
|
+
fork(): ReturnType<UntypedTreeView["fork"]> & TreeViewAlpha<TSchema>;
|
|
2138
2201
|
initialize(content: InsertableField<TSchema>): void;
|
|
2202
|
+
isStagedUpgradeEnabled(upgrade: SchemaUpgrade): StagedUpgradeStatus;
|
|
2139
2203
|
// (undocumented)
|
|
2140
2204
|
get root(): ReadableField<TSchema>;
|
|
2141
2205
|
set root(newRoot: InsertableField<TSchema>);
|
|
2142
2206
|
}
|
|
2143
2207
|
|
|
2144
2208
|
// @beta @sealed
|
|
2145
|
-
export interface TreeViewBeta<in out TSchema extends ImplicitFieldSchema> extends TreeView<TSchema>,
|
|
2209
|
+
export interface TreeViewBeta<in out TSchema extends ImplicitFieldSchema> extends TreeView<TSchema>, UntypedTreeView {
|
|
2210
|
+
readonly compatibility: SchemaCompatibilityStatusBeta;
|
|
2146
2211
|
// (undocumented)
|
|
2147
|
-
fork(): ReturnType<
|
|
2212
|
+
fork(): ReturnType<UntypedTreeView["fork"]> & TreeViewBeta<TSchema>;
|
|
2148
2213
|
runTransaction<TOut extends TransactionCallbackStatusBeta<unknown, unknown> | VoidTransactionCallbackStatusBeta | void>(transaction: () => TOut, params?: RunTransactionParamsBeta): TOut extends TransactionCallbackStatusBeta<infer TSuccessValue, infer TFailureValue> ? TransactionValueResult<TSuccessValue, TFailureValue> : TransactionVoidResult;
|
|
2149
2214
|
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>;
|
|
2150
2215
|
}
|
|
@@ -2215,6 +2280,32 @@ export const UnsafeUnknownSchema: unique symbol;
|
|
|
2215
2280
|
// @alpha
|
|
2216
2281
|
export type UnsafeUnknownSchema = typeof UnsafeUnknownSchema;
|
|
2217
2282
|
|
|
2283
|
+
// @beta @sealed
|
|
2284
|
+
export interface UntypedTreeView extends IDisposable {
|
|
2285
|
+
dispose(error?: Error): void;
|
|
2286
|
+
fork(): UntypedTreeView;
|
|
2287
|
+
merge(view: UntypedTreeView, disposeMerged?: boolean): void;
|
|
2288
|
+
rebaseOnto(view: UntypedTreeView): void;
|
|
2289
|
+
}
|
|
2290
|
+
|
|
2291
|
+
// @alpha @sealed
|
|
2292
|
+
export interface UntypedTreeViewAlpha extends UntypedTreeView, TreeContextAlpha {
|
|
2293
|
+
applyChange(change: JsonCompatibleReadOnly): void;
|
|
2294
|
+
readonly branchHistory: TreeBranchHistory;
|
|
2295
|
+
computeNetChangeIfRebasedOnto(view: UntypedTreeView): JsonCompatibleReadOnly | undefined;
|
|
2296
|
+
readonly events: Listenable_2<TreeBranchEvents>;
|
|
2297
|
+
// (undocumented)
|
|
2298
|
+
fork(): UntypedTreeViewAlpha;
|
|
2299
|
+
hasRootSchema<TSchema extends ImplicitFieldSchema>(schema: TSchema): this is TreeViewAlpha<TSchema>;
|
|
2300
|
+
isMissingEditsFrom(view: UntypedTreeView): boolean;
|
|
2301
|
+
revertTo(revision: CommitRevision, options?: RevertToOptionsAlpha): void;
|
|
2302
|
+
rewindTo(revision: CommitRevision): void;
|
|
2303
|
+
runTransaction<TSuccessValue, TFailureValue>(transaction: () => TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>, params?: RunTransactionParamsAlpha): TransactionValueResult<TSuccessValue, TFailureValue>;
|
|
2304
|
+
runTransaction(transaction: () => VoidTransactionCallbackStatusAlpha | void, params?: RunTransactionParamsAlpha): TransactionVoidResult;
|
|
2305
|
+
runTransactionAsync<TSuccessValue, TFailureValue>(transaction: () => Promise<TransactionCallbackStatusAlpha<TSuccessValue, TFailureValue>>, params?: RunTransactionParamsAlpha): Promise<TransactionValueResult<TSuccessValue, TFailureValue>>;
|
|
2306
|
+
runTransactionAsync(transaction: () => Promise<VoidTransactionCallbackStatusAlpha | void>, params?: RunTransactionParamsAlpha): Promise<TransactionVoidResult>;
|
|
2307
|
+
}
|
|
2308
|
+
|
|
2218
2309
|
// @public
|
|
2219
2310
|
export type ValidateRecursiveSchema<T extends ValidateRecursiveSchemaTemplate<T>> = true;
|
|
2220
2311
|
|
|
@@ -514,6 +514,43 @@ export interface SchemaCompatibilityStatus {
|
|
|
514
514
|
readonly isEquivalent: boolean;
|
|
515
515
|
}
|
|
516
516
|
|
|
517
|
+
// @beta @sealed
|
|
518
|
+
export interface SchemaCompatibilityStatusBeta extends SchemaCompatibilityStatus {
|
|
519
|
+
readonly discrepancies: readonly SchemaDiscrepancy[] | undefined;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
// @beta @sealed
|
|
523
|
+
export type SchemaDiscrepancy = {
|
|
524
|
+
readonly mismatch: "allowedTypes";
|
|
525
|
+
readonly location: "root" | {
|
|
526
|
+
readonly nodeType: string;
|
|
527
|
+
readonly fieldKey: string | undefined;
|
|
528
|
+
};
|
|
529
|
+
readonly view: readonly string[];
|
|
530
|
+
readonly stagedView?: readonly string[];
|
|
531
|
+
readonly stored: readonly string[];
|
|
532
|
+
readonly viewIsStagedOptional?: true;
|
|
533
|
+
} | {
|
|
534
|
+
readonly mismatch: "fieldKind";
|
|
535
|
+
readonly location: "root" | {
|
|
536
|
+
readonly nodeType: string;
|
|
537
|
+
readonly fieldKey: string | undefined;
|
|
538
|
+
};
|
|
539
|
+
readonly view: string;
|
|
540
|
+
readonly stored: string;
|
|
541
|
+
readonly viewIsStagedOptional?: true;
|
|
542
|
+
} | {
|
|
543
|
+
readonly mismatch: "valueSchema";
|
|
544
|
+
readonly nodeType: string;
|
|
545
|
+
readonly view: string | undefined;
|
|
546
|
+
readonly stored: string | undefined;
|
|
547
|
+
} | {
|
|
548
|
+
readonly mismatch: "nodeKind";
|
|
549
|
+
readonly nodeType: string;
|
|
550
|
+
readonly view: string;
|
|
551
|
+
readonly stored: string;
|
|
552
|
+
};
|
|
553
|
+
|
|
517
554
|
// @public @sealed
|
|
518
555
|
export class SchemaFactory<out TScope extends string | undefined = string | undefined, TName extends number | string = string> extends SchemaFactory_base {
|
|
519
556
|
constructor(
|
|
@@ -957,13 +994,8 @@ export interface TreeBeta {
|
|
|
957
994
|
// @beta
|
|
958
995
|
export const TreeBeta: TreeBeta;
|
|
959
996
|
|
|
960
|
-
// @beta @
|
|
961
|
-
export
|
|
962
|
-
dispose(error?: Error): void;
|
|
963
|
-
fork(): TreeBranch;
|
|
964
|
-
merge(branch: TreeBranch, disposeMerged?: boolean): void;
|
|
965
|
-
rebaseOnto(branch: TreeBranch): void;
|
|
966
|
-
}
|
|
997
|
+
// @beta @deprecated
|
|
998
|
+
export type TreeBranch = UntypedTreeView;
|
|
967
999
|
|
|
968
1000
|
// @public @sealed
|
|
969
1001
|
export interface TreeChangeEvents {
|
|
@@ -1100,9 +1132,10 @@ export interface TreeView<in out TSchema extends ImplicitFieldSchema> extends ID
|
|
|
1100
1132
|
}
|
|
1101
1133
|
|
|
1102
1134
|
// @beta @sealed
|
|
1103
|
-
export interface TreeViewBeta<in out TSchema extends ImplicitFieldSchema> extends TreeView<TSchema>,
|
|
1135
|
+
export interface TreeViewBeta<in out TSchema extends ImplicitFieldSchema> extends TreeView<TSchema>, UntypedTreeView {
|
|
1136
|
+
readonly compatibility: SchemaCompatibilityStatusBeta;
|
|
1104
1137
|
// (undocumented)
|
|
1105
|
-
fork(): ReturnType<
|
|
1138
|
+
fork(): ReturnType<UntypedTreeView["fork"]> & TreeViewBeta<TSchema>;
|
|
1106
1139
|
runTransaction<TOut extends TransactionCallbackStatusBeta<unknown, unknown> | VoidTransactionCallbackStatusBeta | void>(transaction: () => TOut, params?: RunTransactionParamsBeta): TOut extends TransactionCallbackStatusBeta<infer TSuccessValue, infer TFailureValue> ? TransactionValueResult<TSuccessValue, TFailureValue> : TransactionVoidResult;
|
|
1107
1140
|
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>;
|
|
1108
1141
|
}
|
|
@@ -1157,6 +1190,14 @@ export type UnionToIntersection<T> = (T extends T ? (k: T) => unknown : never) e
|
|
|
1157
1190
|
// @beta @system
|
|
1158
1191
|
export type UnionToTuple<Union, A extends unknown[] = [], First = PopUnion<Union>> = IsUnion<Union> extends true ? UnionToTuple<Exclude<Union, First>, [First, ...A]> : [Union, ...A];
|
|
1159
1192
|
|
|
1193
|
+
// @beta @sealed
|
|
1194
|
+
export interface UntypedTreeView extends IDisposable {
|
|
1195
|
+
dispose(error?: Error): void;
|
|
1196
|
+
fork(): UntypedTreeView;
|
|
1197
|
+
merge(view: UntypedTreeView, disposeMerged?: boolean): void;
|
|
1198
|
+
rebaseOnto(view: UntypedTreeView): void;
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1160
1201
|
// @public
|
|
1161
1202
|
export type ValidateRecursiveSchema<T extends ValidateRecursiveSchemaTemplate<T>> = true;
|
|
1162
1203
|
|
|
@@ -517,6 +517,43 @@ export interface SchemaCompatibilityStatus {
|
|
|
517
517
|
readonly isEquivalent: boolean;
|
|
518
518
|
}
|
|
519
519
|
|
|
520
|
+
// @beta @sealed
|
|
521
|
+
export interface SchemaCompatibilityStatusBeta extends SchemaCompatibilityStatus {
|
|
522
|
+
readonly discrepancies: readonly SchemaDiscrepancy[] | undefined;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
// @beta @sealed
|
|
526
|
+
export type SchemaDiscrepancy = {
|
|
527
|
+
readonly mismatch: "allowedTypes";
|
|
528
|
+
readonly location: "root" | {
|
|
529
|
+
readonly nodeType: string;
|
|
530
|
+
readonly fieldKey: string | undefined;
|
|
531
|
+
};
|
|
532
|
+
readonly view: readonly string[];
|
|
533
|
+
readonly stagedView?: readonly string[];
|
|
534
|
+
readonly stored: readonly string[];
|
|
535
|
+
readonly viewIsStagedOptional?: true;
|
|
536
|
+
} | {
|
|
537
|
+
readonly mismatch: "fieldKind";
|
|
538
|
+
readonly location: "root" | {
|
|
539
|
+
readonly nodeType: string;
|
|
540
|
+
readonly fieldKey: string | undefined;
|
|
541
|
+
};
|
|
542
|
+
readonly view: string;
|
|
543
|
+
readonly stored: string;
|
|
544
|
+
readonly viewIsStagedOptional?: true;
|
|
545
|
+
} | {
|
|
546
|
+
readonly mismatch: "valueSchema";
|
|
547
|
+
readonly nodeType: string;
|
|
548
|
+
readonly view: string | undefined;
|
|
549
|
+
readonly stored: string | undefined;
|
|
550
|
+
} | {
|
|
551
|
+
readonly mismatch: "nodeKind";
|
|
552
|
+
readonly nodeType: string;
|
|
553
|
+
readonly view: string;
|
|
554
|
+
readonly stored: string;
|
|
555
|
+
};
|
|
556
|
+
|
|
520
557
|
// @public @sealed
|
|
521
558
|
export class SchemaFactory<out TScope extends string | undefined = string | undefined, TName extends number | string = string> extends SchemaFactory_base {
|
|
522
559
|
constructor(
|
|
@@ -969,13 +1006,8 @@ export interface TreeBeta {
|
|
|
969
1006
|
// @beta
|
|
970
1007
|
export const TreeBeta: TreeBeta;
|
|
971
1008
|
|
|
972
|
-
// @beta @
|
|
973
|
-
export
|
|
974
|
-
dispose(error?: Error): void;
|
|
975
|
-
fork(): TreeBranch;
|
|
976
|
-
merge(branch: TreeBranch, disposeMerged?: boolean): void;
|
|
977
|
-
rebaseOnto(branch: TreeBranch): void;
|
|
978
|
-
}
|
|
1009
|
+
// @beta @deprecated
|
|
1010
|
+
export type TreeBranch = UntypedTreeView;
|
|
979
1011
|
|
|
980
1012
|
// @public @sealed
|
|
981
1013
|
export interface TreeChangeEvents {
|
|
@@ -1112,9 +1144,10 @@ export interface TreeView<in out TSchema extends ImplicitFieldSchema> extends ID
|
|
|
1112
1144
|
}
|
|
1113
1145
|
|
|
1114
1146
|
// @beta @sealed
|
|
1115
|
-
export interface TreeViewBeta<in out TSchema extends ImplicitFieldSchema> extends TreeView<TSchema>,
|
|
1147
|
+
export interface TreeViewBeta<in out TSchema extends ImplicitFieldSchema> extends TreeView<TSchema>, UntypedTreeView {
|
|
1148
|
+
readonly compatibility: SchemaCompatibilityStatusBeta;
|
|
1116
1149
|
// (undocumented)
|
|
1117
|
-
fork(): ReturnType<
|
|
1150
|
+
fork(): ReturnType<UntypedTreeView["fork"]> & TreeViewBeta<TSchema>;
|
|
1118
1151
|
runTransaction<TOut extends TransactionCallbackStatusBeta<unknown, unknown> | VoidTransactionCallbackStatusBeta | void>(transaction: () => TOut, params?: RunTransactionParamsBeta): TOut extends TransactionCallbackStatusBeta<infer TSuccessValue, infer TFailureValue> ? TransactionValueResult<TSuccessValue, TFailureValue> : TransactionVoidResult;
|
|
1119
1152
|
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>;
|
|
1120
1153
|
}
|
|
@@ -1169,6 +1202,14 @@ export type UnionToIntersection<T> = (T extends T ? (k: T) => unknown : never) e
|
|
|
1169
1202
|
// @beta @system
|
|
1170
1203
|
export type UnionToTuple<Union, A extends unknown[] = [], First = PopUnion<Union>> = IsUnion<Union> extends true ? UnionToTuple<Exclude<Union, First>, [First, ...A]> : [Union, ...A];
|
|
1171
1204
|
|
|
1205
|
+
// @beta @sealed
|
|
1206
|
+
export interface UntypedTreeView extends IDisposable {
|
|
1207
|
+
dispose(error?: Error): void;
|
|
1208
|
+
fork(): UntypedTreeView;
|
|
1209
|
+
merge(view: UntypedTreeView, disposeMerged?: boolean): void;
|
|
1210
|
+
rebaseOnto(view: UntypedTreeView): void;
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1172
1213
|
// @public
|
|
1173
1214
|
export type ValidateRecursiveSchema<T extends ValidateRecursiveSchemaTemplate<T>> = true;
|
|
1174
1215
|
|