@fluidframework/tree 2.74.0-368706 → 2.74.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 +2 -0
- package/CHANGELOG.md +11 -0
- package/api-report/tree.alpha.api.md +19 -15
- package/assertTagging.config.mjs +1 -1
- package/dist/alpha.d.ts +3 -0
- package/dist/codec/codec.d.ts +32 -17
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +40 -24
- package/dist/codec/codec.js.map +1 -1
- package/dist/core/change-family/changeFamily.d.ts +1 -4
- package/dist/core/change-family/changeFamily.d.ts.map +1 -1
- package/dist/core/change-family/changeFamily.js.map +1 -1
- package/dist/core/change-family/index.d.ts +1 -1
- package/dist/core/change-family/index.d.ts.map +1 -1
- package/dist/core/change-family/index.js.map +1 -1
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +4 -6
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/changeRebaser.d.ts +1 -6
- package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
- package/dist/core/rebase/changeRebaser.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 +1 -2
- package/dist/core/rebase/index.js.map +1 -1
- package/dist/core/rebase/types.d.ts +21 -3
- package/dist/core/rebase/types.d.ts.map +1 -1
- package/dist/core/rebase/types.js +1 -5
- 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 +7 -25
- package/dist/core/rebase/utils.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +4 -7
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +2 -2
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/tree/detachedFieldIndex.d.ts +0 -6
- package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndex.js +0 -9
- package/dist/core/tree/detachedFieldIndex.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts +4 -4
- package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.js +2 -2
- package/dist/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
- package/dist/core/tree/index.d.ts +1 -1
- package/dist/core/tree/index.d.ts.map +1 -1
- package/dist/core/tree/index.js +3 -4
- package/dist/core/tree/index.js.map +1 -1
- package/dist/core/tree/pathTree.d.ts +3 -11
- package/dist/core/tree/pathTree.d.ts.map +1 -1
- package/dist/core/tree/pathTree.js +2 -14
- package/dist/core/tree/pathTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.js +0 -7
- package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js +1 -4
- package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +2 -2
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts +5 -5
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.js +4 -4
- package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +42 -90
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js +69 -234
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +2 -11
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/default-schema/index.d.ts +1 -2
- package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/index.js +2 -4
- package/dist/feature-libraries/default-schema/index.js.map +1 -1
- package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts +6 -7
- package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/mappedEditBuilder.js +0 -15
- package/dist/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
- package/dist/feature-libraries/deltaUtils.d.ts +0 -1
- package/dist/feature-libraries/deltaUtils.d.ts.map +1 -1
- package/dist/feature-libraries/deltaUtils.js +1 -6
- package/dist/feature-libraries/deltaUtils.js.map +1 -1
- package/dist/feature-libraries/flex-tree/context.d.ts +0 -9
- package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/context.js +0 -6
- package/dist/feature-libraries/flex-tree/context.js.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.d.ts +7 -8
- package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +8 -37
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.d.ts +8 -2
- package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.js +13 -11
- 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 +18 -9
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/forest-summary/formatCommon.d.ts +61 -0
- package/dist/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/{format.js → formatCommon.js} +9 -6
- package/dist/feature-libraries/forest-summary/formatCommon.js.map +1 -0
- package/dist/feature-libraries/forest-summary/{format.d.ts → formatV1.d.ts} +6 -14
- package/dist/feature-libraries/forest-summary/formatV1.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/formatV1.js +11 -0
- package/dist/feature-libraries/forest-summary/formatV1.js.map +1 -0
- package/dist/feature-libraries/forest-summary/formatV2.d.ts +51 -0
- package/dist/feature-libraries/forest-summary/formatV2.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/formatV2.js +11 -0
- package/dist/feature-libraries/forest-summary/formatV2.js.map +1 -0
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +7 -15
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +11 -20
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
- package/dist/feature-libraries/forest-summary/index.d.ts +1 -2
- package/dist/feature-libraries/forest-summary/index.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/index.js +3 -5
- package/dist/feature-libraries/forest-summary/index.js.map +1 -1
- package/dist/feature-libraries/forest-summary/summaryFormatCommon.d.ts +35 -0
- package/dist/feature-libraries/forest-summary/summaryFormatCommon.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryFormatCommon.js +43 -0
- package/dist/feature-libraries/forest-summary/summaryFormatCommon.js.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts +11 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.js +14 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.js.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV3.d.ts +18 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV3.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV3.js +21 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV3.js.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryTypes.d.ts +7 -37
- package/dist/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/summaryTypes.js +23 -45
- package/dist/feature-libraries/forest-summary/summaryTypes.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 +3 -6
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
- package/dist/feature-libraries/mapTreeCursor.js +0 -1
- package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
- package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/mitigatedChangeFamily.js +2 -2
- package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.js +1 -1
- package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +21 -97
- package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.js +7 -4
- package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +52 -20
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.js +9 -3
- package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js +2 -2
- package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/index.d.ts +4 -4
- package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/index.js +8 -11
- package/dist/feature-libraries/modular-schema/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +284 -8
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +15 -48
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +465 -1298
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/{lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts → dist/feature-libraries/modular-schema/modularChangeFormat.d.ts} +2 -2
- package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/{modularChangeFormatV1.js → modularChangeFormat.js} +5 -5
- package/dist/feature-libraries/modular-schema/modularChangeFormat.js.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +10 -50
- package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeTypes.js +3 -24
- package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
- package/dist/feature-libraries/optional-field/index.d.ts +2 -2
- package/dist/feature-libraries/optional-field/index.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/index.js +2 -1
- package/dist/feature-libraries/optional-field/index.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.d.ts +26 -5
- package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.js +451 -217
- package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +33 -24
- package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js +28 -57
- package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +2 -3
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/codec.js +4 -4
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/feature-libraries/schema-index/formatV1.d.ts +1 -1
- package/dist/feature-libraries/schema-index/formatV2.d.ts +1 -1
- package/dist/feature-libraries/sequence-field/compose.d.ts +7 -6
- package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.js +256 -80
- package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
- package/dist/feature-libraries/sequence-field/helperTypes.d.ts +10 -14
- package/dist/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/helperTypes.js.map +1 -1
- package/dist/feature-libraries/sequence-field/index.d.ts +3 -2
- package/dist/feature-libraries/sequence-field/index.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/index.js +3 -1
- package/dist/feature-libraries/sequence-field/index.js.map +1 -1
- package/dist/feature-libraries/sequence-field/invert.d.ts +3 -3
- package/dist/feature-libraries/sequence-field/invert.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/invert.js +167 -65
- package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
- package/dist/feature-libraries/sequence-field/markQueue.d.ts +2 -2
- package/dist/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
- package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts +56 -4
- package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/moveEffectTable.js +86 -7
- package/dist/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
- package/dist/feature-libraries/sequence-field/rebase.d.ts +3 -3
- package/dist/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/rebase.js +112 -106
- package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
- package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +9 -0
- package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +1 -0
- package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js +50 -0
- package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -0
- package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/replaceRevisions.js +33 -16
- package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +2 -0
- package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +4 -22
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +179 -358
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js +60 -20
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js +10 -10
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +2 -3
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +109 -14
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
- package/dist/feature-libraries/sequence-field/types.d.ts +59 -30
- package/dist/feature-libraries/sequence-field/types.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/types.js.map +1 -1
- package/dist/feature-libraries/sequence-field/utils.d.ts +24 -15
- package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/utils.js +299 -111
- package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/shared-tree/independentView.d.ts.map +1 -1
- package/dist/shared-tree/independentView.js +1 -1
- package/dist/shared-tree/independentView.js.map +1 -1
- package/dist/shared-tree/index.d.ts +1 -1
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/schematizeTree.d.ts +4 -4
- package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
- package/dist/shared-tree/schematizeTree.js +1 -2
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +7 -2
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +36 -32
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +3 -9
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +0 -10
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.js +2 -3
- package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts +4 -4
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js +2 -2
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts +6 -16
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.js +6 -13
- package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +15 -12
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +54 -48
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts +2 -3
- package/dist/shared-tree-core/branch.d.ts.map +1 -1
- package/dist/shared-tree-core/branch.js +3 -4
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/shared-tree-core/editManager.d.ts +2 -2
- package/dist/shared-tree-core/editManager.d.ts.map +1 -1
- package/dist/shared-tree-core/editManager.js +9 -9
- package/dist/shared-tree-core/editManager.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts +0 -4
- package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js +7 -15
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js +1 -1
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts +8 -44
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js +2 -8
- package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.js +0 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts +1 -1
- package/dist/shared-tree-core/index.d.ts +3 -2
- package/dist/shared-tree-core/index.d.ts.map +1 -1
- package/dist/shared-tree-core/index.js +2 -3
- package/dist/shared-tree-core/index.js.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/messageCodecs.d.ts +0 -4
- package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js +9 -17
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/messageFormat.d.ts +9 -50
- package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormat.js +3 -8
- package/dist/shared-tree-core/messageFormat.js.map +1 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +2 -3
- package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.js +1 -8
- package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts +0 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/shared-tree-core/versionedSummarizer.d.ts +6 -1
- package/dist/shared-tree-core/versionedSummarizer.d.ts.map +1 -1
- package/dist/shared-tree-core/versionedSummarizer.js +4 -3
- package/dist/shared-tree-core/versionedSummarizer.js.map +1 -1
- package/dist/simple-tree/api/eraseSchemaDetails.d.ts +89 -0
- package/dist/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -0
- package/dist/simple-tree/api/eraseSchemaDetails.js +97 -0
- package/dist/simple-tree/api/eraseSchemaDetails.js.map +1 -0
- package/dist/simple-tree/api/index.d.ts +1 -0
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +5 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/storedSchema.d.ts +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/tree.d.ts +15 -2
- 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/treeNode.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNode.js +1 -0
- package/dist/simple-tree/core/treeNode.js.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts +15 -15
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js +8 -59
- package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/dist/simple-tree/createContext.d.ts.map +1 -1
- package/dist/simple-tree/createContext.js +1 -1
- package/dist/simple-tree/createContext.js.map +1 -1
- package/dist/simple-tree/fieldSchema.d.ts +4 -4
- package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
- package/dist/simple-tree/fieldSchema.js.map +1 -1
- package/dist/simple-tree/index.d.ts +3 -3
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +5 -3
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js +3 -5
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/common.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/common.js +1 -1
- package/dist/simple-tree/node-kinds/common.js.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.js +2 -2
- package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.js +18 -18
- package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.js +2 -4
- package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/dist/simple-tree/prepareForInsertion.d.ts +47 -54
- package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
- package/dist/simple-tree/prepareForInsertion.js +125 -183
- package/dist/simple-tree/prepareForInsertion.js.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +3 -3
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +4 -13
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +11 -29
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/dist/tableSchema.d.ts +3 -14
- package/dist/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +2 -2
- package/dist/tableSchema.js.map +1 -1
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +3 -17
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/brand.d.ts +49 -0
- package/dist/util/brand.d.ts.map +1 -1
- package/dist/util/brand.js +47 -1
- package/dist/util/brand.js.map +1 -1
- package/dist/util/index.d.ts +2 -2
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +4 -3
- package/dist/util/index.js.map +1 -1
- package/dist/util/rangeMap.d.ts +12 -24
- package/dist/util/rangeMap.d.ts.map +1 -1
- package/dist/util/rangeMap.js +6 -46
- package/dist/util/rangeMap.js.map +1 -1
- package/docs/main/sequence-field/move-composition.md +46 -0
- package/eslint.config.mts +98 -0
- package/lib/alpha.d.ts +3 -0
- package/lib/codec/codec.d.ts +32 -17
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +34 -18
- package/lib/codec/codec.js.map +1 -1
- package/lib/core/change-family/changeFamily.d.ts +1 -4
- package/lib/core/change-family/changeFamily.d.ts.map +1 -1
- package/lib/core/change-family/changeFamily.js.map +1 -1
- package/lib/core/change-family/index.d.ts +1 -1
- package/lib/core/change-family/index.d.ts.map +1 -1
- package/lib/core/change-family/index.js.map +1 -1
- package/lib/core/index.d.ts +3 -3
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +2 -2
- package/lib/core/index.js.map +1 -1
- package/lib/core/rebase/changeRebaser.d.ts +1 -6
- package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
- package/lib/core/rebase/changeRebaser.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 +21 -3
- package/lib/core/rebase/types.d.ts.map +1 -1
- package/lib/core/rebase/types.js +0 -3
- 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 +7 -25
- package/lib/core/rebase/utils.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +4 -7
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +3 -3
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/tree/detachedFieldIndex.d.ts +0 -6
- package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndex.js +1 -10
- package/lib/core/tree/detachedFieldIndex.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts +4 -4
- package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatCommon.js +3 -3
- package/lib/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
- package/lib/core/tree/index.d.ts +1 -1
- package/lib/core/tree/index.d.ts.map +1 -1
- package/lib/core/tree/index.js +1 -1
- package/lib/core/tree/index.js.map +1 -1
- package/lib/core/tree/pathTree.d.ts +3 -11
- package/lib/core/tree/pathTree.d.ts.map +1 -1
- package/lib/core/tree/pathTree.js +1 -12
- package/lib/core/tree/pathTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.js +1 -8
- package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js +1 -4
- package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +3 -3
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts +5 -5
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.js +5 -5
- package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +42 -90
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js +69 -232
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js +2 -11
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/lib/feature-libraries/default-schema/index.d.ts +1 -2
- package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/index.js +1 -2
- package/lib/feature-libraries/default-schema/index.js.map +1 -1
- package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts +6 -7
- package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/mappedEditBuilder.js +0 -15
- package/lib/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
- package/lib/feature-libraries/deltaUtils.d.ts +0 -1
- package/lib/feature-libraries/deltaUtils.d.ts.map +1 -1
- package/lib/feature-libraries/deltaUtils.js +1 -5
- package/lib/feature-libraries/deltaUtils.js.map +1 -1
- package/lib/feature-libraries/flex-tree/context.d.ts +0 -9
- package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/context.js +0 -6
- package/lib/feature-libraries/flex-tree/context.js.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.d.ts +7 -8
- package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +9 -38
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.d.ts +8 -2
- package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.js +12 -11
- 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 +19 -10
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/forest-summary/formatCommon.d.ts +61 -0
- package/lib/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/{format.js → formatCommon.js} +8 -6
- package/lib/feature-libraries/forest-summary/formatCommon.js.map +1 -0
- package/lib/feature-libraries/forest-summary/{format.d.ts → formatV1.d.ts} +6 -14
- package/lib/feature-libraries/forest-summary/formatV1.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/formatV1.js +8 -0
- package/lib/feature-libraries/forest-summary/formatV1.js.map +1 -0
- package/lib/feature-libraries/forest-summary/formatV2.d.ts +51 -0
- package/lib/feature-libraries/forest-summary/formatV2.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/formatV2.js +8 -0
- package/lib/feature-libraries/forest-summary/formatV2.js.map +1 -0
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +7 -15
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +11 -20
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
- package/lib/feature-libraries/forest-summary/index.d.ts +1 -2
- package/lib/feature-libraries/forest-summary/index.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/index.js +1 -2
- package/lib/feature-libraries/forest-summary/index.js.map +1 -1
- package/lib/feature-libraries/forest-summary/summaryFormatCommon.d.ts +35 -0
- package/lib/feature-libraries/forest-summary/summaryFormatCommon.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryFormatCommon.js +40 -0
- package/lib/feature-libraries/forest-summary/summaryFormatCommon.js.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts +11 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.js +11 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.js.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV3.d.ts +18 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV3.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV3.js +18 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV3.js.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryTypes.d.ts +7 -37
- package/lib/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/summaryTypes.js +20 -43
- package/lib/feature-libraries/forest-summary/summaryTypes.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/mapTreeCursor.d.ts.map +1 -1
- package/lib/feature-libraries/mapTreeCursor.js +1 -2
- package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
- package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/mitigatedChangeFamily.js +2 -2
- package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.js +1 -1
- package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +21 -97
- package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/crossFieldQueries.js +5 -3
- package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +52 -20
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.js +9 -3
- package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/index.d.ts +4 -4
- package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/index.js +2 -3
- package/lib/feature-libraries/modular-schema/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +285 -9
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +15 -48
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +458 -1284
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/{dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts → lib/feature-libraries/modular-schema/modularChangeFormat.d.ts} +2 -2
- package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/{modularChangeFormatV1.js → modularChangeFormat.js} +2 -2
- package/lib/feature-libraries/modular-schema/modularChangeFormat.js.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +10 -50
- package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeTypes.js +2 -20
- package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
- package/lib/feature-libraries/optional-field/index.d.ts +2 -2
- package/lib/feature-libraries/optional-field/index.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/index.js +1 -1
- package/lib/feature-libraries/optional-field/index.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalField.d.ts +26 -5
- package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalField.js +449 -217
- package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +33 -24
- package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js +26 -55
- package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +2 -3
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/codec.js +5 -5
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/feature-libraries/schema-index/formatV1.d.ts +1 -1
- package/lib/feature-libraries/schema-index/formatV2.d.ts +1 -1
- package/lib/feature-libraries/sequence-field/compose.d.ts +7 -6
- package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.js +258 -82
- package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
- package/lib/feature-libraries/sequence-field/helperTypes.d.ts +10 -14
- package/lib/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/helperTypes.js.map +1 -1
- package/lib/feature-libraries/sequence-field/index.d.ts +3 -2
- package/lib/feature-libraries/sequence-field/index.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/index.js +1 -0
- package/lib/feature-libraries/sequence-field/index.js.map +1 -1
- package/lib/feature-libraries/sequence-field/invert.d.ts +3 -3
- package/lib/feature-libraries/sequence-field/invert.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/invert.js +169 -67
- package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
- package/lib/feature-libraries/sequence-field/markQueue.d.ts +2 -2
- package/lib/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
- package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts +56 -4
- package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/moveEffectTable.js +80 -6
- package/lib/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
- package/lib/feature-libraries/sequence-field/rebase.d.ts +3 -3
- package/lib/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/rebase.js +114 -108
- package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
- package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +9 -0
- package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +1 -0
- package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js +46 -0
- package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -0
- package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/replaceRevisions.js +33 -16
- package/lib/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +2 -0
- package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +4 -22
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +175 -350
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js +61 -21
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js +10 -10
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +2 -3
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js +109 -14
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
- package/lib/feature-libraries/sequence-field/types.d.ts +59 -30
- package/lib/feature-libraries/sequence-field/types.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/types.js.map +1 -1
- package/lib/feature-libraries/sequence-field/utils.d.ts +24 -15
- package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/utils.js +292 -107
- package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/shared-tree/independentView.d.ts.map +1 -1
- package/lib/shared-tree/independentView.js +2 -2
- package/lib/shared-tree/independentView.js.map +1 -1
- package/lib/shared-tree/index.d.ts +1 -1
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/schematizeTree.d.ts +4 -4
- package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
- package/lib/shared-tree/schematizeTree.js +2 -3
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +7 -2
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +39 -35
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +3 -9
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +0 -10
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.js +2 -3
- package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts +4 -4
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js +3 -3
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts +6 -16
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.js +5 -11
- package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +15 -12
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +57 -51
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts +2 -3
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +3 -4
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/shared-tree-core/editManager.d.ts +2 -2
- package/lib/shared-tree-core/editManager.d.ts.map +1 -1
- package/lib/shared-tree-core/editManager.js +9 -9
- package/lib/shared-tree-core/editManager.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts +0 -4
- package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js +7 -14
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts +8 -44
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.js +3 -9
- package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.js +0 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts +1 -1
- package/lib/shared-tree-core/index.d.ts +3 -2
- package/lib/shared-tree-core/index.d.ts.map +1 -1
- package/lib/shared-tree-core/index.js +2 -2
- package/lib/shared-tree-core/index.js.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/lib/shared-tree-core/messageCodecs.d.ts +0 -4
- package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecs.js +9 -16
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/messageFormat.d.ts +9 -50
- package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormat.js +3 -8
- package/lib/shared-tree-core/messageFormat.js.map +1 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +2 -3
- package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.js +1 -8
- package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
- package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts +0 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/shared-tree-core/versionedSummarizer.d.ts +6 -1
- package/lib/shared-tree-core/versionedSummarizer.d.ts.map +1 -1
- package/lib/shared-tree-core/versionedSummarizer.js +4 -3
- package/lib/shared-tree-core/versionedSummarizer.js.map +1 -1
- package/lib/simple-tree/api/eraseSchemaDetails.d.ts +89 -0
- package/lib/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -0
- package/lib/simple-tree/api/eraseSchemaDetails.js +92 -0
- package/lib/simple-tree/api/eraseSchemaDetails.js.map +1 -0
- package/lib/simple-tree/api/index.d.ts +1 -0
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +1 -0
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/storedSchema.d.ts +1 -1
- package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/storedSchema.js +1 -2
- package/lib/simple-tree/api/storedSchema.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +15 -2
- 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/treeNode.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNode.js +1 -0
- package/lib/simple-tree/core/treeNode.js.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts +15 -15
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js +8 -58
- package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/lib/simple-tree/createContext.d.ts.map +1 -1
- package/lib/simple-tree/createContext.js +1 -1
- package/lib/simple-tree/createContext.js.map +1 -1
- package/lib/simple-tree/fieldSchema.d.ts +4 -4
- package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
- package/lib/simple-tree/fieldSchema.js.map +1 -1
- package/lib/simple-tree/index.d.ts +3 -3
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +2 -2
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js +4 -6
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/common.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/common.js +2 -2
- package/lib/simple-tree/node-kinds/common.js.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.js +2 -2
- package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.js +19 -19
- package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNode.js +2 -4
- package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/lib/simple-tree/prepareForInsertion.d.ts +47 -54
- package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
- package/lib/simple-tree/prepareForInsertion.js +124 -183
- package/lib/simple-tree/prepareForInsertion.js.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +3 -3
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +4 -13
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +9 -26
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/lib/tableSchema.d.ts +3 -14
- package/lib/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +3 -3
- package/lib/tableSchema.js.map +1 -1
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +4 -18
- package/lib/treeFactory.js.map +1 -1
- package/lib/util/brand.d.ts +49 -0
- package/lib/util/brand.d.ts.map +1 -1
- package/lib/util/brand.js +44 -0
- package/lib/util/brand.js.map +1 -1
- package/lib/util/index.d.ts +2 -2
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +2 -2
- package/lib/util/index.js.map +1 -1
- package/lib/util/rangeMap.d.ts +12 -24
- package/lib/util/rangeMap.d.ts.map +1 -1
- package/lib/util/rangeMap.js +5 -44
- package/lib/util/rangeMap.js.map +1 -1
- package/package.json +24 -23
- package/src/codec/codec.ts +34 -18
- package/src/core/change-family/changeFamily.ts +0 -5
- package/src/core/change-family/index.ts +0 -1
- package/src/core/index.ts +2 -4
- package/src/core/rebase/changeRebaser.ts +1 -6
- package/src/core/rebase/index.ts +1 -1
- package/src/core/rebase/types.ts +26 -8
- package/src/core/rebase/utils.ts +7 -31
- package/src/core/schema-stored/schema.ts +5 -7
- package/src/core/tree/detachedFieldIndex.ts +1 -17
- package/src/core/tree/detachedFieldIndexFormatCommon.ts +4 -7
- package/src/core/tree/index.ts +1 -2
- package/src/core/tree/pathTree.ts +4 -16
- package/src/feature-libraries/chunked-forest/basicChunk.ts +1 -7
- package/src/feature-libraries/chunked-forest/chunkTree.ts +1 -6
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +3 -2
- package/src/feature-libraries/chunked-forest/codec/format.ts +6 -9
- package/src/feature-libraries/default-schema/defaultEditBuilder.ts +127 -393
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +5 -13
- package/src/feature-libraries/default-schema/index.ts +5 -16
- package/src/feature-libraries/default-schema/mappedEditBuilder.ts +9 -35
- package/src/feature-libraries/deltaUtils.ts +1 -6
- package/src/feature-libraries/flex-tree/context.ts +0 -17
- package/src/feature-libraries/flex-tree/flexTreeTypes.ts +8 -7
- package/src/feature-libraries/flex-tree/lazyField.ts +24 -66
- package/src/feature-libraries/forest-summary/codec.ts +25 -13
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +37 -12
- package/src/feature-libraries/forest-summary/{format.ts → formatCommon.ts} +10 -11
- package/src/feature-libraries/forest-summary/formatV1.ts +12 -0
- package/src/feature-libraries/forest-summary/formatV2.ts +12 -0
- package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +18 -21
- package/src/feature-libraries/forest-summary/index.ts +1 -2
- package/src/feature-libraries/forest-summary/summaryFormatCommon.ts +41 -0
- package/src/feature-libraries/forest-summary/summaryFormatV1ToV2.ts +11 -0
- package/src/feature-libraries/forest-summary/summaryFormatV3.ts +18 -0
- package/src/feature-libraries/forest-summary/summaryTypes.ts +26 -46
- package/src/feature-libraries/index.ts +8 -21
- package/src/feature-libraries/mapTreeCursor.ts +1 -2
- package/src/feature-libraries/mitigatedChangeFamily.ts +1 -3
- package/src/feature-libraries/modular-schema/comparison.ts +2 -1
- package/src/feature-libraries/modular-schema/crossFieldQueries.ts +44 -142
- package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +57 -36
- package/src/feature-libraries/modular-schema/genericFieldKind.ts +18 -6
- package/src/feature-libraries/modular-schema/genericFieldKindCodecs.ts +1 -1
- package/src/feature-libraries/modular-schema/index.ts +15 -20
- package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +499 -29
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +741 -2541
- package/src/feature-libraries/modular-schema/{modularChangeFormatV1.ts → modularChangeFormat.ts} +1 -2
- package/src/feature-libraries/modular-schema/modularChangeTypes.ts +10 -98
- package/src/feature-libraries/optional-field/index.ts +3 -1
- package/src/feature-libraries/optional-field/optionalField.ts +574 -317
- package/src/feature-libraries/optional-field/optionalFieldChangeTypes.ts +38 -24
- package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +35 -89
- package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +2 -3
- package/src/feature-libraries/schema-index/codec.ts +7 -9
- package/src/feature-libraries/sequence-field/compose.ts +519 -134
- package/src/feature-libraries/sequence-field/helperTypes.ts +19 -34
- package/src/feature-libraries/sequence-field/index.ts +9 -0
- package/src/feature-libraries/sequence-field/invert.ts +228 -103
- package/src/feature-libraries/sequence-field/markQueue.ts +2 -2
- package/src/feature-libraries/sequence-field/moveEffectTable.ts +191 -8
- package/src/feature-libraries/sequence-field/rebase.ts +203 -168
- package/src/feature-libraries/sequence-field/relevantRemovedRoots.ts +57 -0
- package/src/feature-libraries/sequence-field/replaceRevisions.ts +52 -31
- package/src/feature-libraries/sequence-field/sequenceFieldChangeHandler.ts +2 -0
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +220 -643
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +68 -56
- package/src/feature-libraries/sequence-field/sequenceFieldEditor.ts +27 -25
- package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +129 -19
- package/src/feature-libraries/sequence-field/types.ts +64 -34
- package/src/feature-libraries/sequence-field/utils.ts +346 -133
- package/src/index.ts +3 -0
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/independentView.ts +1 -2
- package/src/shared-tree/index.ts +2 -3
- package/src/shared-tree/schematizeTree.ts +8 -21
- package/src/shared-tree/schematizingTreeView.ts +73 -50
- package/src/shared-tree/sharedTree.ts +3 -19
- package/src/shared-tree/sharedTreeChangeCodecs.ts +3 -7
- package/src/shared-tree/sharedTreeChangeFamily.ts +4 -7
- package/src/shared-tree/sharedTreeEditBuilder.ts +12 -46
- package/src/shared-tree/treeCheckout.ts +92 -82
- package/src/shared-tree-core/branch.ts +2 -8
- package/src/shared-tree-core/editManager.ts +2 -16
- package/src/shared-tree-core/editManagerCodecs.ts +7 -17
- package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +1 -1
- package/src/shared-tree-core/editManagerFormatCommons.ts +6 -15
- package/src/shared-tree-core/editManagerFormatV1toV4.ts +1 -3
- package/src/shared-tree-core/index.ts +3 -2
- package/src/shared-tree-core/messageCodecV1ToV4.ts +1 -2
- package/src/shared-tree-core/messageCodecs.ts +9 -19
- package/src/shared-tree-core/messageFormat.ts +7 -15
- package/src/shared-tree-core/messageFormatV1ToV4.ts +2 -16
- package/src/shared-tree-core/sharedTreeCore.ts +1 -4
- package/src/shared-tree-core/versionedSummarizer.ts +10 -3
- package/src/simple-tree/api/eraseSchemaDetails.ts +123 -0
- package/src/simple-tree/api/index.ts +4 -0
- package/src/simple-tree/api/storedSchema.ts +2 -2
- package/src/simple-tree/api/tree.ts +16 -1
- package/src/simple-tree/core/treeNode.ts +1 -0
- package/src/simple-tree/core/unhydratedFlexTree.ts +36 -87
- package/src/simple-tree/createContext.ts +4 -1
- package/src/simple-tree/fieldSchema.ts +4 -6
- package/src/simple-tree/index.ts +3 -2
- package/src/simple-tree/node-kinds/array/arrayNode.ts +5 -7
- package/src/simple-tree/node-kinds/common.ts +5 -2
- package/src/simple-tree/node-kinds/map/mapNode.ts +4 -4
- package/src/simple-tree/node-kinds/object/objectNode.ts +26 -26
- package/src/simple-tree/node-kinds/record/recordNode.ts +9 -10
- package/src/simple-tree/prepareForInsertion.ts +200 -343
- package/src/simple-tree/toStoredSchema.ts +3 -3
- package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +14 -42
- package/src/tableSchema.ts +13 -18
- package/src/treeFactory.ts +5 -19
- package/src/util/brand.ts +61 -0
- package/src/util/index.ts +3 -3
- package/src/util/rangeMap.ts +18 -72
- package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +0 -36
- package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +0 -1
- package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js +0 -126
- package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js.map +0 -1
- package/dist/feature-libraries/forest-summary/format.d.ts.map +0 -1
- package/dist/feature-libraries/forest-summary/format.js.map +0 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +0 -17
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +0 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +0 -388
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +0 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +0 -17
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +0 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js +0 -413
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +0 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +0 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +0 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +0 -146
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +0 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js +0 -32
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js.map +0 -1
- package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +0 -36
- package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +0 -1
- package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js +0 -122
- package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js.map +0 -1
- package/lib/feature-libraries/forest-summary/format.d.ts.map +0 -1
- package/lib/feature-libraries/forest-summary/format.js.map +0 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +0 -17
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +0 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +0 -384
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +0 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +0 -17
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +0 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js +0 -409
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +0 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +0 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js.map +0 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +0 -146
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +0 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js +0 -29
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js.map +0 -1
- package/src/feature-libraries/default-schema/locationBasedEditBuilder.ts +0 -180
- package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +0 -732
- package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +0 -790
- package/src/feature-libraries/modular-schema/modularChangeFormatV2.ts +0 -62
package/.vscode/settings.json
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @fluidframework/tree
|
|
2
2
|
|
|
3
|
+
## 2.74.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Fixed bug in sending of revert edits after an aborted transaction ([#25978](https://github.com/microsoft/FluidFramework/pull/25978)) [93ec6c77dab](https://github.com/microsoft/FluidFramework/commit/93ec6c77dab27bd65c2b04862f578ac3876b2cbe)
|
|
8
|
+
|
|
9
|
+
Aborting a transaction used to put the tree in a state that would trigger an assert when sending some undo/redo edits to peers.
|
|
10
|
+
This would prevent some undo/redo edits from being sent and would put the tree in a broken state that prevented any further edits.
|
|
11
|
+
This issue could not have caused document corruption, so reopening the document was a possible remedy.
|
|
12
|
+
Aborting a transaction no longer puts the tree in such a state, so it is safe to perform undo/redo edits after that.
|
|
13
|
+
|
|
3
14
|
## 2.73.0
|
|
4
15
|
|
|
5
16
|
### Minor Changes
|
|
@@ -134,6 +134,15 @@ export interface BranchableTree extends ViewableTree {
|
|
|
134
134
|
rebase(branch: TreeBranchFork): void;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
+
// @alpha @sealed
|
|
138
|
+
export type ChangeMetadata = CommitMetadata & ({
|
|
139
|
+
readonly isLocal: true;
|
|
140
|
+
getChange(): JsonCompatibleReadOnly;
|
|
141
|
+
} | {
|
|
142
|
+
readonly isLocal: false;
|
|
143
|
+
readonly getChange?: undefined;
|
|
144
|
+
});
|
|
145
|
+
|
|
137
146
|
// @alpha
|
|
138
147
|
export function checkCompatibility(viewWhichCreatedStoredSchema: TreeViewConfiguration, view: TreeViewConfiguration): Omit<SchemaCompatibilityStatus, "canInitialize">;
|
|
139
148
|
|
|
@@ -239,6 +248,12 @@ export function enumFromStrings<TScope extends string, const Members extends rea
|
|
|
239
248
|
}, Record<string, never>, true, Record<string, never>, undefined>; }[Members[number]] : never>;
|
|
240
249
|
};
|
|
241
250
|
|
|
251
|
+
// @alpha
|
|
252
|
+
export function eraseSchemaDetails<TNode, ExtraSchemaProperties = unknown>(): <T extends ExtraSchemaProperties & TreeNodeSchema<string, NodeKind, TNode & TreeNode>>(schema: T) => ExtraSchemaProperties & TreeNodeSchema<T["identifier"], NodeKind, TNode & TreeNode & WithType<T["identifier"]>, never, false>;
|
|
253
|
+
|
|
254
|
+
// @alpha
|
|
255
|
+
export function eraseSchemaDetailsSubclassable<TNode, ExtraSchemaProperties = unknown>(): <T extends ExtraSchemaProperties & TreeNodeSchemaClass<string, NodeKind, TNode & TreeNode>>(schema: T) => ExtraSchemaProperties & TreeNodeSchemaClass<T["identifier"], NodeKind, TNode & TreeNode & WithType<T["identifier"]>, never, false>;
|
|
256
|
+
|
|
242
257
|
// @alpha
|
|
243
258
|
export function evaluateLazySchema<T extends TreeNodeSchema>(value: LazyItem<T>): T;
|
|
244
259
|
|
|
@@ -1042,7 +1057,6 @@ export interface SharedTreeFormatOptions {
|
|
|
1042
1057
|
|
|
1043
1058
|
// @alpha @input
|
|
1044
1059
|
export interface SharedTreeOptions extends SharedTreeOptionsBeta, Partial<CodecWriteOptions>, Partial<SharedTreeFormatOptions> {
|
|
1045
|
-
readonly enableDetachedRootEditing?: boolean;
|
|
1046
1060
|
readonly enableSharedBranches?: boolean;
|
|
1047
1061
|
shouldEncodeIncrementally?: IncrementalEncodingPolicy;
|
|
1048
1062
|
}
|
|
@@ -1163,20 +1177,9 @@ export namespace System_TableSchema {
|
|
|
1163
1177
|
readonly cells: FieldSchema_2<FieldKind_2.Required, TreeNodeSchemaClass<ScopedSchemaName<`com.fluidframework.table<${TUserScope}>`, "Row.cells">, NodeKind.Record, TreeRecordNode<TCellSchema> & WithType<ScopedSchemaName<`com.fluidframework.table<${TUserScope}>`, "Row.cells">, NodeKind.Record, unknown>, RecordNodeInsertableData_2<TCellSchema>, true, TCellSchema, undefined, unknown>, unknown>;
|
|
1164
1178
|
}>;
|
|
1165
1179
|
// @system
|
|
1166
|
-
export function createTableSchema<const TUserScope extends string, const TCellSchema extends ImplicitAllowedTypes, const TColumnSchema extends ColumnSchemaBase<TUserScope, TCellSchema>, const TRowSchema extends RowSchemaBase<TUserScope, TCellSchema>>(inputSchemaFactory: SchemaFactoryBeta<TUserScope>, _cellSchema: TCellSchema, columnSchema: TColumnSchema, rowSchema: TRowSchema):
|
|
1167
|
-
readonly table: FieldSchema_2<FieldKind_2.Required, TreeNodeSchemaClass<ScopedSchemaName<`com.fluidframework.table<${TUserScope}>`, "Table">, NodeKind.Object, TreeObjectNode_2< {
|
|
1168
|
-
readonly rows: TreeNodeSchemaClass<ScopedSchemaName<`com.fluidframework.table<${TUserScope}>`, "Table.rows">, NodeKind.Array, TreeArrayNode<TRowSchema, [TRowSchema] extends [ImplicitAllowedTypes] ? TreeNodeFromImplicitAllowedTypes<TRowSchema> : TreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>, [TRowSchema] extends [ImplicitAllowedTypes] ? InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema> : never, ReadonlyArrayNode_2<TreeNode | TreeLeafValue_2>> & WithType<ScopedSchemaName<`com.fluidframework.table<${TUserScope}>`, "Table.rows">, NodeKind.Array, unknown>, Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema>>, true, TRowSchema, undefined>;
|
|
1169
|
-
readonly columns: TreeNodeSchemaClass<ScopedSchemaName<`com.fluidframework.table<${TUserScope}>`, "Table.columns">, NodeKind.Array, TreeArrayNode<TColumnSchema, [TColumnSchema] extends [ImplicitAllowedTypes] ? TreeNodeFromImplicitAllowedTypes<TColumnSchema> : TreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>, [TColumnSchema] extends [ImplicitAllowedTypes] ? InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema> : never, ReadonlyArrayNode_2<TreeNode | TreeLeafValue_2>> & WithType<ScopedSchemaName<`com.fluidframework.table<${TUserScope}>`, "Table.columns">, NodeKind.Array, unknown>, Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema>>, true, TColumnSchema, undefined>;
|
|
1170
|
-
}, ScopedSchemaName<`com.fluidframework.table<${TUserScope}>`, "Table">>, object & {
|
|
1171
|
-
readonly rows: (InsertableTypedNode_2<TreeNodeSchemaCore_2<ScopedSchemaName<`com.fluidframework.table<${TUserScope}>`, "Table.rows">, NodeKind.Array, true, TRowSchema, Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema>>, unknown> & (new (data?: InternalTreeNode | Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema>> | undefined) => TreeArrayNode<TRowSchema, [TRowSchema] extends [ImplicitAllowedTypes] ? TreeNodeFromImplicitAllowedTypes<TRowSchema> : TreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>, [TRowSchema] extends [ImplicitAllowedTypes] ? InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema> : never, ReadonlyArrayNode_2<TreeNode | TreeLeafValue_2>> & WithType<ScopedSchemaName<`com.fluidframework.table<${TUserScope}>`, "Table.rows">, NodeKind.Array, unknown>)> | undefined) & InsertableTypedNode_2<TreeNodeSchemaCore_2<ScopedSchemaName<`com.fluidframework.table<${TUserScope}>`, "Table.rows">, NodeKind.Array, true, TRowSchema, Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema>>, unknown> & (new (data?: InternalTreeNode | Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema>> | undefined) => TreeArrayNode<TRowSchema, [TRowSchema] extends [ImplicitAllowedTypes] ? TreeNodeFromImplicitAllowedTypes<TRowSchema> : TreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>, [TRowSchema] extends [ImplicitAllowedTypes] ? InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema> : never, ReadonlyArrayNode_2<TreeNode | TreeLeafValue_2>> & WithType<ScopedSchemaName<`com.fluidframework.table<${TUserScope}>`, "Table.rows">, NodeKind.Array, unknown>)>;
|
|
1172
|
-
readonly columns: (InsertableTypedNode_2<TreeNodeSchemaCore_2<ScopedSchemaName<`com.fluidframework.table<${TUserScope}>`, "Table.columns">, NodeKind.Array, true, TColumnSchema, Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema>>, unknown> & (new (data?: InternalTreeNode | Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema>> | undefined) => TreeArrayNode<TColumnSchema, [TColumnSchema] extends [ImplicitAllowedTypes] ? TreeNodeFromImplicitAllowedTypes<TColumnSchema> : TreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>, [TColumnSchema] extends [ImplicitAllowedTypes] ? InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema> : never, ReadonlyArrayNode_2<TreeNode | TreeLeafValue_2>> & WithType<ScopedSchemaName<`com.fluidframework.table<${TUserScope}>`, "Table.columns">, NodeKind.Array, unknown>)> | undefined) & InsertableTypedNode_2<TreeNodeSchemaCore_2<ScopedSchemaName<`com.fluidframework.table<${TUserScope}>`, "Table.columns">, NodeKind.Array, true, TColumnSchema, Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema>>, unknown> & (new (data?: InternalTreeNode | Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema>> | undefined) => TreeArrayNode<TColumnSchema, [TColumnSchema] extends [ImplicitAllowedTypes] ? TreeNodeFromImplicitAllowedTypes<TColumnSchema> : TreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>, [TColumnSchema] extends [ImplicitAllowedTypes] ? InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema> : never, ReadonlyArrayNode_2<TreeNode | TreeLeafValue_2>> & WithType<ScopedSchemaName<`com.fluidframework.table<${TUserScope}>`, "Table.columns">, NodeKind.Array, unknown>)>;
|
|
1173
|
-
}, true, {
|
|
1174
|
-
readonly rows: TreeNodeSchemaClass<ScopedSchemaName<`com.fluidframework.table<${TUserScope}>`, "Table.rows">, NodeKind.Array, TreeArrayNode<TRowSchema, [TRowSchema] extends [ImplicitAllowedTypes] ? TreeNodeFromImplicitAllowedTypes<TRowSchema> : TreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>, [TRowSchema] extends [ImplicitAllowedTypes] ? InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema> : never, ReadonlyArrayNode_2<TreeNode | TreeLeafValue_2>> & WithType<ScopedSchemaName<`com.fluidframework.table<${TUserScope}>`, "Table.rows">, NodeKind.Array, unknown>, Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TRowSchema>>, true, TRowSchema, undefined>;
|
|
1175
|
-
readonly columns: TreeNodeSchemaClass<ScopedSchemaName<`com.fluidframework.table<${TUserScope}>`, "Table.columns">, NodeKind.Array, TreeArrayNode<TColumnSchema, [TColumnSchema] extends [ImplicitAllowedTypes] ? TreeNodeFromImplicitAllowedTypes<TColumnSchema> : TreeNodeFromImplicitAllowedTypes<ImplicitAllowedTypes>, [TColumnSchema] extends [ImplicitAllowedTypes] ? InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema> : never, ReadonlyArrayNode_2<TreeNode | TreeLeafValue_2>> & WithType<ScopedSchemaName<`com.fluidframework.table<${TUserScope}>`, "Table.columns">, NodeKind.Array, unknown>, Iterable<InsertableTreeNodeFromImplicitAllowedTypes<TColumnSchema>>, true, TColumnSchema, undefined>;
|
|
1176
|
-
}, never, unknown>, unknown>;
|
|
1177
|
-
}, never, unknown> & (new (data?: InternalTreeNode | undefined) => TreeNode & TableSchema.Table<TUserScope, TCellSchema, TColumnSchema, TRowSchema> & WithType<ScopedSchemaName<`com.fluidframework.table<${TUserScope}>`, "TableRoot">, NodeKind, unknown>) & {
|
|
1180
|
+
export function createTableSchema<const TUserScope extends string, const TCellSchema extends ImplicitAllowedTypes, const TColumnSchema extends ColumnSchemaBase<TUserScope, TCellSchema>, const TRowSchema extends RowSchemaBase<TUserScope, TCellSchema>>(inputSchemaFactory: SchemaFactoryBeta<TUserScope>, _cellSchema: TCellSchema, columnSchema: TColumnSchema, rowSchema: TRowSchema): {
|
|
1178
1181
|
create<TThis extends new (data?: InternalTreeNode | undefined) => TreeNode & TableSchema.Table<TUserScope, TCellSchema, TColumnSchema, TRowSchema> & WithType<ScopedSchemaName<`com.fluidframework.table<${TUserScope}>`, "TableRoot">, NodeKind, unknown>>(this: TThis, initialContents?: TableSchema.TableFactoryMethodParameters<TUserScope, TCellSchema, TColumnSchema, TRowSchema> | undefined): InstanceType<TThis>;
|
|
1179
|
-
};
|
|
1182
|
+
} & (new (data?: InternalTreeNode | undefined) => TreeNode & TableSchema.Table<TUserScope, TCellSchema, TColumnSchema, TRowSchema> & WithType<ScopedSchemaName<`com.fluidframework.table<${TUserScope}>`, "TableRoot">, NodeKind, unknown>) & TreeNodeSchemaCore<ScopedSchemaName<`com.fluidframework.table<${TUserScope}>`, "TableRoot"> & string, NodeKind, false, unknown, never, unknown> & (new (data: InternalTreeNode) => TreeNode & TableSchema.Table<TUserScope, TCellSchema, TColumnSchema, TRowSchema> & WithType<ScopedSchemaName<`com.fluidframework.table<${TUserScope}>`, "TableRoot">, NodeKind, unknown> & WithType<ScopedSchemaName<`com.fluidframework.table<${TUserScope}>`, "TableRoot"> & string, NodeKind, unknown>);
|
|
1180
1183
|
// @system
|
|
1181
1184
|
export type DefaultPropsType = ReturnType<typeof SchemaFactory.optional<[]>>;
|
|
1182
1185
|
// @system
|
|
@@ -1488,6 +1491,7 @@ export interface TreeBranch extends IDisposable {
|
|
|
1488
1491
|
|
|
1489
1492
|
// @alpha @sealed
|
|
1490
1493
|
export interface TreeBranchAlpha extends TreeBranch {
|
|
1494
|
+
applyChange(change: JsonCompatibleReadOnly): void;
|
|
1491
1495
|
readonly events: Listenable_2<TreeBranchEvents>;
|
|
1492
1496
|
// (undocumented)
|
|
1493
1497
|
fork(): TreeBranchAlpha;
|
|
@@ -1498,7 +1502,7 @@ export interface TreeBranchAlpha extends TreeBranch {
|
|
|
1498
1502
|
|
|
1499
1503
|
// @alpha @sealed
|
|
1500
1504
|
export interface TreeBranchEvents extends Omit<TreeViewEvents, "commitApplied"> {
|
|
1501
|
-
changed(data:
|
|
1505
|
+
changed(data: ChangeMetadata, getRevertible?: RevertibleAlphaFactory): void;
|
|
1502
1506
|
commitApplied(data: CommitMetadata, getRevertible?: RevertibleAlphaFactory): void;
|
|
1503
1507
|
}
|
|
1504
1508
|
|
package/assertTagging.config.mjs
CHANGED
package/dist/alpha.d.ts
CHANGED
|
@@ -150,6 +150,7 @@ export {
|
|
|
150
150
|
ArrayNodePojoEmulationSchema,
|
|
151
151
|
ArrayNodeSchema,
|
|
152
152
|
BranchableTree,
|
|
153
|
+
ChangeMetadata,
|
|
153
154
|
CodecWriteOptions,
|
|
154
155
|
DirtyTreeMap,
|
|
155
156
|
DirtyTreeStatus,
|
|
@@ -260,6 +261,8 @@ export {
|
|
|
260
261
|
createSimpleTreeIndex,
|
|
261
262
|
decodeSchemaCompatibilitySnapshot,
|
|
262
263
|
encodeSchemaCompatibilitySnapshot,
|
|
264
|
+
eraseSchemaDetails,
|
|
265
|
+
eraseSchemaDetailsSubclassable,
|
|
263
266
|
evaluateLazySchema,
|
|
264
267
|
exportCompatibilitySchemaSnapshot,
|
|
265
268
|
extractPersistedSchema,
|
package/dist/codec/codec.d.ts
CHANGED
|
@@ -279,8 +279,14 @@ export declare function withSchemaValidation<TInMemoryFormat, EncodedSchema exte
|
|
|
279
279
|
* If the need arises, they might be added in the future.
|
|
280
280
|
*
|
|
281
281
|
* @privateRemarks
|
|
282
|
-
*
|
|
283
|
-
*
|
|
282
|
+
* The entries in these enums should document the following:
|
|
283
|
+
* - The user facing impact of opting into a particular version. This will help customers decide if they want to opt into
|
|
284
|
+
* a new version. For example, document if there is an encoding efficiency improvement of oping into that version or newer.
|
|
285
|
+
* - Any new data formats that are introduced in that version. This will help developers tell which data formats a given
|
|
286
|
+
* version will write. For example, document if a new summary or encoding format is added in a version.
|
|
287
|
+
* - Whether the above features or data formats introduced in a version are enabled by default or require the
|
|
288
|
+
* {@link minVersionForCollab} option to be set to that particular version.
|
|
289
|
+
*
|
|
284
290
|
* Versions with no notable impact can be omitted.
|
|
285
291
|
*
|
|
286
292
|
* This scheme assumes a single version will always be enough to communicate compatibility.
|
|
@@ -311,46 +317,55 @@ export declare const FluidClientVersion: {
|
|
|
311
317
|
* Fluid Framework Client 2.43 and newer.
|
|
312
318
|
* @remarks
|
|
313
319
|
* New formats introduced in 2.43:
|
|
314
|
-
* - SchemaFormatVersion.v2
|
|
315
|
-
* - MessageFormatVersion.v4
|
|
316
|
-
* - EditManagerFormatVersion.v4
|
|
317
|
-
* -
|
|
320
|
+
* - SchemaFormatVersion.v2 - written when minVersionForCollab \>= 2.43
|
|
321
|
+
* - MessageFormatVersion.v4 - written when minVersionForCollab \>= 2.43
|
|
322
|
+
* - EditManagerFormatVersion.v4 - written when minVersionForCollab \>= 2.43
|
|
323
|
+
* - sequence-field/formatV3 - written when minVersionForCollab \>= 2.43
|
|
318
324
|
*/
|
|
319
325
|
readonly v2_43: "2.43.0";
|
|
320
326
|
/**
|
|
321
327
|
* Fluid Framework Client 2.52 and newer.
|
|
322
328
|
* @remarks
|
|
323
329
|
* New formats introduced in 2.52:
|
|
324
|
-
* - DetachedFieldIndexFormatVersion.v2
|
|
330
|
+
* - DetachedFieldIndexFormatVersion.v2 - written when minVersionForCollab \>= 2.52
|
|
325
331
|
*/
|
|
326
332
|
readonly v2_52: "2.52.0";
|
|
327
333
|
/**
|
|
328
334
|
* Fluid Framework Client 2.73 and newer.
|
|
329
335
|
* @remarks
|
|
330
336
|
* New formats introduced in 2.73:
|
|
331
|
-
* - FieldBatchFormatVersion
|
|
337
|
+
* - FieldBatchFormatVersion.v2 - written when minVersionForCollab \>= 2.73
|
|
332
338
|
*/
|
|
333
339
|
readonly v2_73: "2.73.0";
|
|
334
340
|
/**
|
|
335
341
|
* Fluid Framework Client 2.74 and newer.
|
|
336
342
|
* @remarks
|
|
337
343
|
* New formats introduced in 2.74:
|
|
338
|
-
* - SharedTreeSummaryFormatVersion
|
|
339
|
-
* - DetachedFieldIndexSummaryFormatVersion
|
|
340
|
-
* - SchemaSummaryFormatVersion
|
|
341
|
-
* - EditManagerSummaryFormatVersion
|
|
342
|
-
* - ForestSummaryFormatVersion
|
|
344
|
+
* - SharedTreeSummaryFormatVersion.v2 - written by default
|
|
345
|
+
* - DetachedFieldIndexSummaryFormatVersion.v2 - written by default
|
|
346
|
+
* - SchemaSummaryFormatVersion.v2 - written by default
|
|
347
|
+
* - EditManagerSummaryFormatVersion.v2 - written by default
|
|
348
|
+
* - ForestSummaryFormatVersion.v2 - written by default
|
|
349
|
+
* - ForestFormatVersion.v2 - written when minVersionForCollab \>= 2.74
|
|
350
|
+
* - ForestSummaryFormatVersion.v3 - written when minVersionForCollab \>= 2.74
|
|
343
351
|
*/
|
|
344
352
|
readonly v2_74: "2.74.0";
|
|
345
353
|
};
|
|
346
354
|
/**
|
|
347
|
-
* An up to date version which includes all
|
|
355
|
+
* An up to date version which includes all stable features.
|
|
348
356
|
* @remarks
|
|
349
|
-
* Use for cases when data is not persisted and thus would only ever be read by the
|
|
357
|
+
* Use for cases when data is not persisted and thus would only ever be read by the the same version of the code which read this value.
|
|
358
|
+
*
|
|
359
|
+
* The pkgVersion from this package (tree) can not be used here as it is not guaranteed to be a valid MinimumVersionForCollab
|
|
360
|
+
* and would also unexpectedly disable features in prereleases and on CI if it didn't fail validation.
|
|
361
|
+
* See {@link @fluidframework/runtime-utils/internal#cleanedPackageVersion} for more details on why cleanedPackageVersion is preferred over pkgVersion.
|
|
350
362
|
*
|
|
351
363
|
* @privateRemarks
|
|
352
|
-
*
|
|
353
|
-
*
|
|
364
|
+
* It is safe to use CleanedPackageVersion from runtime-utils here since features are enabled in minor versions,
|
|
365
|
+
* and this package (tree) depends on runtime-utils with a `~` semver range
|
|
366
|
+
* ensuring that the version of runtime-utils this was imported from will match the version of this (tree) package at least up to the minor version.
|
|
367
|
+
* Reusing this from runtime-utils avoids duplicating the cleanup logic here as well as the cost or recomputing it.
|
|
368
|
+
* If in the future for some reason this becomes not okay, runtime-utils could instead export a function that performs that cleanup logic which could be reused here.
|
|
354
369
|
*/
|
|
355
370
|
export declare const currentVersion: MinimumVersionForCollab;
|
|
356
371
|
export interface CodecTree {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../src/codec/codec.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../src/codec/codec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAkB,MAAM,8BAA8B,CAAC;AAEzE,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAErE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAE5F;;;GAGG;AACH,MAAM,WAAW,QAAQ,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ;IACrD;;OAEG;IACH,MAAM,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,GAAG,QAAQ,CAAC;CAC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,EAAE,SAAS,SAAS,EAAE,CAAC;CACzC;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,SAAS,GAAG,sBAAsB,CAMzE"}
|
package/dist/codec/codec.js
CHANGED
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.jsonableCodecTree = exports.currentVersion = exports.FluidClientVersion = exports.withSchemaValidation = exports.unitCodec = exports.ensureBinaryEncoding = exports.withDefaultBinaryEncoding = exports.makeCodecFamily = exports.DependentFormatVersion = exports.MappedDependentFormatVersion = exports.UniqueDependentFormatVersion = exports.extractJsonValidator = exports.toFormatValidator = exports.FormatValidatorNoOp = void 0;
|
|
8
|
+
const internal_1 = require("@fluidframework/runtime-utils/internal");
|
|
8
9
|
const client_utils_1 = require("@fluid-internal/client-utils");
|
|
9
|
-
const
|
|
10
|
+
const internal_2 = require("@fluidframework/core-utils/internal");
|
|
10
11
|
/**
|
|
11
12
|
* A {@link JsonValidator} implementation which performs no validation and accepts all data as valid.
|
|
12
13
|
* @privateRemarks Having this as an option unifies opting out of validation with selection of
|
|
@@ -48,7 +49,7 @@ class MappedDependentFormatVersion {
|
|
|
48
49
|
this.map = map;
|
|
49
50
|
}
|
|
50
51
|
lookup(parent) {
|
|
51
|
-
return this.map.get(parent) ?? (0,
|
|
52
|
+
return this.map.get(parent) ?? (0, internal_2.fail)(0xc73 /* Unknown parent version */);
|
|
52
53
|
}
|
|
53
54
|
}
|
|
54
55
|
exports.MappedDependentFormatVersion = MappedDependentFormatVersion;
|
|
@@ -65,14 +66,14 @@ function makeCodecFamily(registry) {
|
|
|
65
66
|
const codecs = new Map();
|
|
66
67
|
for (const [formatVersion, codec] of registry) {
|
|
67
68
|
if (codecs.has(formatVersion)) {
|
|
68
|
-
(0,
|
|
69
|
+
(0, internal_2.fail)(0xabf /* Duplicate codecs specified. */);
|
|
69
70
|
}
|
|
70
71
|
codecs.set(formatVersion, ensureBinaryEncoding(codec));
|
|
71
72
|
}
|
|
72
73
|
return {
|
|
73
74
|
resolve(formatVersion) {
|
|
74
75
|
const codec = codecs.get(formatVersion);
|
|
75
|
-
(0,
|
|
76
|
+
(0, internal_2.assert)(codec !== undefined, 0x5e6 /* Requested coded for unsupported format. */);
|
|
76
77
|
return codec;
|
|
77
78
|
},
|
|
78
79
|
getSupportedFormats() {
|
|
@@ -144,13 +145,13 @@ function withSchemaValidation(schema, codec, validator) {
|
|
|
144
145
|
encode: (obj, context) => {
|
|
145
146
|
const encoded = codec.encode(obj, context);
|
|
146
147
|
if (!compiledFormat.check(encoded)) {
|
|
147
|
-
(0,
|
|
148
|
+
(0, internal_2.fail)(0xac0 /* Encoded schema should validate */);
|
|
148
149
|
}
|
|
149
150
|
return encoded;
|
|
150
151
|
},
|
|
151
152
|
decode: (encoded, context) => {
|
|
152
153
|
if (!compiledFormat.check(encoded)) {
|
|
153
|
-
(0,
|
|
154
|
+
(0, internal_2.fail)(0xac1 /* Encoded schema should validate */);
|
|
154
155
|
}
|
|
155
156
|
// TODO: would be nice to provide a more specific validate type to the inner codec than the outer one gets.
|
|
156
157
|
return codec.decode(encoded, context);
|
|
@@ -173,8 +174,14 @@ exports.withSchemaValidation = withSchemaValidation;
|
|
|
173
174
|
* If the need arises, they might be added in the future.
|
|
174
175
|
*
|
|
175
176
|
* @privateRemarks
|
|
176
|
-
*
|
|
177
|
-
*
|
|
177
|
+
* The entries in these enums should document the following:
|
|
178
|
+
* - The user facing impact of opting into a particular version. This will help customers decide if they want to opt into
|
|
179
|
+
* a new version. For example, document if there is an encoding efficiency improvement of oping into that version or newer.
|
|
180
|
+
* - Any new data formats that are introduced in that version. This will help developers tell which data formats a given
|
|
181
|
+
* version will write. For example, document if a new summary or encoding format is added in a version.
|
|
182
|
+
* - Whether the above features or data formats introduced in a version are enabled by default or require the
|
|
183
|
+
* {@link minVersionForCollab} option to be set to that particular version.
|
|
184
|
+
*
|
|
178
185
|
* Versions with no notable impact can be omitted.
|
|
179
186
|
*
|
|
180
187
|
* This scheme assumes a single version will always be enough to communicate compatibility.
|
|
@@ -210,48 +217,57 @@ exports.FluidClientVersion = {
|
|
|
210
217
|
* Fluid Framework Client 2.43 and newer.
|
|
211
218
|
* @remarks
|
|
212
219
|
* New formats introduced in 2.43:
|
|
213
|
-
* - SchemaFormatVersion.v2
|
|
214
|
-
* - MessageFormatVersion.v4
|
|
215
|
-
* - EditManagerFormatVersion.v4
|
|
216
|
-
* -
|
|
220
|
+
* - SchemaFormatVersion.v2 - written when minVersionForCollab \>= 2.43
|
|
221
|
+
* - MessageFormatVersion.v4 - written when minVersionForCollab \>= 2.43
|
|
222
|
+
* - EditManagerFormatVersion.v4 - written when minVersionForCollab \>= 2.43
|
|
223
|
+
* - sequence-field/formatV3 - written when minVersionForCollab \>= 2.43
|
|
217
224
|
*/
|
|
218
225
|
v2_43: "2.43.0",
|
|
219
226
|
/**
|
|
220
227
|
* Fluid Framework Client 2.52 and newer.
|
|
221
228
|
* @remarks
|
|
222
229
|
* New formats introduced in 2.52:
|
|
223
|
-
* - DetachedFieldIndexFormatVersion.v2
|
|
230
|
+
* - DetachedFieldIndexFormatVersion.v2 - written when minVersionForCollab \>= 2.52
|
|
224
231
|
*/
|
|
225
232
|
v2_52: "2.52.0",
|
|
226
233
|
/**
|
|
227
234
|
* Fluid Framework Client 2.73 and newer.
|
|
228
235
|
* @remarks
|
|
229
236
|
* New formats introduced in 2.73:
|
|
230
|
-
* - FieldBatchFormatVersion
|
|
237
|
+
* - FieldBatchFormatVersion.v2 - written when minVersionForCollab \>= 2.73
|
|
231
238
|
*/
|
|
232
239
|
v2_73: "2.73.0",
|
|
233
240
|
/**
|
|
234
241
|
* Fluid Framework Client 2.74 and newer.
|
|
235
242
|
* @remarks
|
|
236
243
|
* New formats introduced in 2.74:
|
|
237
|
-
* - SharedTreeSummaryFormatVersion
|
|
238
|
-
* - DetachedFieldIndexSummaryFormatVersion
|
|
239
|
-
* - SchemaSummaryFormatVersion
|
|
240
|
-
* - EditManagerSummaryFormatVersion
|
|
241
|
-
* - ForestSummaryFormatVersion
|
|
244
|
+
* - SharedTreeSummaryFormatVersion.v2 - written by default
|
|
245
|
+
* - DetachedFieldIndexSummaryFormatVersion.v2 - written by default
|
|
246
|
+
* - SchemaSummaryFormatVersion.v2 - written by default
|
|
247
|
+
* - EditManagerSummaryFormatVersion.v2 - written by default
|
|
248
|
+
* - ForestSummaryFormatVersion.v2 - written by default
|
|
249
|
+
* - ForestFormatVersion.v2 - written when minVersionForCollab \>= 2.74
|
|
250
|
+
* - ForestSummaryFormatVersion.v3 - written when minVersionForCollab \>= 2.74
|
|
242
251
|
*/
|
|
243
252
|
v2_74: "2.74.0",
|
|
244
253
|
};
|
|
245
254
|
/**
|
|
246
|
-
* An up to date version which includes all
|
|
255
|
+
* An up to date version which includes all stable features.
|
|
247
256
|
* @remarks
|
|
248
|
-
* Use for cases when data is not persisted and thus would only ever be read by the
|
|
257
|
+
* Use for cases when data is not persisted and thus would only ever be read by the the same version of the code which read this value.
|
|
258
|
+
*
|
|
259
|
+
* The pkgVersion from this package (tree) can not be used here as it is not guaranteed to be a valid MinimumVersionForCollab
|
|
260
|
+
* and would also unexpectedly disable features in prereleases and on CI if it didn't fail validation.
|
|
261
|
+
* See {@link @fluidframework/runtime-utils/internal#cleanedPackageVersion} for more details on why cleanedPackageVersion is preferred over pkgVersion.
|
|
249
262
|
*
|
|
250
263
|
* @privateRemarks
|
|
251
|
-
*
|
|
252
|
-
*
|
|
264
|
+
* It is safe to use CleanedPackageVersion from runtime-utils here since features are enabled in minor versions,
|
|
265
|
+
* and this package (tree) depends on runtime-utils with a `~` semver range
|
|
266
|
+
* ensuring that the version of runtime-utils this was imported from will match the version of this (tree) package at least up to the minor version.
|
|
267
|
+
* Reusing this from runtime-utils avoids duplicating the cleanup logic here as well as the cost or recomputing it.
|
|
268
|
+
* If in the future for some reason this becomes not okay, runtime-utils could instead export a function that performs that cleanup logic which could be reused here.
|
|
253
269
|
*/
|
|
254
|
-
exports.currentVersion =
|
|
270
|
+
exports.currentVersion = internal_1.cleanedPackageVersion;
|
|
255
271
|
function jsonableCodecTree(tree) {
|
|
256
272
|
return {
|
|
257
273
|
name: tree.name,
|
package/dist/codec/codec.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec.js","sourceRoot":"","sources":["../../src/codec/codec.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,+DAAyE;AACzE,kEAAmE;AA4DnE;;;;GAIG;AACH,MAAM,aAAa,GAAkB;IACpC,OAAO,EAAE,GAA2B,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,IAAI,EAA0B,EAAE,CAAC,IAAI,EAAE,CAAC;CAC1F,CAAC;AAEF;;;GAGG;AACU,QAAA,mBAAmB,GAAG,iBAAiB,CAAC,aAAa,CAAC,CAAC;AAEpE;;GAEG;AACH,SAAgB,iBAAiB,CAAC,OAAsB;IACvD,OAAO,OAAqC,CAAC;AAC9C,CAAC;AAFD,8CAEC;AAED;;GAEG;AACH,SAAgB,oBAAoB,CAAC,KAAsC;IAC1E,OAAO,KAAiC,CAAC;AAC1C,CAAC;AAFD,oDAEC;AAqLD,MAAa,4BAA4B;IAGxC,YAAoC,KAAoB;QAApB,UAAK,GAAL,KAAK,CAAe;IAAG,CAAC;IACrD,MAAM,CAAC,OAAsB;QACnC,OAAO,IAAI,CAAC,KAAK,CAAC;IACnB,CAAC;CACD;AAPD,oEAOC;AAED,MAAa,4BAA4B;IAKxC,YAAoC,GAA+C;QAA/C,QAAG,GAAH,GAAG,CAA4C;IAAG,CAAC;IAChF,MAAM,CAAC,MAAsB;QACnC,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,IAAA,eAAI,EAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;IACzE,CAAC;CACD;AATD,oEASC;AAEY,QAAA,sBAAsB,GAAG;IACrC,UAAU,EAAE,CAAsC,KA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,CAAC,IAAI,CAAC;AAQ/E,SAAgB,iBAAiB,CAAC,IAAe;IAChD,OAAO;QACN,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,MAAM;QAC/B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,iBAAiB,CAAC;KAC/C,CAAC;AACH,CAAC;AAND,8CAMC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ErasedType } from \"@fluidframework/core-interfaces/internal\";\nimport { IsoBuffer, bufferToString } from \"@fluid-internal/client-utils\";\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\nimport type { Static, TAnySchema, TSchema } from \"@sinclair/typebox\";\n\nimport type { ChangeEncodingContext } from \"../core/index.js\";\nimport type { JsonCompatibleReadOnly } from \"../util/index.js\";\nimport type { MinimumVersionForCollab } from \"@fluidframework/runtime-definitions/internal\";\n\n/**\n * Translates decoded data to encoded data.\n * @remarks Typically paired with an {@link IEncoder}.\n */\nexport interface IEncoder<TDecoded, TEncoded, TContext> {\n\t/**\n\t * Encodes `obj` into some encoded format.\n\t */\n\tencode(obj: TDecoded, context: TContext): TEncoded;\n}\n\n/**\n * Translates encoded data to decoded data.\n * @remarks Typically paired with an {@link IEncoder}.\n */\nexport interface IDecoder<TDecoded, TEncoded, TContext> {\n\t/**\n\t * Decodes `obj` from some encoded format.\n\t */\n\tdecode(obj: TEncoded, context: TContext): TDecoded;\n}\n\n/**\n * Validates data complies with some particular schema.\n * Implementations are typically created by a {@link JsonValidator}.\n */\nexport interface SchemaValidationFunction<Schema extends TSchema> {\n\t/**\n\t * Returns whether the data matches a schema.\n\t */\n\tcheck(data: unknown): data is Static<Schema>;\n}\n\n/**\n * A kind of validator for SharedTree's internal data formats.\n * @remarks\n * Assuming no data corruption or type confusion, such validation should never fail.\n * Any client version compatibility issues should instead be detected by the data format versioning which Shared Tree does internally independent of data format validation.\n * However, persisted data can sometimes be corrupted, bugs can produce invalid data, or users can mix up which data is compatible with which APIs.\n * In such cases, a format validator can help catch issues.\n *\n * Current options are {@link FormatValidatorNoOp} and {@link FormatValidatorBasic}.\n * @privateRemarks\n * Implement using {@link toFormatValidator}.\n * Consume using {@link extractJsonValidator}.\n *\n * Exposing this as the stable API entry point (instead of {@link JsonValidator}) means that we avoid leaking the reference to TypeBox to the API surface.\n * Additionally, if we adopt non JSON formats, we can just update the validators as needed without breaking the API.\n * This also allows us to avoid stabilizing or documenting how handles interact with JSON validation since that is not exposed through this type.\n * @sealed @alpha\n */\nexport interface FormatValidator extends ErasedType<\"FormatValidator\"> {}\n\n/**\n * A {@link JsonValidator} implementation which performs no validation and accepts all data as valid.\n * @privateRemarks Having this as an option unifies opting out of validation with selection of\n * validators, simplifying code performing validation.\n */\nconst noopValidator: JsonValidator = {\n\tcompile: <Schema extends TSchema>() => ({ check: (data): data is Static<Schema> => true }),\n};\n\n/**\n * A {@link FormatValidator} which does no validation.\n * @alpha\n */\nexport const FormatValidatorNoOp = toFormatValidator(noopValidator);\n\n/**\n * Type erase a {@link JsonValidator} to a {@link FormatValidator}.\n */\nexport function toFormatValidator(factory: JsonValidator): FormatValidator {\n\treturn factory as unknown as FormatValidator;\n}\n\n/**\n * Un-type-erase the {@link FormatValidator}.\n */\nexport function extractJsonValidator(input: FormatValidator | JsonValidator): JsonValidator {\n\treturn input as unknown as JsonValidator;\n}\n\n/**\n * JSON schema validator compliant with draft 6 schema. See https://json-schema.org.\n * @alpha @input\n */\nexport interface JsonValidator {\n\t/**\n\t * Compiles the provided JSON schema into a validator for that schema.\n\t * @param schema - A valid draft 6 JSON schema\n\t * @remarks IFluidHandles--which have circular property references--are used in various places in SharedTree's persisted\n\t * format. Handles should only be contained in sections of data which are validated against the empty schema `{}`\n\t * (see https://datatracker.ietf.org/doc/html/draft-wright-json-schema-01#section-4.4).\n\t *\n\t * Implementations of `JsonValidator` must therefore tolerate these values, despite the input not being valid JSON.\n\t */\n\tcompile<Schema extends TSchema>(schema: Schema): SchemaValidationFunction<Schema>;\n}\n\n/**\n * Options relating to handling of persisted data.\n *\n * @see {@link CodecWriteOptions} for options that are specific to encoding data.\n * @alpha @input\n */\nexport interface ICodecOptions {\n\t/**\n\t * {@link FormatValidator} which SharedTree uses to validate persisted data it reads & writes\n\t * matches the expected encoded format (i.e. the wire format for ops and summaries).\n\t * @remarks\n\t * See {@link FormatValidatorNoOp} and {@link FormatValidatorBasic} for out-of-the-box implementations.\n\t *\n\t * This option is not \"on-by-default\" because JSON schema validation comes with a small but noticeable\n\t * runtime performance cost, and popular schema validation libraries have relatively large bundle size.\n\t *\n\t * SharedTree users are still encouraged to use a non-trivial validator (i.e. not `FormatValidatorNoOp`)\n\t * whenever reasonable: it gives better fail-fast behavior when unexpected encoded data is found,\n\t * which reduces the risk of unrecoverable data corruption.\n\t * @privateRemarks\n\t * This property should probably be renamed to `validator` before stabilizing the API.\n\t */\n\treadonly jsonValidator: FormatValidator;\n}\n\n/**\n * Options relating to encoding of persisted data.\n * @remarks\n * Extends {@link ICodecOptions} with options that are specific to encoding data.\n * @alpha @input\n */\nexport interface CodecWriteOptions extends ICodecOptions {\n\t/**\n\t * The minimum version of the Fluid Framework client output must be encoded to be compatible with.\n\t * @remarks\n\t * This is used to ensure that the the output from this codec can be used with older versions of the Fluid Framework client.\n\t * This includes both concurrent collaboration, and an older version opening the document later.\n\t *\n\t * Note that versions older than this should not result in data corruption if they access the data:\n\t * the data's format should be versioned and if they can't handle the format they should error.\n\t */\n\treadonly minVersionForCollab: MinimumVersionForCollab;\n}\n\n/**\n * `TContext` allows passing context to the codec which may configure how data is encoded/decoded.\n * This parameter is typically used for:\n * - Codecs which can pick from multiple encoding options, and imbue the encoded data with information about which option was used.\n * The caller of such a codec can provide context about which encoding choice to make as part of the `encode` call without creating\n * additional codecs. Note that this pattern can always be implemented by having the caller create multiple codecs and selecting the\n * appropriate one, but depending on API layering this might be less ergonomic.\n * - Context for the object currently being encoded, which might enable more efficient encoding. When used in this fashion, the codec author\n * should be careful to include the context somewhere in the encoded data such that decoding can correctly round-trip.\n * For example, a composed set of codecs could implement a form of {@link https://en.wikipedia.org/wiki/Dictionary_coder | dictionary coding}\n * using a context map which was created by the top-level codec and passed to the inner codecs.\n * This pattern is used:\n * - To avoid repeatedly encoding session ids on commits (only recording it once at the top level)\n * @remarks `TEncoded` should always be valid Json (i.e. not contain functions), but due to TypeScript's handling\n * of index signatures and `JsonCompatibleReadOnly`'s index signature in the Json object case, specifying this as a\n * type-system level constraint makes code that uses this interface more difficult to write.\n *\n * If provided, `TValidate` allows the input type passed to `decode` to be different than `TEncoded`.\n * This is useful when, for example, the type being decoded is `unknown` and must be validated to be a `TEncoded` before being decoded to a `TDecoded`.\n */\nexport interface IJsonCodec<\n\tTDecoded,\n\tTEncoded = JsonCompatibleReadOnly,\n\tTValidate = TEncoded,\n\tTContext = void,\n> extends IEncoder<TDecoded, TEncoded, TContext>,\n\t\tIDecoder<TDecoded, TValidate, TContext> {\n\tencodedSchema?: TAnySchema;\n}\n\n/**\n * @remarks TODO: We might consider using DataView or some kind of writer instead of IsoBuffer.\n */\nexport interface IBinaryCodec<TDecoded, TContext = void>\n\textends IEncoder<TDecoded, IsoBuffer, TContext>,\n\t\tIDecoder<TDecoded, IsoBuffer, TContext> {}\n\n/**\n * Contains knowledge of how to encode some in-memory type into JSON and binary formats,\n * as well as how to decode those representations.\n *\n * @remarks Codecs are typically used in shared-tree to convert data into some persisted format.\n * For this common use case, any format for encoding that was ever actually used needs to\n * be supported for decoding in all future code versions.\n *\n * Using an {@link ICodecFamily} is the recommended strategy for managing this support, keeping in\n * mind evolution of encodings over time.\n */\nexport interface IMultiFormatCodec<\n\tTDecoded,\n\tTJsonEncoded extends JsonCompatibleReadOnly = JsonCompatibleReadOnly,\n\tTJsonValidate = TJsonEncoded,\n\tTContext = void,\n> {\n\tjson: IJsonCodec<TDecoded, TJsonEncoded, TJsonValidate, TContext>;\n\tbinary: IBinaryCodec<TDecoded, TContext>;\n\n\t/** Ensures multi-format codecs cannot also be single-format codecs. */\n\tencode?: never;\n\t/** Ensures multi-format codecs cannot also be single-format codecs. */\n\tdecode?: never;\n}\n\n/**\n * Represents a family of codecs that can be used to encode and decode data in different formats.\n * The family is identified by a format version, which is typically used to select the codec to use.\n *\n * Separating codecs into families rather than having a single codec support multiple versions (i.e. currying\n * the `formatVersion` parameter)\n * allows avoiding some duplicate work at encode/decode time, since the vast majority of document usage will not\n * involve mixed format versions.\n *\n * @privateRemarks This interface currently assumes all codecs in a family require the same encode/decode context,\n * which isn't necessarily true.\n * This may need to be relaxed in the future.\n */\nexport interface ICodecFamily<TDecoded, TContext = void> {\n\t/**\n\t * @returns a codec that can be used to encode and decode data in the specified format.\n\t * @throws if the format version is not supported by this family.\n\t * @remarks Implementations should typically emit telemetry (either indirectly by throwing a well-known error with\n\t * logged properties or directly using some logger) when a format version is requested that is not supported.\n\t * This ensures that applications can diagnose compatibility issues.\n\t */\n\tresolve(\n\t\tformatVersion: FormatVersion,\n\t): IMultiFormatCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>;\n\n\t/**\n\t * @returns an iterable of all format versions supported by this family.\n\t */\n\tgetSupportedFormats(): Iterable<FormatVersion>;\n}\n\n/**\n * A version stamp for encoded data.\n *\n * Strings are used for formats that are not yet officially supported.\n * When such formats become officially supported/stable, they will be switched to using a number.\n * Undefined is tolerated to enable the scenario where data was not initially versioned.\n */\nexport type FormatVersion = number | string | undefined;\n\n/**\n * A format version which is dependent on some parent format version.\n */\nexport interface DependentFormatVersion<\n\tTParentVersion extends FormatVersion = FormatVersion,\n\tTChildVersion extends FormatVersion = FormatVersion,\n> {\n\t/**\n\t * Looks up the child format version for a given parent format version.\n\t * @param parent - The parent format version.\n\t * @returns The corresponding child format version.\n\t */\n\tlookup(parent: TParentVersion): TChildVersion;\n}\n\nexport class UniqueDependentFormatVersion<TChildVersion extends FormatVersion>\n\timplements DependentFormatVersion<FormatVersion, TChildVersion>\n{\n\tpublic constructor(private readonly child: TChildVersion) {}\n\tpublic lookup(_parent: FormatVersion): TChildVersion {\n\t\treturn this.child;\n\t}\n}\n\nexport class MappedDependentFormatVersion<\n\tTParentVersion extends FormatVersion = FormatVersion,\n\tTChildVersion extends FormatVersion = FormatVersion,\n> implements DependentFormatVersion<TParentVersion, TChildVersion>\n{\n\tpublic constructor(private readonly map: ReadonlyMap<TParentVersion, TChildVersion>) {}\n\tpublic lookup(parent: TParentVersion): TChildVersion {\n\t\treturn this.map.get(parent) ?? fail(0xc73 /* Unknown parent version */);\n\t}\n}\n\nexport const DependentFormatVersion = {\n\tfromUnique: <TChildVersion extends FormatVersion>(child: TChildVersion) =>\n\t\tnew UniqueDependentFormatVersion(child),\n\tfromMap: <TParentVersion extends FormatVersion, TChildVersion extends FormatVersion>(\n\t\tmap: ReadonlyMap<TParentVersion, TChildVersion>,\n\t) => new MappedDependentFormatVersion(map),\n\tfromPairs: <TParentVersion extends FormatVersion, TChildVersion extends FormatVersion>(\n\t\tpairs: Iterable<[TParentVersion, TChildVersion]>,\n\t) => new MappedDependentFormatVersion(new Map(pairs)),\n};\n\n/**\n * Creates a codec family from a registry of codecs.\n * Any codec that is not a {@link IMultiFormatCodec} will be wrapped with a default binary encoding.\n */\nexport function makeCodecFamily<TDecoded, TContext>(\n\tregistry: Iterable<\n\t\t[\n\t\t\tformatVersion: FormatVersion,\n\t\t\tcodec:\n\t\t\t\t| IMultiFormatCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>\n\t\t\t\t| IJsonCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>,\n\t\t]\n\t>,\n): ICodecFamily<TDecoded, TContext> {\n\tconst codecs: Map<\n\t\tFormatVersion,\n\t\tIMultiFormatCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>\n\t> = new Map();\n\tfor (const [formatVersion, codec] of registry) {\n\t\tif (codecs.has(formatVersion)) {\n\t\t\tfail(0xabf /* Duplicate codecs specified. */);\n\t\t}\n\t\tcodecs.set(formatVersion, ensureBinaryEncoding(codec));\n\t}\n\n\treturn {\n\t\tresolve(\n\t\t\tformatVersion: number,\n\t\t): IMultiFormatCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext> {\n\t\t\tconst codec = codecs.get(formatVersion);\n\t\t\tassert(codec !== undefined, 0x5e6 /* Requested coded for unsupported format. */);\n\t\t\treturn codec;\n\t\t},\n\t\tgetSupportedFormats(): Iterable<FormatVersion> {\n\t\t\treturn codecs.keys();\n\t\t},\n\t};\n}\n\nclass DefaultBinaryCodec<TDecoded, TContext> implements IBinaryCodec<TDecoded, TContext> {\n\tpublic constructor(\n\t\tprivate readonly jsonCodec: IJsonCodec<TDecoded, unknown, unknown, TContext>,\n\t) {}\n\n\tpublic encode(change: TDecoded, context: TContext): IsoBuffer {\n\t\tconst jsonable = this.jsonCodec.encode(change, context);\n\t\tconst json = JSON.stringify(jsonable);\n\t\treturn IsoBuffer.from(json);\n\t}\n\n\tpublic decode(change: IsoBuffer, context: TContext): TDecoded {\n\t\tconst json = bufferToString(change, \"utf8\");\n\t\tconst jsonable = JSON.parse(json);\n\t\treturn this.jsonCodec.decode(jsonable, context);\n\t}\n}\n\nfunction isJsonCodec<TDecoded, TContext>(\n\tcodec:\n\t\t| IMultiFormatCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>\n\t\t| IJsonCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>,\n): codec is IJsonCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext> {\n\treturn typeof codec.encode === \"function\" && typeof codec.decode === \"function\";\n}\n\n/**\n * Constructs a {@link IMultiFormatCodec} from a `IJsonCodec` using a generic binary encoding that simply writes\n * the json representation of the object to a buffer.\n */\nexport function withDefaultBinaryEncoding<TDecoded, TContext>(\n\tjsonCodec: IJsonCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>,\n): IMultiFormatCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext> {\n\treturn {\n\t\tjson: jsonCodec,\n\t\tbinary: new DefaultBinaryCodec(jsonCodec),\n\t};\n}\n\n/**\n * Ensures that the provided single or multi-format codec has a binary encoding.\n * Adapts the json encoding using {@link withDefaultBinaryEncoding} if necessary.\n */\nexport function ensureBinaryEncoding<TDecoded, TContext>(\n\tcodec:\n\t\t| IMultiFormatCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>\n\t\t| IJsonCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>,\n): IMultiFormatCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext> {\n\treturn isJsonCodec(codec) ? withDefaultBinaryEncoding(codec) : codec;\n}\n\n/**\n * Codec for objects which carry no information.\n */\nexport const unitCodec: IMultiFormatCodec<\n\t0,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnly,\n\tunknown\n> = {\n\tjson: {\n\t\tencode: () => 0,\n\t\tdecode: () => 0,\n\t},\n\tbinary: {\n\t\tencode: () => IsoBuffer.from(\"\"),\n\t\tdecode: () => 0,\n\t},\n};\n\n/**\n * Wraps a codec with JSON schema validation for its encoded type.\n * @returns An {@link IJsonCodec} which validates the data it encodes and decodes matches the provided schema.\n */\nexport function withSchemaValidation<\n\tTInMemoryFormat,\n\tEncodedSchema extends TSchema,\n\tTEncodedFormat = JsonCompatibleReadOnly,\n\tTValidate = TEncodedFormat,\n\tTContext = ChangeEncodingContext,\n>(\n\tschema: EncodedSchema,\n\tcodec: IJsonCodec<TInMemoryFormat, TEncodedFormat, TValidate, TContext>,\n\tvalidator?: JsonValidator | FormatValidator,\n): IJsonCodec<TInMemoryFormat, TEncodedFormat, TValidate, TContext> {\n\tif (!validator) {\n\t\treturn codec;\n\t}\n\tconst compiledFormat = extractJsonValidator(validator).compile(schema);\n\treturn {\n\t\tencode: (obj: TInMemoryFormat, context: TContext): TEncodedFormat => {\n\t\t\tconst encoded = codec.encode(obj, context);\n\t\t\tif (!compiledFormat.check(encoded)) {\n\t\t\t\tfail(0xac0 /* Encoded schema should validate */);\n\t\t\t}\n\t\t\treturn encoded;\n\t\t},\n\t\tdecode: (encoded: TValidate, context: TContext): TInMemoryFormat => {\n\t\t\tif (!compiledFormat.check(encoded)) {\n\t\t\t\tfail(0xac1 /* Encoded schema should validate */);\n\t\t\t}\n\t\t\t// TODO: would be nice to provide a more specific validate type to the inner codec than the outer one gets.\n\t\t\treturn codec.decode(encoded, context) as unknown as TInMemoryFormat;\n\t\t},\n\t};\n}\n\n/**\n * Versions of Fluid Framework client packages.\n * @remarks\n * Used to express compatibility requirements by indicating the oldest version with which compatibility must be maintained.\n *\n * When no compatibility-impacting change is made in a given version, the value associated with its enum entry may point to the older version which it's fully compatible with.\n * Note that this can change if a future version of the framework introduces an option to use something which is only supported at a particular version. In which case, the values of the enum may shift,\n * but the semantics of keys in this enum will not change.\n *\n * Do not depend on the value of this enums's entries: only depend on the keys (enum members) themselves.\n *\n * Some release may also be omitted if there is currently no need to express that specific version.\n * If the need arises, they might be added in the future.\n *\n * @privateRemarks\n * Entries in these enums should document the user facing impact of opting into a particular version.\n * For example, document if there is an encoding efficiency improvement of oping into that version or newer.\n * Versions with no notable impact can be omitted.\n *\n * This scheme assumes a single version will always be enough to communicate compatibility.\n * For this to work, compatibility has to be strictly increasing.\n * If this is violated (for example a subset of incompatible features from 3.x that are not in 3.0 are back ported to 2.x),\n * a more complex scheme may be needed to allow safely opting into incompatible features in those cases:\n * such a system can be added if/when its needed since it will be opt in and thus non-breaking.\n *\n * TODO: this should likely be defined higher in the stack and specified when creating the container, possibly as part of its schema.\n * TODO: compatibility requirements for how this enum can and cannot be changed should be clarified when/if it's used across multiple layers in the stack.\n * For example, if needed, would adding more leading zeros to the minor version break things.\n * @alpha\n */\nexport const FluidClientVersion = {\n\t/**\n\t * Fluid Framework Client 1.4 and newer.\n\t * @remarks\n\t * This opts into support for the 1.4 LTS branch.\n\t * @privateRemarks\n\t * As long as this code is in Tree, there is no reason to have this option as SharedTree did not exist in 1.4.\n\t */\n\t// v1_4 = 1.004,\n\n\t/**\n\t * Fluid Framework Client 2.0 and newer.\n\t */\n\tv2_0: \"2.0.0\",\n\n\t/** Fluid Framework Client 2.1 and newer. */\n\t// If we think we might want to start allowing opting into something that landed in 2.1 (without opting into something newer),\n\t// we could add an entry like this to allow users to indicate that they can be opted in once we are ready,\n\t// then update it to \"2.001\" once we actually have the opt in working.\n\t// v2_1 = v2_0,\n\n\t/**\n\t * Fluid Framework Client 2.43 and newer.\n\t * @remarks\n\t * New formats introduced in 2.43:\n\t * - SchemaFormatVersion.v2\n\t * - MessageFormatVersion.v4\n\t * - EditManagerFormatVersion.v4\n\t * - Sequence format version 3\n\t */\n\tv2_43: \"2.43.0\",\n\n\t/**\n\t * Fluid Framework Client 2.52 and newer.\n\t * @remarks\n\t * New formats introduced in 2.52:\n\t * - DetachedFieldIndexFormatVersion.v2\n\t */\n\tv2_52: \"2.52.0\",\n\n\t/**\n\t * Fluid Framework Client 2.73 and newer.\n\t * @remarks\n\t * New formats introduced in 2.73:\n\t * - FieldBatchFormatVersion v2\n\t */\n\tv2_73: \"2.73.0\",\n\n\t/**\n\t * Fluid Framework Client 2.74 and newer.\n\t * @remarks\n\t * New formats introduced in 2.74:\n\t * - SharedTreeSummaryFormatVersion v2\n\t * - DetachedFieldIndexSummaryFormatVersion v2\n\t * - SchemaSummaryFormatVersion v2\n\t * - EditManagerSummaryFormatVersion v2\n\t * - ForestSummaryFormatVersion v2\n\t */\n\tv2_74: \"2.74.0\",\n} as const satisfies Record<string, MinimumVersionForCollab>;\n\n/**\n * An up to date version which includes all the important stable features.\n * @remarks\n * Use for cases when data is not persisted and thus would only ever be read by the current version of the framework.\n *\n * @privateRemarks\n * Update as needed.\n * TODO: Consider using packageVersion.ts to keep this current.\n */\nexport const currentVersion: MinimumVersionForCollab = FluidClientVersion.v2_0;\n\nexport interface CodecTree {\n\treadonly name: string;\n\treadonly version: FormatVersion;\n\treadonly children?: readonly CodecTree[];\n}\n\nexport function jsonableCodecTree(tree: CodecTree): JsonCompatibleReadOnly {\n\treturn {\n\t\tname: tree.name,\n\t\tversion: tree.version ?? \"null\",\n\t\tchildren: tree.children?.map(jsonableCodecTree),\n\t};\n}\n"]}
|
|
1
|
+
{"version":3,"file":"codec.js","sourceRoot":"","sources":["../../src/codec/codec.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qEAAoH;AAEpH,+DAAyE;AACzE,kEAAmE;AA4DnE;;;;GAIG;AACH,MAAM,aAAa,GAAkB;IACpC,OAAO,EAAE,GAA2B,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,IAAI,EAA0B,EAAE,CAAC,IAAI,EAAE,CAAC;CAC1F,CAAC;AAEF;;;GAGG;AACU,QAAA,mBAAmB,GAAG,iBAAiB,CAAC,aAAa,CAAC,CAAC;AAEpE;;GAEG;AACH,SAAgB,iBAAiB,CAAC,OAAsB;IACvD,OAAO,OAAqC,CAAC;AAC9C,CAAC;AAFD,8CAEC;AAED;;GAEG;AACH,SAAgB,oBAAoB,CAAC,KAAsC;IAC1E,OAAO,KAAiC,CAAC;AAC1C,CAAC;AAFD,oDAEC;AAqLD,MAAa,4BAA4B;IAGxC,YAAoC,KAAoB;QAApB,UAAK,GAAL,KAAK,CAAe;IAAG,CAAC;IACrD,MAAM,CAAC,OAAsB;QACnC,OAAO,IAAI,CAAC,KAAK,CAAC;IACnB,CAAC;CACD;AAPD,oEAOC;AAED,MAAa,4BAA4B;IAKxC,YAAoC,GAA+C;QAA/C,QAAG,GAAH,GAAG,CAA4C;IAAG,CAAC;IAChF,MAAM,CAAC,MAAsB;QACnC,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,IAAA,eAAI,EAAC,KAAK,CAAC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IAEf;;;;;;;;;;;OAWG;IACH,KAAK,EAAE,QAAQ;CAC4C,CAAC;AAE7D;;;;;;;;;;;;;;;GAeG;AACU,QAAA,cAAc,GAA4B,gCAAiC,CAAC;AAQzF,SAAgB,iBAAiB,CAAC,IAAe;IAChD,OAAO;QACN,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,MAAM;QAC/B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,iBAAiB,CAAC;KAC/C,CAAC;AACH,CAAC;AAND,8CAMC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { cleanedPackageVersion as runtimeUtilsCleanedPackageVersion } from \"@fluidframework/runtime-utils/internal\";\nimport type { ErasedType } from \"@fluidframework/core-interfaces/internal\";\nimport { IsoBuffer, bufferToString } from \"@fluid-internal/client-utils\";\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\nimport type { Static, TAnySchema, TSchema } from \"@sinclair/typebox\";\n\nimport type { ChangeEncodingContext } from \"../core/index.js\";\nimport type { JsonCompatibleReadOnly } from \"../util/index.js\";\nimport type { MinimumVersionForCollab } from \"@fluidframework/runtime-definitions/internal\";\n\n/**\n * Translates decoded data to encoded data.\n * @remarks Typically paired with an {@link IEncoder}.\n */\nexport interface IEncoder<TDecoded, TEncoded, TContext> {\n\t/**\n\t * Encodes `obj` into some encoded format.\n\t */\n\tencode(obj: TDecoded, context: TContext): TEncoded;\n}\n\n/**\n * Translates encoded data to decoded data.\n * @remarks Typically paired with an {@link IEncoder}.\n */\nexport interface IDecoder<TDecoded, TEncoded, TContext> {\n\t/**\n\t * Decodes `obj` from some encoded format.\n\t */\n\tdecode(obj: TEncoded, context: TContext): TDecoded;\n}\n\n/**\n * Validates data complies with some particular schema.\n * Implementations are typically created by a {@link JsonValidator}.\n */\nexport interface SchemaValidationFunction<Schema extends TSchema> {\n\t/**\n\t * Returns whether the data matches a schema.\n\t */\n\tcheck(data: unknown): data is Static<Schema>;\n}\n\n/**\n * A kind of validator for SharedTree's internal data formats.\n * @remarks\n * Assuming no data corruption or type confusion, such validation should never fail.\n * Any client version compatibility issues should instead be detected by the data format versioning which Shared Tree does internally independent of data format validation.\n * However, persisted data can sometimes be corrupted, bugs can produce invalid data, or users can mix up which data is compatible with which APIs.\n * In such cases, a format validator can help catch issues.\n *\n * Current options are {@link FormatValidatorNoOp} and {@link FormatValidatorBasic}.\n * @privateRemarks\n * Implement using {@link toFormatValidator}.\n * Consume using {@link extractJsonValidator}.\n *\n * Exposing this as the stable API entry point (instead of {@link JsonValidator}) means that we avoid leaking the reference to TypeBox to the API surface.\n * Additionally, if we adopt non JSON formats, we can just update the validators as needed without breaking the API.\n * This also allows us to avoid stabilizing or documenting how handles interact with JSON validation since that is not exposed through this type.\n * @sealed @alpha\n */\nexport interface FormatValidator extends ErasedType<\"FormatValidator\"> {}\n\n/**\n * A {@link JsonValidator} implementation which performs no validation and accepts all data as valid.\n * @privateRemarks Having this as an option unifies opting out of validation with selection of\n * validators, simplifying code performing validation.\n */\nconst noopValidator: JsonValidator = {\n\tcompile: <Schema extends TSchema>() => ({ check: (data): data is Static<Schema> => true }),\n};\n\n/**\n * A {@link FormatValidator} which does no validation.\n * @alpha\n */\nexport const FormatValidatorNoOp = toFormatValidator(noopValidator);\n\n/**\n * Type erase a {@link JsonValidator} to a {@link FormatValidator}.\n */\nexport function toFormatValidator(factory: JsonValidator): FormatValidator {\n\treturn factory as unknown as FormatValidator;\n}\n\n/**\n * Un-type-erase the {@link FormatValidator}.\n */\nexport function extractJsonValidator(input: FormatValidator | JsonValidator): JsonValidator {\n\treturn input as unknown as JsonValidator;\n}\n\n/**\n * JSON schema validator compliant with draft 6 schema. See https://json-schema.org.\n * @alpha @input\n */\nexport interface JsonValidator {\n\t/**\n\t * Compiles the provided JSON schema into a validator for that schema.\n\t * @param schema - A valid draft 6 JSON schema\n\t * @remarks IFluidHandles--which have circular property references--are used in various places in SharedTree's persisted\n\t * format. Handles should only be contained in sections of data which are validated against the empty schema `{}`\n\t * (see https://datatracker.ietf.org/doc/html/draft-wright-json-schema-01#section-4.4).\n\t *\n\t * Implementations of `JsonValidator` must therefore tolerate these values, despite the input not being valid JSON.\n\t */\n\tcompile<Schema extends TSchema>(schema: Schema): SchemaValidationFunction<Schema>;\n}\n\n/**\n * Options relating to handling of persisted data.\n *\n * @see {@link CodecWriteOptions} for options that are specific to encoding data.\n * @alpha @input\n */\nexport interface ICodecOptions {\n\t/**\n\t * {@link FormatValidator} which SharedTree uses to validate persisted data it reads & writes\n\t * matches the expected encoded format (i.e. the wire format for ops and summaries).\n\t * @remarks\n\t * See {@link FormatValidatorNoOp} and {@link FormatValidatorBasic} for out-of-the-box implementations.\n\t *\n\t * This option is not \"on-by-default\" because JSON schema validation comes with a small but noticeable\n\t * runtime performance cost, and popular schema validation libraries have relatively large bundle size.\n\t *\n\t * SharedTree users are still encouraged to use a non-trivial validator (i.e. not `FormatValidatorNoOp`)\n\t * whenever reasonable: it gives better fail-fast behavior when unexpected encoded data is found,\n\t * which reduces the risk of unrecoverable data corruption.\n\t * @privateRemarks\n\t * This property should probably be renamed to `validator` before stabilizing the API.\n\t */\n\treadonly jsonValidator: FormatValidator;\n}\n\n/**\n * Options relating to encoding of persisted data.\n * @remarks\n * Extends {@link ICodecOptions} with options that are specific to encoding data.\n * @alpha @input\n */\nexport interface CodecWriteOptions extends ICodecOptions {\n\t/**\n\t * The minimum version of the Fluid Framework client output must be encoded to be compatible with.\n\t * @remarks\n\t * This is used to ensure that the the output from this codec can be used with older versions of the Fluid Framework client.\n\t * This includes both concurrent collaboration, and an older version opening the document later.\n\t *\n\t * Note that versions older than this should not result in data corruption if they access the data:\n\t * the data's format should be versioned and if they can't handle the format they should error.\n\t */\n\treadonly minVersionForCollab: MinimumVersionForCollab;\n}\n\n/**\n * `TContext` allows passing context to the codec which may configure how data is encoded/decoded.\n * This parameter is typically used for:\n * - Codecs which can pick from multiple encoding options, and imbue the encoded data with information about which option was used.\n * The caller of such a codec can provide context about which encoding choice to make as part of the `encode` call without creating\n * additional codecs. Note that this pattern can always be implemented by having the caller create multiple codecs and selecting the\n * appropriate one, but depending on API layering this might be less ergonomic.\n * - Context for the object currently being encoded, which might enable more efficient encoding. When used in this fashion, the codec author\n * should be careful to include the context somewhere in the encoded data such that decoding can correctly round-trip.\n * For example, a composed set of codecs could implement a form of {@link https://en.wikipedia.org/wiki/Dictionary_coder | dictionary coding}\n * using a context map which was created by the top-level codec and passed to the inner codecs.\n * This pattern is used:\n * - To avoid repeatedly encoding session ids on commits (only recording it once at the top level)\n * @remarks `TEncoded` should always be valid Json (i.e. not contain functions), but due to TypeScript's handling\n * of index signatures and `JsonCompatibleReadOnly`'s index signature in the Json object case, specifying this as a\n * type-system level constraint makes code that uses this interface more difficult to write.\n *\n * If provided, `TValidate` allows the input type passed to `decode` to be different than `TEncoded`.\n * This is useful when, for example, the type being decoded is `unknown` and must be validated to be a `TEncoded` before being decoded to a `TDecoded`.\n */\nexport interface IJsonCodec<\n\tTDecoded,\n\tTEncoded = JsonCompatibleReadOnly,\n\tTValidate = TEncoded,\n\tTContext = void,\n> extends IEncoder<TDecoded, TEncoded, TContext>,\n\t\tIDecoder<TDecoded, TValidate, TContext> {\n\tencodedSchema?: TAnySchema;\n}\n\n/**\n * @remarks TODO: We might consider using DataView or some kind of writer instead of IsoBuffer.\n */\nexport interface IBinaryCodec<TDecoded, TContext = void>\n\textends IEncoder<TDecoded, IsoBuffer, TContext>,\n\t\tIDecoder<TDecoded, IsoBuffer, TContext> {}\n\n/**\n * Contains knowledge of how to encode some in-memory type into JSON and binary formats,\n * as well as how to decode those representations.\n *\n * @remarks Codecs are typically used in shared-tree to convert data into some persisted format.\n * For this common use case, any format for encoding that was ever actually used needs to\n * be supported for decoding in all future code versions.\n *\n * Using an {@link ICodecFamily} is the recommended strategy for managing this support, keeping in\n * mind evolution of encodings over time.\n */\nexport interface IMultiFormatCodec<\n\tTDecoded,\n\tTJsonEncoded extends JsonCompatibleReadOnly = JsonCompatibleReadOnly,\n\tTJsonValidate = TJsonEncoded,\n\tTContext = void,\n> {\n\tjson: IJsonCodec<TDecoded, TJsonEncoded, TJsonValidate, TContext>;\n\tbinary: IBinaryCodec<TDecoded, TContext>;\n\n\t/** Ensures multi-format codecs cannot also be single-format codecs. */\n\tencode?: never;\n\t/** Ensures multi-format codecs cannot also be single-format codecs. */\n\tdecode?: never;\n}\n\n/**\n * Represents a family of codecs that can be used to encode and decode data in different formats.\n * The family is identified by a format version, which is typically used to select the codec to use.\n *\n * Separating codecs into families rather than having a single codec support multiple versions (i.e. currying\n * the `formatVersion` parameter)\n * allows avoiding some duplicate work at encode/decode time, since the vast majority of document usage will not\n * involve mixed format versions.\n *\n * @privateRemarks This interface currently assumes all codecs in a family require the same encode/decode context,\n * which isn't necessarily true.\n * This may need to be relaxed in the future.\n */\nexport interface ICodecFamily<TDecoded, TContext = void> {\n\t/**\n\t * @returns a codec that can be used to encode and decode data in the specified format.\n\t * @throws if the format version is not supported by this family.\n\t * @remarks Implementations should typically emit telemetry (either indirectly by throwing a well-known error with\n\t * logged properties or directly using some logger) when a format version is requested that is not supported.\n\t * This ensures that applications can diagnose compatibility issues.\n\t */\n\tresolve(\n\t\tformatVersion: FormatVersion,\n\t): IMultiFormatCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>;\n\n\t/**\n\t * @returns an iterable of all format versions supported by this family.\n\t */\n\tgetSupportedFormats(): Iterable<FormatVersion>;\n}\n\n/**\n * A version stamp for encoded data.\n *\n * Strings are used for formats that are not yet officially supported.\n * When such formats become officially supported/stable, they will be switched to using a number.\n * Undefined is tolerated to enable the scenario where data was not initially versioned.\n */\nexport type FormatVersion = number | string | undefined;\n\n/**\n * A format version which is dependent on some parent format version.\n */\nexport interface DependentFormatVersion<\n\tTParentVersion extends FormatVersion = FormatVersion,\n\tTChildVersion extends FormatVersion = FormatVersion,\n> {\n\t/**\n\t * Looks up the child format version for a given parent format version.\n\t * @param parent - The parent format version.\n\t * @returns The corresponding child format version.\n\t */\n\tlookup(parent: TParentVersion): TChildVersion;\n}\n\nexport class UniqueDependentFormatVersion<TChildVersion extends FormatVersion>\n\timplements DependentFormatVersion<FormatVersion, TChildVersion>\n{\n\tpublic constructor(private readonly child: TChildVersion) {}\n\tpublic lookup(_parent: FormatVersion): TChildVersion {\n\t\treturn this.child;\n\t}\n}\n\nexport class MappedDependentFormatVersion<\n\tTParentVersion extends FormatVersion = FormatVersion,\n\tTChildVersion extends FormatVersion = FormatVersion,\n> implements DependentFormatVersion<TParentVersion, TChildVersion>\n{\n\tpublic constructor(private readonly map: ReadonlyMap<TParentVersion, TChildVersion>) {}\n\tpublic lookup(parent: TParentVersion): TChildVersion {\n\t\treturn this.map.get(parent) ?? fail(0xc73 /* Unknown parent version */);\n\t}\n}\n\nexport const DependentFormatVersion = {\n\tfromUnique: <TChildVersion extends FormatVersion>(child: TChildVersion) =>\n\t\tnew UniqueDependentFormatVersion(child),\n\tfromMap: <TParentVersion extends FormatVersion, TChildVersion extends FormatVersion>(\n\t\tmap: ReadonlyMap<TParentVersion, TChildVersion>,\n\t) => new MappedDependentFormatVersion(map),\n\tfromPairs: <TParentVersion extends FormatVersion, TChildVersion extends FormatVersion>(\n\t\tpairs: Iterable<[TParentVersion, TChildVersion]>,\n\t) => new MappedDependentFormatVersion(new Map(pairs)),\n};\n\n/**\n * Creates a codec family from a registry of codecs.\n * Any codec that is not a {@link IMultiFormatCodec} will be wrapped with a default binary encoding.\n */\nexport function makeCodecFamily<TDecoded, TContext>(\n\tregistry: Iterable<\n\t\t[\n\t\t\tformatVersion: FormatVersion,\n\t\t\tcodec:\n\t\t\t\t| IMultiFormatCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>\n\t\t\t\t| IJsonCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>,\n\t\t]\n\t>,\n): ICodecFamily<TDecoded, TContext> {\n\tconst codecs: Map<\n\t\tFormatVersion,\n\t\tIMultiFormatCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>\n\t> = new Map();\n\tfor (const [formatVersion, codec] of registry) {\n\t\tif (codecs.has(formatVersion)) {\n\t\t\tfail(0xabf /* Duplicate codecs specified. */);\n\t\t}\n\t\tcodecs.set(formatVersion, ensureBinaryEncoding(codec));\n\t}\n\n\treturn {\n\t\tresolve(\n\t\t\tformatVersion: number,\n\t\t): IMultiFormatCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext> {\n\t\t\tconst codec = codecs.get(formatVersion);\n\t\t\tassert(codec !== undefined, 0x5e6 /* Requested coded for unsupported format. */);\n\t\t\treturn codec;\n\t\t},\n\t\tgetSupportedFormats(): Iterable<FormatVersion> {\n\t\t\treturn codecs.keys();\n\t\t},\n\t};\n}\n\nclass DefaultBinaryCodec<TDecoded, TContext> implements IBinaryCodec<TDecoded, TContext> {\n\tpublic constructor(\n\t\tprivate readonly jsonCodec: IJsonCodec<TDecoded, unknown, unknown, TContext>,\n\t) {}\n\n\tpublic encode(change: TDecoded, context: TContext): IsoBuffer {\n\t\tconst jsonable = this.jsonCodec.encode(change, context);\n\t\tconst json = JSON.stringify(jsonable);\n\t\treturn IsoBuffer.from(json);\n\t}\n\n\tpublic decode(change: IsoBuffer, context: TContext): TDecoded {\n\t\tconst json = bufferToString(change, \"utf8\");\n\t\tconst jsonable = JSON.parse(json);\n\t\treturn this.jsonCodec.decode(jsonable, context);\n\t}\n}\n\nfunction isJsonCodec<TDecoded, TContext>(\n\tcodec:\n\t\t| IMultiFormatCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>\n\t\t| IJsonCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>,\n): codec is IJsonCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext> {\n\treturn typeof codec.encode === \"function\" && typeof codec.decode === \"function\";\n}\n\n/**\n * Constructs a {@link IMultiFormatCodec} from a `IJsonCodec` using a generic binary encoding that simply writes\n * the json representation of the object to a buffer.\n */\nexport function withDefaultBinaryEncoding<TDecoded, TContext>(\n\tjsonCodec: IJsonCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>,\n): IMultiFormatCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext> {\n\treturn {\n\t\tjson: jsonCodec,\n\t\tbinary: new DefaultBinaryCodec(jsonCodec),\n\t};\n}\n\n/**\n * Ensures that the provided single or multi-format codec has a binary encoding.\n * Adapts the json encoding using {@link withDefaultBinaryEncoding} if necessary.\n */\nexport function ensureBinaryEncoding<TDecoded, TContext>(\n\tcodec:\n\t\t| IMultiFormatCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>\n\t\t| IJsonCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>,\n): IMultiFormatCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext> {\n\treturn isJsonCodec(codec) ? withDefaultBinaryEncoding(codec) : codec;\n}\n\n/**\n * Codec for objects which carry no information.\n */\nexport const unitCodec: IMultiFormatCodec<\n\t0,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnly,\n\tunknown\n> = {\n\tjson: {\n\t\tencode: () => 0,\n\t\tdecode: () => 0,\n\t},\n\tbinary: {\n\t\tencode: () => IsoBuffer.from(\"\"),\n\t\tdecode: () => 0,\n\t},\n};\n\n/**\n * Wraps a codec with JSON schema validation for its encoded type.\n * @returns An {@link IJsonCodec} which validates the data it encodes and decodes matches the provided schema.\n */\nexport function withSchemaValidation<\n\tTInMemoryFormat,\n\tEncodedSchema extends TSchema,\n\tTEncodedFormat = JsonCompatibleReadOnly,\n\tTValidate = TEncodedFormat,\n\tTContext = ChangeEncodingContext,\n>(\n\tschema: EncodedSchema,\n\tcodec: IJsonCodec<TInMemoryFormat, TEncodedFormat, TValidate, TContext>,\n\tvalidator?: JsonValidator | FormatValidator,\n): IJsonCodec<TInMemoryFormat, TEncodedFormat, TValidate, TContext> {\n\tif (!validator) {\n\t\treturn codec;\n\t}\n\tconst compiledFormat = extractJsonValidator(validator).compile(schema);\n\treturn {\n\t\tencode: (obj: TInMemoryFormat, context: TContext): TEncodedFormat => {\n\t\t\tconst encoded = codec.encode(obj, context);\n\t\t\tif (!compiledFormat.check(encoded)) {\n\t\t\t\tfail(0xac0 /* Encoded schema should validate */);\n\t\t\t}\n\t\t\treturn encoded;\n\t\t},\n\t\tdecode: (encoded: TValidate, context: TContext): TInMemoryFormat => {\n\t\t\tif (!compiledFormat.check(encoded)) {\n\t\t\t\tfail(0xac1 /* Encoded schema should validate */);\n\t\t\t}\n\t\t\t// TODO: would be nice to provide a more specific validate type to the inner codec than the outer one gets.\n\t\t\treturn codec.decode(encoded, context) as unknown as TInMemoryFormat;\n\t\t},\n\t};\n}\n\n/**\n * Versions of Fluid Framework client packages.\n * @remarks\n * Used to express compatibility requirements by indicating the oldest version with which compatibility must be maintained.\n *\n * When no compatibility-impacting change is made in a given version, the value associated with its enum entry may point to the older version which it's fully compatible with.\n * Note that this can change if a future version of the framework introduces an option to use something which is only supported at a particular version. In which case, the values of the enum may shift,\n * but the semantics of keys in this enum will not change.\n *\n * Do not depend on the value of this enums's entries: only depend on the keys (enum members) themselves.\n *\n * Some release may also be omitted if there is currently no need to express that specific version.\n * If the need arises, they might be added in the future.\n *\n * @privateRemarks\n * The entries in these enums should document the following:\n * - The user facing impact of opting into a particular version. This will help customers decide if they want to opt into\n * a new version. For example, document if there is an encoding efficiency improvement of oping into that version or newer.\n * - Any new data formats that are introduced in that version. This will help developers tell which data formats a given\n * version will write. For example, document if a new summary or encoding format is added in a version.\n * - Whether the above features or data formats introduced in a version are enabled by default or require the\n * {@link minVersionForCollab} option to be set to that particular version.\n *\n * Versions with no notable impact can be omitted.\n *\n * This scheme assumes a single version will always be enough to communicate compatibility.\n * For this to work, compatibility has to be strictly increasing.\n * If this is violated (for example a subset of incompatible features from 3.x that are not in 3.0 are back ported to 2.x),\n * a more complex scheme may be needed to allow safely opting into incompatible features in those cases:\n * such a system can be added if/when its needed since it will be opt in and thus non-breaking.\n *\n * TODO: this should likely be defined higher in the stack and specified when creating the container, possibly as part of its schema.\n * TODO: compatibility requirements for how this enum can and cannot be changed should be clarified when/if it's used across multiple layers in the stack.\n * For example, if needed, would adding more leading zeros to the minor version break things.\n * @alpha\n */\nexport const FluidClientVersion = {\n\t/**\n\t * Fluid Framework Client 1.4 and newer.\n\t * @remarks\n\t * This opts into support for the 1.4 LTS branch.\n\t * @privateRemarks\n\t * As long as this code is in Tree, there is no reason to have this option as SharedTree did not exist in 1.4.\n\t */\n\t// v1_4 = 1.004,\n\n\t/**\n\t * Fluid Framework Client 2.0 and newer.\n\t */\n\tv2_0: \"2.0.0\",\n\n\t/** Fluid Framework Client 2.1 and newer. */\n\t// If we think we might want to start allowing opting into something that landed in 2.1 (without opting into something newer),\n\t// we could add an entry like this to allow users to indicate that they can be opted in once we are ready,\n\t// then update it to \"2.001\" once we actually have the opt in working.\n\t// v2_1 = v2_0,\n\n\t/**\n\t * Fluid Framework Client 2.43 and newer.\n\t * @remarks\n\t * New formats introduced in 2.43:\n\t * - SchemaFormatVersion.v2 - written when minVersionForCollab \\>= 2.43\n\t * - MessageFormatVersion.v4 - written when minVersionForCollab \\>= 2.43\n\t * - EditManagerFormatVersion.v4 - written when minVersionForCollab \\>= 2.43\n\t * - sequence-field/formatV3 - written when minVersionForCollab \\>= 2.43\n\t */\n\tv2_43: \"2.43.0\",\n\n\t/**\n\t * Fluid Framework Client 2.52 and newer.\n\t * @remarks\n\t * New formats introduced in 2.52:\n\t * - DetachedFieldIndexFormatVersion.v2 - written when minVersionForCollab \\>= 2.52\n\t */\n\tv2_52: \"2.52.0\",\n\n\t/**\n\t * Fluid Framework Client 2.73 and newer.\n\t * @remarks\n\t * New formats introduced in 2.73:\n\t * - FieldBatchFormatVersion.v2 - written when minVersionForCollab \\>= 2.73\n\t */\n\tv2_73: \"2.73.0\",\n\n\t/**\n\t * Fluid Framework Client 2.74 and newer.\n\t * @remarks\n\t * New formats introduced in 2.74:\n\t * - SharedTreeSummaryFormatVersion.v2 - written by default\n\t * - DetachedFieldIndexSummaryFormatVersion.v2 - written by default\n\t * - SchemaSummaryFormatVersion.v2 - written by default\n\t * - EditManagerSummaryFormatVersion.v2 - written by default\n\t * - ForestSummaryFormatVersion.v2 - written by default\n\t * - ForestFormatVersion.v2 - written when minVersionForCollab \\>= 2.74\n\t * - ForestSummaryFormatVersion.v3 - written when minVersionForCollab \\>= 2.74\n\t */\n\tv2_74: \"2.74.0\",\n} as const satisfies Record<string, MinimumVersionForCollab>;\n\n/**\n * An up to date version which includes all stable features.\n * @remarks\n * Use for cases when data is not persisted and thus would only ever be read by the the same version of the code which read this value.\n *\n * The pkgVersion from this package (tree) can not be used here as it is not guaranteed to be a valid MinimumVersionForCollab\n * and would also unexpectedly disable features in prereleases and on CI if it didn't fail validation.\n * See {@link @fluidframework/runtime-utils/internal#cleanedPackageVersion} for more details on why cleanedPackageVersion is preferred over pkgVersion.\n *\n * @privateRemarks\n * It is safe to use CleanedPackageVersion from runtime-utils here since features are enabled in minor versions,\n * and this package (tree) depends on runtime-utils with a `~` semver range\n * ensuring that the version of runtime-utils this was imported from will match the version of this (tree) package at least up to the minor version.\n * Reusing this from runtime-utils avoids duplicating the cleanup logic here as well as the cost or recomputing it.\n * If in the future for some reason this becomes not okay, runtime-utils could instead export a function that performs that cleanup logic which could be reused here.\n */\nexport const currentVersion: MinimumVersionForCollab = runtimeUtilsCleanedPackageVersion;\n\nexport interface CodecTree {\n\treadonly name: string;\n\treadonly version: FormatVersion;\n\treadonly children?: readonly CodecTree[];\n}\n\nexport function jsonableCodecTree(tree: CodecTree): JsonCompatibleReadOnly {\n\treturn {\n\t\tname: tree.name,\n\t\tversion: tree.version ?? \"null\",\n\t\tchildren: tree.children?.map(jsonableCodecTree),\n\t};\n}\n"]}
|
|
@@ -8,13 +8,10 @@ import type { SchemaAndPolicy } from "../../core/index.js";
|
|
|
8
8
|
import type { JsonCompatibleReadOnly } from "../../util/index.js";
|
|
9
9
|
import type { ChangeRebaser, RevisionTag, TaggedChange } from "../rebase/index.js";
|
|
10
10
|
export interface ChangeFamily<TEditor extends ChangeFamilyEditor, TChange> {
|
|
11
|
-
buildEditor(mintRevisionTag: () => RevisionTag, changeReceiver: (change: TaggedChange<TChange>) => void
|
|
11
|
+
buildEditor(mintRevisionTag: () => RevisionTag, changeReceiver: (change: TaggedChange<TChange>) => void): TEditor;
|
|
12
12
|
readonly rebaser: ChangeRebaser<TChange>;
|
|
13
13
|
readonly codecs: ICodecFamily<TChange, ChangeEncodingContext>;
|
|
14
14
|
}
|
|
15
|
-
export interface EditorOptions {
|
|
16
|
-
readonly canMakeDetachedRootEdits: boolean;
|
|
17
|
-
}
|
|
18
15
|
export interface ChangeEncodingContext {
|
|
19
16
|
readonly originatorId: SessionId;
|
|
20
17
|
readonly revision: RevisionTag | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changeFamily.d.ts","sourceRoot":"","sources":["../../../src/core/change-family/changeFamily.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE9E,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEnF,MAAM,WAAW,YAAY,CAAC,OAAO,SAAS,kBAAkB,EAAE,OAAO;IACxE,WAAW,C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M,WAAW,kBAAkB;IAClC;;;;;;;OAOG;IACH,gBAAgB,IAAI,IAAI,CAAC;IAEzB;;;;;;;OAOG;IACH,eAAe,IAAI,IAAI,CAAC;CACxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changeFamily.js","sourceRoot":"","sources":["../../../src/core/change-family/changeFamily.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IIdCompressor, SessionId } from \"@fluidframework/id-compressor\";\n\nimport type { ICodecFamily, IJsonCodec } from \"../../codec/index.js\";\nimport type { SchemaAndPolicy } from \"../../core/index.js\";\nimport type { JsonCompatibleReadOnly } from \"../../util/index.js\";\nimport type { ChangeRebaser, RevisionTag, TaggedChange } from \"../rebase/index.js\";\n\nexport interface ChangeFamily<TEditor extends ChangeFamilyEditor, TChange> {\n\tbuildEditor(\n\t\tmintRevisionTag: () => RevisionTag,\n\t\tchangeReceiver: (change: TaggedChange<TChange>) => void,\n\t
|
|
1
|
+
{"version":3,"file":"changeFamily.js","sourceRoot":"","sources":["../../../src/core/change-family/changeFamily.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IIdCompressor, SessionId } from \"@fluidframework/id-compressor\";\n\nimport type { ICodecFamily, IJsonCodec } from \"../../codec/index.js\";\nimport type { SchemaAndPolicy } from \"../../core/index.js\";\nimport type { JsonCompatibleReadOnly } from \"../../util/index.js\";\nimport type { ChangeRebaser, RevisionTag, TaggedChange } from \"../rebase/index.js\";\n\nexport interface ChangeFamily<TEditor extends ChangeFamilyEditor, TChange> {\n\tbuildEditor(\n\t\tmintRevisionTag: () => RevisionTag,\n\t\tchangeReceiver: (change: TaggedChange<TChange>) => void,\n\t): TEditor;\n\n\treadonly rebaser: ChangeRebaser<TChange>;\n\treadonly codecs: ICodecFamily<TChange, ChangeEncodingContext>;\n}\n\nexport interface ChangeEncodingContext {\n\treadonly originatorId: SessionId;\n\treadonly revision: RevisionTag | undefined;\n\treadonly idCompressor: IIdCompressor;\n\treadonly schema?: SchemaAndPolicy;\n}\n\nexport type ChangeFamilyCodec<TChange> = IJsonCodec<\n\tTChange,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnly,\n\tChangeEncodingContext\n>;\n\nexport interface ChangeFamilyEditor {\n\t/**\n\t * Must be called when a new transaction starts.\n\t *\n\t * Note: transactions are an optional feature. It is valid to make edits outside of a transaction.\n\t *\n\t * For each call to this function, a matching call to `exitTransaction` must be made at a later time.\n\t * Can be called repeatedly to indicate the start of nesting transactions.\n\t */\n\tenterTransaction(): void;\n\n\t/**\n\t * Must be called when a transaction ends.\n\t *\n\t * Note: transactions are an optional feature. It is valid to make edits outside of a transaction.\n\t *\n\t * For each call to this function, a matching call to `enterTransaction` must be made at an earlier time.\n\t * Can be called repeatedly to indicate the end of nesting transactions.\n\t */\n\texitTransaction(): void;\n}\n"]}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export type { ChangeFamily, ChangeFamilyEditor, ChangeEncodingContext, ChangeFamilyCodec,
|
|
5
|
+
export type { ChangeFamily, ChangeFamilyEditor, ChangeEncodingContext, ChangeFamilyCodec, } from "./changeFamily.js";
|
|
6
6
|
export { EditBuilder } from "./editBuilder.js";
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/change-family/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EACX,YAAY,EACZ,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/change-family/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EACX,YAAY,EACZ,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/change-family/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/change-family/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAQH,mDAA+C;AAAtC,6GAAA,WAAW,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type {\n\tChangeFamily,\n\tChangeFamilyEditor,\n\tChangeEncodingContext,\n\tChangeFamilyCodec,\n} from \"./changeFamily.js\";\nexport { EditBuilder } from \"./editBuilder.js\";\n"]}
|