@fluidframework/tree 2.74.0-365691 → 2.74.0-370705
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 -2
- package/api-report/tree.alpha.api.md +119 -85
- package/api-report/tree.beta.api.md +0 -1
- package/api-report/tree.legacy.beta.api.md +0 -1
- package/api-report/tree.legacy.public.api.md +0 -1
- package/api-report/tree.public.api.md +0 -1
- package/dist/alpha.d.ts +3 -2
- package/dist/codec/codec.d.ts +14 -1
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +11 -0
- package/dist/codec/codec.js.map +1 -1
- package/dist/codec/versioned/codec.d.ts +1 -1
- package/dist/codec/versioned/codec.d.ts.map +1 -1
- package/dist/codec/versioned/codec.js.map +1 -1
- package/dist/codec/versioned/format.d.ts +4 -1
- package/dist/codec/versioned/format.d.ts.map +1 -1
- package/dist/codec/versioned/format.js +4 -1
- package/dist/codec/versioned/format.js.map +1 -1
- package/dist/core/change-family/changeFamily.d.ts +4 -1
- 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 +7 -4
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/changeRebaser.d.ts +6 -1
- 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 +2 -1
- package/dist/core/rebase/index.js.map +1 -1
- package/dist/core/rebase/types.d.ts +2 -1
- package/dist/core/rebase/types.d.ts.map +1 -1
- package/dist/core/rebase/types.js +5 -1
- 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 +25 -7
- package/dist/core/rebase/utils.js.map +1 -1
- package/dist/core/tree/detachedFieldIndex.d.ts +40 -13
- package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndex.js +21 -12
- package/dist/core/tree/detachedFieldIndex.js.map +1 -1
- package/dist/core/tree/index.d.ts +4 -3
- package/dist/core/tree/index.d.ts.map +1 -1
- package/dist/core/tree/index.js +6 -2
- package/dist/core/tree/index.js.map +1 -1
- package/dist/core/tree/pathTree.d.ts +11 -3
- package/dist/core/tree/pathTree.d.ts.map +1 -1
- package/dist/core/tree/pathTree.js +14 -2
- 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 +7 -0
- 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 +4 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +14 -6
- package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +7 -2
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +91 -42
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js +238 -69
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +4 -4
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +33 -28
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/default-schema/index.d.ts +2 -1
- package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/index.js +5 -2
- package/dist/feature-libraries/default-schema/index.js.map +1 -1
- package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +36 -0
- package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +1 -0
- package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js +126 -0
- package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js.map +1 -0
- package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts +7 -6
- package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/mappedEditBuilder.js +15 -0
- package/dist/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
- package/dist/feature-libraries/deltaUtils.d.ts +1 -0
- package/dist/feature-libraries/deltaUtils.d.ts.map +1 -1
- package/dist/feature-libraries/deltaUtils.js +6 -1
- package/dist/feature-libraries/deltaUtils.js.map +1 -1
- package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts +30 -8
- package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/detachedFieldIndexSummarizer.js +41 -11
- package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
- package/dist/feature-libraries/flex-tree/context.d.ts +9 -0
- package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/context.js +6 -0
- 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 +8 -7
- package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +37 -8
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.d.ts +2 -2
- package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.js +4 -4
- package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +9 -13
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +21 -26
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/forest-summary/format.d.ts +41 -5
- package/dist/feature-libraries/forest-summary/format.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/format.js +7 -7
- package/dist/feature-libraries/forest-summary/format.js.map +1 -1
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +11 -9
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +16 -29
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
- package/dist/feature-libraries/forest-summary/index.d.ts +2 -1
- package/dist/feature-libraries/forest-summary/index.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/index.js +3 -2
- package/dist/feature-libraries/forest-summary/index.js.map +1 -1
- package/dist/feature-libraries/forest-summary/summaryTypes.d.ts +47 -0
- package/dist/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryTypes.js +57 -0
- package/dist/feature-libraries/forest-summary/summaryTypes.js.map +1 -0
- package/dist/feature-libraries/index.d.ts +4 -4
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +8 -3
- 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 +1 -0
- 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 +18 -2
- package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.js +54 -3
- package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +97 -21
- package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.js +4 -7
- package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +20 -52
- 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/fieldKind.d.ts +25 -13
- package/dist/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKind.js +0 -21
- package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.js +7 -10
- 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 +6 -6
- package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/index.js +13 -8
- package/dist/feature-libraries/modular-schema/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +17 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +388 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +17 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js +413 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -0
- 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 +8 -284
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +49 -15
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +1306 -465
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/{modularChangeFormat.d.ts → modularChangeFormatV1.d.ts} +2 -2
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/{modularChangeFormat.js → modularChangeFormatV1.js} +5 -5
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +146 -0
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js +32 -0
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +50 -10
- package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeTypes.js +24 -3
- 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 +1 -2
- package/dist/feature-libraries/optional-field/index.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.d.ts +5 -26
- package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.js +217 -451
- package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts +23 -0
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts.map +1 -0
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.js +31 -0
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.js.map +1 -0
- package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +24 -33
- 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 +57 -28
- package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV3.d.ts +12 -0
- package/dist/feature-libraries/optional-field/optionalFieldCodecV3.d.ts.map +1 -0
- package/dist/feature-libraries/optional-field/optionalFieldCodecV3.js +57 -0
- package/dist/feature-libraries/optional-field/optionalFieldCodecV3.js.map +1 -0
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.js +5 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +27 -8
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.js +42 -16
- package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.d.ts +6 -7
- package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.js +80 -256
- package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
- package/dist/feature-libraries/sequence-field/helperTypes.d.ts +14 -10
- 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 +2 -3
- package/dist/feature-libraries/sequence-field/index.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/index.js +1 -3
- 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 +65 -167
- 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 +4 -56
- package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/moveEffectTable.js +7 -86
- 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 +106 -112
- package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
- package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/replaceRevisions.js +16 -33
- 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 +0 -2
- package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +22 -4
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +358 -179
- 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 +20 -60
- 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 +3 -2
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +14 -109
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
- package/dist/feature-libraries/sequence-field/types.d.ts +30 -59
- 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 +15 -24
- package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/utils.js +111 -299
- package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/shared-tree/independentView.d.ts +1 -1
- package/dist/shared-tree/independentView.d.ts.map +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 +2 -1
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +1 -5
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +32 -33
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +11 -5
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +14 -4
- 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 +1 -0
- package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.d.ts +20 -8
- package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.js +26 -12
- package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts +5 -5
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js +10 -4
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts +16 -6
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.js +14 -7
- package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +1 -1
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +12 -10
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +66 -17
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts +3 -2
- package/dist/shared-tree-core/branch.d.ts.map +1 -1
- package/dist/shared-tree-core/branch.js +4 -3
- 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 +4 -0
- package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js +16 -6
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/{lib/shared-tree-core/editManagerCodecsV5.d.ts → dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts} +3 -3
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -0
- package/dist/shared-tree-core/{editManagerCodecsV5.js → editManagerCodecsVSharedBranches.js} +7 -7
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -0
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts +20 -6
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js +22 -7
- 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 +1 -0
- package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/dist/shared-tree-core/{editManagerFormatV5.d.ts → editManagerFormatVSharedBranches.d.ts} +3 -3
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -0
- package/dist/shared-tree-core/{editManagerFormatV5.js → editManagerFormatVSharedBranches.js} +2 -2
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -0
- package/dist/shared-tree-core/editManagerSummarizer.d.ts +29 -9
- package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.js +41 -13
- package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/dist/shared-tree-core/index.d.ts +5 -3
- package/dist/shared-tree-core/index.d.ts.map +1 -1
- package/dist/shared-tree-core/index.js +8 -1
- 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/{lib/shared-tree-core/messageCodecV5.d.ts → dist/shared-tree-core/messageCodecVSharedBranches.d.ts} +2 -2
- package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -0
- package/dist/shared-tree-core/{messageCodecV5.js → messageCodecVSharedBranches.js} +6 -6
- package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -0
- package/dist/shared-tree-core/messageCodecs.d.ts +4 -0
- package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js +16 -6
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/messageFormat.d.ts +20 -6
- package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormat.js +22 -7
- package/dist/shared-tree-core/messageFormat.js.map +1 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +3 -2
- package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.js +8 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/{messageFormatV5.d.ts → messageFormatVSharedBranches.d.ts} +5 -7
- package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -0
- package/dist/shared-tree-core/{messageFormatV5.js → messageFormatVSharedBranches.js} +3 -2
- package/dist/shared-tree-core/messageFormatVSharedBranches.js.map +1 -0
- package/dist/shared-tree-core/sharedTreeCore.d.ts +14 -47
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +30 -18
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/shared-tree-core/summaryTypes.d.ts +94 -0
- package/dist/shared-tree-core/summaryTypes.d.ts.map +1 -0
- package/dist/shared-tree-core/summaryTypes.js +47 -0
- package/dist/shared-tree-core/summaryTypes.js.map +1 -0
- package/dist/shared-tree-core/versionedSummarizer.d.ts +67 -0
- package/dist/shared-tree-core/versionedSummarizer.d.ts.map +1 -0
- package/dist/shared-tree-core/versionedSummarizer.js +63 -0
- package/dist/shared-tree-core/versionedSummarizer.js.map +1 -0
- package/dist/simple-tree/api/configuration.d.ts +3 -26
- package/dist/simple-tree/api/configuration.d.ts.map +1 -1
- package/dist/simple-tree/api/configuration.js +10 -21
- package/dist/simple-tree/api/configuration.js.map +1 -1
- package/dist/simple-tree/api/dirtyIndex.d.ts +11 -0
- package/dist/simple-tree/api/dirtyIndex.d.ts.map +1 -1
- package/dist/simple-tree/api/dirtyIndex.js +7 -0
- package/dist/simple-tree/api/dirtyIndex.js.map +1 -1
- package/dist/simple-tree/api/discrepancies.d.ts +1 -1
- package/dist/simple-tree/api/discrepancies.d.ts.map +1 -1
- package/dist/simple-tree/api/discrepancies.js.map +1 -1
- package/dist/simple-tree/api/getSimpleSchema.d.ts +3 -3
- package/dist/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/getSimpleSchema.js +9 -3
- package/dist/simple-tree/api/getSimpleSchema.js.map +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.js +7 -0
- package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +3 -4
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +4 -5
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +5 -5
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.js +0 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.d.ts +6 -1
- package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.js +5 -0
- package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/dist/simple-tree/api/schemaStatics.d.ts +12 -12
- package/dist/simple-tree/api/simpleSchemaCodec.d.ts +15 -3
- package/dist/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
- package/dist/simple-tree/api/simpleSchemaCodec.js +18 -6
- package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +8 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js +13 -8
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.d.ts +3 -3
- package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
- package/dist/simple-tree/core/allowedTypes.d.ts +2 -2
- package/dist/simple-tree/core/allowedTypes.d.ts.map +1 -1
- package/dist/simple-tree/core/allowedTypes.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +1 -1
- package/dist/simple-tree/core/index.d.ts.map +1 -1
- package/dist/simple-tree/core/index.js +2 -3
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/toStored.d.ts +17 -15
- package/dist/simple-tree/core/toStored.d.ts.map +1 -1
- package/dist/simple-tree/core/toStored.js +5 -40
- package/dist/simple-tree/core/toStored.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 +59 -8
- package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/dist/simple-tree/core/walkSchema.d.ts.map +1 -1
- package/dist/simple-tree/core/walkSchema.js +4 -0
- package/dist/simple-tree/core/walkSchema.js.map +1 -1
- package/dist/simple-tree/createContext.d.ts.map +1 -1
- package/dist/simple-tree/createContext.js +20 -5
- package/dist/simple-tree/createContext.js.map +1 -1
- package/dist/simple-tree/fieldSchema.d.ts +7 -7
- 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 +8 -7
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +15 -12
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts +5 -5
- package/dist/simple-tree/leafNodeSchema.d.ts.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 +5 -3
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +3 -3
- package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNodeTypes.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.d.ts.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/map/mapNodeTypes.d.ts +3 -3
- package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNodeTypes.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/object/objectNodeTypes.d.ts +2 -2
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.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 +4 -2
- package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -3
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
- package/dist/simple-tree/prepareForInsertion.d.ts +54 -47
- package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
- package/dist/simple-tree/prepareForInsertion.js +183 -125
- package/dist/simple-tree/prepareForInsertion.js.map +1 -1
- package/dist/simple-tree/simpleSchema.d.ts +55 -23
- package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/simpleSchema.js +17 -0
- package/dist/simple-tree/simpleSchema.js.map +1 -1
- package/dist/simple-tree/simpleSchemaFormatV1.d.ts +1 -1
- package/dist/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
- package/dist/simple-tree/simpleSchemaFormatV1.js +8 -1
- package/dist/simple-tree/simpleSchemaFormatV1.js.map +1 -1
- package/dist/simple-tree/toStoredSchema.d.ts +58 -11
- package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +205 -30
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/simple-tree/treeSchema.d.ts +23 -0
- package/dist/simple-tree/treeSchema.d.ts.map +1 -0
- package/dist/simple-tree/treeSchema.js +25 -0
- package/dist/simple-tree/treeSchema.js.map +1 -0
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +13 -4
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +29 -11
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/dist/tableSchema.d.ts +117 -63
- package/dist/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +159 -58
- package/dist/tableSchema.js.map +1 -1
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +17 -3
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/index.d.ts +2 -1
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +4 -1
- package/dist/util/index.js.map +1 -1
- package/dist/util/rangeMap.d.ts +24 -12
- package/dist/util/rangeMap.d.ts.map +1 -1
- package/dist/util/rangeMap.js +46 -6
- package/dist/util/rangeMap.js.map +1 -1
- package/dist/util/readSnapshotBlob.d.ts +13 -0
- package/dist/util/readSnapshotBlob.d.ts.map +1 -0
- package/dist/util/readSnapshotBlob.js +18 -0
- package/dist/util/readSnapshotBlob.js.map +1 -0
- package/lib/alpha.d.ts +3 -2
- package/lib/codec/codec.d.ts +14 -1
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +11 -0
- package/lib/codec/codec.js.map +1 -1
- package/lib/codec/versioned/codec.d.ts +1 -1
- package/lib/codec/versioned/codec.d.ts.map +1 -1
- package/lib/codec/versioned/codec.js.map +1 -1
- package/lib/codec/versioned/format.d.ts +4 -1
- package/lib/codec/versioned/format.d.ts.map +1 -1
- package/lib/codec/versioned/format.js +4 -1
- package/lib/codec/versioned/format.js.map +1 -1
- package/lib/core/change-family/changeFamily.d.ts +4 -1
- 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 +6 -1
- 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 +2 -1
- package/lib/core/rebase/types.d.ts.map +1 -1
- package/lib/core/rebase/types.js +3 -0
- 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 +25 -7
- package/lib/core/rebase/utils.js.map +1 -1
- package/lib/core/tree/detachedFieldIndex.d.ts +40 -13
- package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndex.js +22 -13
- package/lib/core/tree/detachedFieldIndex.js.map +1 -1
- package/lib/core/tree/index.d.ts +4 -3
- package/lib/core/tree/index.d.ts.map +1 -1
- package/lib/core/tree/index.js +3 -2
- package/lib/core/tree/index.js.map +1 -1
- package/lib/core/tree/pathTree.d.ts +11 -3
- package/lib/core/tree/pathTree.d.ts.map +1 -1
- package/lib/core/tree/pathTree.js +12 -1
- 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 +8 -1
- 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 +4 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +14 -6
- package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +7 -2
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +91 -42
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js +236 -70
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +4 -4
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js +34 -29
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/lib/feature-libraries/default-schema/index.d.ts +2 -1
- package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/index.js +2 -1
- package/lib/feature-libraries/default-schema/index.js.map +1 -1
- package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +36 -0
- package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +1 -0
- package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js +122 -0
- package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js.map +1 -0
- package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts +7 -6
- package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/mappedEditBuilder.js +15 -0
- package/lib/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
- package/lib/feature-libraries/deltaUtils.d.ts +1 -0
- package/lib/feature-libraries/deltaUtils.d.ts.map +1 -1
- package/lib/feature-libraries/deltaUtils.js +5 -1
- package/lib/feature-libraries/deltaUtils.js.map +1 -1
- package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts +30 -8
- package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/detachedFieldIndexSummarizer.js +38 -8
- package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
- package/lib/feature-libraries/flex-tree/context.d.ts +9 -0
- package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/context.js +6 -0
- 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 +8 -7
- package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +38 -9
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.d.ts +2 -2
- package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.js +5 -5
- package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +9 -13
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +17 -22
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/forest-summary/format.d.ts +41 -5
- package/lib/feature-libraries/forest-summary/format.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/format.js +3 -3
- package/lib/feature-libraries/forest-summary/format.js.map +1 -1
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +11 -9
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +13 -26
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
- package/lib/feature-libraries/forest-summary/index.d.ts +2 -1
- package/lib/feature-libraries/forest-summary/index.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/index.js +2 -1
- package/lib/feature-libraries/forest-summary/index.js.map +1 -1
- package/lib/feature-libraries/forest-summary/summaryTypes.d.ts +47 -0
- package/lib/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryTypes.js +53 -0
- package/lib/feature-libraries/forest-summary/summaryTypes.js.map +1 -0
- package/lib/feature-libraries/index.d.ts +4 -4
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +3 -3
- 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 +2 -1
- 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 +18 -2
- package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.js +55 -5
- package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +97 -21
- package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/crossFieldQueries.js +3 -5
- package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +20 -52
- 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/fieldKind.d.ts +25 -13
- package/lib/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKind.js +0 -21
- package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.js +7 -10
- 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 +6 -6
- package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/index.js +5 -4
- package/lib/feature-libraries/modular-schema/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +17 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +384 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +17 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js +409 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -0
- 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 +9 -285
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +49 -15
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +1291 -458
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/{modularChangeFormat.d.ts → modularChangeFormatV1.d.ts} +2 -2
- package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/{modularChangeFormat.js → modularChangeFormatV1.js} +2 -2
- package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +146 -0
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js +29 -0
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +50 -10
- package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeTypes.js +20 -2
- 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 +5 -26
- package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalField.js +217 -449
- package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts +23 -0
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts.map +1 -0
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.js +27 -0
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.js.map +1 -0
- package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +24 -33
- 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 +55 -26
- package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV3.d.ts +12 -0
- package/lib/feature-libraries/optional-field/optionalFieldCodecV3.d.ts.map +1 -0
- package/lib/feature-libraries/optional-field/optionalFieldCodecV3.js +53 -0
- package/lib/feature-libraries/optional-field/optionalFieldCodecV3.js.map +1 -0
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.js +5 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +27 -8
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.js +38 -12
- package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.d.ts +6 -7
- package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.js +82 -258
- package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
- package/lib/feature-libraries/sequence-field/helperTypes.d.ts +14 -10
- 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 +2 -3
- package/lib/feature-libraries/sequence-field/index.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/index.js +0 -1
- 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 +67 -169
- 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 +4 -56
- package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/moveEffectTable.js +6 -80
- 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 +108 -114
- package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
- package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/replaceRevisions.js +16 -33
- 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 +0 -2
- package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +22 -4
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +350 -175
- 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 +21 -61
- 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 +3 -2
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js +14 -109
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
- package/lib/feature-libraries/sequence-field/types.d.ts +30 -59
- 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 +15 -24
- package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/utils.js +107 -292
- package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/shared-tree/independentView.d.ts +1 -1
- package/lib/shared-tree/independentView.d.ts.map +1 -1
- 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 +3 -2
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +1 -5
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +35 -36
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +11 -5
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +14 -4
- 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 +1 -0
- package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.d.ts +20 -8
- package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.js +27 -13
- package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts +5 -5
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js +11 -5
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts +16 -6
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.js +12 -6
- package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +2 -2
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +12 -10
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +69 -20
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts +3 -2
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +4 -3
- 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 +4 -0
- package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js +14 -5
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/{dist/shared-tree-core/editManagerCodecsV5.d.ts → lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts} +3 -3
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -0
- package/lib/shared-tree-core/{editManagerCodecsV5.js → editManagerCodecsVSharedBranches.js} +4 -4
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -0
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts +20 -6
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.js +22 -7
- 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 +1 -0
- package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/lib/shared-tree-core/{editManagerFormatV5.d.ts → editManagerFormatVSharedBranches.d.ts} +3 -3
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -0
- package/lib/shared-tree-core/{editManagerFormatV5.js → editManagerFormatVSharedBranches.js} +2 -2
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -0
- package/lib/shared-tree-core/editManagerSummarizer.d.ts +29 -9
- package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.js +39 -11
- package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/lib/shared-tree-core/index.d.ts +5 -3
- package/lib/shared-tree-core/index.d.ts.map +1 -1
- package/lib/shared-tree-core/index.js +4 -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/{dist/shared-tree-core/messageCodecV5.d.ts → lib/shared-tree-core/messageCodecVSharedBranches.d.ts} +2 -2
- package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -0
- package/lib/shared-tree-core/{messageCodecV5.js → messageCodecVSharedBranches.js} +3 -3
- package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -0
- package/lib/shared-tree-core/messageCodecs.d.ts +4 -0
- package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecs.js +14 -5
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/messageFormat.d.ts +20 -6
- package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormat.js +22 -7
- package/lib/shared-tree-core/messageFormat.js.map +1 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +3 -2
- package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.js +8 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
- package/lib/shared-tree-core/{messageFormatV5.d.ts → messageFormatVSharedBranches.d.ts} +5 -7
- package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -0
- package/lib/shared-tree-core/{messageFormatV5.js → messageFormatVSharedBranches.js} +3 -2
- package/lib/shared-tree-core/messageFormatVSharedBranches.js.map +1 -0
- package/lib/shared-tree-core/sharedTreeCore.d.ts +14 -47
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +28 -16
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/shared-tree-core/summaryTypes.d.ts +94 -0
- package/lib/shared-tree-core/summaryTypes.d.ts.map +1 -0
- package/lib/shared-tree-core/summaryTypes.js +43 -0
- package/lib/shared-tree-core/summaryTypes.js.map +1 -0
- package/lib/shared-tree-core/versionedSummarizer.d.ts +67 -0
- package/lib/shared-tree-core/versionedSummarizer.d.ts.map +1 -0
- package/lib/shared-tree-core/versionedSummarizer.js +59 -0
- package/lib/shared-tree-core/versionedSummarizer.js.map +1 -0
- package/lib/simple-tree/api/configuration.d.ts +3 -26
- package/lib/simple-tree/api/configuration.d.ts.map +1 -1
- package/lib/simple-tree/api/configuration.js +14 -25
- package/lib/simple-tree/api/configuration.js.map +1 -1
- package/lib/simple-tree/api/dirtyIndex.d.ts +11 -0
- package/lib/simple-tree/api/dirtyIndex.d.ts.map +1 -1
- package/lib/simple-tree/api/dirtyIndex.js +7 -0
- package/lib/simple-tree/api/dirtyIndex.js.map +1 -1
- package/lib/simple-tree/api/discrepancies.d.ts +1 -1
- package/lib/simple-tree/api/discrepancies.d.ts.map +1 -1
- package/lib/simple-tree/api/discrepancies.js.map +1 -1
- package/lib/simple-tree/api/getSimpleSchema.d.ts +3 -3
- package/lib/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/getSimpleSchema.js +9 -3
- package/lib/simple-tree/api/getSimpleSchema.js.map +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.js +8 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +3 -4
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +2 -3
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +5 -5
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.js +0 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.d.ts +6 -1
- package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.js +5 -0
- package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/lib/simple-tree/api/schemaStatics.d.ts +12 -12
- package/lib/simple-tree/api/simpleSchemaCodec.d.ts +15 -3
- package/lib/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
- package/lib/simple-tree/api/simpleSchemaCodec.js +15 -3
- package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +8 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js +15 -10
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.d.ts +3 -3
- package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
- package/lib/simple-tree/core/allowedTypes.d.ts +2 -2
- package/lib/simple-tree/core/allowedTypes.d.ts.map +1 -1
- package/lib/simple-tree/core/allowedTypes.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +1 -1
- package/lib/simple-tree/core/index.d.ts.map +1 -1
- package/lib/simple-tree/core/index.js +1 -1
- package/lib/simple-tree/core/index.js.map +1 -1
- package/lib/simple-tree/core/toStored.d.ts +17 -15
- package/lib/simple-tree/core/toStored.d.ts.map +1 -1
- package/lib/simple-tree/core/toStored.js +4 -37
- package/lib/simple-tree/core/toStored.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 +58 -8
- package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/lib/simple-tree/core/walkSchema.d.ts.map +1 -1
- package/lib/simple-tree/core/walkSchema.js +5 -1
- package/lib/simple-tree/core/walkSchema.js.map +1 -1
- package/lib/simple-tree/createContext.d.ts.map +1 -1
- package/lib/simple-tree/createContext.js +20 -5
- package/lib/simple-tree/createContext.js.map +1 -1
- package/lib/simple-tree/fieldSchema.d.ts +7 -7
- 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 +8 -7
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +6 -5
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.d.ts +5 -5
- package/lib/simple-tree/leafNodeSchema.d.ts.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 +6 -4
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +3 -3
- package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNodeTypes.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.d.ts.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/map/mapNodeTypes.d.ts +3 -3
- package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNodeTypes.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/object/objectNodeTypes.d.ts +2 -2
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.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 +4 -2
- package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -3
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
- package/lib/simple-tree/prepareForInsertion.d.ts +54 -47
- package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
- package/lib/simple-tree/prepareForInsertion.js +183 -124
- package/lib/simple-tree/prepareForInsertion.js.map +1 -1
- package/lib/simple-tree/simpleSchema.d.ts +55 -23
- package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/simpleSchema.js +16 -1
- package/lib/simple-tree/simpleSchema.js.map +1 -1
- package/lib/simple-tree/simpleSchemaFormatV1.d.ts +1 -1
- package/lib/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
- package/lib/simple-tree/simpleSchemaFormatV1.js +8 -1
- package/lib/simple-tree/simpleSchemaFormatV1.js.map +1 -1
- package/lib/simple-tree/toStoredSchema.d.ts +58 -11
- package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +204 -31
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/simple-tree/treeSchema.d.ts +23 -0
- package/lib/simple-tree/treeSchema.d.ts.map +1 -0
- package/lib/simple-tree/treeSchema.js +21 -0
- package/lib/simple-tree/treeSchema.js.map +1 -0
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +13 -4
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +26 -9
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/lib/tableSchema.d.ts +117 -63
- package/lib/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +160 -59
- package/lib/tableSchema.js.map +1 -1
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +18 -4
- package/lib/treeFactory.js.map +1 -1
- package/lib/util/index.d.ts +2 -1
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +2 -1
- package/lib/util/index.js.map +1 -1
- package/lib/util/rangeMap.d.ts +24 -12
- package/lib/util/rangeMap.d.ts.map +1 -1
- package/lib/util/rangeMap.js +44 -5
- package/lib/util/rangeMap.js.map +1 -1
- package/lib/util/readSnapshotBlob.d.ts +13 -0
- package/lib/util/readSnapshotBlob.d.ts.map +1 -0
- package/lib/util/readSnapshotBlob.js +14 -0
- package/lib/util/readSnapshotBlob.js.map +1 -0
- package/package.json +21 -21
- package/src/codec/codec.ts +15 -1
- package/src/codec/versioned/codec.ts +1 -1
- package/src/codec/versioned/format.ts +4 -1
- package/src/core/change-family/changeFamily.ts +5 -0
- package/src/core/change-family/index.ts +1 -0
- package/src/core/index.ts +7 -2
- package/src/core/rebase/changeRebaser.ts +6 -1
- package/src/core/rebase/index.ts +1 -0
- package/src/core/rebase/types.ts +8 -1
- package/src/core/rebase/utils.ts +31 -7
- package/src/core/tree/detachedFieldIndex.ts +71 -14
- package/src/core/tree/index.ts +9 -3
- package/src/core/tree/pathTree.ts +16 -4
- package/src/feature-libraries/chunked-forest/basicChunk.ts +7 -1
- package/src/feature-libraries/chunked-forest/chunkTree.ts +6 -1
- package/src/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.ts +15 -7
- package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +9 -9
- package/src/feature-libraries/default-schema/defaultEditBuilder.ts +398 -127
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +35 -38
- package/src/feature-libraries/default-schema/index.ts +17 -5
- package/src/feature-libraries/default-schema/locationBasedEditBuilder.ts +180 -0
- package/src/feature-libraries/default-schema/mappedEditBuilder.ts +35 -9
- package/src/feature-libraries/deltaUtils.ts +6 -1
- package/src/feature-libraries/detachedFieldIndexSummarizer.ts +62 -15
- package/src/feature-libraries/flex-tree/context.ts +17 -0
- package/src/feature-libraries/flex-tree/flexTreeTypes.ts +7 -8
- package/src/feature-libraries/flex-tree/lazyField.ts +66 -24
- package/src/feature-libraries/forest-summary/codec.ts +8 -8
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +45 -37
- package/src/feature-libraries/forest-summary/format.ts +4 -4
- package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +23 -39
- package/src/feature-libraries/forest-summary/index.ts +2 -1
- package/src/feature-libraries/forest-summary/summaryTypes.ts +61 -0
- package/src/feature-libraries/index.ts +23 -9
- package/src/feature-libraries/mapTreeCursor.ts +2 -1
- package/src/feature-libraries/mitigatedChangeFamily.ts +3 -1
- package/src/feature-libraries/modular-schema/comparison.ts +63 -5
- package/src/feature-libraries/modular-schema/crossFieldQueries.ts +142 -44
- package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +36 -57
- package/src/feature-libraries/modular-schema/fieldKind.ts +24 -40
- package/src/feature-libraries/modular-schema/genericFieldKind.ts +10 -19
- package/src/feature-libraries/modular-schema/genericFieldKindCodecs.ts +1 -1
- package/src/feature-libraries/modular-schema/index.ts +22 -15
- package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +732 -0
- package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +790 -0
- package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +29 -499
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +2547 -739
- package/src/feature-libraries/modular-schema/{modularChangeFormat.ts → modularChangeFormatV1.ts} +2 -1
- package/src/feature-libraries/modular-schema/modularChangeFormatV2.ts +62 -0
- package/src/feature-libraries/modular-schema/modularChangeTypes.ts +98 -10
- package/src/feature-libraries/optional-field/index.ts +1 -3
- package/src/feature-libraries/optional-field/optionalField.ts +317 -574
- package/src/feature-libraries/optional-field/optionalFieldChangeFormatV3.ts +45 -0
- package/src/feature-libraries/optional-field/optionalFieldChangeTypes.ts +24 -38
- package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +89 -35
- package/src/feature-libraries/optional-field/optionalFieldCodecV3.ts +94 -0
- package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +5 -1
- package/src/feature-libraries/schema-index/schemaSummarizer.ts +59 -18
- package/src/feature-libraries/sequence-field/compose.ts +134 -519
- package/src/feature-libraries/sequence-field/helperTypes.ts +34 -19
- package/src/feature-libraries/sequence-field/index.ts +0 -9
- package/src/feature-libraries/sequence-field/invert.ts +103 -228
- package/src/feature-libraries/sequence-field/markQueue.ts +2 -2
- package/src/feature-libraries/sequence-field/moveEffectTable.ts +8 -191
- package/src/feature-libraries/sequence-field/rebase.ts +168 -203
- package/src/feature-libraries/sequence-field/replaceRevisions.ts +31 -52
- package/src/feature-libraries/sequence-field/sequenceFieldChangeHandler.ts +0 -2
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +643 -220
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +56 -68
- package/src/feature-libraries/sequence-field/sequenceFieldEditor.ts +25 -27
- package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +19 -129
- package/src/feature-libraries/sequence-field/types.ts +34 -64
- package/src/feature-libraries/sequence-field/utils.ts +133 -346
- package/src/index.ts +3 -2
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/independentView.ts +1 -1
- package/src/shared-tree/index.ts +3 -2
- package/src/shared-tree/schematizeTree.ts +21 -8
- package/src/shared-tree/schematizingTreeView.ts +50 -68
- package/src/shared-tree/sharedTree.ts +39 -12
- package/src/shared-tree/sharedTreeChangeCodecs.ts +5 -1
- package/src/shared-tree/sharedTreeChangeEnricher.ts +33 -11
- package/src/shared-tree/sharedTreeChangeFamily.ts +15 -5
- package/src/shared-tree/sharedTreeEditBuilder.ts +47 -13
- package/src/shared-tree/treeAlpha.ts +2 -3
- package/src/shared-tree/treeCheckout.ts +104 -31
- package/src/shared-tree-core/branch.ts +8 -2
- package/src/shared-tree-core/editManager.ts +16 -2
- package/src/shared-tree-core/editManagerCodecs.ts +17 -5
- package/src/shared-tree-core/{editManagerCodecsV5.ts → editManagerCodecsVSharedBranches.ts} +3 -3
- package/src/shared-tree-core/editManagerFormatCommons.ts +22 -7
- package/src/shared-tree-core/editManagerFormatV1toV4.ts +3 -1
- package/src/shared-tree-core/{editManagerFormatV5.ts → editManagerFormatVSharedBranches.ts} +2 -2
- package/src/shared-tree-core/editManagerSummarizer.ts +58 -16
- package/src/shared-tree-core/index.ts +11 -3
- package/src/shared-tree-core/messageCodecV1ToV4.ts +2 -1
- package/src/shared-tree-core/{messageCodecV5.ts → messageCodecVSharedBranches.ts} +3 -3
- package/src/shared-tree-core/messageCodecs.ts +17 -5
- package/src/shared-tree-core/messageFormat.ts +22 -7
- package/src/shared-tree-core/messageFormatV1ToV4.ts +16 -2
- package/src/shared-tree-core/{messageFormatV5.ts → messageFormatVSharedBranches.ts} +4 -6
- package/src/shared-tree-core/sharedTreeCore.ts +67 -76
- package/src/shared-tree-core/summaryTypes.ts +122 -0
- package/src/shared-tree-core/versionedSummarizer.ts +107 -0
- package/src/simple-tree/api/configuration.ts +21 -68
- package/src/simple-tree/api/dirtyIndex.ts +11 -0
- package/src/simple-tree/api/discrepancies.ts +1 -1
- package/src/simple-tree/api/getSimpleSchema.ts +13 -6
- package/src/simple-tree/api/incrementalAllowedTypes.ts +15 -3
- package/src/simple-tree/api/index.ts +3 -4
- package/src/simple-tree/api/schemaCompatibilityTester.ts +1 -1
- package/src/simple-tree/api/schemaFactoryAlpha.ts +2 -2
- package/src/simple-tree/api/schemaFactoryRecursive.ts +0 -2
- package/src/simple-tree/api/schemaFromSimple.ts +11 -5
- package/src/simple-tree/api/simpleSchemaCodec.ts +17 -3
- package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +1 -1
- package/src/simple-tree/api/snapshotCompatibilityChecker.ts +18 -10
- package/src/simple-tree/api/typesUnsafe.ts +7 -3
- package/src/simple-tree/core/allowedTypes.ts +3 -3
- package/src/simple-tree/core/index.ts +2 -2
- package/src/simple-tree/core/toStored.ts +22 -55
- package/src/simple-tree/core/unhydratedFlexTree.ts +87 -36
- package/src/simple-tree/core/walkSchema.ts +6 -0
- package/src/simple-tree/createContext.ts +26 -11
- package/src/simple-tree/fieldSchema.ts +16 -7
- package/src/simple-tree/index.ts +12 -11
- package/src/simple-tree/node-kinds/array/arrayNode.ts +12 -7
- package/src/simple-tree/node-kinds/array/arrayNodeTypes.ts +3 -3
- package/src/simple-tree/node-kinds/common.ts +2 -5
- package/src/simple-tree/node-kinds/map/mapNode.ts +9 -6
- package/src/simple-tree/node-kinds/map/mapNodeTypes.ts +3 -3
- package/src/simple-tree/node-kinds/object/objectNode.ts +26 -26
- package/src/simple-tree/node-kinds/object/objectNodeTypes.ts +6 -2
- package/src/simple-tree/node-kinds/record/recordNode.ts +15 -11
- package/src/simple-tree/node-kinds/record/recordNodeTypes.ts +3 -3
- package/src/simple-tree/prepareForInsertion.ts +343 -200
- package/src/simple-tree/simpleSchema.ts +79 -32
- package/src/simple-tree/simpleSchemaFormatV1.ts +9 -1
- package/src/simple-tree/toStoredSchema.ts +319 -61
- package/src/simple-tree/treeSchema.ts +54 -0
- package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +42 -14
- package/src/tableSchema.ts +485 -166
- package/src/treeFactory.ts +19 -5
- package/src/util/index.ts +5 -0
- package/src/util/rangeMap.ts +72 -18
- package/src/util/readSnapshotBlob.ts +23 -0
- package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +0 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormat.js.map +0 -1
- package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +0 -9
- package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +0 -1
- package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js +0 -50
- package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js.map +0 -1
- package/dist/shared-tree-core/editManagerCodecsV5.d.ts.map +0 -1
- package/dist/shared-tree-core/editManagerCodecsV5.js.map +0 -1
- package/dist/shared-tree-core/editManagerFormatV5.d.ts.map +0 -1
- package/dist/shared-tree-core/editManagerFormatV5.js.map +0 -1
- package/dist/shared-tree-core/messageCodecV5.d.ts.map +0 -1
- package/dist/shared-tree-core/messageCodecV5.js.map +0 -1
- package/dist/shared-tree-core/messageFormatV5.d.ts.map +0 -1
- package/dist/shared-tree-core/messageFormatV5.js.map +0 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts +0 -40
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +0 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +0 -177
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +0 -1
- package/docs/main/sequence-field/move-composition.md +0 -46
- package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +0 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormat.js.map +0 -1
- package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +0 -9
- package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +0 -1
- package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js +0 -46
- package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js.map +0 -1
- package/lib/shared-tree-core/editManagerCodecsV5.d.ts.map +0 -1
- package/lib/shared-tree-core/editManagerCodecsV5.js.map +0 -1
- package/lib/shared-tree-core/editManagerFormatV5.d.ts.map +0 -1
- package/lib/shared-tree-core/editManagerFormatV5.js.map +0 -1
- package/lib/shared-tree-core/messageCodecV5.d.ts.map +0 -1
- package/lib/shared-tree-core/messageCodecV5.js.map +0 -1
- package/lib/shared-tree-core/messageFormatV5.d.ts.map +0 -1
- package/lib/shared-tree-core/messageFormatV5.js.map +0 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts +0 -40
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +0 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +0 -171
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +0 -1
- package/src/feature-libraries/sequence-field/relevantRemovedRoots.ts +0 -57
- package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +0 -209
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sharedTreeChangeFamily.js","sourceRoot":"","sources":["../../src/shared-tree/sharedTreeChangeFamily.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAmE;AAInE,+CAU0B;AAC1B,4DASuC;AACvC,+CAM0B;AAE1B,2EAA8E;AAE9E,yEAAmE;AAEnE;;;;GAIG;AACH,MAAa,sBAAsB;IAYlC,YACC,gBAAkC,EAClC,eAAgC,EAChC,YAA+B,EAC/B,wBAAkD,EACjC,YAA4B;QAA5B,iBAAY,GAAZ,YAAY,CAAgB;QAE7C,MAAM,kBAAkB,GAAG,IAAA,uCAA4B,EACtD,kCAAuB,EACvB,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,wBAAwB,CACxB,CAAC;QACF,IAAI,CAAC,mBAAmB,GAAG,IAAI,8BAAmB,CAAC,qBAAU,EAAE,kBAAkB,C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C,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC;QAClD,OAAO,eAAe,CAAC,EAAE,CAAC,CAAC;IAC5B,CAAC;IACD,QAAQ,CAAC,CAAC,mBAAmB,CAC5B,QAAuC;QAEvC,KAAK,MAAM,EAAE,IAAI,QAAQ,EAAE,CAAC;YAC3B,IAAI,CAAC,IAAA,4BAAiB,EAAC,aAAa,EAAE,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC3D,MAAM,EAAE,CAAC;YACV,CAAC;QACF,CAAC;IACF,CAAC;IACD,IAAI,iBAAiB,GAAG,IAAI,CAAC;IAC7B,OAAO,cAAc,CAAC,MAAM,EAAE,CAAC,UAAU,EAAE,EAAE;QAC5C,MAAM,YAAY,GAAG,kCAAkC,CAAC,UAAU,CAAC,CAAC;QACpE,IAAI,iBAAiB,EAAE,CAAC;YACvB,iBAAiB,GAAG,KAAK,CAAC;YAC1B,OAAO,0BAA0B,CAChC,UAAU,EACV,0BAA0B,EAC1B,YAAY,EACZ,IAAI,CACJ,CAAC;QACH,CAAC;aAAM,CAAC;YACP,OAAO,0BAA0B,CAChC,UAAU,EACV,0BAA0B,EAC1B,mBAAmB,CAAC,YAAY,CAAC,EACjC,KAAK,CACL,CAAC;QACH,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC;AAlED,4CAkEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\nimport type { CodecWriteOptions, ICodecFamily } from \"../codec/index.js\";\nimport {\n\ttype ChangeEncodingContext,\n\ttype ChangeFamily,\n\ttype ChangeRebaser,\n\ttype DeltaDetachedNodeId,\n\ttype RevisionMetadataSource,\n\ttype RevisionTag,\n\ttype RevisionTagCodec,\n\ttype TaggedChange,\n\tmapTaggedChange,\n} from \"../core/index.js\";\nimport {\n\ttype FieldBatchCodec,\n\tModularChangeFamily,\n\ttype ModularChangeset,\n\ttype TreeChunk,\n\ttype TreeCompressionStrategy,\n\tfieldKindConfigurations,\n\tfieldKinds,\n\tmakeModularChangeCodecFamily,\n} from \"../feature-libraries/index.js\";\nimport {\n\ttype Mutable,\n\ttype NestedSet,\n\taddToNestedSet,\n\thasSingle,\n\tnestedSetContains,\n} from \"../util/index.js\";\n\nimport { makeSharedTreeChangeCodecFamily } from \"./sharedTreeChangeCodecs.js\";\nimport type { SharedTreeChange } from \"./sharedTreeChangeTypes.js\";\nimport { SharedTreeEditBuilder } from \"./sharedTreeEditBuilder.js\";\n\n/**\n * Implementation of {@link ChangeFamily} that combines edits to fields and schema changes.\n *\n * @sealed\n */\nexport class SharedTreeChangeFamily\n\timplements\n\t\tChangeFamily<SharedTreeEditBuilder, SharedTreeChange>,\n\t\tChangeRebaser<SharedTreeChange>\n{\n\tpublic static readonly emptyChange: SharedTreeChange = {\n\t\tchanges: [],\n\t};\n\n\tpublic readonly codecs: ICodecFamily<SharedTreeChange, ChangeEncodingContext>;\n\tprivate readonly modularChangeFamily: ModularChangeFamily;\n\n\tpublic constructor(\n\t\trevisionTagCodec: RevisionTagCodec,\n\t\tfieldBatchCodec: FieldBatchCodec,\n\t\tcodecOptions: CodecWriteOptions,\n\t\tchunkCompressionStrategy?: TreeCompressionStrategy,\n\t\tprivate readonly idCompressor?: IIdCompressor,\n\t) {\n\t\tconst modularChangeCodec = makeModularChangeCodecFamily(\n\t\t\tfieldKindConfigurations,\n\t\t\trevisionTagCodec,\n\t\t\tfieldBatchCodec,\n\t\t\tcodecOptions,\n\t\t\tchunkCompressionStrategy,\n\t\t);\n\t\tthis.modularChangeFamily = new ModularChangeFamily(fieldKinds, modularChangeCodec);\n\t\tthis.codecs = makeSharedTreeChangeCodecFamily(\n\t\t\tthis.modularChangeFamily.codecs,\n\t\t\tcodecOptions,\n\t\t);\n\t}\n\n\tpublic buildEditor(\n\t\tmintRevisionTag: () => RevisionTag,\n\t\tchangeReceiver: (change: TaggedChange<SharedTreeChange>) => void,\n\t): SharedTreeEditBuilder {\n\t\treturn new SharedTreeEditBuilder(\n\t\t\tthis.modularChangeFamily,\n\t\t\tmintRevisionTag,\n\t\t\tchangeReceiver,\n\t\t);\n\t}\n\n\tpublic compose(changes: TaggedChange<SharedTreeChange>[]): SharedTreeChange {\n\t\tconst newChanges: Mutable<SharedTreeChange[\"changes\"]> = [];\n\t\tconst dataChangeRun: TaggedChange<ModularChangeset>[] = [];\n\n\t\tconst flushDataChangeRun = (): void => {\n\t\t\tif (dataChangeRun.length > 0) {\n\t\t\t\tnewChanges.push({\n\t\t\t\t\ttype: \"data\",\n\t\t\t\t\tinnerChange: this.modularChangeFamily.compose(dataChangeRun),\n\t\t\t\t});\n\t\t\t\tdataChangeRun.length = 0;\n\t\t\t}\n\t\t};\n\n\t\tfor (const topChange of changes) {\n\t\t\tfor (const change of topChange.change.changes) {\n\t\t\t\tif (change.type === \"schema\") {\n\t\t\t\t\tflushDataChangeRun();\n\t\t\t\t\tnewChanges.push(change);\n\t\t\t\t} else {\n\t\t\t\t\tdataChangeRun.push(mapTaggedChange(topChange, change.innerChange));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tflushDataChangeRun();\n\t\treturn { changes: newChanges };\n\t}\n\n\tpublic invert(\n\t\tchange: TaggedChange<SharedTreeChange>,\n\t\tisRollback: boolean,\n\t\trevision: RevisionTag,\n\t): SharedTreeChange {\n\t\tconst invertInnerChange: (\n\t\t\tinnerChange: SharedTreeChange[\"changes\"][number],\n\t\t) => SharedTreeChange[\"changes\"][number] = (innerChange) => {\n\t\t\tswitch (innerChange.type) {\n\t\t\t\tcase \"data\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: \"data\",\n\t\t\t\t\t\tinnerChange: this.modularChangeFamily.invert(\n\t\t\t\t\t\t\tmapTaggedChange(change, innerChange.innerChange),\n\t\t\t\t\t\t\tisRollback,\n\t\t\t\t\t\t\trevision,\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\tcase \"schema\": {\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: \"schema\",\n\t\t\t\t\t\tinnerChange: {\n\t\t\t\t\t\t\tschema: {\n\t\t\t\t\t\t\t\tnew: innerChange.innerChange.schema.old,\n\t\t\t\t\t\t\t\told: innerChange.innerChange.schema.new,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tisInverse: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tfail(0xacc /* Unknown SharedTree change type. */);\n\t\t\t}\n\t\t};\n\t\treturn {\n\t\t\tchanges: change.change.changes.map(invertInnerChange).reverse(),\n\t\t};\n\t}\n\n\tpublic rebase(\n\t\tchange: TaggedChange<SharedTreeChange>,\n\t\tover: TaggedChange<SharedTreeChange>,\n\t\trevisionMetadata: RevisionMetadataSource,\n\t): SharedTreeChange {\n\t\tif (change.change.changes.length === 0 || over.change.changes.length === 0) {\n\t\t\treturn change.change;\n\t\t}\n\n\t\tif (hasSchemaChange(change.change) || hasSchemaChange(over.change)) {\n\t\t\t// Any SharedTreeChange (a list of sub-changes) that contains a schema change will cause ANY change that rebases over it to conflict.\n\t\t\t// Similarly, any SharedTreeChange containing a schema change will fail to rebase over ANY change.\n\t\t\t// Those two combine to mean: no concurrency with schema changes is supported.\n\t\t\t// This is fine because it's an open problem. Example: a tree with an A at the root and a schema that allows an A | B at the root will\n\t\t\t// become out of schema if a schema changes to restrict root types to just A is concurrent with a data change that sets it to a B.\n\t\t\t// We don't have an efficient way to detect this document-wide and there are varying opinions on restricting schema changes to prevent this.\n\t\t\t// A SharedTreeChange containing a schema change will NOT conflict in a non-concurrency case, as the \"meatless sandwich\" optimization\n\t\t\t// will result in rebase never being called.\n\t\t\treturn SharedTreeChangeFamily.emptyChange;\n\t\t}\n\t\tassert(\n\t\t\thasSingle(change.change.changes) && hasSingle(over.change.changes),\n\t\t\t0x884 /* SharedTreeChange should have exactly one inner change if no schema change is present. */,\n\t\t);\n\n\t\tconst dataChangeIntention = change.change.changes[0];\n\t\tconst dataChangeOver = over.change.changes[0];\n\t\tassert(\n\t\t\tdataChangeIntention.type === \"data\" && dataChangeOver.type === \"data\",\n\t\t\t0x885 /* Data change should be present. */,\n\t\t);\n\n\t\treturn {\n\t\t\tchanges: [\n\t\t\t\t{\n\t\t\t\t\ttype: \"data\",\n\t\t\t\t\tinnerChange: this.modularChangeFamily.rebase(\n\t\t\t\t\t\tmapTaggedChange(change, dataChangeIntention.innerChange),\n\t\t\t\t\t\tmapTaggedChange(over, dataChangeOver.innerChange),\n\t\t\t\t\t\trevisionMetadata,\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t],\n\t\t};\n\t}\n\n\tpublic changeRevision(\n\t\tchange: SharedTreeChange,\n\t\tnewRevision: RevisionTag | undefined,\n\t\trollbackOf?: RevisionTag,\n\t): SharedTreeChange {\n\t\treturn {\n\t\t\tchanges: change.changes.map((inner) => {\n\t\t\t\treturn inner.type === \"data\"\n\t\t\t\t\t? {\n\t\t\t\t\t\t\t...inner,\n\t\t\t\t\t\t\tinnerChange: this.modularChangeFamily.rebaser.changeRevision(\n\t\t\t\t\t\t\t\tinner.innerChange,\n\t\t\t\t\t\t\t\tnewRevision,\n\t\t\t\t\t\t\t\trollbackOf,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t}\n\t\t\t\t\t: inner;\n\t\t\t}),\n\t\t};\n\t}\n\n\tpublic get rebaser(): ChangeRebaser<SharedTreeChange> {\n\t\treturn this;\n\t}\n}\n\nexport function hasSchemaChange(change: SharedTreeChange): boolean {\n\treturn change.changes.some((innerChange) => innerChange.type === \"schema\");\n}\n\nfunction mapDataChanges(\n\tchange: SharedTreeChange,\n\tmap: (change: ModularChangeset) => ModularChangeset,\n): SharedTreeChange {\n\treturn {\n\t\tchanges: change.changes.map((dataOrSchemaChange) => {\n\t\t\tif (dataOrSchemaChange.type === \"data\") {\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"data\",\n\t\t\t\t\tinnerChange: map(dataOrSchemaChange.innerChange),\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn dataOrSchemaChange;\n\t\t}),\n\t};\n}\n\n/**\n * Produces an equivalent change with an updated set of appropriate refreshers.\n * @param change - The change to compute refreshers for. Not mutated.\n * @param getDetachedNode - retrieves a {@link TreeChunk} for the corresponding detached node id.\n * Is expected to read from a forest in a state that corresponds to the input context of the given change.\n * @returns An equivalent change with an updated set of appropriate refreshers.\n */\nexport function updateRefreshers(\n\tchange: SharedTreeChange,\n\tgetDetachedNode: (id: DeltaDetachedNodeId) => TreeChunk | undefined,\n\trelevantRemovedRootsFromDataChange: (\n\t\ttaggedChange: ModularChangeset,\n\t) => Iterable<DeltaDetachedNodeId>,\n\tupdateDataChangeRefreshers: (\n\t\tchange: ModularChangeset,\n\t\tgetDetachedNode: (id: DeltaDetachedNodeId) => TreeChunk | undefined,\n\t\tremovedRoots: Iterable<DeltaDetachedNodeId>,\n\t\trequireRefreshers: boolean,\n\t) => ModularChangeset,\n): SharedTreeChange {\n\t// Adding refreshers to a SharedTreeChange is not as simple as adding refreshers to each of its data changes.\n\t// This is because earlier data changes affect the state of the forest in ways that can influence the refreshers\n\t// needed for later data changes. This can happen in two ways:\n\t// 1. By removing a tree that is a relevant root to a later data change.\n\t// 2. By changing the contents of a tree that is a relevant root to a later data change.\n\t// (Note that these two cases can compound)\n\t// Thankfully, in both of these cases, refreshers can be omitted from the later data changes because the forest\n\t// applying those data changes is guaranteed to still have have the relevant trees in memory.\n\t// This means that for the first data change, all required refreshers should be added (and none should be missing).\n\t// While for later data changes, we should not include refreshers that either:\n\t// A) were already included in the earlier data changes\n\t// B) correspond to trees that were removed by earlier data changes\n\t// Set A is excluded by tracking which roots have already been included in the earlier data changes, and filtering\n\t// them out from the relevant removed roots.\n\t// Set B is excluded because the `getDetachedNode` is bound to return `undefined` for them, which tell\n\t// `defaultUpdateRefreshers` to ignore. One downside of this approach is that it prevents `defaultUpdateRefreshers`\n\t// from detecting cases where a detached node is missing for another reason (which would be a bug).\n\n\t// The roots that have been included as refreshers across all data changes so far.\n\tconst includedRoots: NestedSet<RevisionTag | undefined, number> = new Map();\n\tfunction getAndRememberDetachedNode(id: DeltaDetachedNodeId): TreeChunk | undefined {\n\t\taddToNestedSet(includedRoots, id.major, id.minor);\n\t\treturn getDetachedNode(id);\n\t}\n\tfunction* filterIncludedRoots(\n\t\ttoFilter: Iterable<DeltaDetachedNodeId>,\n\t): Iterable<DeltaDetachedNodeId> {\n\t\tfor (const id of toFilter) {\n\t\t\tif (!nestedSetContains(includedRoots, id.major, id.minor)) {\n\t\t\t\tyield id;\n\t\t\t}\n\t\t}\n\t}\n\tlet isFirstDataChange = true;\n\treturn mapDataChanges(change, (dataChange) => {\n\t\tconst removedRoots = relevantRemovedRootsFromDataChange(dataChange);\n\t\tif (isFirstDataChange) {\n\t\t\tisFirstDataChange = false;\n\t\t\treturn updateDataChangeRefreshers(\n\t\t\t\tdataChange,\n\t\t\t\tgetAndRememberDetachedNode,\n\t\t\t\tremovedRoots,\n\t\t\t\ttrue,\n\t\t\t);\n\t\t} else {\n\t\t\treturn updateDataChangeRefreshers(\n\t\t\t\tdataChange,\n\t\t\t\tgetAndRememberDetachedNode,\n\t\t\t\tfilterIncludedRoots(removedRoots),\n\t\t\t\tfalse,\n\t\t\t);\n\t\t}\n\t});\n}\n"]}
|
|
1
|
+
{"version":3,"file":"sharedTreeChangeFamily.js","sourceRoot":"","sources":["../../src/shared-tree/sharedTreeChangeFamily.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAmE;AAInE,+CAW0B;AAC1B,4DASuC;AACvC,+CAM0B;AAE1B,2EAA8E;AAE9E,yEAA0E;AAE1E;;;;GAIG;AACH,MAAa,sBAAsB;IAYlC,YACC,gBAAkC,EAClC,eAAgC,EAChC,YAA+B,EAC/B,wBAAkD,EACjC,YAA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OAAO,0BAA0B,CAChC,UAAU,EACV,0BAA0B,EAC1B,mBAAmB,CAAC,YAAY,CAAC,EACjC,KAAK,CACL,CAAC;QACH,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC;AAzED,4CAyEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\nimport type { CodecWriteOptions, ICodecFamily } from \"../codec/index.js\";\nimport {\n\ttype ChangeEncodingContext,\n\ttype ChangeFamily,\n\ttype ChangeRebaser,\n\ttype DeltaDetachedNodeId,\n\ttype EditorOptions,\n\ttype RevisionMetadataSource,\n\ttype RevisionTag,\n\ttype RevisionTagCodec,\n\ttype TaggedChange,\n\tmapTaggedChange,\n} from \"../core/index.js\";\nimport {\n\ttype FieldBatchCodec,\n\tModularChangeFamily,\n\ttype ModularChangeset,\n\ttype TreeChunk,\n\ttype TreeCompressionStrategy,\n\tfieldKindConfigurations,\n\tfieldKinds,\n\tmakeModularChangeCodecFamily,\n} from \"../feature-libraries/index.js\";\nimport {\n\ttype Mutable,\n\ttype NestedSet,\n\taddToNestedSet,\n\thasSingle,\n\tnestedSetContains,\n} from \"../util/index.js\";\n\nimport { makeSharedTreeChangeCodecFamily } from \"./sharedTreeChangeCodecs.js\";\nimport type { SharedTreeChange } from \"./sharedTreeChangeTypes.js\";\nimport { IdBasedSharedTreeEditBuilder } from \"./sharedTreeEditBuilder.js\";\n\n/**\n * Implementation of {@link ChangeFamily} that combines edits to fields and schema changes.\n *\n * @sealed\n */\nexport class SharedTreeChangeFamily\n\timplements\n\t\tChangeFamily<IdBasedSharedTreeEditBuilder, SharedTreeChange>,\n\t\tChangeRebaser<SharedTreeChange>\n{\n\tpublic static readonly emptyChange: SharedTreeChange = {\n\t\tchanges: [],\n\t};\n\n\tpublic readonly codecs: ICodecFamily<SharedTreeChange, ChangeEncodingContext>;\n\tprivate readonly modularChangeFamily: ModularChangeFamily;\n\n\tpublic constructor(\n\t\trevisionTagCodec: RevisionTagCodec,\n\t\tfieldBatchCodec: FieldBatchCodec,\n\t\tcodecOptions: CodecWriteOptions,\n\t\tchunkCompressionStrategy?: TreeCompressionStrategy,\n\t\tprivate readonly idCompressor?: IIdCompressor,\n\t) {\n\t\tconst modularChangeCodec = makeModularChangeCodecFamily(\n\t\t\tfieldKindConfigurations,\n\t\t\trevisionTagCodec,\n\t\t\tfieldBatchCodec,\n\t\t\tcodecOptions,\n\t\t\tchunkCompressionStrategy,\n\t\t);\n\t\tthis.modularChangeFamily = new ModularChangeFamily(fieldKinds, modularChangeCodec);\n\t\tthis.codecs = makeSharedTreeChangeCodecFamily(\n\t\t\tthis.modularChangeFamily.codecs,\n\t\t\tcodecOptions,\n\t\t);\n\t}\n\n\tpublic buildEditor(\n\t\tmintRevisionTag: () => RevisionTag,\n\t\tchangeReceiver: (change: TaggedChange<SharedTreeChange>) => void,\n\t\toptions?: EditorOptions,\n\t): IdBasedSharedTreeEditBuilder {\n\t\treturn new IdBasedSharedTreeEditBuilder(\n\t\t\tthis.modularChangeFamily,\n\t\t\tmintRevisionTag,\n\t\t\tchangeReceiver,\n\t\t\toptions,\n\t\t);\n\t}\n\n\tpublic compose(changes: TaggedChange<SharedTreeChange>[]): SharedTreeChange {\n\t\tconst newChanges: Mutable<SharedTreeChange[\"changes\"]> = [];\n\t\tconst dataChangeRun: TaggedChange<ModularChangeset>[] = [];\n\n\t\tconst flushDataChangeRun = (): void => {\n\t\t\tif (dataChangeRun.length > 0) {\n\t\t\t\tnewChanges.push({\n\t\t\t\t\ttype: \"data\",\n\t\t\t\t\tinnerChange: this.modularChangeFamily.compose(dataChangeRun),\n\t\t\t\t});\n\t\t\t\tdataChangeRun.length = 0;\n\t\t\t}\n\t\t};\n\n\t\tfor (const topChange of changes) {\n\t\t\tfor (const change of topChange.change.changes) {\n\t\t\t\tif (change.type === \"schema\") {\n\t\t\t\t\tflushDataChangeRun();\n\t\t\t\t\tnewChanges.push(change);\n\t\t\t\t} else {\n\t\t\t\t\tdataChangeRun.push(mapTaggedChange(topChange, change.innerChange));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tflushDataChangeRun();\n\t\treturn { changes: newChanges };\n\t}\n\n\tpublic invert(\n\t\tchange: TaggedChange<SharedTreeChange>,\n\t\tisRollback: boolean,\n\t\trevision: RevisionTag,\n\t): SharedTreeChange {\n\t\tconst invertInnerChange: (\n\t\t\tinnerChange: SharedTreeChange[\"changes\"][number],\n\t\t) => SharedTreeChange[\"changes\"][number] = (innerChange) => {\n\t\t\tswitch (innerChange.type) {\n\t\t\t\tcase \"data\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: \"data\",\n\t\t\t\t\t\tinnerChange: this.modularChangeFamily.invert(\n\t\t\t\t\t\t\tmapTaggedChange(change, innerChange.innerChange),\n\t\t\t\t\t\t\tisRollback,\n\t\t\t\t\t\t\trevision,\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\tcase \"schema\": {\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: \"schema\",\n\t\t\t\t\t\tinnerChange: {\n\t\t\t\t\t\t\tschema: {\n\t\t\t\t\t\t\t\tnew: innerChange.innerChange.schema.old,\n\t\t\t\t\t\t\t\told: innerChange.innerChange.schema.new,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tisInverse: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tfail(0xacc /* Unknown SharedTree change type. */);\n\t\t\t}\n\t\t};\n\t\treturn {\n\t\t\tchanges: change.change.changes.map(invertInnerChange).reverse(),\n\t\t};\n\t}\n\n\tpublic rebase(\n\t\tchange: TaggedChange<SharedTreeChange>,\n\t\tover: TaggedChange<SharedTreeChange>,\n\t\trevisionMetadata: RevisionMetadataSource,\n\t): SharedTreeChange {\n\t\tif (change.change.changes.length === 0 || over.change.changes.length === 0) {\n\t\t\treturn change.change;\n\t\t}\n\n\t\tif (hasSchemaChange(change.change) || hasSchemaChange(over.change)) {\n\t\t\t// Any SharedTreeChange (a list of sub-changes) that contains a schema change will cause ANY change that rebases over it to conflict.\n\t\t\t// Similarly, any SharedTreeChange containing a schema change will fail to rebase over ANY change.\n\t\t\t// Those two combine to mean: no concurrency with schema changes is supported.\n\t\t\t// This is fine because it's an open problem. Example: a tree with an A at the root and a schema that allows an A | B at the root will\n\t\t\t// become out of schema if a schema changes to restrict root types to just A is concurrent with a data change that sets it to a B.\n\t\t\t// We don't have an efficient way to detect this document-wide and there are varying opinions on restricting schema changes to prevent this.\n\t\t\t// A SharedTreeChange containing a schema change will NOT conflict in a non-concurrency case, as the \"meatless sandwich\" optimization\n\t\t\t// will result in rebase never being called.\n\t\t\treturn SharedTreeChangeFamily.emptyChange;\n\t\t}\n\t\tassert(\n\t\t\thasSingle(change.change.changes) && hasSingle(over.change.changes),\n\t\t\t0x884 /* SharedTreeChange should have exactly one inner change if no schema change is present. */,\n\t\t);\n\n\t\tconst dataChangeIntention = change.change.changes[0];\n\t\tconst dataChangeOver = over.change.changes[0];\n\t\tassert(\n\t\t\tdataChangeIntention.type === \"data\" && dataChangeOver.type === \"data\",\n\t\t\t0x885 /* Data change should be present. */,\n\t\t);\n\n\t\treturn {\n\t\t\tchanges: [\n\t\t\t\t{\n\t\t\t\t\ttype: \"data\",\n\t\t\t\t\tinnerChange: this.modularChangeFamily.rebase(\n\t\t\t\t\t\tmapTaggedChange(change, dataChangeIntention.innerChange),\n\t\t\t\t\t\tmapTaggedChange(over, dataChangeOver.innerChange),\n\t\t\t\t\t\trevisionMetadata,\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t],\n\t\t};\n\t}\n\n\tpublic changeRevision(\n\t\tchange: SharedTreeChange,\n\t\tnewRevision: RevisionTag | undefined,\n\t\trollbackOf?: RevisionTag,\n\t): SharedTreeChange {\n\t\treturn {\n\t\t\tchanges: change.changes.map((inner) => {\n\t\t\t\treturn inner.type === \"data\"\n\t\t\t\t\t? {\n\t\t\t\t\t\t\t...inner,\n\t\t\t\t\t\t\tinnerChange: this.modularChangeFamily.rebaser.changeRevision(\n\t\t\t\t\t\t\t\tinner.innerChange,\n\t\t\t\t\t\t\t\tnewRevision,\n\t\t\t\t\t\t\t\trollbackOf,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t}\n\t\t\t\t\t: inner;\n\t\t\t}),\n\t\t};\n\t}\n\n\tpublic get rebaser(): ChangeRebaser<SharedTreeChange> {\n\t\treturn this;\n\t}\n}\n\nexport function hasSchemaChange(change: SharedTreeChange): boolean {\n\treturn change.changes.some((innerChange) => innerChange.type === \"schema\");\n}\n\nfunction mapDataChanges(\n\tchange: SharedTreeChange,\n\tmap: (change: ModularChangeset) => ModularChangeset,\n): SharedTreeChange {\n\treturn {\n\t\tchanges: change.changes.map((dataOrSchemaChange) => {\n\t\t\tif (dataOrSchemaChange.type === \"data\") {\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"data\",\n\t\t\t\t\tinnerChange: map(dataOrSchemaChange.innerChange),\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn dataOrSchemaChange;\n\t\t}),\n\t};\n}\n\n/**\n * Produces an equivalent change with an updated set of appropriate refreshers.\n * @param change - The change to compute refreshers for. Not mutated.\n * @param getDetachedNode - retrieves a {@link TreeChunk} for the corresponding detached node id.\n * Is expected to read from a forest in a state that corresponds to the input context of the given change.\n * @returns An equivalent change with an updated set of appropriate refreshers.\n */\nexport function updateRefreshers(\n\tchange: SharedTreeChange,\n\tbuildsFromDataChange: (taggedChange: ModularChangeset) => Iterable<DeltaDetachedNodeId>,\n\tgetDetachedNode: (id: DeltaDetachedNodeId) => TreeChunk | undefined,\n\trelevantRemovedRootsFromDataChange: (\n\t\ttaggedChange: ModularChangeset,\n\t) => Iterable<DeltaDetachedNodeId>,\n\tupdateDataChangeRefreshers: (\n\t\tchange: ModularChangeset,\n\t\tgetDetachedNode: (id: DeltaDetachedNodeId) => TreeChunk | undefined,\n\t\tremovedRoots: Iterable<DeltaDetachedNodeId>,\n\t\trequireRefreshers: boolean,\n\t) => ModularChangeset,\n): SharedTreeChange {\n\t// Adding refreshers to a SharedTreeChange is not as simple as adding refreshers to each of its data changes.\n\t// This is because earlier data changes affect the state of the forest in ways that can influence the refreshers\n\t// needed for later data changes. This can happen in two ways:\n\t// 1. By removing a tree that is a relevant root to a later data change.\n\t// 2. By changing the contents of a tree that is a relevant root to a later data change.\n\t// (Note that these two cases can compound)\n\t// Thankfully, in both of these cases, refreshers can be omitted from the later data changes because the forest\n\t// applying those data changes is guaranteed to still have have the relevant trees in memory.\n\t// This means that for the first data change, all required refreshers should be added (and none should be missing).\n\t// While for later data changes, we should not include refreshers that either:\n\t// A) were already included in the earlier data changes\n\t// B) correspond to trees that were removed by earlier data changes\n\t// Set A is excluded by tracking which roots have already been included in the earlier data changes, and filtering\n\t// them out from the relevant removed roots.\n\t// Set B is excluded because the `getDetachedNode` is bound to return `undefined` for them, which tell\n\t// `defaultUpdateRefreshers` to ignore. One downside of this approach is that it prevents `defaultUpdateRefreshers`\n\t// from detecting cases where a detached node is missing for another reason (which would be a bug).\n\n\t// The roots that have been included as refreshers across all data changes so far.\n\tconst includedRoots: NestedSet<RevisionTag | undefined, number> = new Map();\n\tfunction getAndRememberDetachedNode(id: DeltaDetachedNodeId): TreeChunk | undefined {\n\t\taddToNestedSet(includedRoots, id.major, id.minor);\n\t\treturn getDetachedNode(id);\n\t}\n\tfunction* filterIncludedRoots(\n\t\ttoFilter: Iterable<DeltaDetachedNodeId>,\n\t): Iterable<DeltaDetachedNodeId> {\n\t\tfor (const id of toFilter) {\n\t\t\tif (!nestedSetContains(includedRoots, id.major, id.minor)) {\n\t\t\t\tyield id;\n\t\t\t}\n\t\t}\n\t}\n\tlet isFirstDataChange = true;\n\treturn mapDataChanges(change, (dataChange) => {\n\t\tconst builtRoots = buildsFromDataChange(dataChange);\n\t\tfor (const id of builtRoots) {\n\t\t\t// Detached root IDs that are used for builds are only ever used by a single node,\n\t\t\t// so there is no risk of excluding needed refreshers by adding them to the list of already included roots.\n\t\t\taddToNestedSet(includedRoots, id.major, id.minor);\n\t\t}\n\t\tconst removedRoots = relevantRemovedRootsFromDataChange(dataChange);\n\t\tif (isFirstDataChange) {\n\t\t\tisFirstDataChange = false;\n\t\t\treturn updateDataChangeRefreshers(\n\t\t\t\tdataChange,\n\t\t\t\tgetAndRememberDetachedNode,\n\t\t\t\tfilterIncludedRoots(removedRoots),\n\t\t\t\ttrue,\n\t\t\t);\n\t\t} else {\n\t\t\treturn updateDataChangeRefreshers(\n\t\t\t\tdataChange,\n\t\t\t\tgetAndRememberDetachedNode,\n\t\t\t\tfilterIncludedRoots(removedRoots),\n\t\t\t\tfalse,\n\t\t\t);\n\t\t}\n\t});\n}\n"]}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import type { ChangeFamilyEditor, RevisionTag, TaggedChange, TreeStoredSchema } from "../core/index.js";
|
|
6
|
-
import {
|
|
5
|
+
import type { ChangeAtomId, ChangeFamilyEditor, EditorOptions, RevisionTag, TaggedChange, TreeChunk, TreeStoredSchema } from "../core/index.js";
|
|
6
|
+
import { DefaultIdBasedDataEditor, LocationBasedDataEditor, type DetachedRootIds, type DetachedRootLocation, type DetachedRootsLocation, type Locator, type DataEditor, type ModularChangeFamily } from "../feature-libraries/index.js";
|
|
7
7
|
import type { SharedTreeChange } from "./sharedTreeChangeTypes.js";
|
|
8
8
|
/**
|
|
9
9
|
* Editor for schema changes.
|
|
@@ -20,19 +20,29 @@ export interface ISchemaEditor {
|
|
|
20
20
|
/**
|
|
21
21
|
* SharedTree editor for transactional tree data and schema changes.
|
|
22
22
|
*/
|
|
23
|
-
export interface
|
|
23
|
+
export interface IIdBasedSharedTreeEditor extends DataEditor<TreeChunk, ChangeAtomId, DetachedRootIds> {
|
|
24
|
+
/**
|
|
25
|
+
* Editor for schema changes.
|
|
26
|
+
*/
|
|
27
|
+
schema: ISchemaEditor;
|
|
28
|
+
}
|
|
29
|
+
export interface ILocationBasedSharedTreeEditor extends DataEditor<TreeChunk, DetachedRootLocation, DetachedRootsLocation> {
|
|
24
30
|
/**
|
|
25
31
|
* Editor for schema changes.
|
|
26
32
|
*/
|
|
27
33
|
schema: ISchemaEditor;
|
|
28
34
|
}
|
|
29
35
|
/**
|
|
30
|
-
* Implementation of {@link
|
|
36
|
+
* Implementation of {@link DataEditor} based on the default set of supported field kinds.
|
|
31
37
|
* @sealed
|
|
32
38
|
*/
|
|
33
|
-
export declare class
|
|
39
|
+
export declare class IdBasedSharedTreeEditBuilder extends DefaultIdBasedDataEditor implements ChangeFamilyEditor, IIdBasedSharedTreeEditor {
|
|
34
40
|
private readonly changeReceiver;
|
|
35
41
|
readonly schema: ISchemaEditor;
|
|
36
|
-
constructor(modularChangeFamily: ModularChangeFamily, mintRevisionTag: () => RevisionTag, changeReceiver: (change: TaggedChange<SharedTreeChange>) => void);
|
|
42
|
+
constructor(modularChangeFamily: ModularChangeFamily, mintRevisionTag: () => RevisionTag, changeReceiver: (change: TaggedChange<SharedTreeChange>) => void, options?: EditorOptions);
|
|
43
|
+
}
|
|
44
|
+
export declare class LocationBasedSharedTreeEditBuilder extends LocationBasedDataEditor implements ILocationBasedSharedTreeEditor {
|
|
45
|
+
readonly schema: ISchemaEditor;
|
|
46
|
+
constructor(idBasedEditor: IIdBasedSharedTreeEditor, locator: Locator);
|
|
37
47
|
}
|
|
38
48
|
//# sourceMappingURL=sharedTreeEditBuilder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sharedTreeEditBuilder.d.ts","sourceRoot":"","sources":["../../src/shared-tree/sharedTreeEditBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,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CAAC,MAAM,EAAE,YAAY,CAAC,gBAAgB,CAAC,KAAK,IAAI,EACjF,OAAO,CAAC,EAAE,aAAa;CAgCxB;AAED,qBAAa,kCACZ,SAAQ,uBACR,YAAW,8BAA8B;IAEzC,SAAgB,MAAM,EAAE,aAAa,CAAC;gBAEnB,aAAa,EAAE,wBAAwB,EAAE,OAAO,EAAE,OAAO;CAI5E"}
|
|
@@ -4,22 +4,22 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.
|
|
7
|
+
exports.LocationBasedSharedTreeEditBuilder = exports.IdBasedSharedTreeEditBuilder = void 0;
|
|
8
8
|
const index_js_1 = require("../feature-libraries/index.js");
|
|
9
9
|
/**
|
|
10
|
-
* Implementation of {@link
|
|
10
|
+
* Implementation of {@link DataEditor} based on the default set of supported field kinds.
|
|
11
11
|
* @sealed
|
|
12
12
|
*/
|
|
13
|
-
class
|
|
14
|
-
constructor(modularChangeFamily, mintRevisionTag, changeReceiver) {
|
|
13
|
+
class IdBasedSharedTreeEditBuilder extends index_js_1.DefaultIdBasedDataEditor {
|
|
14
|
+
constructor(modularChangeFamily, mintRevisionTag, changeReceiver, options) {
|
|
15
15
|
super(modularChangeFamily, mintRevisionTag, (taggedChange) => changeReceiver({
|
|
16
16
|
...taggedChange,
|
|
17
17
|
change: { changes: [{ type: "data", innerChange: taggedChange.change }] },
|
|
18
|
-
}));
|
|
18
|
+
}), options);
|
|
19
19
|
this.changeReceiver = changeReceiver;
|
|
20
20
|
this.schema = {
|
|
21
21
|
setStoredSchema: (oldSchema, newSchema) => {
|
|
22
|
-
|
|
22
|
+
changeReceiver({
|
|
23
23
|
revision: mintRevisionTag(),
|
|
24
24
|
change: {
|
|
25
25
|
changes: [
|
|
@@ -37,5 +37,12 @@ class SharedTreeEditBuilder extends index_js_1.DefaultEditBuilder {
|
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
exports.
|
|
40
|
+
exports.IdBasedSharedTreeEditBuilder = IdBasedSharedTreeEditBuilder;
|
|
41
|
+
class LocationBasedSharedTreeEditBuilder extends index_js_1.LocationBasedDataEditor {
|
|
42
|
+
constructor(idBasedEditor, locator) {
|
|
43
|
+
super(idBasedEditor, locator);
|
|
44
|
+
this.schema = idBasedEditor.schema;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.LocationBasedSharedTreeEditBuilder = LocationBasedSharedTreeEditBuilder;
|
|
41
48
|
//# sourceMappingURL=sharedTreeEditBuilder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sharedTreeEditBuilder.js","sourceRoot":"","sources":["../../src/shared-tree/sharedTreeEditBuilder.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"sharedTreeEditBuilder.js","sourceRoot":"","sources":["../../src/shared-tree/sharedTreeEditBuilder.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAWH,4DASuC;AAoCvC;;;GAGG;AACH,MAAa,4BACZ,SAAQ,mCAAwB;IAKhC,YACC,mBAAwC,EACxC,eAAkC,EACjB,cAAgE,EACjF,OAAuB;QAEvB,KAAK,CACJ,mBAAmB,EACnB,eAAe,EACf,CAAC,YAAY,EAAE,EAAE,CAChB,cAAc,CAAC;YACd,GAAG,YAAY;YACf,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE;SACzE,CAAC,EACH,OAAO,CACP,CAAC;QAZe,mBAAc,GAAd,cAAc,CAAkD;QAcjF,IAAI,CAAC,MAAM,GAAG;YACb,eAAe,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE;gBACzC,cAAc,CAAC;oBACd,QAAQ,EAAE,eAAe,EAAE;oBAC3B,MAAM,EAAE;wBACP,OAAO,EAAE;4BACR;gCACC,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE;oCACZ,MAAM,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE;oCAC1C,SAAS,EAAE,KAAK;iCAChB;6BACD;yBACD;qBACD;iBACD,CAAC,CAAC;YACJ,CAAC;SACD,CAAC;IACH,CAAC;CACD;AA1CD,oEA0CC;AAED,MAAa,kCACZ,SAAQ,kCAAuB;IAK/B,YAAmB,aAAuC,EAAE,OAAgB;QAC3E,KAAK,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC;IACpC,CAAC;CACD;AAVD,gFAUC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tChangeAtomId,\n\tChangeFamilyEditor,\n\tEditorOptions,\n\tRevisionTag,\n\tTaggedChange,\n\tTreeChunk,\n\tTreeStoredSchema,\n} from \"../core/index.js\";\nimport {\n\tDefaultIdBasedDataEditor,\n\tLocationBasedDataEditor,\n\ttype DetachedRootIds,\n\ttype DetachedRootLocation,\n\ttype DetachedRootsLocation,\n\ttype Locator,\n\ttype DataEditor,\n\ttype ModularChangeFamily,\n} from \"../feature-libraries/index.js\";\n\nimport type { SharedTreeChange } from \"./sharedTreeChangeTypes.js\";\n\n/**\n * Editor for schema changes.\n * The only currently supported operation is to replace the stored schema.\n */\nexport interface ISchemaEditor {\n\t/**\n\t * Updates the stored schema.\n\t * @param oldSchema - The schema being overwritten.\n\t * @param newSchema - The new schema to apply.\n\t */\n\tsetStoredSchema(oldSchema: TreeStoredSchema, newSchema: TreeStoredSchema): void;\n}\n\n/**\n * SharedTree editor for transactional tree data and schema changes.\n */\nexport interface IIdBasedSharedTreeEditor\n\textends DataEditor<TreeChunk, ChangeAtomId, DetachedRootIds> {\n\t/**\n\t * Editor for schema changes.\n\t */\n\tschema: ISchemaEditor;\n}\n\nexport interface ILocationBasedSharedTreeEditor\n\textends DataEditor<TreeChunk, DetachedRootLocation, DetachedRootsLocation> {\n\t/**\n\t * Editor for schema changes.\n\t */\n\tschema: ISchemaEditor;\n}\n\n/**\n * Implementation of {@link DataEditor} based on the default set of supported field kinds.\n * @sealed\n */\nexport class IdBasedSharedTreeEditBuilder\n\textends DefaultIdBasedDataEditor\n\timplements ChangeFamilyEditor, IIdBasedSharedTreeEditor\n{\n\tpublic readonly schema: ISchemaEditor;\n\n\tpublic constructor(\n\t\tmodularChangeFamily: ModularChangeFamily,\n\t\tmintRevisionTag: () => RevisionTag,\n\t\tprivate readonly changeReceiver: (change: TaggedChange<SharedTreeChange>) => void,\n\t\toptions?: EditorOptions,\n\t) {\n\t\tsuper(\n\t\t\tmodularChangeFamily,\n\t\t\tmintRevisionTag,\n\t\t\t(taggedChange) =>\n\t\t\t\tchangeReceiver({\n\t\t\t\t\t...taggedChange,\n\t\t\t\t\tchange: { changes: [{ type: \"data\", innerChange: taggedChange.change }] },\n\t\t\t\t}),\n\t\t\toptions,\n\t\t);\n\n\t\tthis.schema = {\n\t\t\tsetStoredSchema: (oldSchema, newSchema) => {\n\t\t\t\tchangeReceiver({\n\t\t\t\t\trevision: mintRevisionTag(),\n\t\t\t\t\tchange: {\n\t\t\t\t\t\tchanges: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: \"schema\",\n\t\t\t\t\t\t\t\tinnerChange: {\n\t\t\t\t\t\t\t\t\tschema: { new: newSchema, old: oldSchema },\n\t\t\t\t\t\t\t\t\tisInverse: false,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t},\n\t\t};\n\t}\n}\n\nexport class LocationBasedSharedTreeEditBuilder\n\textends LocationBasedDataEditor\n\timplements ILocationBasedSharedTreeEditor\n{\n\tpublic readonly schema: ISchemaEditor;\n\n\tpublic constructor(idBasedEditor: IIdBasedSharedTreeEditor, locator: Locator) {\n\t\tsuper(idBasedEditor, locator);\n\t\tthis.schema = idBasedEditor.schema;\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treeAlpha.d.ts","sourceRoot":"","sources":["../../src/shared-tree/treeAlpha.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,EAGN,QAAQ,EACR,KAAK,UAAU,EAMf,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,0BAA0B,EAC/B,KAAK,aAAa,EAClB,KAAK,mBAAmB,EAIxB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAEhB,KAAK,UAAU,
|
|
1
|
+
{"version":3,"file":"treeAlpha.d.ts","sourceRoot":"","sources":["../../src/shared-tree/treeAlpha.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,EAGN,QAAQ,EACR,KAAK,UAAU,EAMf,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,0BAA0B,EAC/B,KAAK,aAAa,EAClB,KAAK,mBAAmB,EAIxB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAEhB,KAAK,UAAU,EAef,KAAK,kBAAkB,EAEvB,KAAK,WAAW,EAKhB,KAAK,cAAc,EAEnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAA4B,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACjF,OAAO,EAEN,KAAK,aAAa,EAClB,KAAK,iBAAiB,EAEtB,MAAM,mBAAmB,CAAC;AAiB3B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,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AAM,SAAS,EAAE,SAkUvB,CAAC"}
|
|
@@ -219,7 +219,7 @@ exports.TreeAlpha = {
|
|
|
219
219
|
return undefined;
|
|
220
220
|
}
|
|
221
221
|
const cursor = (0, index_js_1.cursorFromVerbose)(data, schemalessConfig);
|
|
222
|
-
return (0, index_js_1.createFromCursor)(schema, cursor, (0, index_js_1.
|
|
222
|
+
return (0, index_js_1.createFromCursor)(schema, cursor, (0, index_js_1.getUnhydratedContext)(schema).flexContext.schema.rootFieldSchema);
|
|
223
223
|
},
|
|
224
224
|
exportVerbose(node, options) {
|
|
225
225
|
if ((0, index_js_5.isTreeValue)(node)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treeAlpha.js","sourceRoot":"","sources":["../../src/shared-tree/treeAlpha.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAK6C;AAC7C,qEAA4E;AAC5E,uEAAsE;AAItE,sDA8CiC;AACjC,+CAAiF;AACjF,gDAK2B;AAC3B,+CAAwF;AACxF,4DAcuC;AAEvC,6DAAoF;AACpF,uEAAiF;AACjF,iEAA8D;AAE9D,MAAM,UAAU,GAAwB,CAAC,IAAc,EAAsB,EAAE;IAC9E,MAAM,cAAc,GAAG,IAAA,gCAAqB,EAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IACnE,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAE,CAAC;QACxC,MAAM,IAAI,SAAS,CAAC,oCAAoC,CAAC,CAAC;IAC3D,CAAC;IACD,OAAO,cAAc,CAAC;AACvB,CAAC,CAAC;AAEF,UAAU,CAAC,OAAO,GAAG,CAAC,MAAkB,EAAE,cAAsB,EAAsB,EAAE;IACvF,MAAM,cAAc,GAAI,MAA0D;SAChF,cAAc,CAAC;IACjB,MAAM,YAAY,GAAG,cAAc,CAAC,yBAAyB,CAAC,cAAc,CAAC,CAAC;IAC9E,OAAO,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,IAAA,4BAAiB,EAAC,YAAY,C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C;IAED,gBAAgB,CACf,MAAe,EACf,IAAW;QAEX,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,CAAC,IAAA,6BAAa,EAAC,IAAI,CAAC,EAAE,CAAC;YACvE,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,8BAAmB,EAAE;gBACjD,YAAY,EAAE,KAAK;gBACnB,UAAU,EAAE,KAAK;gBACjB,QAAQ,EAAE,IAAI;gBACd,KAAK,EAAE,MAAM,CAAC,UAAU;aACxB,CAAC,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;CACD,CAAC;AAEF;;;;GAIG;AACH,SAAS,oCAAoC,CAC5C,IAA0C;IAE1C,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,IAAA,gCAAqB,EAAC,EAAE,CAAC,CAAC;IAClC,CAAC;IACD,MAAM,MAAM,GAAG,IAAA,0CAA+B,EAAC,IAAI,CAAC,CAAC;IACrD,sDAAsD;IACtD,MAAM,OAAO,GAAG,IAAA,4BAAiB,EAAC,MAAM,CAAC,CAAC;IAC1C,OAAO,IAAA,gCAAqB,EAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AACzC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tassert,\n\tdebugAssert,\n\tfail,\n\tunreachableCase,\n} from \"@fluidframework/core-utils/internal\";\nimport { createIdCompressor } from \"@fluidframework/id-compressor/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport type { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\nimport {\n\tasIndex,\n\tgetKernel,\n\tTreeNode,\n\ttype Unhydrated,\n\tTreeBeta,\n\ttryGetSchema,\n\tcreateFromCursor,\n\tFieldKind,\n\tnormalizeFieldSchema,\n\ttype ImplicitFieldSchema,\n\ttype InsertableField,\n\ttype TreeFieldFromImplicitField,\n\ttype TreeLeafValue,\n\ttype UnsafeUnknownSchema,\n\tapplySchemaToParserOptions,\n\tcursorFromVerbose,\n\tverboseFromCursor,\n\ttype TreeEncodingOptions,\n\ttype VerboseTree,\n\textractPersistedSchema,\n\ttype TreeBranch,\n\tTreeViewConfigurationAlpha,\n\tgetStoredKey,\n\tgetPropertyKeyFromStoredKey,\n\ttreeNodeApi,\n\tgetIdentifierFromNode,\n\tunhydratedFlexTreeFromInsertable,\n\tgetOrCreateNodeFromInnerNode,\n\tgetOrCreateNodeFromInnerUnboxedNode,\n\tgetInnerNode,\n\tNodeKind,\n\ttryGetTreeNodeForField,\n\tisObjectNodeSchema,\n\tisTreeNode,\n\ttoInitialSchema,\n\tconvertField,\n\ttoUnhydratedSchema,\n\ttype TreeParsingOptions,\n\ttype NodeChangedData,\n\ttype ConciseTree,\n\timportConcise,\n\texportConcise,\n\tborrowCursorFromTreeNodeOrValue,\n\tcontentSchemaSymbol,\n\ttype TreeNodeSchema,\n} from \"../simple-tree/index.js\";\nimport { brand, extractFromOpaque, type JsonCompatible } from \"../util/index.js\";\nimport {\n\tFluidClientVersion,\n\ttype ICodecOptions,\n\ttype CodecWriteOptions,\n\tFormatValidatorNoOp,\n} from \"../codec/index.js\";\nimport { EmptyKey, type FieldKey, type ITreeCursorSynchronous } from \"../core/index.js\";\nimport {\n\tcursorForMapTreeField,\n\tdefaultSchemaPolicy,\n\tisTreeValue,\n\tmakeFieldBatchCodec,\n\tmapTreeFromCursor,\n\tTreeCompressionStrategy,\n\ttype FieldBatch,\n\ttype FieldBatchEncodingContext,\n\ttype LocalNodeIdentifier,\n\ttype FlexTreeSequenceField,\n\ttype FlexTreeNode,\n\ttype Observer,\n\twithObservation,\n} from \"../feature-libraries/index.js\";\nimport type { TreeBranchAlpha } from \"../simple-tree/index.js\";\nimport { independentInitializedView, type ViewContent } from \"./independentView.js\";\nimport { SchematizingSimpleTreeView, ViewSlot } from \"./schematizingTreeView.js\";\nimport { isFluidHandle } from \"@fluidframework/runtime-utils\";\n\nconst identifier: TreeIdentifierUtils = (node: TreeNode): string | undefined => {\n\tconst nodeIdentifier = getIdentifierFromNode(node, \"uncompressed\");\n\tif (typeof nodeIdentifier === \"number\") {\n\t\tthrow new TypeError(\"identifier should be uncompressed.\");\n\t}\n\treturn nodeIdentifier;\n};\n\nidentifier.shorten = (branch: TreeBranch, nodeIdentifier: string): number | undefined => {\n\tconst nodeKeyManager = (branch as SchematizingSimpleTreeView<ImplicitFieldSchema>)\n\t\t.nodeKeyManager;\n\tconst localNodeKey = nodeKeyManager.tryLocalizeNodeIdentifier(nodeIdentifier);\n\treturn localNodeKey !== undefined ? extractFromOpaque(localNodeKey) : undefined;\n};\n\nidentifier.lengthen = (branch: TreeBranch, nodeIdentifier: number): string => {\n\tconst nodeKeyManager = (branch as SchematizingSimpleTreeView<ImplicitFieldSchema>)\n\t\t.nodeKeyManager;\n\treturn nodeKeyManager.stabilizeNodeIdentifier(\n\t\tnodeIdentifier as unknown as LocalNodeIdentifier,\n\t);\n};\n\nidentifier.getShort = (node: TreeNode): number | undefined => {\n\tconst shortIdentifier = getIdentifierFromNode(node, \"compressed\");\n\treturn typeof shortIdentifier === \"number\" ? shortIdentifier : undefined;\n};\n\nidentifier.create = (branch: TreeBranch): string => {\n\tconst nodeKeyManager = (branch as SchematizingSimpleTreeView<ImplicitFieldSchema>)\n\t\t.nodeKeyManager;\n\treturn nodeKeyManager.stabilizeNodeIdentifier(nodeKeyManager.generateLocalNodeIdentifier());\n};\n\nObject.freeze(identifier);\n\n/**\n * A utility interface for retrieving or converting node identifiers.\n *\n * @remarks\n * This provides methods to:\n *\n * - Retrieve long or short identifiers from nodes\n *\n * - Convert between long identifiers and short identifiers\n *\n * - Generates long identifiers\n *\n * @alpha @sealed\n */\nexport interface TreeIdentifierUtils {\n\t/**\n\t * Returns the contents of a node's {@link SchemaFactory.identifier} field as a stable identifier.\n\t * If the identifier field does not exist, returns undefined.\n\t *\n\t * @param node - The TreeNode you want to get the identifier from,\n\t */\n\t(node: TreeNode): string | undefined;\n\n\t/**\n\t * Returns the shortened identifier as a number given long identifier known by the id compressor on the branch if possible.\n\t * Otherwise, it will return the original string identifier provided.\n\t * If the id does not exist, or is unknown by the id compressor, it returns undefined.\n\t *\n\t * This method is the inverse of {@link TreeIdentifierUtils.lengthen}. If you shorten an identifier\n\t * and then immediately pass it to {@link TreeIdentifierUtils.lengthen}, you will get the original string back.\n\t *\n\t * @param branch - TreeBranch from where you get the idCompressor to do the decompression.\n\t * @param nodeIdentifier - the stable identifier that needs to be shortened.\n\t */\n\tshorten(branch: TreeBranch, nodeIdentifier: string): number | undefined;\n\n\t/**\n\t * Returns the stable id as a string if the identifier is decompressible and known by the id compressor. Otherwise, it will throw an error.\n\t *\n\t * This method is the inverse of {@link TreeIdentifierUtils.shorten}. If you lengthen an identifier\n\t * and then immediately pass it to {@link TreeIdentifierUtils.shorten}, you will get the original short identifier back.\n\t *\n\t * @param branch - TreeBranch from where you want to get the id compressor to do the decompression.\n\t * @param nodeIdentifier - The local identifier that needs to be expanded.\n\t */\n\tlengthen(branch: TreeBranch, nodeIdentifier: number): string;\n\n\t/**\n\t * Returns the {@link SchemaFactory.identifier | identifier} of the given node in the most compressed form possible.\n\t * @remarks\n\t * If the node is {@link Unhydrated | hydrated} and its identifier is a valid UUID that was automatically generated by the SharedTree it is part of (or something else using the same {@link @fluidframework/id-compressor#IIdCompressor}), then this will return a process-unique integer corresponding to that identifier.\n\t * This is useful for performance-sensitive scenarios involving many nodes with identifiers that need to be compactly retained in memory or used for efficient lookup.\n\t * Note that automatically generated identifiers that were accessed before the node was hydrated will return the generated UUID, not the process-unique integer.\n\t *\n\t * If the node's identifier is any other user-provided string, then this will return undefined.\n\t *\n\t * If the node has no identifier (that is, it has no {@link SchemaFactory.identifier | identifier} field), then this returns `undefined`.\n\t *\n\t * If the node has more than one identifier, then this will throw an error.\n\t *\n\t * The returned integer should not be serialized or preserved outside of the current process.\n\t * Its lifetime is that of the current in-memory instance of the FF container for this client, and it is not guaranteed to be unique or stable outside of that context.\n\t * The same node's identifier may, for example, be different across multiple sessions for the same client and document, or different across two clients in the same session.\n\t */\n\tgetShort(node: TreeNode): number | undefined;\n\n\t/**\n\t * Creates and returns a long identifier.\n\t * The long identifier is a compressible, stable identifier generated by the tree's ID compressor.\n\t *\n\t * @param branch - TreeBranch from where you want to get the id compressor to generate the identifier from.\n\t */\n\tcreate(branch: TreeBranch): string;\n}\n\n/**\n * Extensions to {@link (Tree:interface)} and {@link (TreeBeta:interface)} which are not yet stable.\n * @remarks\n * Use via the {@link (TreeAlpha:variable)} singleton.\n *\n * The unhydrated node creation APIs in this interface do not support {@link ObjectSchemaOptions.allowUnknownOptionalFields | unknown optional fields}.\n * This is because unknown optional fields still must have a schema: its just that the schema may come from the document's stored schema.\n * Unhydrated nodes created via this interface are not associated with any document, so there is nowhere for them to get schema for unknown optional fields.\n * Note that {@link (TreeBeta:interface).clone} can create an unhydrated node with unknown optional fields, as it uses the source node's stored schema (if any).\n *\n * Export APIs in this interface include {@link ObjectSchemaOptions.allowUnknownOptionalFields | unknown optional fields}\n * if they are using {@link KeyEncodingOptions.allStoredKeys}.\n *\n * @privateRemarks\n * TODO:\n * There should be a way to provide a source for defaulted identifiers for unhydrated node creation, either via these APIs or some way to add them to its output later.\n * If an option were added to these APIs, it could also be used to enable unknown optional fields.\n *\n * @system @sealed @alpha\n */\nexport interface TreeAlpha {\n\t/**\n\t * Retrieve the {@link TreeBranch | branch}, if any, for the given node.\n\t * @param node - The node to query\n\t * @remarks If the node has already been inserted into the tree, this will return the branch associated with that node's {@link TreeView | view}.\n\t * Otherwise, it will return `undefined` (because the node has not yet been inserted and is therefore not part of a branch or view).\n\t *\n\t * This does not fork a new branch, but rather retrieves the _existing_ branch for the node.\n\t * To create a new branch, use e.g. {@link TreeBranch.fork | `myBranch.fork()`}.\n\t */\n\tbranch(node: TreeNode): TreeBranchAlpha | undefined;\n\n\t/**\n\t * Construct tree content that is compatible with the field defined by the provided `schema`.\n\t * @param schema - The schema for what to construct. As this is an {@link ImplicitFieldSchema}, a {@link FieldSchema}, {@link TreeNodeSchema} or {@link AllowedTypes} array can be provided.\n\t * @param data - The data used to construct the field content.\n\t * @remarks\n\t * When providing a {@link TreeNodeSchemaClass}, this is the same as invoking its constructor except that an unhydrated node can also be provided.\n\t * This function exists as a generalization that can be used in other cases as well,\n\t * such as when `undefined` might be allowed (for an optional field), or when the type should be inferred from the data when more than one type is possible.\n\t */\n\tcreate<const TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema>(\n\t\tschema: UnsafeUnknownSchema extends TSchema\n\t\t\t? ImplicitFieldSchema\n\t\t\t: TSchema & ImplicitFieldSchema,\n\t\tdata: InsertableField<TSchema>,\n\t): Unhydrated<\n\t\tTSchema extends ImplicitFieldSchema\n\t\t\t? TreeFieldFromImplicitField<TSchema>\n\t\t\t: TreeNode | TreeLeafValue | undefined\n\t>;\n\n\t/**\n\t * {@inheritDoc (TreeBeta:interface).importConcise}\n\t */\n\timportConcise<const TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema>(\n\t\tschema: UnsafeUnknownSchema extends TSchema\n\t\t\t? ImplicitFieldSchema\n\t\t\t: TSchema & ImplicitFieldSchema,\n\t\tdata: ConciseTree | undefined,\n\t): Unhydrated<\n\t\tTSchema extends ImplicitFieldSchema\n\t\t\t? TreeFieldFromImplicitField<TSchema>\n\t\t\t: TreeNode | TreeLeafValue | undefined\n\t>;\n\n\t/**\n\t * {@inheritDoc (TreeBeta:interface).(exportConcise:1)}\n\t * @privateRemarks Note: this was retained on this interface because {@link (TreeAlpha:interface).importConcise} exists.\n\t * It should be removed if/when that is removed from this interface.\n\t */\n\texportConcise(node: TreeNode | TreeLeafValue, options?: TreeEncodingOptions): ConciseTree;\n\n\t/**\n\t * {@inheritDoc (TreeBeta:interface).(exportConcise:2)}\n\t * @privateRemarks Note: this was retained on this interface because {@link (TreeAlpha:interface).importConcise} exists.\n\t * It should be removed if/when that is removed from this interface.\n\t */\n\texportConcise(\n\t\tnode: TreeNode | TreeLeafValue | undefined,\n\t\toptions?: TreeEncodingOptions,\n\t): ConciseTree | undefined;\n\n\t/**\n\t * Construct tree content compatible with a field defined by the provided `schema`.\n\t * @param schema - The schema for what to construct. As this is an {@link ImplicitFieldSchema}, a {@link FieldSchema}, {@link TreeNodeSchema} or {@link AllowedTypes} array can be provided.\n\t * @param data - The data used to construct the field content. See {@link (TreeAlpha:interface).(exportVerbose:1)}.\n\t * @remarks\n\t * This currently does not support input containing\n\t * {@link ObjectSchemaOptions.allowUnknownOptionalFields| unknown optional fields} but does support\n\t * {@link SchemaStaticsBeta.staged | staged} allowed types.\n\t * Non-empty default values for fields are currently not supported (must be provided in the input).\n\t * The content will be validated against the schema and an error will be thrown if out of schema.\n\t */\n\timportVerbose<const TSchema extends ImplicitFieldSchema>(\n\t\tschema: TSchema,\n\t\tdata: VerboseTree | undefined,\n\t\toptions?: TreeParsingOptions,\n\t): Unhydrated<TreeFieldFromImplicitField<TSchema>>;\n\n\t/**\n\t * Copy a snapshot of the current version of a TreeNode into a JSON compatible plain old JavaScript Object (except for {@link @fluidframework/core-interfaces#IFluidHandle|IFluidHandles}).\n\t * Uses the {@link VerboseTree} format, with an explicit type on every node.\n\t *\n\t * @remarks\n\t * There are several cases this may be preferred to {@link (TreeBeta:interface).(exportConcise:1)}:\n\t *\n\t * 1. When not using {@link ITreeConfigurationOptions.preventAmbiguity} (or when using `useStableFieldKeys`), `exportConcise` can produce ambiguous data (the type may be unclear on some nodes).\n\t * `exportVerbose` will always be unambiguous and thus lossless.\n\t *\n\t * 2. When the data might be interpreted without access to the exact same view schema. In such cases, the types may be unknowable if not included.\n\t *\n\t * 3. When easy access to the type is desired.\n\t */\n\texportVerbose(node: TreeNode | TreeLeafValue, options?: TreeEncodingOptions): VerboseTree;\n\n\t/**\n\t * Export the content of the provided `tree` in a compressed JSON compatible format.\n\t * @remarks\n\t * If an `idCompressor` is provided, it will be used to compress identifiers and thus will be needed to decompress the data.\n\t *\n\t * Always uses \"stored\" keys.\n\t * See {@link KeyEncodingOptions.allStoredKeys} for details.\n\t * @privateRemarks\n\t * TODO: It is currently not clear how to work with the idCompressors correctly in the package API.\n\t * Better APIs should probably be provided as there is currently no way to associate an un-hydrated tree with an idCompressor,\n\t * Nor get the correct idCompressor from a subtree to use when exporting it.\n\t * Additionally using `createIdCompressor` to make an idCompressor is `@legacy` and thus not intended for use in this API surface.\n\t * It would probably make more sense if we provided a way to get an idCompressor from the context of a node,\n\t * which could be optional (and settable if missing) for un0hydrated nodes and required for hydrated ones.\n\t * Add in a stable public API for creating idCompressors, and a way to get them from a tree (without view schema), and that should address the anticipated use-cases.\n\t */\n\texportCompressed(\n\t\ttree: TreeNode | TreeLeafValue,\n\t\toptions: { idCompressor?: IIdCompressor } & Pick<CodecWriteOptions, \"minVersionForCollab\">,\n\t): JsonCompatible<IFluidHandle>;\n\n\t/**\n\t * Import data encoded by {@link (TreeAlpha:interface).exportCompressed}.\n\t *\n\t * @param schema - Schema with which the data must be compatible. This compatibility is not verified and must be ensured by the caller.\n\t * @param compressedData - Data compressed by {@link (TreeAlpha:interface).exportCompressed}.\n\t * @param options - If {@link (TreeAlpha:interface).exportCompressed} was given an `idCompressor`, it must be provided here.\n\t *\n\t * @remarks\n\t * If the data could have been encoded with a different schema, consider encoding the schema along side it using {@link extractPersistedSchema} and loading the data using {@link independentView}.\n\t *\n\t * @privateRemarks\n\t * This API could be improved:\n\t *\n\t * 1. It could validate that the schema is compatible, and return or throw an error in the invalid case (maybe add a \"try\" version).\n\t *\n\t * 2. A \"try\" version of this could return an error if the data isn't in a supported format (as determined by version and/or JasonValidator).\n\t *\n\t * 3. Requiring the caller provide a JsonValidator isn't the most friendly API. It might be practical to provide a default.\n\t */\n\timportCompressed<const TSchema extends ImplicitFieldSchema>(\n\t\tschema: TSchema,\n\t\tcompressedData: JsonCompatible<IFluidHandle>,\n\t\toptions: { idCompressor?: IIdCompressor } & ICodecOptions,\n\t): Unhydrated<TreeFieldFromImplicitField<TSchema>>;\n\n\t/**\n\t * APIs for creating, converting, and retrieving identifiers.\n\t */\n\treadonly identifier: TreeIdentifierUtils;\n\n\t/**\n\t * The key of the given node under its parent.\n\t * @remarks\n\t * If `node` is an element in a {@link (TreeArrayNode:interface)}, this returns the index of `node` in the array node (a `number`).\n\t * If `node` is the root node, this returns undefined.\n\t * Otherwise, this returns the key of the field that it is under (a `string`).\n\t */\n\tkey2(node: TreeNode): string | number | undefined;\n\n\t/**\n\t * Gets the child of the given node with the given property key if a child exists under that key.\n\t *\n\t * @remarks {@link ObjectSchemaOptions.allowUnknownOptionalFields | Unknown optional fields} of Object nodes will not be returned by this method.\n\t *\n\t * @param node - The parent node whose child is being requested.\n\t * @param key - The property key under the node under which the child is being requested.\n\t * For Object nodes, this is the developer-facing \"property key\", not the \"{@link SimpleObjectFieldSchema.storedKey | stored keys}\".\n\t *\n\t * @returns The child node or leaf value under the given key, or `undefined` if no such child exists.\n\t *\n\t * @see {@link (TreeAlpha:interface).key2}\n\t * @see {@link (TreeNodeApi:interface).parent}\n\t */\n\tchild(node: TreeNode, key: string | number): TreeNode | TreeLeafValue | undefined;\n\n\t/**\n\t * Gets the children of the provided node, paired with their property keys under the node.\n\t *\n\t * @remarks\n\t * No guarantees are made regarding the order of the children in the returned array.\n\t *\n\t * Optional properties of Object nodes with no value are not included in the result.\n\t *\n\t * {@link ObjectSchemaOptions.allowUnknownOptionalFields | Unknown optional fields} of Object nodes are not included in the result.\n\t *\n\t * @param node - The node whose children are being requested.\n\t *\n\t * @returns\n\t * An array of pairs of the form `[propertyKey, child]`.\n\t *\n\t * For Array nodes, the `propertyKey` is the index of the child in the array.\n\t *\n\t * For Object nodes, the returned `propertyKey`s are the developer-facing \"property keys\", not the \"{@link SimpleObjectFieldSchema.storedKey | stored keys}\".\n\t *\n\t * @see {@link (TreeAlpha:interface).key2}\n\t * @see {@link (TreeNodeApi:interface).parent}\n\t */\n\tchildren(\n\t\tnode: TreeNode,\n\t): Iterable<[propertyKey: string | number, child: TreeNode | TreeLeafValue]>;\n\n\t/**\n\t * Track observations of any TreeNode content.\n\t * @remarks\n\t * This subscribes to changes to any nodes content observed during `trackDuring`.\n\t *\n\t * Currently this does not support tracking parentage (see {@link (TreeAlpha:interface).trackObservationsOnce} for a version which does):\n\t * if accessing parentage during `trackDuring`, this will throw a usage error.\n\t *\n\t * This also does not track node status changes (e.g. whether a node is attached to a view or not).\n\t * The current behavior of checking status is unspecified: future versions may track it, error, or ignore it.\n\t *\n\t * These subscriptions remain active until `unsubscribe` is called: `onInvalidation` may be called multiple times.\n\t * See {@link (TreeAlpha:interface).trackObservationsOnce} for a version which automatically unsubscribes on the first invalidation.\n\t * @privateRemarks\n\t * This version, while more general than {@link (TreeAlpha:interface).trackObservationsOnce}, might be unnecessary.\n\t * Maybe this should be removed and only `trackObservationsOnce` kept.\n\t * Reevaluate this before stabilizing.\n\t */\n\ttrackObservations<TResult>(\n\t\tonInvalidation: () => void,\n\t\ttrackDuring: () => TResult,\n\t): ObservationResults<TResult>;\n\n\t/**\n\t * {@link (TreeAlpha:interface).trackObservations} except automatically unsubscribes when the first invalidation occurs.\n\t * @remarks\n\t * This also supports tracking parentage, unlike {@link (TreeAlpha:interface).trackObservations}, as long as the parent is not undefined.\n\t *\n\t * @example Simple cached value invalidation\n\t * ```typescript\n\t * // Compute and cache this \"foo\" value, and clear the cache when the fields read in the callback to compute it change.\n\t * cachedFoo ??= TreeAlpha.trackObservationsOnce(\n\t * \t() => {\n\t * \t\tcachedFoo = undefined;\n\t * \t},\n\t * \t() => nodeA.someChild.bar + nodeB.someChild.baz,\n\t * ).result;\n\t * ```\n\t *\n\t * That is equivalent to doing the following:\n\t * ```typescript\n\t * if (cachedFoo === undefined) {\n\t * \tcachedFoo = nodeA.someChild.bar + nodeB.someChild.baz;\n\t * \tconst invalidate = (): void => {\n\t * \t\tcachedFoo = undefined;\n\t * \t\tfor (const u of unsubscribe) {\n\t * \t\t\tu();\n\t * \t\t}\n\t * \t};\n\t * \tconst unsubscribe: (() => void)[] = [\n\t * \t\tTreeBeta.on(nodeA, \"nodeChanged\", (data) => {\n\t * \t\t\tif (data.changedProperties.has(\"someChild\")) {\n\t * \t\t\t\tinvalidate();\n\t * \t\t\t}\n\t * \t\t}),\n\t * \t\tTreeBeta.on(nodeB, \"nodeChanged\", (data) => {\n\t * \t\t\tif (data.changedProperties.has(\"someChild\")) {\n\t * \t\t\t\tinvalidate();\n\t * \t\t\t}\n\t * \t\t}),\n\t * \t\tTreeBeta.on(nodeA.someChild, \"nodeChanged\", (data) => {\n\t * \t\t\tif (data.changedProperties.has(\"bar\")) {\n\t * \t\t\t\tinvalidate();\n\t * \t\t\t}\n\t * \t\t}),\n\t * \t\tTreeBeta.on(nodeB.someChild, \"nodeChanged\", (data) => {\n\t * \t\t\tif (data.changedProperties.has(\"baz\")) {\n\t * \t\t\t\tinvalidate();\n\t * \t\t\t}\n\t * \t\t}),\n\t * \t];\n\t * }\n\t * ```\n\t * @example Cached derived schema property\n\t * ```typescript\n\t * const factory = new SchemaFactory(\"com.example\");\n\t * class Vector extends factory.object(\"Vector\", {\n\t * \tx: SchemaFactory.number,\n\t * \ty: SchemaFactory.number,\n\t * }) {\n\t * \t#length: number | undefined = undefined;\n\t * \tpublic length(): number {\n\t * \t\tif (this.#length === undefined) {\n\t * \t\t\tconst result = TreeAlpha.trackObservationsOnce(\n\t * \t\t\t\t() => {\n\t * \t\t\t\t\tthis.#length = undefined;\n\t * \t\t\t\t},\n\t * \t\t\t\t() => Math.hypot(this.x, this.y),\n\t * \t\t\t);\n\t * \t\t\tthis.#length = result.result;\n\t * \t\t}\n\t * \t\treturn this.#length;\n\t * \t}\n\t * }\n\t * const vec = new Vector({ x: 3, y: 4 });\n\t * assert.equal(vec.length(), 5);\n\t * vec.x = 0;\n\t * assert.equal(vec.length(), 4);\n\t * ```\n\t */\n\ttrackObservationsOnce<TResult>(\n\t\tonInvalidation: () => void,\n\t\ttrackDuring: () => TResult,\n\t): ObservationResults<TResult>;\n\n\t/**\n\t * Ensures that the provided content will be interpreted as the given schema when inserting into the tree.\n\t * @returns `content`, for convenience.\n\t * @remarks\n\t * If applicable, this will tag the given content with a {@link contentSchemaSymbol | special property} that indicates its intended schema.\n\t * The `content` will be interpreted as the given `schema` when later inserted into the tree.\n\t *\n\t * This does not validate that the content actually conforms to the given schema (such validation will be done at insert time).\n\t * If the content is not compatible with the tagged schema, an error will be thrown when the content is inserted.\n\t *\n\t * This is particularly useful when the content's schema cannot be inferred from its structure alone because it is compatible with multiple schemas.\n\t * @example\n\t * ```typescript\n\t * const sf = new SchemaFactory(\"example\");\n\t * class Dog extends sf.object(\"Dog\", { name: sf.string() }) {}\n\t * class Cat extends sf.object(\"Cat\", { name: sf.string() }) {}\n\t * class Root extends sf.object(\"Root\", { pet: [Dog, Cat] }) {}\n\t * // ...\n\t * const pet = { name: \"Max\" };\n\t * view.root.pet = pet; // Error: ambiguous schema - is it a Dog or a Cat?\n\t * TreeAlpha.ensureSchema(Dog, pet); // Tags `pet` as a Dog.\n\t * view.root.pet = pet; // No error - it's a Dog.\n\t * ```\n\t */\n\ttagContentSchema<TSchema extends TreeNodeSchema, TContent extends InsertableField<TSchema>>(\n\t\tschema: TSchema,\n\t\tcontent: TContent,\n\t): TContent;\n}\n\n/**\n * Results from an operation with tracked observations.\n * @remarks\n * Results from {@link (TreeAlpha:interface).trackObservations} or {@link (TreeAlpha:interface).trackObservationsOnce}.\n * @sealed @alpha\n */\nexport interface ObservationResults<TResult> {\n\t/**\n\t * The result of the operation which had its observations tracked.\n\t */\n\treadonly result: TResult;\n\n\t/**\n\t * Call to unsubscribe from further invalidations.\n\t */\n\treadonly unsubscribe: () => void;\n}\n\n/**\n * Subscription to changes on a single node.\n * @remarks\n * Either tracks some set of fields, or all fields and can be updated to track more fields.\n */\nclass NodeSubscription {\n\t/**\n\t * If undefined, subscribes to all keys.\n\t * Otherwise only subscribes to the keys in the set.\n\t */\n\tprivate keys: Set<FieldKey> | undefined;\n\tprivate readonly unsubscribe: () => void;\n\tprivate constructor(\n\t\tprivate readonly onInvalidation: () => void,\n\t\tflexNode: FlexTreeNode,\n\t) {\n\t\t// TODO:Performance: It is possible to optimize this to not use the public TreeNode API.\n\t\tconst node = getOrCreateNodeFromInnerNode(flexNode);\n\t\tassert(node instanceof TreeNode, 0xc54 /* Unexpected leaf value */);\n\n\t\tconst handler = (data: NodeChangedData): void => {\n\t\t\tif (this.keys === undefined || data.changedProperties === undefined) {\n\t\t\t\tthis.onInvalidation();\n\t\t\t} else {\n\t\t\t\tlet keyMap: ReadonlyMap<FieldKey, string> | undefined;\n\t\t\t\tconst schema = treeNodeApi.schema(node);\n\t\t\t\tif (isObjectNodeSchema(schema)) {\n\t\t\t\t\tkeyMap = schema.storedKeyToPropertyKey;\n\t\t\t\t}\n\t\t\t\t// TODO:Performance: Ideally this would use Set.prototype.isDisjointFrom when available.\n\t\t\t\tfor (const flexKey of this.keys) {\n\t\t\t\t\t// TODO:Performance: doing everything at the flex tree layer could avoid this translation\n\t\t\t\t\tconst key = keyMap?.get(flexKey) ?? flexKey;\n\n\t\t\t\t\tif (data.changedProperties.has(key)) {\n\t\t\t\t\t\tthis.onInvalidation();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tthis.unsubscribe = TreeBeta.on(node, \"nodeChanged\", handler);\n\t}\n\n\t/**\n\t * Create an {@link Observer} which subscribes to what was observed in {@link NodeSubscription}s.\n\t */\n\tpublic static createObserver(\n\t\tinvalidate: () => void,\n\t\tonlyOnce = false,\n\t): { observer: Observer; unsubscribe: () => void } {\n\t\tconst subscriptions = new Map<FlexTreeNode, NodeSubscription>();\n\t\tconst observer: Observer = {\n\t\t\tobserveNodeFields(flexNode: FlexTreeNode): void {\n\t\t\t\tif (flexNode.value !== undefined) {\n\t\t\t\t\t// Leaf value, nothing to observe.\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst subscription = subscriptions.get(flexNode);\n\t\t\t\tif (subscription !== undefined) {\n\t\t\t\t\t// Already subscribed to this node.\n\t\t\t\t\tsubscription.keys = undefined; // Now subscribed to all keys.\n\t\t\t\t} else {\n\t\t\t\t\tconst newSubscription = new NodeSubscription(invalidate, flexNode);\n\t\t\t\t\tsubscriptions.set(flexNode, newSubscription);\n\t\t\t\t}\n\t\t\t},\n\t\t\tobserveNodeField(flexNode: FlexTreeNode, key: FieldKey): void {\n\t\t\t\tif (flexNode.value !== undefined) {\n\t\t\t\t\t// Leaf value, nothing to observe.\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst subscription = subscriptions.get(flexNode);\n\t\t\t\tif (subscription !== undefined) {\n\t\t\t\t\t// Already subscribed to this node: if not subscribed to all keys, subscribe to this one.\n\t\t\t\t\t// TODO:Performance: due to how JavaScript set ordering works,\n\t\t\t\t\t// it might be faster to check `has` and only add if not present in case the same field is viewed many times.\n\t\t\t\t\tsubscription.keys?.add(key);\n\t\t\t\t} else {\n\t\t\t\t\tconst newSubscription = new NodeSubscription(invalidate, flexNode);\n\t\t\t\t\tnewSubscription.keys = new Set([key]);\n\t\t\t\t\tsubscriptions.set(flexNode, newSubscription);\n\t\t\t\t}\n\t\t\t},\n\t\t\tobserveParentOf(node: FlexTreeNode): void {\n\t\t\t\t// Supporting parent tracking is more difficult that it might seem at first.\n\t\t\t\t// There are two main complicating factors:\n\t\t\t\t// 1. The parent may be undefined (the node is a root).\n\t\t\t\t// 2. If tracking this by subscribing to the parent's changes, then which events are subscribed to needs to be updated after the parent changes.\n\t\t\t\t//\n\t\t\t\t// If not supporting the first case (undefined parents), the second case gets problematic: edits which un-parent a node could error due to being unable to update the event subscription.\n\t\t\t\t// For now this is mitigated by only supporting one of tracking (non-undefined) parents or maintaining event subscriptions across edits.\n\n\t\t\t\tif (!onlyOnce) {\n\t\t\t\t\t// TODO: better APIS should be provided which make handling this case practical.\n\t\t\t\t\tthrow new UsageError(\"Observation tracking for parents is currently not supported.\");\n\t\t\t\t}\n\n\t\t\t\tconst parent = withObservation(undefined, () => node.parentField.parent);\n\n\t\t\t\tif (parent.parent === undefined) {\n\t\t\t\t\t// TODO: better APIS should be provided which make handling this case practical.\n\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\"Observation tracking for parents is currently not supported when parent is undefined.\",\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tobserver.observeNodeField(parent.parent, parent.key);\n\t\t\t},\n\t\t};\n\n\t\tlet subscribed = true;\n\n\t\treturn {\n\t\t\tobserver,\n\t\t\tunsubscribe: () => {\n\t\t\t\tif (!subscribed) {\n\t\t\t\t\tthrow new UsageError(\"Already unsubscribed\");\n\t\t\t\t}\n\t\t\t\tsubscribed = false;\n\t\t\t\tfor (const subscription of subscriptions.values()) {\n\t\t\t\t\tsubscription.unsubscribe();\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t}\n}\n\n/**\n * Handles both {@link (TreeAlpha:interface).trackObservations} and {@link (TreeAlpha:interface).trackObservationsOnce}.\n */\nfunction trackObservations<TResult>(\n\tonInvalidation: () => void,\n\ttrackDuring: () => TResult,\n\tonlyOnce = false,\n): ObservationResults<TResult> {\n\tlet observing = true;\n\n\tconst invalidate = (): void => {\n\t\tif (observing) {\n\t\t\tthrow new UsageError(\"Cannot invalidate while tracking observations\");\n\t\t}\n\t\tonInvalidation();\n\t};\n\n\tconst { observer, unsubscribe } = NodeSubscription.createObserver(invalidate, onlyOnce);\n\tconst result = withObservation(observer, trackDuring);\n\tobserving = false;\n\n\treturn {\n\t\tresult,\n\t\tunsubscribe,\n\t};\n}\n\n/**\n * Extensions to {@link (Tree:variable)} and {@link (TreeBeta:variable)} which are not yet stable.\n * @see {@link (TreeAlpha:interface)}.\n * @alpha\n */\nexport const TreeAlpha: TreeAlpha = {\n\ttrackObservations<TResult>(\n\t\tonInvalidation: () => void,\n\t\ttrackDuring: () => TResult,\n\t): ObservationResults<TResult> {\n\t\treturn trackObservations(onInvalidation, trackDuring);\n\t},\n\n\ttrackObservationsOnce<TResult>(\n\t\tonInvalidation: () => void,\n\t\ttrackDuring: () => TResult,\n\t): ObservationResults<TResult> {\n\t\tconst result = trackObservations(\n\t\t\t() => {\n\t\t\t\t// trackObservations ensures no invalidation occurs while its running,\n\t\t\t\t// so this callback can only run after trackObservations has returns and thus result is defined.\n\t\t\t\tresult.unsubscribe();\n\t\t\t\tonInvalidation();\n\t\t\t},\n\t\t\ttrackDuring,\n\t\t\ttrue,\n\t\t);\n\t\treturn result;\n\t},\n\n\tbranch(node: TreeNode): TreeBranchAlpha | undefined {\n\t\tconst kernel = getKernel(node);\n\t\tif (!kernel.isHydrated()) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst view = kernel.anchorNode.anchorSet.slots.get(ViewSlot);\n\t\tassert(\n\t\t\tview instanceof SchematizingSimpleTreeView,\n\t\t\t0xa5c /* Unexpected view implementation */,\n\t\t);\n\t\treturn view;\n\t},\n\n\tcreate<const TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema>(\n\t\tschema: UnsafeUnknownSchema extends TSchema\n\t\t\t? ImplicitFieldSchema\n\t\t\t: TSchema & ImplicitFieldSchema,\n\t\tdata: InsertableField<TSchema>,\n\t): Unhydrated<\n\t\tTSchema extends ImplicitFieldSchema\n\t\t\t? TreeFieldFromImplicitField<TSchema>\n\t\t\t: TreeNode | TreeLeafValue | undefined\n\t> {\n\t\tconst mapTree = unhydratedFlexTreeFromInsertable(\n\t\t\tdata as InsertableField<UnsafeUnknownSchema>,\n\t\t\tschema,\n\t\t);\n\t\tconst result = mapTree === undefined ? undefined : getOrCreateNodeFromInnerNode(mapTree);\n\t\treturn result as Unhydrated<\n\t\t\tTSchema extends ImplicitFieldSchema\n\t\t\t\t? TreeFieldFromImplicitField<TSchema>\n\t\t\t\t: TreeNode | TreeLeafValue | undefined\n\t\t>;\n\t},\n\n\timportConcise<const TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema>(\n\t\tschema: UnsafeUnknownSchema extends TSchema\n\t\t\t? ImplicitFieldSchema\n\t\t\t: TSchema & ImplicitFieldSchema,\n\t\tdata: ConciseTree | undefined,\n\t): Unhydrated<\n\t\tTSchema extends ImplicitFieldSchema\n\t\t\t? TreeFieldFromImplicitField<TSchema>\n\t\t\t: TreeNode | TreeLeafValue | undefined\n\t> {\n\t\treturn importConcise(schema, data);\n\t},\n\n\texportConcise,\n\n\timportVerbose<const TSchema extends ImplicitFieldSchema>(\n\t\tschema: TSchema,\n\t\tdata: VerboseTree | undefined,\n\t\toptions?: TreeParsingOptions,\n\t): Unhydrated<TreeFieldFromImplicitField<TSchema>> {\n\t\tconst config: TreeEncodingOptions = { ...options };\n\t\t// Create a config which is standalone, and thus can be used without having to refer back to the schema.\n\t\tconst schemalessConfig = applySchemaToParserOptions(schema, config);\n\t\tif (data === undefined) {\n\t\t\tconst field = normalizeFieldSchema(schema);\n\t\t\tif (field.kind !== FieldKind.Optional) {\n\t\t\t\tthrow new UsageError(\"undefined provided for non-optional field.\");\n\t\t\t}\n\t\t\treturn undefined as Unhydrated<TreeFieldFromImplicitField<TSchema>>;\n\t\t}\n\t\tconst cursor = cursorFromVerbose(data, schemalessConfig);\n\t\treturn createFromCursor(\n\t\t\tschema,\n\t\t\tcursor,\n\t\t\tconvertField(normalizeFieldSchema(schema), toUnhydratedSchema),\n\t\t);\n\t},\n\n\texportVerbose(node: TreeNode | TreeLeafValue, options?: TreeEncodingOptions): VerboseTree {\n\t\tif (isTreeValue(node)) {\n\t\t\treturn node;\n\t\t}\n\t\tconst config: TreeEncodingOptions = { ...options };\n\n\t\tconst cursor = borrowCursorFromTreeNodeOrValue(node);\n\t\tconst kernel = getKernel(node);\n\t\treturn verboseFromCursor(cursor, kernel.context, config);\n\t},\n\n\texportCompressed(\n\t\tnode: TreeNode | TreeLeafValue,\n\t\toptions: { idCompressor?: IIdCompressor } & Pick<CodecWriteOptions, \"minVersionForCollab\">,\n\t): JsonCompatible<IFluidHandle> {\n\t\tconst schema = tryGetSchema(node) ?? fail(0xacf /* invalid input */);\n\t\tconst codec = makeFieldBatchCodec({\n\t\t\tjsonValidator: FormatValidatorNoOp,\n\t\t\tminVersionForCollab: options.minVersionForCollab,\n\t\t});\n\t\tconst cursor = borrowFieldCursorFromTreeNodeOrValue(node);\n\t\tconst batch: FieldBatch = [cursor];\n\t\t// If none provided, create a compressor which will not compress anything.\n\t\tconst idCompressor = options.idCompressor ?? createIdCompressor();\n\n\t\t// Grabbing an existing stored schema from the node is important to ensure that unknown optional fields can be preserved.\n\t\t// Note that if the node is unhydrated, this can result in all staged allowed types being included in the schema, which might be undesired.\n\t\tconst storedSchema = isTreeNode(node)\n\t\t\t? getKernel(node).context.flexContext.schema\n\t\t\t: toInitialSchema(schema);\n\n\t\tconst context: FieldBatchEncodingContext = {\n\t\t\tencodeType: TreeCompressionStrategy.Compressed,\n\t\t\tidCompressor,\n\t\t\toriginatorId: idCompressor.localSessionId, // TODO: Why is this needed?\n\t\t\tschema: { schema: storedSchema, policy: defaultSchemaPolicy },\n\t\t};\n\t\tconst result = codec.encode(batch, context);\n\t\treturn result;\n\t},\n\n\timportCompressed<const TSchema extends ImplicitFieldSchema>(\n\t\tschema: TSchema,\n\t\tcompressedData: JsonCompatible<IFluidHandle>,\n\t\toptions: {\n\t\t\tidCompressor?: IIdCompressor;\n\t\t} & CodecWriteOptions,\n\t): Unhydrated<TreeFieldFromImplicitField<TSchema>> {\n\t\tconst config = new TreeViewConfigurationAlpha({ schema });\n\t\tconst content: ViewContent = {\n\t\t\t// Always use a v1 schema codec for consistency.\n\t\t\t// TODO: reevaluate how staged schema should behave in schema import/export APIs before stabilizing this.\n\t\t\tschema: extractPersistedSchema(config.schema, FluidClientVersion.v2_0, () => true),\n\t\t\ttree: compressedData,\n\t\t\tidCompressor: options.idCompressor ?? createIdCompressor(),\n\t\t};\n\t\tconst view = independentInitializedView(config, options, content);\n\t\treturn TreeBeta.clone<TSchema>(view.root);\n\t},\n\n\tidentifier,\n\n\tkey2(node: TreeNode): string | number | undefined {\n\t\t// If the parent is undefined, then this node is under the root field,\n\t\tconst parent = treeNodeApi.parent(node);\n\t\tif (parent === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// The flex-domain strictly operates in terms of \"stored keys\".\n\t\t// To find the associated developer-facing \"property key\", we need to look up the field associated with\n\t\t// the stored key from the flex-domain, and get property key its simple-domain counterpart was created with.\n\t\tconst storedKey = getStoredKey(node);\n\t\tconst parentSchema = treeNodeApi.schema(parent);\n\t\treturn getPropertyKeyFromStoredKey(parentSchema, storedKey);\n\t},\n\n\tchild: (\n\t\tnode: TreeNode,\n\t\tpropertyKey: string | number,\n\t): TreeNode | TreeLeafValue | undefined => {\n\t\tconst flexNode = getInnerNode(node);\n\t\tdebugAssert(\n\t\t\t() => !flexNode.context.isDisposed() || \"The provided tree node has been disposed.\",\n\t\t);\n\n\t\tconst schema = treeNodeApi.schema(node);\n\n\t\tswitch (schema.kind) {\n\t\t\tcase NodeKind.Array: {\n\t\t\t\tconst sequence = flexNode.tryGetField(EmptyKey) as FlexTreeSequenceField | undefined;\n\n\t\t\t\t// Empty sequence - cannot have children.\n\t\t\t\tif (sequence === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\tconst index =\n\t\t\t\t\ttypeof propertyKey === \"number\"\n\t\t\t\t\t\t? propertyKey\n\t\t\t\t\t\t: asIndex(propertyKey, Number.POSITIVE_INFINITY);\n\n\t\t\t\t// If the key is not a valid index, then there is no corresponding child.\n\t\t\t\tif (index === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\tconst childFlexTree = sequence.at(index);\n\n\t\t\t\t// No child at the given index.\n\t\t\t\tif (childFlexTree === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\treturn getOrCreateNodeFromInnerUnboxedNode(childFlexTree);\n\t\t\t}\n\t\t\tcase NodeKind.Map:\n\t\t\t\tif (typeof propertyKey !== \"string\") {\n\t\t\t\t\t// Map nodes only support string keys.\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t// Fall through\n\t\t\tcase NodeKind.Record:\n\t\t\tcase NodeKind.Object: {\n\t\t\t\tlet storedKey: string | number = propertyKey;\n\t\t\t\tif (isObjectNodeSchema(schema)) {\n\t\t\t\t\tconst fieldSchema = schema.fields.get(String(propertyKey));\n\t\t\t\t\tif (fieldSchema === undefined) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\n\t\t\t\t\tstoredKey = fieldSchema.storedKey;\n\t\t\t\t}\n\n\t\t\t\tconst field = flexNode.tryGetField(brand(String(storedKey)));\n\t\t\t\tif (field !== undefined) {\n\t\t\t\t\treturn tryGetTreeNodeForField(field);\n\t\t\t\t}\n\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tcase NodeKind.Leaf: {\n\t\t\t\tfail(0xbc3 /* Leaf schema associated with non-leaf tree node. */);\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tunreachableCase(schema.kind);\n\t\t\t}\n\t\t}\n\t},\n\n\tchildren(node: TreeNode): [propertyKey: string | number, child: TreeNode | TreeLeafValue][] {\n\t\tconst flexNode = getInnerNode(node);\n\t\tdebugAssert(\n\t\t\t() => !flexNode.context.isDisposed() || \"The provided tree node has been disposed.\",\n\t\t);\n\n\t\tconst schema = treeNodeApi.schema(node);\n\n\t\tconst result: [string | number, TreeNode | TreeLeafValue][] = [];\n\t\tswitch (schema.kind) {\n\t\t\tcase NodeKind.Array: {\n\t\t\t\tconst sequence = flexNode.tryGetField(EmptyKey) as FlexTreeSequenceField | undefined;\n\t\t\t\tif (sequence === undefined) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tfor (let index = 0; index < sequence.length; index++) {\n\t\t\t\t\tconst childFlexTree = sequence.at(index);\n\t\t\t\t\tassert(childFlexTree !== undefined, 0xbc4 /* Sequence child was undefined. */);\n\t\t\t\t\tconst childTree = getOrCreateNodeFromInnerUnboxedNode(childFlexTree);\n\t\t\t\t\tresult.push([index, childTree]);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase NodeKind.Map:\n\t\t\tcase NodeKind.Record: {\n\t\t\t\tfor (const [key, flexField] of flexNode.fields) {\n\t\t\t\t\tconst childTreeNode = tryGetTreeNodeForField(flexField);\n\t\t\t\t\tif (childTreeNode !== undefined) {\n\t\t\t\t\t\tresult.push([key, childTreeNode]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase NodeKind.Object: {\n\t\t\t\tassert(isObjectNodeSchema(schema), 0xbc5 /* Expected object schema. */);\n\t\t\t\tfor (const [propertyKey, fieldSchema] of schema.fields) {\n\t\t\t\t\tconst storedKey = fieldSchema.storedKey;\n\t\t\t\t\tconst flexField = flexNode.tryGetField(brand(String(storedKey)));\n\t\t\t\t\tif (flexField !== undefined) {\n\t\t\t\t\t\tconst childTreeNode = tryGetTreeNodeForField(flexField);\n\t\t\t\t\t\tassert(\n\t\t\t\t\t\t\tchildTreeNode !== undefined,\n\t\t\t\t\t\t\t0xbc6 /* Expected child tree node for field. */,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tresult.push([propertyKey, childTreeNode]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase NodeKind.Leaf: {\n\t\t\t\tfail(0xbc7 /* Leaf schema associated with non-leaf tree node. */);\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tunreachableCase(schema.kind);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t},\n\n\ttagContentSchema<TSchema extends TreeNodeSchema, TNode extends InsertableField<TSchema>>(\n\t\tschema: TSchema,\n\t\tnode: TNode,\n\t): TNode {\n\t\tif (typeof node === \"object\" && node !== null && !isFluidHandle(node)) {\n\t\t\tReflect.defineProperty(node, contentSchemaSymbol, {\n\t\t\t\tconfigurable: false,\n\t\t\t\tenumerable: false,\n\t\t\t\twritable: true,\n\t\t\t\tvalue: schema.identifier,\n\t\t\t});\n\t\t}\n\t\treturn node;\n\t},\n};\n\n/**\n * Borrow a cursor from a field.\n * @remarks\n * The cursor must be put back to its original location before the node is used again.\n */\nfunction borrowFieldCursorFromTreeNodeOrValue(\n\tnode: TreeNode | TreeLeafValue | undefined,\n): ITreeCursorSynchronous {\n\tif (node === undefined) {\n\t\treturn cursorForMapTreeField([]);\n\t}\n\tconst cursor = borrowCursorFromTreeNodeOrValue(node);\n\t// TODO: avoid copy: borrow cursor from field instead.\n\tconst mapTree = mapTreeFromCursor(cursor);\n\treturn cursorForMapTreeField([mapTree]);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"treeAlpha.js","sourceRoot":"","sources":["../../src/shared-tree/treeAlpha.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAK6C;AAC7C,qEAA4E;AAC5E,uEAAsE;AAItE,sDA6CiC;AACjC,+CAAiF;AACjF,gDAK2B;AAC3B,+CAAwF;AACxF,4DAcuC;AAEvC,6DAAoF;AACpF,uEAAiF;AACjF,iEAA8D;AAE9D,MAAM,UAAU,GAAwB,CAAC,IAAc,EAAsB,EAAE;IAC9E,MAAM,cAAc,GAAG,IAAA,gCAAqB,EAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IACnE,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAE,CAAC;QACxC,MAAM,IAAI,SAAS,CAAC,oCAAoC,CAAC,CAAC;IAC3D,CAAC;IACD,OAAO,cAAc,CAAC;AACvB,CAAC,CAAC;AAEF,UAAU,CAAC,OAAO,GAAG,CAAC,MAAkB,EAAE,cAAsB,EAAsB,EAAE;IACvF,MAAM,cAAc,GAAI,MAA0D;SAChF,cAAc,CAAC;IACjB,MAAM,YAAY,GAAG,cAAc,CAAC,yBAAyB,CAAC,cAAc,CAAC,CAAC;IAC9E,OAAO,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC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AAO,MAAM,CAAC;IACf,CAAC;IAED,gBAAgB,CACf,MAAe,EACf,IAAW;QAEX,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,CAAC,IAAA,6BAAa,EAAC,IAAI,CAAC,EAAE,CAAC;YACvE,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,8BAAmB,EAAE;gBACjD,YAAY,EAAE,KAAK;gBACnB,UAAU,EAAE,KAAK;gBACjB,QAAQ,EAAE,IAAI;gBACd,KAAK,EAAE,MAAM,CAAC,UAAU;aACxB,CAAC,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;CACD,CAAC;AAEF;;;;GAIG;AACH,SAAS,oCAAoC,CAC5C,IAA0C;IAE1C,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,IAAA,gCAAqB,EAAC,EAAE,CAAC,CAAC;IAClC,CAAC;IACD,MAAM,MAAM,GAAG,IAAA,0CAA+B,EAAC,IAAI,CAAC,CAAC;IACrD,sDAAsD;IACtD,MAAM,OAAO,GAAG,IAAA,4BAAiB,EAAC,MAAM,CAAC,CAAC;IAC1C,OAAO,IAAA,gCAAqB,EAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AACzC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tassert,\n\tdebugAssert,\n\tfail,\n\tunreachableCase,\n} from \"@fluidframework/core-utils/internal\";\nimport { createIdCompressor } from \"@fluidframework/id-compressor/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport type { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\nimport {\n\tasIndex,\n\tgetKernel,\n\tTreeNode,\n\ttype Unhydrated,\n\tTreeBeta,\n\ttryGetSchema,\n\tcreateFromCursor,\n\tFieldKind,\n\tnormalizeFieldSchema,\n\ttype ImplicitFieldSchema,\n\ttype InsertableField,\n\ttype TreeFieldFromImplicitField,\n\ttype TreeLeafValue,\n\ttype UnsafeUnknownSchema,\n\tapplySchemaToParserOptions,\n\tcursorFromVerbose,\n\tverboseFromCursor,\n\ttype TreeEncodingOptions,\n\ttype VerboseTree,\n\textractPersistedSchema,\n\ttype TreeBranch,\n\tTreeViewConfigurationAlpha,\n\tgetStoredKey,\n\tgetPropertyKeyFromStoredKey,\n\ttreeNodeApi,\n\tgetIdentifierFromNode,\n\tunhydratedFlexTreeFromInsertable,\n\tgetOrCreateNodeFromInnerNode,\n\tgetOrCreateNodeFromInnerUnboxedNode,\n\tgetInnerNode,\n\tNodeKind,\n\ttryGetTreeNodeForField,\n\tisObjectNodeSchema,\n\tisTreeNode,\n\ttoInitialSchema,\n\ttype TreeParsingOptions,\n\ttype NodeChangedData,\n\ttype ConciseTree,\n\timportConcise,\n\texportConcise,\n\tborrowCursorFromTreeNodeOrValue,\n\tcontentSchemaSymbol,\n\ttype TreeNodeSchema,\n\tgetUnhydratedContext,\n} from \"../simple-tree/index.js\";\nimport { brand, extractFromOpaque, type JsonCompatible } from \"../util/index.js\";\nimport {\n\tFluidClientVersion,\n\ttype ICodecOptions,\n\ttype CodecWriteOptions,\n\tFormatValidatorNoOp,\n} from \"../codec/index.js\";\nimport { EmptyKey, type FieldKey, type ITreeCursorSynchronous } from \"../core/index.js\";\nimport {\n\tcursorForMapTreeField,\n\tdefaultSchemaPolicy,\n\tisTreeValue,\n\tmakeFieldBatchCodec,\n\tmapTreeFromCursor,\n\tTreeCompressionStrategy,\n\ttype FieldBatch,\n\ttype FieldBatchEncodingContext,\n\ttype LocalNodeIdentifier,\n\ttype FlexTreeSequenceField,\n\ttype FlexTreeNode,\n\ttype Observer,\n\twithObservation,\n} from \"../feature-libraries/index.js\";\nimport type { TreeBranchAlpha } from \"../simple-tree/index.js\";\nimport { independentInitializedView, type ViewContent } from \"./independentView.js\";\nimport { SchematizingSimpleTreeView, ViewSlot } from \"./schematizingTreeView.js\";\nimport { isFluidHandle } from \"@fluidframework/runtime-utils\";\n\nconst identifier: TreeIdentifierUtils = (node: TreeNode): string | undefined => {\n\tconst nodeIdentifier = getIdentifierFromNode(node, \"uncompressed\");\n\tif (typeof nodeIdentifier === \"number\") {\n\t\tthrow new TypeError(\"identifier should be uncompressed.\");\n\t}\n\treturn nodeIdentifier;\n};\n\nidentifier.shorten = (branch: TreeBranch, nodeIdentifier: string): number | undefined => {\n\tconst nodeKeyManager = (branch as SchematizingSimpleTreeView<ImplicitFieldSchema>)\n\t\t.nodeKeyManager;\n\tconst localNodeKey = nodeKeyManager.tryLocalizeNodeIdentifier(nodeIdentifier);\n\treturn localNodeKey !== undefined ? extractFromOpaque(localNodeKey) : undefined;\n};\n\nidentifier.lengthen = (branch: TreeBranch, nodeIdentifier: number): string => {\n\tconst nodeKeyManager = (branch as SchematizingSimpleTreeView<ImplicitFieldSchema>)\n\t\t.nodeKeyManager;\n\treturn nodeKeyManager.stabilizeNodeIdentifier(\n\t\tnodeIdentifier as unknown as LocalNodeIdentifier,\n\t);\n};\n\nidentifier.getShort = (node: TreeNode): number | undefined => {\n\tconst shortIdentifier = getIdentifierFromNode(node, \"compressed\");\n\treturn typeof shortIdentifier === \"number\" ? shortIdentifier : undefined;\n};\n\nidentifier.create = (branch: TreeBranch): string => {\n\tconst nodeKeyManager = (branch as SchematizingSimpleTreeView<ImplicitFieldSchema>)\n\t\t.nodeKeyManager;\n\treturn nodeKeyManager.stabilizeNodeIdentifier(nodeKeyManager.generateLocalNodeIdentifier());\n};\n\nObject.freeze(identifier);\n\n/**\n * A utility interface for retrieving or converting node identifiers.\n *\n * @remarks\n * This provides methods to:\n *\n * - Retrieve long or short identifiers from nodes\n *\n * - Convert between long identifiers and short identifiers\n *\n * - Generates long identifiers\n *\n * @alpha @sealed\n */\nexport interface TreeIdentifierUtils {\n\t/**\n\t * Returns the contents of a node's {@link SchemaFactory.identifier} field as a stable identifier.\n\t * If the identifier field does not exist, returns undefined.\n\t *\n\t * @param node - The TreeNode you want to get the identifier from,\n\t */\n\t(node: TreeNode): string | undefined;\n\n\t/**\n\t * Returns the shortened identifier as a number given long identifier known by the id compressor on the branch if possible.\n\t * Otherwise, it will return the original string identifier provided.\n\t * If the id does not exist, or is unknown by the id compressor, it returns undefined.\n\t *\n\t * This method is the inverse of {@link TreeIdentifierUtils.lengthen}. If you shorten an identifier\n\t * and then immediately pass it to {@link TreeIdentifierUtils.lengthen}, you will get the original string back.\n\t *\n\t * @param branch - TreeBranch from where you get the idCompressor to do the decompression.\n\t * @param nodeIdentifier - the stable identifier that needs to be shortened.\n\t */\n\tshorten(branch: TreeBranch, nodeIdentifier: string): number | undefined;\n\n\t/**\n\t * Returns the stable id as a string if the identifier is decompressible and known by the id compressor. Otherwise, it will throw an error.\n\t *\n\t * This method is the inverse of {@link TreeIdentifierUtils.shorten}. If you lengthen an identifier\n\t * and then immediately pass it to {@link TreeIdentifierUtils.shorten}, you will get the original short identifier back.\n\t *\n\t * @param branch - TreeBranch from where you want to get the id compressor to do the decompression.\n\t * @param nodeIdentifier - The local identifier that needs to be expanded.\n\t */\n\tlengthen(branch: TreeBranch, nodeIdentifier: number): string;\n\n\t/**\n\t * Returns the {@link SchemaFactory.identifier | identifier} of the given node in the most compressed form possible.\n\t * @remarks\n\t * If the node is {@link Unhydrated | hydrated} and its identifier is a valid UUID that was automatically generated by the SharedTree it is part of (or something else using the same {@link @fluidframework/id-compressor#IIdCompressor}), then this will return a process-unique integer corresponding to that identifier.\n\t * This is useful for performance-sensitive scenarios involving many nodes with identifiers that need to be compactly retained in memory or used for efficient lookup.\n\t * Note that automatically generated identifiers that were accessed before the node was hydrated will return the generated UUID, not the process-unique integer.\n\t *\n\t * If the node's identifier is any other user-provided string, then this will return undefined.\n\t *\n\t * If the node has no identifier (that is, it has no {@link SchemaFactory.identifier | identifier} field), then this returns `undefined`.\n\t *\n\t * If the node has more than one identifier, then this will throw an error.\n\t *\n\t * The returned integer should not be serialized or preserved outside of the current process.\n\t * Its lifetime is that of the current in-memory instance of the FF container for this client, and it is not guaranteed to be unique or stable outside of that context.\n\t * The same node's identifier may, for example, be different across multiple sessions for the same client and document, or different across two clients in the same session.\n\t */\n\tgetShort(node: TreeNode): number | undefined;\n\n\t/**\n\t * Creates and returns a long identifier.\n\t * The long identifier is a compressible, stable identifier generated by the tree's ID compressor.\n\t *\n\t * @param branch - TreeBranch from where you want to get the id compressor to generate the identifier from.\n\t */\n\tcreate(branch: TreeBranch): string;\n}\n\n/**\n * Extensions to {@link (Tree:interface)} and {@link (TreeBeta:interface)} which are not yet stable.\n * @remarks\n * Use via the {@link (TreeAlpha:variable)} singleton.\n *\n * The unhydrated node creation APIs in this interface do not support {@link ObjectSchemaOptions.allowUnknownOptionalFields | unknown optional fields}.\n * This is because unknown optional fields still must have a schema: its just that the schema may come from the document's stored schema.\n * Unhydrated nodes created via this interface are not associated with any document, so there is nowhere for them to get schema for unknown optional fields.\n * Note that {@link (TreeBeta:interface).clone} can create an unhydrated node with unknown optional fields, as it uses the source node's stored schema (if any).\n *\n * Export APIs in this interface include {@link ObjectSchemaOptions.allowUnknownOptionalFields | unknown optional fields}\n * if they are using {@link KeyEncodingOptions.allStoredKeys}.\n *\n * @privateRemarks\n * TODO:\n * There should be a way to provide a source for defaulted identifiers for unhydrated node creation, either via these APIs or some way to add them to its output later.\n * If an option were added to these APIs, it could also be used to enable unknown optional fields.\n *\n * @system @sealed @alpha\n */\nexport interface TreeAlpha {\n\t/**\n\t * Retrieve the {@link TreeBranch | branch}, if any, for the given node.\n\t * @param node - The node to query\n\t * @remarks If the node has already been inserted into the tree, this will return the branch associated with that node's {@link TreeView | view}.\n\t * Otherwise, it will return `undefined` (because the node has not yet been inserted and is therefore not part of a branch or view).\n\t *\n\t * This does not fork a new branch, but rather retrieves the _existing_ branch for the node.\n\t * To create a new branch, use e.g. {@link TreeBranch.fork | `myBranch.fork()`}.\n\t */\n\tbranch(node: TreeNode): TreeBranchAlpha | undefined;\n\n\t/**\n\t * Construct tree content that is compatible with the field defined by the provided `schema`.\n\t * @param schema - The schema for what to construct. As this is an {@link ImplicitFieldSchema}, a {@link FieldSchema}, {@link TreeNodeSchema} or {@link AllowedTypes} array can be provided.\n\t * @param data - The data used to construct the field content.\n\t * @remarks\n\t * When providing a {@link TreeNodeSchemaClass}, this is the same as invoking its constructor except that an unhydrated node can also be provided.\n\t * This function exists as a generalization that can be used in other cases as well,\n\t * such as when `undefined` might be allowed (for an optional field), or when the type should be inferred from the data when more than one type is possible.\n\t */\n\tcreate<const TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema>(\n\t\tschema: UnsafeUnknownSchema extends TSchema\n\t\t\t? ImplicitFieldSchema\n\t\t\t: TSchema & ImplicitFieldSchema,\n\t\tdata: InsertableField<TSchema>,\n\t): Unhydrated<\n\t\tTSchema extends ImplicitFieldSchema\n\t\t\t? TreeFieldFromImplicitField<TSchema>\n\t\t\t: TreeNode | TreeLeafValue | undefined\n\t>;\n\n\t/**\n\t * {@inheritDoc (TreeBeta:interface).importConcise}\n\t */\n\timportConcise<const TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema>(\n\t\tschema: UnsafeUnknownSchema extends TSchema\n\t\t\t? ImplicitFieldSchema\n\t\t\t: TSchema & ImplicitFieldSchema,\n\t\tdata: ConciseTree | undefined,\n\t): Unhydrated<\n\t\tTSchema extends ImplicitFieldSchema\n\t\t\t? TreeFieldFromImplicitField<TSchema>\n\t\t\t: TreeNode | TreeLeafValue | undefined\n\t>;\n\n\t/**\n\t * {@inheritDoc (TreeBeta:interface).(exportConcise:1)}\n\t * @privateRemarks Note: this was retained on this interface because {@link (TreeAlpha:interface).importConcise} exists.\n\t * It should be removed if/when that is removed from this interface.\n\t */\n\texportConcise(node: TreeNode | TreeLeafValue, options?: TreeEncodingOptions): ConciseTree;\n\n\t/**\n\t * {@inheritDoc (TreeBeta:interface).(exportConcise:2)}\n\t * @privateRemarks Note: this was retained on this interface because {@link (TreeAlpha:interface).importConcise} exists.\n\t * It should be removed if/when that is removed from this interface.\n\t */\n\texportConcise(\n\t\tnode: TreeNode | TreeLeafValue | undefined,\n\t\toptions?: TreeEncodingOptions,\n\t): ConciseTree | undefined;\n\n\t/**\n\t * Construct tree content compatible with a field defined by the provided `schema`.\n\t * @param schema - The schema for what to construct. As this is an {@link ImplicitFieldSchema}, a {@link FieldSchema}, {@link TreeNodeSchema} or {@link AllowedTypes} array can be provided.\n\t * @param data - The data used to construct the field content. See {@link (TreeAlpha:interface).(exportVerbose:1)}.\n\t * @remarks\n\t * This currently does not support input containing\n\t * {@link ObjectSchemaOptions.allowUnknownOptionalFields| unknown optional fields} but does support\n\t * {@link SchemaStaticsBeta.staged | staged} allowed types.\n\t * Non-empty default values for fields are currently not supported (must be provided in the input).\n\t * The content will be validated against the schema and an error will be thrown if out of schema.\n\t */\n\timportVerbose<const TSchema extends ImplicitFieldSchema>(\n\t\tschema: TSchema,\n\t\tdata: VerboseTree | undefined,\n\t\toptions?: TreeParsingOptions,\n\t): Unhydrated<TreeFieldFromImplicitField<TSchema>>;\n\n\t/**\n\t * Copy a snapshot of the current version of a TreeNode into a JSON compatible plain old JavaScript Object (except for {@link @fluidframework/core-interfaces#IFluidHandle|IFluidHandles}).\n\t * Uses the {@link VerboseTree} format, with an explicit type on every node.\n\t *\n\t * @remarks\n\t * There are several cases this may be preferred to {@link (TreeBeta:interface).(exportConcise:1)}:\n\t *\n\t * 1. When not using {@link ITreeConfigurationOptions.preventAmbiguity} (or when using `useStableFieldKeys`), `exportConcise` can produce ambiguous data (the type may be unclear on some nodes).\n\t * `exportVerbose` will always be unambiguous and thus lossless.\n\t *\n\t * 2. When the data might be interpreted without access to the exact same view schema. In such cases, the types may be unknowable if not included.\n\t *\n\t * 3. When easy access to the type is desired.\n\t */\n\texportVerbose(node: TreeNode | TreeLeafValue, options?: TreeEncodingOptions): VerboseTree;\n\n\t/**\n\t * Export the content of the provided `tree` in a compressed JSON compatible format.\n\t * @remarks\n\t * If an `idCompressor` is provided, it will be used to compress identifiers and thus will be needed to decompress the data.\n\t *\n\t * Always uses \"stored\" keys.\n\t * See {@link KeyEncodingOptions.allStoredKeys} for details.\n\t * @privateRemarks\n\t * TODO: It is currently not clear how to work with the idCompressors correctly in the package API.\n\t * Better APIs should probably be provided as there is currently no way to associate an un-hydrated tree with an idCompressor,\n\t * Nor get the correct idCompressor from a subtree to use when exporting it.\n\t * Additionally using `createIdCompressor` to make an idCompressor is `@legacy` and thus not intended for use in this API surface.\n\t * It would probably make more sense if we provided a way to get an idCompressor from the context of a node,\n\t * which could be optional (and settable if missing) for un0hydrated nodes and required for hydrated ones.\n\t * Add in a stable public API for creating idCompressors, and a way to get them from a tree (without view schema), and that should address the anticipated use-cases.\n\t */\n\texportCompressed(\n\t\ttree: TreeNode | TreeLeafValue,\n\t\toptions: { idCompressor?: IIdCompressor } & Pick<CodecWriteOptions, \"minVersionForCollab\">,\n\t): JsonCompatible<IFluidHandle>;\n\n\t/**\n\t * Import data encoded by {@link (TreeAlpha:interface).exportCompressed}.\n\t *\n\t * @param schema - Schema with which the data must be compatible. This compatibility is not verified and must be ensured by the caller.\n\t * @param compressedData - Data compressed by {@link (TreeAlpha:interface).exportCompressed}.\n\t * @param options - If {@link (TreeAlpha:interface).exportCompressed} was given an `idCompressor`, it must be provided here.\n\t *\n\t * @remarks\n\t * If the data could have been encoded with a different schema, consider encoding the schema along side it using {@link extractPersistedSchema} and loading the data using {@link independentView}.\n\t *\n\t * @privateRemarks\n\t * This API could be improved:\n\t *\n\t * 1. It could validate that the schema is compatible, and return or throw an error in the invalid case (maybe add a \"try\" version).\n\t *\n\t * 2. A \"try\" version of this could return an error if the data isn't in a supported format (as determined by version and/or JasonValidator).\n\t *\n\t * 3. Requiring the caller provide a JsonValidator isn't the most friendly API. It might be practical to provide a default.\n\t */\n\timportCompressed<const TSchema extends ImplicitFieldSchema>(\n\t\tschema: TSchema,\n\t\tcompressedData: JsonCompatible<IFluidHandle>,\n\t\toptions: { idCompressor?: IIdCompressor } & ICodecOptions,\n\t): Unhydrated<TreeFieldFromImplicitField<TSchema>>;\n\n\t/**\n\t * APIs for creating, converting, and retrieving identifiers.\n\t */\n\treadonly identifier: TreeIdentifierUtils;\n\n\t/**\n\t * The key of the given node under its parent.\n\t * @remarks\n\t * If `node` is an element in a {@link (TreeArrayNode:interface)}, this returns the index of `node` in the array node (a `number`).\n\t * If `node` is the root node, this returns undefined.\n\t * Otherwise, this returns the key of the field that it is under (a `string`).\n\t */\n\tkey2(node: TreeNode): string | number | undefined;\n\n\t/**\n\t * Gets the child of the given node with the given property key if a child exists under that key.\n\t *\n\t * @remarks {@link ObjectSchemaOptions.allowUnknownOptionalFields | Unknown optional fields} of Object nodes will not be returned by this method.\n\t *\n\t * @param node - The parent node whose child is being requested.\n\t * @param key - The property key under the node under which the child is being requested.\n\t * For Object nodes, this is the developer-facing \"property key\", not the \"{@link SimpleObjectFieldSchema.storedKey | stored keys}\".\n\t *\n\t * @returns The child node or leaf value under the given key, or `undefined` if no such child exists.\n\t *\n\t * @see {@link (TreeAlpha:interface).key2}\n\t * @see {@link (TreeNodeApi:interface).parent}\n\t */\n\tchild(node: TreeNode, key: string | number): TreeNode | TreeLeafValue | undefined;\n\n\t/**\n\t * Gets the children of the provided node, paired with their property keys under the node.\n\t *\n\t * @remarks\n\t * No guarantees are made regarding the order of the children in the returned array.\n\t *\n\t * Optional properties of Object nodes with no value are not included in the result.\n\t *\n\t * {@link ObjectSchemaOptions.allowUnknownOptionalFields | Unknown optional fields} of Object nodes are not included in the result.\n\t *\n\t * @param node - The node whose children are being requested.\n\t *\n\t * @returns\n\t * An array of pairs of the form `[propertyKey, child]`.\n\t *\n\t * For Array nodes, the `propertyKey` is the index of the child in the array.\n\t *\n\t * For Object nodes, the returned `propertyKey`s are the developer-facing \"property keys\", not the \"{@link SimpleObjectFieldSchema.storedKey | stored keys}\".\n\t *\n\t * @see {@link (TreeAlpha:interface).key2}\n\t * @see {@link (TreeNodeApi:interface).parent}\n\t */\n\tchildren(\n\t\tnode: TreeNode,\n\t): Iterable<[propertyKey: string | number, child: TreeNode | TreeLeafValue]>;\n\n\t/**\n\t * Track observations of any TreeNode content.\n\t * @remarks\n\t * This subscribes to changes to any nodes content observed during `trackDuring`.\n\t *\n\t * Currently this does not support tracking parentage (see {@link (TreeAlpha:interface).trackObservationsOnce} for a version which does):\n\t * if accessing parentage during `trackDuring`, this will throw a usage error.\n\t *\n\t * This also does not track node status changes (e.g. whether a node is attached to a view or not).\n\t * The current behavior of checking status is unspecified: future versions may track it, error, or ignore it.\n\t *\n\t * These subscriptions remain active until `unsubscribe` is called: `onInvalidation` may be called multiple times.\n\t * See {@link (TreeAlpha:interface).trackObservationsOnce} for a version which automatically unsubscribes on the first invalidation.\n\t * @privateRemarks\n\t * This version, while more general than {@link (TreeAlpha:interface).trackObservationsOnce}, might be unnecessary.\n\t * Maybe this should be removed and only `trackObservationsOnce` kept.\n\t * Reevaluate this before stabilizing.\n\t */\n\ttrackObservations<TResult>(\n\t\tonInvalidation: () => void,\n\t\ttrackDuring: () => TResult,\n\t): ObservationResults<TResult>;\n\n\t/**\n\t * {@link (TreeAlpha:interface).trackObservations} except automatically unsubscribes when the first invalidation occurs.\n\t * @remarks\n\t * This also supports tracking parentage, unlike {@link (TreeAlpha:interface).trackObservations}, as long as the parent is not undefined.\n\t *\n\t * @example Simple cached value invalidation\n\t * ```typescript\n\t * // Compute and cache this \"foo\" value, and clear the cache when the fields read in the callback to compute it change.\n\t * cachedFoo ??= TreeAlpha.trackObservationsOnce(\n\t * \t() => {\n\t * \t\tcachedFoo = undefined;\n\t * \t},\n\t * \t() => nodeA.someChild.bar + nodeB.someChild.baz,\n\t * ).result;\n\t * ```\n\t *\n\t * That is equivalent to doing the following:\n\t * ```typescript\n\t * if (cachedFoo === undefined) {\n\t * \tcachedFoo = nodeA.someChild.bar + nodeB.someChild.baz;\n\t * \tconst invalidate = (): void => {\n\t * \t\tcachedFoo = undefined;\n\t * \t\tfor (const u of unsubscribe) {\n\t * \t\t\tu();\n\t * \t\t}\n\t * \t};\n\t * \tconst unsubscribe: (() => void)[] = [\n\t * \t\tTreeBeta.on(nodeA, \"nodeChanged\", (data) => {\n\t * \t\t\tif (data.changedProperties.has(\"someChild\")) {\n\t * \t\t\t\tinvalidate();\n\t * \t\t\t}\n\t * \t\t}),\n\t * \t\tTreeBeta.on(nodeB, \"nodeChanged\", (data) => {\n\t * \t\t\tif (data.changedProperties.has(\"someChild\")) {\n\t * \t\t\t\tinvalidate();\n\t * \t\t\t}\n\t * \t\t}),\n\t * \t\tTreeBeta.on(nodeA.someChild, \"nodeChanged\", (data) => {\n\t * \t\t\tif (data.changedProperties.has(\"bar\")) {\n\t * \t\t\t\tinvalidate();\n\t * \t\t\t}\n\t * \t\t}),\n\t * \t\tTreeBeta.on(nodeB.someChild, \"nodeChanged\", (data) => {\n\t * \t\t\tif (data.changedProperties.has(\"baz\")) {\n\t * \t\t\t\tinvalidate();\n\t * \t\t\t}\n\t * \t\t}),\n\t * \t];\n\t * }\n\t * ```\n\t * @example Cached derived schema property\n\t * ```typescript\n\t * const factory = new SchemaFactory(\"com.example\");\n\t * class Vector extends factory.object(\"Vector\", {\n\t * \tx: SchemaFactory.number,\n\t * \ty: SchemaFactory.number,\n\t * }) {\n\t * \t#length: number | undefined = undefined;\n\t * \tpublic length(): number {\n\t * \t\tif (this.#length === undefined) {\n\t * \t\t\tconst result = TreeAlpha.trackObservationsOnce(\n\t * \t\t\t\t() => {\n\t * \t\t\t\t\tthis.#length = undefined;\n\t * \t\t\t\t},\n\t * \t\t\t\t() => Math.hypot(this.x, this.y),\n\t * \t\t\t);\n\t * \t\t\tthis.#length = result.result;\n\t * \t\t}\n\t * \t\treturn this.#length;\n\t * \t}\n\t * }\n\t * const vec = new Vector({ x: 3, y: 4 });\n\t * assert.equal(vec.length(), 5);\n\t * vec.x = 0;\n\t * assert.equal(vec.length(), 4);\n\t * ```\n\t */\n\ttrackObservationsOnce<TResult>(\n\t\tonInvalidation: () => void,\n\t\ttrackDuring: () => TResult,\n\t): ObservationResults<TResult>;\n\n\t/**\n\t * Ensures that the provided content will be interpreted as the given schema when inserting into the tree.\n\t * @returns `content`, for convenience.\n\t * @remarks\n\t * If applicable, this will tag the given content with a {@link contentSchemaSymbol | special property} that indicates its intended schema.\n\t * The `content` will be interpreted as the given `schema` when later inserted into the tree.\n\t *\n\t * This does not validate that the content actually conforms to the given schema (such validation will be done at insert time).\n\t * If the content is not compatible with the tagged schema, an error will be thrown when the content is inserted.\n\t *\n\t * This is particularly useful when the content's schema cannot be inferred from its structure alone because it is compatible with multiple schemas.\n\t * @example\n\t * ```typescript\n\t * const sf = new SchemaFactory(\"example\");\n\t * class Dog extends sf.object(\"Dog\", { name: sf.string() }) {}\n\t * class Cat extends sf.object(\"Cat\", { name: sf.string() }) {}\n\t * class Root extends sf.object(\"Root\", { pet: [Dog, Cat] }) {}\n\t * // ...\n\t * const pet = { name: \"Max\" };\n\t * view.root.pet = pet; // Error: ambiguous schema - is it a Dog or a Cat?\n\t * TreeAlpha.ensureSchema(Dog, pet); // Tags `pet` as a Dog.\n\t * view.root.pet = pet; // No error - it's a Dog.\n\t * ```\n\t */\n\ttagContentSchema<TSchema extends TreeNodeSchema, TContent extends InsertableField<TSchema>>(\n\t\tschema: TSchema,\n\t\tcontent: TContent,\n\t): TContent;\n}\n\n/**\n * Results from an operation with tracked observations.\n * @remarks\n * Results from {@link (TreeAlpha:interface).trackObservations} or {@link (TreeAlpha:interface).trackObservationsOnce}.\n * @sealed @alpha\n */\nexport interface ObservationResults<TResult> {\n\t/**\n\t * The result of the operation which had its observations tracked.\n\t */\n\treadonly result: TResult;\n\n\t/**\n\t * Call to unsubscribe from further invalidations.\n\t */\n\treadonly unsubscribe: () => void;\n}\n\n/**\n * Subscription to changes on a single node.\n * @remarks\n * Either tracks some set of fields, or all fields and can be updated to track more fields.\n */\nclass NodeSubscription {\n\t/**\n\t * If undefined, subscribes to all keys.\n\t * Otherwise only subscribes to the keys in the set.\n\t */\n\tprivate keys: Set<FieldKey> | undefined;\n\tprivate readonly unsubscribe: () => void;\n\tprivate constructor(\n\t\tprivate readonly onInvalidation: () => void,\n\t\tflexNode: FlexTreeNode,\n\t) {\n\t\t// TODO:Performance: It is possible to optimize this to not use the public TreeNode API.\n\t\tconst node = getOrCreateNodeFromInnerNode(flexNode);\n\t\tassert(node instanceof TreeNode, 0xc54 /* Unexpected leaf value */);\n\n\t\tconst handler = (data: NodeChangedData): void => {\n\t\t\tif (this.keys === undefined || data.changedProperties === undefined) {\n\t\t\t\tthis.onInvalidation();\n\t\t\t} else {\n\t\t\t\tlet keyMap: ReadonlyMap<FieldKey, string> | undefined;\n\t\t\t\tconst schema = treeNodeApi.schema(node);\n\t\t\t\tif (isObjectNodeSchema(schema)) {\n\t\t\t\t\tkeyMap = schema.storedKeyToPropertyKey;\n\t\t\t\t}\n\t\t\t\t// TODO:Performance: Ideally this would use Set.prototype.isDisjointFrom when available.\n\t\t\t\tfor (const flexKey of this.keys) {\n\t\t\t\t\t// TODO:Performance: doing everything at the flex tree layer could avoid this translation\n\t\t\t\t\tconst key = keyMap?.get(flexKey) ?? flexKey;\n\n\t\t\t\t\tif (data.changedProperties.has(key)) {\n\t\t\t\t\t\tthis.onInvalidation();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tthis.unsubscribe = TreeBeta.on(node, \"nodeChanged\", handler);\n\t}\n\n\t/**\n\t * Create an {@link Observer} which subscribes to what was observed in {@link NodeSubscription}s.\n\t */\n\tpublic static createObserver(\n\t\tinvalidate: () => void,\n\t\tonlyOnce = false,\n\t): { observer: Observer; unsubscribe: () => void } {\n\t\tconst subscriptions = new Map<FlexTreeNode, NodeSubscription>();\n\t\tconst observer: Observer = {\n\t\t\tobserveNodeFields(flexNode: FlexTreeNode): void {\n\t\t\t\tif (flexNode.value !== undefined) {\n\t\t\t\t\t// Leaf value, nothing to observe.\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst subscription = subscriptions.get(flexNode);\n\t\t\t\tif (subscription !== undefined) {\n\t\t\t\t\t// Already subscribed to this node.\n\t\t\t\t\tsubscription.keys = undefined; // Now subscribed to all keys.\n\t\t\t\t} else {\n\t\t\t\t\tconst newSubscription = new NodeSubscription(invalidate, flexNode);\n\t\t\t\t\tsubscriptions.set(flexNode, newSubscription);\n\t\t\t\t}\n\t\t\t},\n\t\t\tobserveNodeField(flexNode: FlexTreeNode, key: FieldKey): void {\n\t\t\t\tif (flexNode.value !== undefined) {\n\t\t\t\t\t// Leaf value, nothing to observe.\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst subscription = subscriptions.get(flexNode);\n\t\t\t\tif (subscription !== undefined) {\n\t\t\t\t\t// Already subscribed to this node: if not subscribed to all keys, subscribe to this one.\n\t\t\t\t\t// TODO:Performance: due to how JavaScript set ordering works,\n\t\t\t\t\t// it might be faster to check `has` and only add if not present in case the same field is viewed many times.\n\t\t\t\t\tsubscription.keys?.add(key);\n\t\t\t\t} else {\n\t\t\t\t\tconst newSubscription = new NodeSubscription(invalidate, flexNode);\n\t\t\t\t\tnewSubscription.keys = new Set([key]);\n\t\t\t\t\tsubscriptions.set(flexNode, newSubscription);\n\t\t\t\t}\n\t\t\t},\n\t\t\tobserveParentOf(node: FlexTreeNode): void {\n\t\t\t\t// Supporting parent tracking is more difficult that it might seem at first.\n\t\t\t\t// There are two main complicating factors:\n\t\t\t\t// 1. The parent may be undefined (the node is a root).\n\t\t\t\t// 2. If tracking this by subscribing to the parent's changes, then which events are subscribed to needs to be updated after the parent changes.\n\t\t\t\t//\n\t\t\t\t// If not supporting the first case (undefined parents), the second case gets problematic: edits which un-parent a node could error due to being unable to update the event subscription.\n\t\t\t\t// For now this is mitigated by only supporting one of tracking (non-undefined) parents or maintaining event subscriptions across edits.\n\n\t\t\t\tif (!onlyOnce) {\n\t\t\t\t\t// TODO: better APIS should be provided which make handling this case practical.\n\t\t\t\t\tthrow new UsageError(\"Observation tracking for parents is currently not supported.\");\n\t\t\t\t}\n\n\t\t\t\tconst parent = withObservation(undefined, () => node.parentField.parent);\n\n\t\t\t\tif (parent.parent === undefined) {\n\t\t\t\t\t// TODO: better APIS should be provided which make handling this case practical.\n\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\"Observation tracking for parents is currently not supported when parent is undefined.\",\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tobserver.observeNodeField(parent.parent, parent.key);\n\t\t\t},\n\t\t};\n\n\t\tlet subscribed = true;\n\n\t\treturn {\n\t\t\tobserver,\n\t\t\tunsubscribe: () => {\n\t\t\t\tif (!subscribed) {\n\t\t\t\t\tthrow new UsageError(\"Already unsubscribed\");\n\t\t\t\t}\n\t\t\t\tsubscribed = false;\n\t\t\t\tfor (const subscription of subscriptions.values()) {\n\t\t\t\t\tsubscription.unsubscribe();\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t}\n}\n\n/**\n * Handles both {@link (TreeAlpha:interface).trackObservations} and {@link (TreeAlpha:interface).trackObservationsOnce}.\n */\nfunction trackObservations<TResult>(\n\tonInvalidation: () => void,\n\ttrackDuring: () => TResult,\n\tonlyOnce = false,\n): ObservationResults<TResult> {\n\tlet observing = true;\n\n\tconst invalidate = (): void => {\n\t\tif (observing) {\n\t\t\tthrow new UsageError(\"Cannot invalidate while tracking observations\");\n\t\t}\n\t\tonInvalidation();\n\t};\n\n\tconst { observer, unsubscribe } = NodeSubscription.createObserver(invalidate, onlyOnce);\n\tconst result = withObservation(observer, trackDuring);\n\tobserving = false;\n\n\treturn {\n\t\tresult,\n\t\tunsubscribe,\n\t};\n}\n\n/**\n * Extensions to {@link (Tree:variable)} and {@link (TreeBeta:variable)} which are not yet stable.\n * @see {@link (TreeAlpha:interface)}.\n * @alpha\n */\nexport const TreeAlpha: TreeAlpha = {\n\ttrackObservations<TResult>(\n\t\tonInvalidation: () => void,\n\t\ttrackDuring: () => TResult,\n\t): ObservationResults<TResult> {\n\t\treturn trackObservations(onInvalidation, trackDuring);\n\t},\n\n\ttrackObservationsOnce<TResult>(\n\t\tonInvalidation: () => void,\n\t\ttrackDuring: () => TResult,\n\t): ObservationResults<TResult> {\n\t\tconst result = trackObservations(\n\t\t\t() => {\n\t\t\t\t// trackObservations ensures no invalidation occurs while its running,\n\t\t\t\t// so this callback can only run after trackObservations has returns and thus result is defined.\n\t\t\t\tresult.unsubscribe();\n\t\t\t\tonInvalidation();\n\t\t\t},\n\t\t\ttrackDuring,\n\t\t\ttrue,\n\t\t);\n\t\treturn result;\n\t},\n\n\tbranch(node: TreeNode): TreeBranchAlpha | undefined {\n\t\tconst kernel = getKernel(node);\n\t\tif (!kernel.isHydrated()) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst view = kernel.anchorNode.anchorSet.slots.get(ViewSlot);\n\t\tassert(\n\t\t\tview instanceof SchematizingSimpleTreeView,\n\t\t\t0xa5c /* Unexpected view implementation */,\n\t\t);\n\t\treturn view;\n\t},\n\n\tcreate<const TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema>(\n\t\tschema: UnsafeUnknownSchema extends TSchema\n\t\t\t? ImplicitFieldSchema\n\t\t\t: TSchema & ImplicitFieldSchema,\n\t\tdata: InsertableField<TSchema>,\n\t): Unhydrated<\n\t\tTSchema extends ImplicitFieldSchema\n\t\t\t? TreeFieldFromImplicitField<TSchema>\n\t\t\t: TreeNode | TreeLeafValue | undefined\n\t> {\n\t\tconst mapTree = unhydratedFlexTreeFromInsertable(\n\t\t\tdata as InsertableField<UnsafeUnknownSchema>,\n\t\t\tschema,\n\t\t);\n\t\tconst result = mapTree === undefined ? undefined : getOrCreateNodeFromInnerNode(mapTree);\n\t\treturn result as Unhydrated<\n\t\t\tTSchema extends ImplicitFieldSchema\n\t\t\t\t? TreeFieldFromImplicitField<TSchema>\n\t\t\t\t: TreeNode | TreeLeafValue | undefined\n\t\t>;\n\t},\n\n\timportConcise<const TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema>(\n\t\tschema: UnsafeUnknownSchema extends TSchema\n\t\t\t? ImplicitFieldSchema\n\t\t\t: TSchema & ImplicitFieldSchema,\n\t\tdata: ConciseTree | undefined,\n\t): Unhydrated<\n\t\tTSchema extends ImplicitFieldSchema\n\t\t\t? TreeFieldFromImplicitField<TSchema>\n\t\t\t: TreeNode | TreeLeafValue | undefined\n\t> {\n\t\treturn importConcise(schema, data);\n\t},\n\n\texportConcise,\n\n\timportVerbose<const TSchema extends ImplicitFieldSchema>(\n\t\tschema: TSchema,\n\t\tdata: VerboseTree | undefined,\n\t\toptions?: TreeParsingOptions,\n\t): Unhydrated<TreeFieldFromImplicitField<TSchema>> {\n\t\tconst config: TreeEncodingOptions = { ...options };\n\t\t// Create a config which is standalone, and thus can be used without having to refer back to the schema.\n\t\tconst schemalessConfig = applySchemaToParserOptions(schema, config);\n\t\tif (data === undefined) {\n\t\t\tconst field = normalizeFieldSchema(schema);\n\t\t\tif (field.kind !== FieldKind.Optional) {\n\t\t\t\tthrow new UsageError(\"undefined provided for non-optional field.\");\n\t\t\t}\n\t\t\treturn undefined as Unhydrated<TreeFieldFromImplicitField<TSchema>>;\n\t\t}\n\t\tconst cursor = cursorFromVerbose(data, schemalessConfig);\n\t\treturn createFromCursor(\n\t\t\tschema,\n\t\t\tcursor,\n\t\t\tgetUnhydratedContext(schema).flexContext.schema.rootFieldSchema,\n\t\t);\n\t},\n\n\texportVerbose(node: TreeNode | TreeLeafValue, options?: TreeEncodingOptions): VerboseTree {\n\t\tif (isTreeValue(node)) {\n\t\t\treturn node;\n\t\t}\n\t\tconst config: TreeEncodingOptions = { ...options };\n\n\t\tconst cursor = borrowCursorFromTreeNodeOrValue(node);\n\t\tconst kernel = getKernel(node);\n\t\treturn verboseFromCursor(cursor, kernel.context, config);\n\t},\n\n\texportCompressed(\n\t\tnode: TreeNode | TreeLeafValue,\n\t\toptions: { idCompressor?: IIdCompressor } & Pick<CodecWriteOptions, \"minVersionForCollab\">,\n\t): JsonCompatible<IFluidHandle> {\n\t\tconst schema = tryGetSchema(node) ?? fail(0xacf /* invalid input */);\n\t\tconst codec = makeFieldBatchCodec({\n\t\t\tjsonValidator: FormatValidatorNoOp,\n\t\t\tminVersionForCollab: options.minVersionForCollab,\n\t\t});\n\t\tconst cursor = borrowFieldCursorFromTreeNodeOrValue(node);\n\t\tconst batch: FieldBatch = [cursor];\n\t\t// If none provided, create a compressor which will not compress anything.\n\t\tconst idCompressor = options.idCompressor ?? createIdCompressor();\n\n\t\t// Grabbing an existing stored schema from the node is important to ensure that unknown optional fields can be preserved.\n\t\t// Note that if the node is unhydrated, this can result in all staged allowed types being included in the schema, which might be undesired.\n\t\tconst storedSchema = isTreeNode(node)\n\t\t\t? getKernel(node).context.flexContext.schema\n\t\t\t: toInitialSchema(schema);\n\n\t\tconst context: FieldBatchEncodingContext = {\n\t\t\tencodeType: TreeCompressionStrategy.Compressed,\n\t\t\tidCompressor,\n\t\t\toriginatorId: idCompressor.localSessionId, // TODO: Why is this needed?\n\t\t\tschema: { schema: storedSchema, policy: defaultSchemaPolicy },\n\t\t};\n\t\tconst result = codec.encode(batch, context);\n\t\treturn result;\n\t},\n\n\timportCompressed<const TSchema extends ImplicitFieldSchema>(\n\t\tschema: TSchema,\n\t\tcompressedData: JsonCompatible<IFluidHandle>,\n\t\toptions: {\n\t\t\tidCompressor?: IIdCompressor;\n\t\t} & CodecWriteOptions,\n\t): Unhydrated<TreeFieldFromImplicitField<TSchema>> {\n\t\tconst config = new TreeViewConfigurationAlpha({ schema });\n\t\tconst content: ViewContent = {\n\t\t\t// Always use a v1 schema codec for consistency.\n\t\t\t// TODO: reevaluate how staged schema should behave in schema import/export APIs before stabilizing this.\n\t\t\tschema: extractPersistedSchema(config.schema, FluidClientVersion.v2_0, () => true),\n\t\t\ttree: compressedData,\n\t\t\tidCompressor: options.idCompressor ?? createIdCompressor(),\n\t\t};\n\t\tconst view = independentInitializedView(config, options, content);\n\t\treturn TreeBeta.clone<TSchema>(view.root);\n\t},\n\n\tidentifier,\n\n\tkey2(node: TreeNode): string | number | undefined {\n\t\t// If the parent is undefined, then this node is under the root field,\n\t\tconst parent = treeNodeApi.parent(node);\n\t\tif (parent === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// The flex-domain strictly operates in terms of \"stored keys\".\n\t\t// To find the associated developer-facing \"property key\", we need to look up the field associated with\n\t\t// the stored key from the flex-domain, and get property key its simple-domain counterpart was created with.\n\t\tconst storedKey = getStoredKey(node);\n\t\tconst parentSchema = treeNodeApi.schema(parent);\n\t\treturn getPropertyKeyFromStoredKey(parentSchema, storedKey);\n\t},\n\n\tchild: (\n\t\tnode: TreeNode,\n\t\tpropertyKey: string | number,\n\t): TreeNode | TreeLeafValue | undefined => {\n\t\tconst flexNode = getInnerNode(node);\n\t\tdebugAssert(\n\t\t\t() => !flexNode.context.isDisposed() || \"The provided tree node has been disposed.\",\n\t\t);\n\n\t\tconst schema = treeNodeApi.schema(node);\n\n\t\tswitch (schema.kind) {\n\t\t\tcase NodeKind.Array: {\n\t\t\t\tconst sequence = flexNode.tryGetField(EmptyKey) as FlexTreeSequenceField | undefined;\n\n\t\t\t\t// Empty sequence - cannot have children.\n\t\t\t\tif (sequence === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\tconst index =\n\t\t\t\t\ttypeof propertyKey === \"number\"\n\t\t\t\t\t\t? propertyKey\n\t\t\t\t\t\t: asIndex(propertyKey, Number.POSITIVE_INFINITY);\n\n\t\t\t\t// If the key is not a valid index, then there is no corresponding child.\n\t\t\t\tif (index === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\tconst childFlexTree = sequence.at(index);\n\n\t\t\t\t// No child at the given index.\n\t\t\t\tif (childFlexTree === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\treturn getOrCreateNodeFromInnerUnboxedNode(childFlexTree);\n\t\t\t}\n\t\t\tcase NodeKind.Map:\n\t\t\t\tif (typeof propertyKey !== \"string\") {\n\t\t\t\t\t// Map nodes only support string keys.\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t// Fall through\n\t\t\tcase NodeKind.Record:\n\t\t\tcase NodeKind.Object: {\n\t\t\t\tlet storedKey: string | number = propertyKey;\n\t\t\t\tif (isObjectNodeSchema(schema)) {\n\t\t\t\t\tconst fieldSchema = schema.fields.get(String(propertyKey));\n\t\t\t\t\tif (fieldSchema === undefined) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\n\t\t\t\t\tstoredKey = fieldSchema.storedKey;\n\t\t\t\t}\n\n\t\t\t\tconst field = flexNode.tryGetField(brand(String(storedKey)));\n\t\t\t\tif (field !== undefined) {\n\t\t\t\t\treturn tryGetTreeNodeForField(field);\n\t\t\t\t}\n\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tcase NodeKind.Leaf: {\n\t\t\t\tfail(0xbc3 /* Leaf schema associated with non-leaf tree node. */);\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tunreachableCase(schema.kind);\n\t\t\t}\n\t\t}\n\t},\n\n\tchildren(node: TreeNode): [propertyKey: string | number, child: TreeNode | TreeLeafValue][] {\n\t\tconst flexNode = getInnerNode(node);\n\t\tdebugAssert(\n\t\t\t() => !flexNode.context.isDisposed() || \"The provided tree node has been disposed.\",\n\t\t);\n\n\t\tconst schema = treeNodeApi.schema(node);\n\n\t\tconst result: [string | number, TreeNode | TreeLeafValue][] = [];\n\t\tswitch (schema.kind) {\n\t\t\tcase NodeKind.Array: {\n\t\t\t\tconst sequence = flexNode.tryGetField(EmptyKey) as FlexTreeSequenceField | undefined;\n\t\t\t\tif (sequence === undefined) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tfor (let index = 0; index < sequence.length; index++) {\n\t\t\t\t\tconst childFlexTree = sequence.at(index);\n\t\t\t\t\tassert(childFlexTree !== undefined, 0xbc4 /* Sequence child was undefined. */);\n\t\t\t\t\tconst childTree = getOrCreateNodeFromInnerUnboxedNode(childFlexTree);\n\t\t\t\t\tresult.push([index, childTree]);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase NodeKind.Map:\n\t\t\tcase NodeKind.Record: {\n\t\t\t\tfor (const [key, flexField] of flexNode.fields) {\n\t\t\t\t\tconst childTreeNode = tryGetTreeNodeForField(flexField);\n\t\t\t\t\tif (childTreeNode !== undefined) {\n\t\t\t\t\t\tresult.push([key, childTreeNode]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase NodeKind.Object: {\n\t\t\t\tassert(isObjectNodeSchema(schema), 0xbc5 /* Expected object schema. */);\n\t\t\t\tfor (const [propertyKey, fieldSchema] of schema.fields) {\n\t\t\t\t\tconst storedKey = fieldSchema.storedKey;\n\t\t\t\t\tconst flexField = flexNode.tryGetField(brand(String(storedKey)));\n\t\t\t\t\tif (flexField !== undefined) {\n\t\t\t\t\t\tconst childTreeNode = tryGetTreeNodeForField(flexField);\n\t\t\t\t\t\tassert(\n\t\t\t\t\t\t\tchildTreeNode !== undefined,\n\t\t\t\t\t\t\t0xbc6 /* Expected child tree node for field. */,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tresult.push([propertyKey, childTreeNode]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase NodeKind.Leaf: {\n\t\t\t\tfail(0xbc7 /* Leaf schema associated with non-leaf tree node. */);\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tunreachableCase(schema.kind);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t},\n\n\ttagContentSchema<TSchema extends TreeNodeSchema, TNode extends InsertableField<TSchema>>(\n\t\tschema: TSchema,\n\t\tnode: TNode,\n\t): TNode {\n\t\tif (typeof node === \"object\" && node !== null && !isFluidHandle(node)) {\n\t\t\tReflect.defineProperty(node, contentSchemaSymbol, {\n\t\t\t\tconfigurable: false,\n\t\t\t\tenumerable: false,\n\t\t\t\twritable: true,\n\t\t\t\tvalue: schema.identifier,\n\t\t\t});\n\t\t}\n\t\treturn node;\n\t},\n};\n\n/**\n * Borrow a cursor from a field.\n * @remarks\n * The cursor must be put back to its original location before the node is used again.\n */\nfunction borrowFieldCursorFromTreeNodeOrValue(\n\tnode: TreeNode | TreeLeafValue | undefined,\n): ITreeCursorSynchronous {\n\tif (node === undefined) {\n\t\treturn cursorForMapTreeField([]);\n\t}\n\tconst cursor = borrowCursorFromTreeNodeOrValue(node);\n\t// TODO: avoid copy: borrow cursor from field instead.\n\tconst mapTree = mapTreeFromCursor(cursor);\n\treturn cursorForMapTreeField([mapTree]);\n}\n"]}
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
import type { Listenable } from "@fluidframework/core-interfaces/internal";
|
|
6
6
|
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
7
7
|
import { type ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
|
|
8
|
-
import { type Anchor, type AnchorLocator, type AnchorNode, type AnchorSetRootEvents, type ChangeFamily, type CommitMetadata, type DetachedFieldIndex, type IEditableForest, type IForestSubscription, type JsonableTree, type RevisionTag, type RevisionTagCodec, type TreeStoredSchema, TreeStoredSchemaRepository, type TreeStoredSchemaSubscription, type RevertibleAlphaFactory, type GraphCommit } from "../core/index.js";
|
|
8
|
+
import { type Anchor, type AnchorLocator, type AnchorNode, type AnchorSetRootEvents, type ChangeFamily, type CommitMetadata, type DetachedFieldIndex, type IEditableForest, type IForestSubscription, type JsonableTree, type RevisionTag, type RevisionTagCodec, type TreeStoredSchema, TreeStoredSchemaRepository, type TreeStoredSchemaSubscription, type RevertibleAlphaFactory, type GraphCommit, type ReadOnlyDetachedFieldIndex } from "../core/index.js";
|
|
9
9
|
import { type FieldBatchCodec, type TreeCompressionStrategy } from "../feature-libraries/index.js";
|
|
10
10
|
import { SharedTreeBranch, type SharedTreeBranchChange, type Transactor } from "../shared-tree-core/index.js";
|
|
11
11
|
import { Breakable, disposeSymbol, type WithBreakable } from "../util/index.js";
|
|
12
12
|
import type { SharedTreeChange } from "./sharedTreeChangeTypes.js";
|
|
13
|
-
import type
|
|
13
|
+
import { type IdBasedSharedTreeEditBuilder, type ILocationBasedSharedTreeEditor } from "./sharedTreeEditBuilder.js";
|
|
14
14
|
import type { IDisposable } from "@fluidframework/core-interfaces";
|
|
15
15
|
import { type ImplicitFieldSchema, type ReadSchema, type TreeView, type TreeViewConfiguration, type UnsafeUnknownSchema, type ViewableTree, type VerboseTree } from "../simple-tree/index.js";
|
|
16
16
|
import { SchematizingSimpleTreeView } from "./schematizingTreeView.js";
|
|
@@ -136,7 +136,7 @@ export interface ITreeCheckout extends AnchorLocator, ViewableTree, WithBreakabl
|
|
|
136
136
|
* Used to edit the state of the tree. Edits will be immediately applied locally to the tree.
|
|
137
137
|
* If there is no transaction currently ongoing, then the edits will be submitted to Fluid immediately as well.
|
|
138
138
|
*/
|
|
139
|
-
readonly editor:
|
|
139
|
+
readonly editor: ILocationBasedSharedTreeEditor;
|
|
140
140
|
/**
|
|
141
141
|
* A collection of functions for managing transactions.
|
|
142
142
|
*/
|
|
@@ -180,8 +180,8 @@ export interface ITreeCheckout extends AnchorLocator, ViewableTree, WithBreakabl
|
|
|
180
180
|
* and functionality required to implement {@link ITreeCheckout}.
|
|
181
181
|
*/
|
|
182
182
|
export declare function createTreeCheckout(idCompressor: IIdCompressor, mintRevisionTag: () => RevisionTag, revisionTagCodec: RevisionTagCodec, args?: {
|
|
183
|
-
branch?: SharedTreeBranch<
|
|
184
|
-
changeFamily?: ChangeFamily<
|
|
183
|
+
branch?: SharedTreeBranch<IdBasedSharedTreeEditBuilder, SharedTreeChange>;
|
|
184
|
+
changeFamily?: ChangeFamily<IdBasedSharedTreeEditBuilder, SharedTreeChange>;
|
|
185
185
|
schema?: TreeStoredSchemaRepository;
|
|
186
186
|
forest?: IEditableForest;
|
|
187
187
|
fieldBatchCodec?: FieldBatchCodec;
|
|
@@ -223,13 +223,14 @@ export declare class TreeCheckout implements ITreeCheckoutFork {
|
|
|
223
223
|
private readonly mintRevisionTag;
|
|
224
224
|
private readonly revisionTagCodec;
|
|
225
225
|
private readonly idCompressor;
|
|
226
|
-
|
|
226
|
+
private readonly _removedRoots;
|
|
227
227
|
/** Optional logger for telemetry. */
|
|
228
228
|
private readonly logger?;
|
|
229
229
|
readonly breaker: Breakable;
|
|
230
230
|
readonly disposeForksAfterTransaction: boolean;
|
|
231
231
|
disposed: boolean;
|
|
232
232
|
private editLock;
|
|
233
|
+
private readonly locator;
|
|
233
234
|
private readonly views;
|
|
234
235
|
/**
|
|
235
236
|
* Set of revertibles maintained for automatic disposal
|
|
@@ -247,11 +248,12 @@ export declare class TreeCheckout implements ITreeCheckoutFork {
|
|
|
247
248
|
*/
|
|
248
249
|
static readonly revertTelemetryEventName = "RevertRevertible";
|
|
249
250
|
events: Listenable<CheckoutEvents>;
|
|
250
|
-
constructor(branch: SharedTreeBranch<
|
|
251
|
+
constructor(branch: SharedTreeBranch<IdBasedSharedTreeEditBuilder, SharedTreeChange>,
|
|
251
252
|
/** True if and only if this checkout is for a branch which is persisted and shared with other clients. */
|
|
252
|
-
isSharedBranch: boolean, changeFamily: ChangeFamily<
|
|
253
|
+
isSharedBranch: boolean, changeFamily: ChangeFamily<IdBasedSharedTreeEditBuilder, SharedTreeChange>, storedSchema: TreeStoredSchemaRepository, forest: IEditableForest, mintRevisionTag: () => RevisionTag, revisionTagCodec: RevisionTagCodec, idCompressor: IIdCompressor, _removedRoots?: DetachedFieldIndex,
|
|
253
254
|
/** Optional logger for telemetry. */
|
|
254
255
|
logger?: ITelemetryLoggerExt | undefined, breaker?: Breakable, disposeForksAfterTransaction?: boolean);
|
|
256
|
+
get removedRoots(): ReadOnlyDetachedFieldIndex;
|
|
255
257
|
private registerForBranchEvents;
|
|
256
258
|
private unregisterFromBranchEvents;
|
|
257
259
|
private createTransactionStack;
|
|
@@ -276,11 +278,11 @@ export declare class TreeCheckout implements ITreeCheckoutFork {
|
|
|
276
278
|
viewWith<TRoot extends ImplicitFieldSchema | UnsafeUnknownSchema>(config: TreeViewConfiguration<ReadSchema<TRoot>>): SchematizingSimpleTreeView<TRoot>;
|
|
277
279
|
viewWith<TRoot extends ImplicitFieldSchema>(config: TreeViewConfiguration<TRoot>): TreeView<TRoot>;
|
|
278
280
|
get rootEvents(): Listenable<AnchorSetRootEvents>;
|
|
279
|
-
get editor():
|
|
281
|
+
get editor(): ILocationBasedSharedTreeEditor;
|
|
280
282
|
locate(anchor: Anchor): AnchorNode | undefined;
|
|
281
283
|
get transaction(): Transactor;
|
|
282
284
|
branch(): TreeCheckout;
|
|
283
|
-
switchBranch(branch: SharedTreeBranch<
|
|
285
|
+
switchBranch(branch: SharedTreeBranch<IdBasedSharedTreeEditBuilder, SharedTreeChange>): void;
|
|
284
286
|
rebase(checkout: TreeCheckout): void;
|
|
285
287
|
rebaseOnto(checkout: ITreeCheckout): void;
|
|
286
288
|
merge(checkout: TreeCheckout): void;
|