@fluidframework/tree 2.11.0 → 2.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +140 -0
- package/api-report/tree.alpha.api.md +88 -12
- package/api-report/tree.beta.api.md +23 -11
- package/api-report/tree.legacy.alpha.api.md +23 -11
- package/api-report/tree.legacy.public.api.md +23 -11
- package/api-report/tree.public.api.md +23 -11
- package/dist/alpha.d.ts +11 -0
- package/dist/beta.d.ts +2 -0
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +5 -3
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/utils.d.ts.map +1 -1
- package/dist/core/rebase/utils.js +2 -9
- package/dist/core/rebase/utils.js.map +1 -1
- package/dist/core/schema-stored/format.d.ts +0 -3
- package/dist/core/schema-stored/format.d.ts.map +1 -1
- package/dist/core/schema-stored/format.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +12 -10
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +3 -5
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/schema-view/index.d.ts +1 -1
- package/dist/core/schema-view/index.d.ts.map +1 -1
- package/dist/core/schema-view/index.js +1 -2
- package/dist/core/schema-view/index.js.map +1 -1
- package/dist/core/schema-view/view.d.ts +0 -7
- package/dist/core/schema-view/view.d.ts.map +1 -1
- package/dist/core/schema-view/view.js +1 -12
- package/dist/core/schema-view/view.js.map +1 -1
- package/dist/{feature-libraries/chunked-forest → core/tree}/chunk.d.ts +2 -1
- package/dist/core/tree/chunk.d.ts.map +1 -0
- package/dist/{feature-libraries/chunked-forest → core/tree}/chunk.js +2 -2
- package/dist/core/tree/chunk.js.map +1 -0
- package/dist/core/tree/index.d.ts +1 -0
- package/dist/core/tree/index.d.ts.map +1 -1
- package/dist/core/tree/index.js +5 -1
- package/dist/core/tree/index.js.map +1 -1
- package/dist/core/tree/treeTextFormat.d.ts +0 -5
- package/dist/core/tree/treeTextFormat.d.ts.map +1 -1
- package/dist/core/tree/treeTextFormat.js.map +1 -1
- package/dist/core/tree/types.d.ts +0 -5
- package/dist/core/tree/types.d.ts.map +1 -1
- package/dist/core/tree/types.js +0 -1
- package/dist/core/tree/types.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.d.ts +1 -2
- package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.js +14 -14
- package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +1 -2
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js +2 -3
- package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts +1 -2
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts +1 -2
- package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +1 -2
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/emptyChunk.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/emptyChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/emptyChunk.js +2 -3
- package/dist/feature-libraries/chunked-forest/emptyChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/index.js +5 -5
- package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/sequenceChunk.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/sequenceChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/sequenceChunk.js +2 -2
- package/dist/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts +1 -2
- package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.js +13 -13
- package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +10 -0
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js +3 -0
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultSchema.js +1 -0
- package/dist/feature-libraries/default-schema/defaultSchema.js.map +1 -1
- package/dist/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/schemaChecker.js +2 -1
- package/dist/feature-libraries/default-schema/schemaChecker.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +1 -2
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +6 -4
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts +8 -1
- package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
- package/dist/feature-libraries/indexing/anchorTreeIndex.js +31 -5
- package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +1 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.js +8 -2
- package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
- package/dist/feature-libraries/modular-schema/discrepancies.d.ts +84 -24
- package/dist/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/discrepancies.js +32 -33
- package/dist/feature-libraries/modular-schema/discrepancies.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +12 -5
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.js +2 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/index.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/index.js +5 -1
- package/dist/feature-libraries/modular-schema/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/isNeverTree.d.ts +0 -1
- package/dist/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/isNeverTree.js +0 -1
- package/dist/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +1 -0
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +89 -25
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +12 -0
- package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.js +24 -4
- package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +6 -6
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +7 -7
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +12 -12
- package/dist/feature-libraries/sequence-field/formatV1.d.ts +99 -99
- package/dist/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV2.d.ts +76 -76
- package/dist/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV3.d.ts +54 -54
- package/dist/feature-libraries/sequence-field/types.d.ts +0 -1
- 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 +2 -2
- package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/utils.js +14 -5
- package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
- package/dist/index.d.ts +4 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -14
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +2 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/public.d.ts +2 -0
- package/dist/shared-tree/index.d.ts +3 -2
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js +2 -1
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/schematizeTree.d.ts +1 -1
- package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
- package/dist/shared-tree/schematizeTree.js +6 -6
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +10 -1
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +51 -12
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +31 -10
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +106 -15
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/transactionTypes.d.ts +105 -0
- package/dist/shared-tree/transactionTypes.d.ts.map +1 -0
- package/dist/shared-tree/transactionTypes.js +13 -0
- package/dist/shared-tree/transactionTypes.js.map +1 -0
- package/dist/shared-tree/treeApi.d.ts +1 -25
- package/dist/shared-tree/treeApi.d.ts.map +1 -1
- package/dist/shared-tree/treeApi.js +4 -8
- package/dist/shared-tree/treeApi.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +39 -13
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +275 -128
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts +13 -35
- package/dist/shared-tree-core/branch.d.ts.map +1 -1
- package/dist/shared-tree-core/branch.js +12 -77
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/shared-tree-core/branchCommitEnricher.d.ts +7 -1
- package/dist/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
- package/dist/shared-tree-core/branchCommitEnricher.js +16 -18
- package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
- package/dist/shared-tree-core/editManager.d.ts.map +1 -1
- package/dist/shared-tree-core/editManager.js +2 -2
- package/dist/shared-tree-core/editManager.js.map +1 -1
- package/dist/shared-tree-core/index.d.ts +3 -3
- package/dist/shared-tree-core/index.d.ts.map +1 -1
- package/dist/shared-tree-core/index.js +2 -2
- package/dist/shared-tree-core/index.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts +2 -9
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +4 -16
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/shared-tree-core/transaction.d.ts +38 -0
- package/dist/shared-tree-core/transaction.d.ts.map +1 -1
- package/dist/shared-tree-core/transaction.js +118 -6
- package/dist/shared-tree-core/transaction.js.map +1 -1
- package/dist/simple-tree/api/conciseTree.d.ts.map +1 -1
- package/dist/simple-tree/api/conciseTree.js +1 -1
- package/dist/simple-tree/api/conciseTree.js.map +1 -1
- package/dist/simple-tree/api/create.d.ts.map +1 -1
- package/dist/simple-tree/api/create.js +5 -1
- package/dist/simple-tree/api/create.js.map +1 -1
- package/dist/simple-tree/api/customTree.d.ts +14 -2
- package/dist/simple-tree/api/customTree.d.ts.map +1 -1
- package/dist/simple-tree/api/customTree.js +53 -3
- package/dist/simple-tree/api/customTree.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +3 -2
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +6 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/jsonSchema.d.ts +6 -0
- package/dist/simple-tree/api/jsonSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/jsonSchema.js.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts +65 -8
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +10 -4
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +83 -0
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -0
- package/dist/simple-tree/api/schemaFactoryAlpha.js +90 -0
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -0
- package/dist/simple-tree/api/simpleSchema.d.ts +8 -2
- package/dist/simple-tree/api/simpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/simpleSchema.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +13 -10
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/dist/simple-tree/api/simpleTreeIndex.js +3 -1
- package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
- package/dist/simple-tree/api/storedSchema.d.ts +4 -4
- package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/storedSchema.js +8 -21
- package/dist/simple-tree/api/storedSchema.js.map +1 -1
- package/dist/simple-tree/api/testRecursiveDomain.d.ts +5 -5
- package/dist/simple-tree/api/tree.d.ts +61 -0
- package/dist/simple-tree/api/tree.d.ts.map +1 -1
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/verboseTree.js +1 -1
- package/dist/simple-tree/api/verboseTree.js.map +1 -1
- package/dist/simple-tree/api/view.d.ts +14 -9
- package/dist/simple-tree/api/view.d.ts.map +1 -1
- package/dist/simple-tree/api/view.js +129 -40
- package/dist/simple-tree/api/view.js.map +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +11 -11
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
- package/dist/simple-tree/arrayNode.d.ts +2 -2
- package/dist/simple-tree/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/arrayNode.js +2 -1
- package/dist/simple-tree/arrayNode.js.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts +10 -6
- package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/dist/simple-tree/index.d.ts +3 -3
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +6 -2
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts +5 -20
- package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js +0 -15
- package/dist/simple-tree/leafNodeSchema.js.map +1 -1
- package/dist/simple-tree/mapNode.d.ts +2 -2
- package/dist/simple-tree/mapNode.d.ts.map +1 -1
- package/dist/simple-tree/mapNode.js +2 -1
- package/dist/simple-tree/mapNode.js.map +1 -1
- package/dist/simple-tree/objectNode.d.ts +9 -4
- package/dist/simple-tree/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/objectNode.js +19 -2
- package/dist/simple-tree/objectNode.js.map +1 -1
- package/dist/simple-tree/objectNodeTypes.d.ts +6 -2
- package/dist/simple-tree/objectNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/objectNodeTypes.js.map +1 -1
- package/dist/simple-tree/schemaTypes.d.ts +51 -3
- package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
- package/dist/simple-tree/schemaTypes.js.map +1 -1
- package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +18 -13
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/util/brand.d.ts +0 -2
- package/dist/util/brand.d.ts.map +1 -1
- package/dist/util/brand.js +0 -1
- package/dist/util/brand.js.map +1 -1
- package/dist/util/index.d.ts +2 -2
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +4 -5
- package/dist/util/index.js.map +1 -1
- package/dist/util/rangeMap.d.ts +72 -42
- package/dist/util/rangeMap.d.ts.map +1 -1
- package/dist/util/rangeMap.js +161 -151
- package/dist/util/rangeMap.js.map +1 -1
- package/dist/util/typeCheck.d.ts +0 -2
- package/dist/util/typeCheck.d.ts.map +1 -1
- package/dist/util/typeCheck.js.map +1 -1
- package/dist/util/utils.d.ts +35 -1
- package/dist/util/utils.d.ts.map +1 -1
- package/dist/util/utils.js +32 -1
- package/dist/util/utils.js.map +1 -1
- package/lib/alpha.d.ts +11 -0
- package/lib/beta.d.ts +2 -0
- package/lib/core/index.d.ts +2 -2
- 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/utils.d.ts.map +1 -1
- package/lib/core/rebase/utils.js +3 -10
- package/lib/core/rebase/utils.js.map +1 -1
- package/lib/core/schema-stored/format.d.ts +0 -3
- package/lib/core/schema-stored/format.d.ts.map +1 -1
- package/lib/core/schema-stored/format.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +12 -10
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +3 -5
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/schema-view/index.d.ts +1 -1
- package/lib/core/schema-view/index.d.ts.map +1 -1
- package/lib/core/schema-view/index.js +1 -1
- package/lib/core/schema-view/index.js.map +1 -1
- package/lib/core/schema-view/view.d.ts +0 -7
- package/lib/core/schema-view/view.d.ts.map +1 -1
- package/lib/core/schema-view/view.js +0 -11
- package/lib/core/schema-view/view.js.map +1 -1
- package/lib/{feature-libraries/chunked-forest → core/tree}/chunk.d.ts +2 -1
- package/lib/core/tree/chunk.d.ts.map +1 -0
- package/lib/{feature-libraries/chunked-forest → core/tree}/chunk.js +1 -1
- package/lib/core/tree/chunk.js.map +1 -0
- package/lib/core/tree/index.d.ts +1 -0
- package/lib/core/tree/index.d.ts.map +1 -1
- package/lib/core/tree/index.js +1 -0
- package/lib/core/tree/index.js.map +1 -1
- package/lib/core/tree/treeTextFormat.d.ts +0 -5
- package/lib/core/tree/treeTextFormat.d.ts.map +1 -1
- package/lib/core/tree/treeTextFormat.js.map +1 -1
- package/lib/core/tree/types.d.ts +0 -5
- package/lib/core/tree/types.d.ts.map +1 -1
- package/lib/core/tree/types.js +0 -1
- package/lib/core/tree/types.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.d.ts +1 -2
- package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.js +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +1 -2
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js +1 -2
- package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts +1 -2
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts +1 -2
- package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +1 -2
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/emptyChunk.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/emptyChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/emptyChunk.js +1 -2
- package/lib/feature-libraries/chunked-forest/emptyChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/index.js +1 -1
- package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/sequenceChunk.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/sequenceChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/sequenceChunk.js +1 -1
- package/lib/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts +1 -2
- package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +10 -0
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js +3 -0
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultSchema.js +1 -0
- package/lib/feature-libraries/default-schema/defaultSchema.js.map +1 -1
- package/lib/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/schemaChecker.js +2 -1
- package/lib/feature-libraries/default-schema/schemaChecker.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +1 -2
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +1 -2
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts +8 -1
- package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
- package/lib/feature-libraries/indexing/anchorTreeIndex.js +31 -5
- package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
- package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +1 -1
- package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/crossFieldQueries.js +9 -3
- package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
- package/lib/feature-libraries/modular-schema/discrepancies.d.ts +84 -24
- package/lib/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/discrepancies.js +25 -28
- package/lib/feature-libraries/modular-schema/discrepancies.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +12 -5
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.js +2 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/index.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/index.js +1 -1
- package/lib/feature-libraries/modular-schema/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/isNeverTree.d.ts +0 -1
- package/lib/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/isNeverTree.js +0 -1
- package/lib/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +1 -0
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +89 -25
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +12 -0
- package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalField.js +24 -4
- package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +6 -6
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +7 -7
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +12 -12
- package/lib/feature-libraries/sequence-field/formatV1.d.ts +99 -99
- package/lib/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV2.d.ts +76 -76
- package/lib/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV3.d.ts +54 -54
- package/lib/feature-libraries/sequence-field/types.d.ts +0 -1
- 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 +2 -2
- package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/utils.js +14 -5
- package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
- package/lib/index.d.ts +4 -5
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -4
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +2 -0
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/public.d.ts +2 -0
- package/lib/shared-tree/index.d.ts +3 -2
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js +2 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/schematizeTree.d.ts +1 -1
- package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
- package/lib/shared-tree/schematizeTree.js +7 -7
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +10 -1
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +56 -17
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +31 -10
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +107 -16
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/transactionTypes.d.ts +105 -0
- package/lib/shared-tree/transactionTypes.d.ts.map +1 -0
- package/lib/shared-tree/transactionTypes.js +10 -0
- package/lib/shared-tree/transactionTypes.js.map +1 -0
- package/lib/shared-tree/treeApi.d.ts +1 -25
- package/lib/shared-tree/treeApi.d.ts.map +1 -1
- package/lib/shared-tree/treeApi.js +1 -5
- package/lib/shared-tree/treeApi.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +39 -13
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +277 -130
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts +13 -35
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +12 -76
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/shared-tree-core/branchCommitEnricher.d.ts +7 -1
- package/lib/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
- package/lib/shared-tree-core/branchCommitEnricher.js +16 -18
- package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
- package/lib/shared-tree-core/editManager.d.ts.map +1 -1
- package/lib/shared-tree-core/editManager.js +3 -3
- package/lib/shared-tree-core/editManager.js.map +1 -1
- package/lib/shared-tree-core/index.d.ts +3 -3
- package/lib/shared-tree-core/index.d.ts.map +1 -1
- package/lib/shared-tree-core/index.js +2 -2
- package/lib/shared-tree-core/index.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts +2 -9
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +4 -16
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/shared-tree-core/transaction.d.ts +38 -0
- package/lib/shared-tree-core/transaction.d.ts.map +1 -1
- package/lib/shared-tree-core/transaction.js +112 -1
- package/lib/shared-tree-core/transaction.js.map +1 -1
- package/lib/simple-tree/api/conciseTree.d.ts.map +1 -1
- package/lib/simple-tree/api/conciseTree.js +2 -2
- package/lib/simple-tree/api/conciseTree.js.map +1 -1
- package/lib/simple-tree/api/create.d.ts.map +1 -1
- package/lib/simple-tree/api/create.js +5 -1
- package/lib/simple-tree/api/create.js.map +1 -1
- package/lib/simple-tree/api/customTree.d.ts +14 -2
- package/lib/simple-tree/api/customTree.d.ts.map +1 -1
- package/lib/simple-tree/api/customTree.js +50 -2
- package/lib/simple-tree/api/customTree.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +3 -2
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +3 -1
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/jsonSchema.d.ts +6 -0
- package/lib/simple-tree/api/jsonSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/jsonSchema.js.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts +65 -8
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +9 -3
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +83 -0
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -0
- package/lib/simple-tree/api/schemaFactoryAlpha.js +86 -0
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -0
- package/lib/simple-tree/api/simpleSchema.d.ts +8 -2
- package/lib/simple-tree/api/simpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/simpleSchema.js.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js +14 -11
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/lib/simple-tree/api/simpleTreeIndex.js +3 -1
- package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
- package/lib/simple-tree/api/storedSchema.d.ts +4 -4
- package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/storedSchema.js +5 -18
- package/lib/simple-tree/api/storedSchema.js.map +1 -1
- package/lib/simple-tree/api/testRecursiveDomain.d.ts +5 -5
- package/lib/simple-tree/api/tree.d.ts +61 -0
- package/lib/simple-tree/api/tree.d.ts.map +1 -1
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/verboseTree.js +2 -2
- package/lib/simple-tree/api/verboseTree.js.map +1 -1
- package/lib/simple-tree/api/view.d.ts +14 -9
- package/lib/simple-tree/api/view.d.ts.map +1 -1
- package/lib/simple-tree/api/view.js +131 -42
- package/lib/simple-tree/api/view.js.map +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +12 -12
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
- package/lib/simple-tree/arrayNode.d.ts +2 -2
- package/lib/simple-tree/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/arrayNode.js +2 -1
- package/lib/simple-tree/arrayNode.js.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts +10 -6
- package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/lib/simple-tree/index.d.ts +3 -3
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +2 -2
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.d.ts +5 -20
- package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js +0 -15
- package/lib/simple-tree/leafNodeSchema.js.map +1 -1
- package/lib/simple-tree/mapNode.d.ts +2 -2
- package/lib/simple-tree/mapNode.d.ts.map +1 -1
- package/lib/simple-tree/mapNode.js +2 -1
- package/lib/simple-tree/mapNode.js.map +1 -1
- package/lib/simple-tree/objectNode.d.ts +9 -4
- package/lib/simple-tree/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/objectNode.js +17 -1
- package/lib/simple-tree/objectNode.js.map +1 -1
- package/lib/simple-tree/objectNodeTypes.d.ts +6 -2
- package/lib/simple-tree/objectNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/objectNodeTypes.js.map +1 -1
- package/lib/simple-tree/schemaTypes.d.ts +51 -3
- package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
- package/lib/simple-tree/schemaTypes.js.map +1 -1
- package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +19 -14
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/util/brand.d.ts +0 -2
- package/lib/util/brand.d.ts.map +1 -1
- package/lib/util/brand.js +0 -1
- package/lib/util/brand.js.map +1 -1
- package/lib/util/index.d.ts +2 -2
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +2 -2
- package/lib/util/index.js.map +1 -1
- package/lib/util/rangeMap.d.ts +72 -42
- package/lib/util/rangeMap.d.ts.map +1 -1
- package/lib/util/rangeMap.js +159 -146
- package/lib/util/rangeMap.js.map +1 -1
- package/lib/util/typeCheck.d.ts +0 -2
- package/lib/util/typeCheck.d.ts.map +1 -1
- package/lib/util/typeCheck.js.map +1 -1
- package/lib/util/utils.d.ts +35 -1
- package/lib/util/utils.d.ts.map +1 -1
- package/lib/util/utils.js +29 -0
- package/lib/util/utils.js.map +1 -1
- package/package.json +23 -23
- package/src/core/index.ts +5 -1
- package/src/core/rebase/utils.ts +17 -20
- package/src/core/schema-stored/format.ts +0 -3
- package/src/core/schema-stored/schema.ts +13 -10
- package/src/core/schema-view/index.ts +0 -1
- package/src/core/schema-view/view.ts +0 -11
- package/src/{feature-libraries/chunked-forest → core/tree}/chunk.ts +4 -4
- package/src/core/tree/index.ts +8 -0
- package/src/core/tree/treeTextFormat.ts +0 -5
- package/src/core/tree/types.ts +0 -5
- package/src/feature-libraries/chunked-forest/basicChunk.ts +4 -2
- package/src/feature-libraries/chunked-forest/chunkTree.ts +2 -1
- package/src/feature-libraries/chunked-forest/chunkedForest.ts +2 -1
- package/src/feature-libraries/chunked-forest/codec/chunkCodecUtilities.ts +1 -2
- package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +6 -2
- package/src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts +1 -1
- package/src/feature-libraries/chunked-forest/emptyChunk.ts +4 -2
- package/src/feature-libraries/chunked-forest/index.ts +1 -1
- package/src/feature-libraries/chunked-forest/sequenceChunk.ts +1 -1
- package/src/feature-libraries/chunked-forest/uniformChunk.ts +4 -1
- package/src/feature-libraries/default-schema/defaultEditBuilder.ts +14 -1
- package/src/feature-libraries/default-schema/defaultSchema.ts +1 -0
- package/src/feature-libraries/default-schema/schemaChecker.ts +4 -1
- package/src/feature-libraries/index.ts +13 -1
- package/src/feature-libraries/indexing/anchorTreeIndex.ts +34 -5
- package/src/feature-libraries/modular-schema/crossFieldQueries.ts +9 -9
- package/src/feature-libraries/modular-schema/discrepancies.ts +76 -38
- package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +13 -9
- package/src/feature-libraries/modular-schema/genericFieldKind.ts +4 -2
- package/src/feature-libraries/modular-schema/index.ts +14 -0
- package/src/feature-libraries/modular-schema/isNeverTree.ts +0 -2
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +124 -31
- package/src/feature-libraries/modular-schema/modularChangeTypes.ts +12 -0
- package/src/feature-libraries/optional-field/optionalField.ts +34 -5
- package/src/feature-libraries/sequence-field/types.ts +0 -1
- package/src/feature-libraries/sequence-field/utils.ts +18 -7
- package/src/index.ts +12 -29
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/index.ts +13 -2
- package/src/shared-tree/schematizeTree.ts +6 -10
- package/src/shared-tree/schematizingTreeView.ts +102 -23
- package/src/shared-tree/sharedTree.ts +181 -44
- package/src/shared-tree/transactionTypes.ts +125 -0
- package/src/shared-tree/treeApi.ts +1 -28
- package/src/shared-tree/treeCheckout.ts +358 -175
- package/src/shared-tree-core/branch.ts +29 -122
- package/src/shared-tree-core/branchCommitEnricher.ts +19 -20
- package/src/shared-tree-core/editManager.ts +3 -8
- package/src/shared-tree-core/index.ts +2 -1
- package/src/shared-tree-core/sharedTreeCore.ts +8 -19
- package/src/shared-tree-core/transaction.ts +145 -0
- package/src/simple-tree/api/conciseTree.ts +2 -2
- package/src/simple-tree/api/create.ts +5 -1
- package/src/simple-tree/api/customTree.ts +69 -1
- package/src/simple-tree/api/index.ts +13 -2
- package/src/simple-tree/api/jsonSchema.ts +7 -0
- package/src/simple-tree/api/schemaFactory.ts +91 -3
- package/src/simple-tree/api/schemaFactoryAlpha.ts +253 -0
- package/src/simple-tree/api/simpleSchema.ts +9 -2
- package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +22 -12
- package/src/simple-tree/api/simpleTreeIndex.ts +2 -0
- package/src/simple-tree/api/storedSchema.ts +7 -22
- package/src/simple-tree/api/tree.ts +78 -0
- package/src/simple-tree/api/verboseTree.ts +2 -2
- package/src/simple-tree/api/view.ts +197 -51
- package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +19 -13
- package/src/simple-tree/arrayNode.ts +7 -1
- package/src/simple-tree/core/treeNodeSchema.ts +51 -7
- package/src/simple-tree/index.ts +9 -0
- package/src/simple-tree/leafNodeSchema.ts +0 -19
- package/src/simple-tree/mapNode.ts +7 -1
- package/src/simple-tree/objectNode.ts +33 -3
- package/src/simple-tree/objectNodeTypes.ts +9 -1
- package/src/simple-tree/schemaTypes.ts +57 -3
- package/src/simple-tree/toStoredSchema.ts +25 -19
- package/src/util/brand.ts +0 -2
- package/src/util/index.ts +3 -6
- package/src/util/rangeMap.ts +199 -189
- package/src/util/typeCheck.ts +0 -2
- package/src/util/utils.ts +73 -1
- package/dist/feature-libraries/chunked-forest/chunk.d.ts.map +0 -1
- package/dist/feature-libraries/chunked-forest/chunk.js.map +0 -1
- package/dist/feature-libraries/memoizedIdRangeAllocator.d.ts +0 -38
- package/dist/feature-libraries/memoizedIdRangeAllocator.d.ts.map +0 -1
- package/dist/feature-libraries/memoizedIdRangeAllocator.js +0 -74
- package/dist/feature-libraries/memoizedIdRangeAllocator.js.map +0 -1
- package/lib/feature-libraries/chunked-forest/chunk.d.ts.map +0 -1
- package/lib/feature-libraries/chunked-forest/chunk.js.map +0 -1
- package/lib/feature-libraries/memoizedIdRangeAllocator.d.ts +0 -38
- package/lib/feature-libraries/memoizedIdRangeAllocator.d.ts.map +0 -1
- package/lib/feature-libraries/memoizedIdRangeAllocator.js +0 -71
- package/lib/feature-libraries/memoizedIdRangeAllocator.js.map +0 -1
- package/src/feature-libraries/memoizedIdRangeAllocator.ts +0 -112
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"memoizedIdRangeAllocator.js","sourceRoot":"","sources":["../../src/feature-libraries/memoizedIdRangeAllocator.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,+CAO0B;AAmC1B;GACG;AACU,QAAA,wBAAwB,GAAG;IACvC,UAAU,CAAC,SAAiB,CAAC;QAC5B,MAAM,QAAQ,GAAmD,IAAI,GAAG,EAAE,CAAC;QAC3E,IAAI,OAAO,GAAG,MAAM,CAAC;QACrB,OAAO;YACN,QAAQ,CAAC,GAAgC,EAAE,OAAe,EAAE,MAAe;gBAC1E,IAAI,KAAK,GAAG,MAAM,IAAI,CAAC,CAAC;gBACxB,MAAM,GAAG,GAAc,EAAE,CAAC;gBAC1B,MAAM,MAAM,GAAG,IAAA,6BAAkB,EAAC,QAAQ,EAAE,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;4BAC9C,OAAO,CAAC,KAAK,GAAG,IAAA,gBAAK,EAAE,OAAO,CAAC,KAAgB,GAAG,WAAW,CAAC,CAAC;4BAC/D,OAAO,CAAC,KAAK,IAAI,WAAW,CAAC;wBAC9B,CAAC;wBACD,IAAI,OAAO,CAAC,KAAK,GAAG,KAAK,EAAE,CAAC;4BAC3B,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;wBACvB,CAAC;6BAAM,IACN,OAAO,CAAC,KAAK,GAAG,KAAK;4BACrB,UAAU,CAAC,KAAK,GAAG,UAAU,CAAC,MAAM,KAAK,OAAO,EAC/C,CAAC;4BACF,qCAAqC;4BACrC,OAAO,IAAI,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;4BACjC,UAAU,CAAC,MAAM,GAAG,KAAK,CAAC;4BAC1B,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;wBACvB,CAAC;wBACD,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;wBAClB,KAAK,IAAI,OAAO,CAAC,KAAK,CAAC;wBACvB,MAAM,IAAI,OAAO,CAAC,KAAK,CAAC;oBACzB,CAAC;gBACF,CAAC;gBACD,OAAO,GAAG,CAAC;YACZ,CAAC;YACD,IAAI,CAAC,MAAe;gBACnB,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,CAAC;gBAC1B,MAAM,GAAG,GAAG,OAAO,CAAC;gBACpB,OAAO,IAAI,KAAK,CAAC;gBACjB,OAAO,IAAA,gBAAK,EAAC,GAAG,CAAC,CAAC;YACnB,CAAC;SACD,CAAC;IACH,CAAC;CACD,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ChangesetLocalId, RevisionTag } from \"../core/index.js\";\nimport {\n\ttype Mutable,\n\ttype RangeMap,\n\tbrand,\n\tgetFirstEntryFromRangeMap,\n\tgetOrAddEmptyToMap,\n\tsetInRangeMap,\n} from \"../util/index.js\";\n\n/**\n * A unique ID allocator that returns the output ID for the same input ID.\n */\nexport interface MemoizedIdRangeAllocator {\n\t/**\n\t * A unique ID allocator that returns the output ID for the same input ID.\n\t *\n\t * \"The same\" here includes cases where a prior call allocated a range of IDs that partially or fully overlap with the\n\t * current call.\n\t * @param revision - The revision associated with the range of IDs to allocate.\n\t * @param startId - The first ID to allocate.\n\t * @param count - The number of IDs to allocate. Interpreted as 1 if undefined.\n\t */\n\tallocate(\n\t\trevision: RevisionTag | undefined,\n\t\tstartId: ChangesetLocalId,\n\t\tcount?: number,\n\t): IdRange[];\n\t/**\n\t * Allocates a new range of IDs.\n\t *\n\t * @param count - The number of IDs to allocate. Interpreted as 1 if undefined.\n\t */\n\tmint(count?: number): ChangesetLocalId;\n}\n\n/**\n */\nexport interface IdRange {\n\treadonly first: ChangesetLocalId;\n\treadonly count: number;\n}\n\n/**\n */\nexport const MemoizedIdRangeAllocator = {\n\tfromNextId(nextId: number = 0): MemoizedIdRangeAllocator {\n\t\tconst rangeMap: Map<RevisionTag | undefined, RangeMap<number>> = new Map();\n\t\tlet _nextId = nextId;\n\t\treturn {\n\t\t\tallocate(key: string | number | undefined, startId: number, length?: number): IdRange[] {\n\t\t\t\tlet count = length ?? 1;\n\t\t\t\tconst out: IdRange[] = [];\n\t\t\t\tconst ranges = getOrAddEmptyToMap(rangeMap, key);\n\t\t\t\tlet currId = startId;\n\t\t\t\twhile (count > 0) {\n\t\t\t\t\tconst firstRange = getFirstEntryFromRangeMap(ranges, currId, count);\n\t\t\t\t\tif (firstRange === undefined) {\n\t\t\t\t\t\tconst newId = _nextId;\n\t\t\t\t\t\t_nextId += count;\n\t\t\t\t\t\tsetInRangeMap(ranges, currId, count, newId);\n\t\t\t\t\t\tout.push({ first: brand(newId), count });\n\t\t\t\t\t\tcount = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst idRange: Mutable<IdRange> = {\n\t\t\t\t\t\t\tfirst: brand(firstRange.value),\n\t\t\t\t\t\t\tcount: firstRange.length,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (currId < firstRange.start) {\n\t\t\t\t\t\t\tconst countToAdd = firstRange.start - currId;\n\t\t\t\t\t\t\tsetInRangeMap(ranges, currId, countToAdd, _nextId);\n\t\t\t\t\t\t\tout.push({ first: brand(_nextId), count: countToAdd });\n\t\t\t\t\t\t\t_nextId += countToAdd;\n\t\t\t\t\t\t\tcurrId += countToAdd;\n\t\t\t\t\t\t\tcount -= countToAdd;\n\t\t\t\t\t\t} else if (firstRange.start < currId) {\n\t\t\t\t\t\t\tconst countToTrim = currId - firstRange.start;\n\t\t\t\t\t\t\tidRange.first = brand((idRange.first as number) + countToTrim);\n\t\t\t\t\t\t\tidRange.count -= countToTrim;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (idRange.count > count) {\n\t\t\t\t\t\t\tidRange.count = count;\n\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\tidRange.count < count &&\n\t\t\t\t\t\t\tfirstRange.value + firstRange.length === _nextId\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// The existing range can be extended\n\t\t\t\t\t\t\t_nextId += count - idRange.count;\n\t\t\t\t\t\t\tfirstRange.length = count;\n\t\t\t\t\t\t\tidRange.count = count;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tout.push(idRange);\n\t\t\t\t\t\tcount -= idRange.count;\n\t\t\t\t\t\tcurrId += idRange.count;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn out;\n\t\t\t},\n\t\t\tmint(length?: number): ChangesetLocalId {\n\t\t\t\tconst count = length ?? 1;\n\t\t\t\tconst out = _nextId;\n\t\t\t\t_nextId += count;\n\t\t\t\treturn brand(out);\n\t\t\t},\n\t\t};\n\t},\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chunk.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/chunked-forest/chunk.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAEN,KA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AAW,CAAC,MAAmB;IAC9C,MAAM,CACL,MAAM,CAAC,IAAI,qCAA6B,EACxC,KAAK,CAAC,+CAA+C,CACrD,CAAC;IACF,OAAQ,MAAoB,CAAC,WAAW,CAAC,CAAC;AAC3C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tCursorLocationType,\n\ttype FieldKey,\n\ttype ITreeCursor,\n\ttype ITreeCursorSynchronous,\n\trootFieldKey,\n} from \"../../core/index.js\";\nimport type { ReferenceCounted } from \"../../util/index.js\";\n\n/**\n * Contiguous part of the tree which get stored together in some data format.\n * Copy-on-write, but optimized to be mutated in place when a chunk only has a single user (detected using reference counting).\n * This allows for efficient cloning without major performance overheads for non-cloning scenarios.\n */\nexport interface TreeChunk extends ReferenceCounted {\n\t/**\n\t * The number of nodes at the top level of this chunk.\n\t *\n\t * If this chunk is included in a field, this is the amount this chunk contributes to the length of the field.\n\t */\n\treadonly topLevelLength: number;\n\n\t/**\n\t * Creates a cursor for navigating the content of this chunk.\n\t *\n\t * Starts in \"fields\" mode in a `dummyRoot` field containing the top level nodes.\n\t *\n\t * This cursor does not own a reference to the data:\n\t * it is up to the caller of this function to ensure the cursor is not used after they release their owning ref to this chunk.\n\t *\n\t * TODO: consider starting this in \"fields\" mode above the top level\n\t * which would compose better with utilities for processing sequences of nodes.\n\t */\n\tcursor(): ChunkedCursor;\n}\n\n/**\n * The key used for the field that contains the root of chunks when not parented anywhere.\n *\n * For now this is using the document root key to ease testing/compatibility, but this may change.\n */\nexport const dummyRoot: FieldKey = rootFieldKey;\n\n/**\n * A symbol for extracting a TreeChunk from {@link ITreeCursor}.\n */\nexport const cursorChunk: unique symbol = Symbol(\"cursorChunk\");\n\n/**\n * Cursors can optionally implement this interface, allowing querying them for the chunk they are traversing.\n */\ninterface WithChunk {\n\t/**\n\t * When in nodes mode, if a value is returned, it is a TreeChunk who's top level nodes are the\n\t * chunkLength nodes starting from chunkStart.\n\t *\n\t *\n\t * @remarks\n\t * Note that there may be other tree representations with different chunk APIs and thus different ways to query them.\n\t * The chunkStart and chunkLength values thus to not uniquely apply to the chunks accessed through this field.\n\t *\n\t * TODO:\n\t * This API (including the chunk start and end on ITreeCUrsor) have some issues:\n\t * 1. There are cases where multiple possible chunks could be considered.\n\t * For example, when in a SequenceChunk, it could be returned, or the chunk within it could be.\n\t * 2. When in a location other than the root of a chunk,\n\t * it can't provide information about the containing chunk other than by allocating a new chunk that just represents that field.\n\t *\n\t * As more optimizations get implemented, this API may need to change to better address these issues.\n\t */\n\treadonly [cursorChunk]?: TreeChunk | undefined;\n}\n\n/**\n * See {@link WithChunk}.\n */\nexport function tryGetChunk(cursor: ITreeCursor): undefined | TreeChunk {\n\tassert(\n\t\tcursor.mode === CursorLocationType.Nodes,\n\t\t0x57b /* cursorChunk only accessible in nodes mode */,\n\t);\n\treturn (cursor as WithChunk)[cursorChunk];\n}\n\n/**\n * Cursor for a chunk which can be wrapped by another cursor.\n *\n * @remarks See `BasicChunkCursor` which uses this.\n */\nexport interface ChunkedCursor extends ITreeCursorSynchronous, WithChunk {\n\t/**\n\t * Checks if the cursor is in the top level nodes of the chunk.\n\t *\n\t * @returns true iff cursor is within the root field, including at a node within that field.\n\t */\n\tatChunkRoot(): boolean;\n\n\t/**\n\t * Clones the cursor to produce a new independent cursor.\n\t * Does not add any counted references to any chunks.\n\t */\n\tfork(): ChunkedCursor;\n}\n"]}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import type { ChangesetLocalId, RevisionTag } from "../core/index.js";
|
|
6
|
-
/**
|
|
7
|
-
* A unique ID allocator that returns the output ID for the same input ID.
|
|
8
|
-
*/
|
|
9
|
-
export interface MemoizedIdRangeAllocator {
|
|
10
|
-
/**
|
|
11
|
-
* A unique ID allocator that returns the output ID for the same input ID.
|
|
12
|
-
*
|
|
13
|
-
* "The same" here includes cases where a prior call allocated a range of IDs that partially or fully overlap with the
|
|
14
|
-
* current call.
|
|
15
|
-
* @param revision - The revision associated with the range of IDs to allocate.
|
|
16
|
-
* @param startId - The first ID to allocate.
|
|
17
|
-
* @param count - The number of IDs to allocate. Interpreted as 1 if undefined.
|
|
18
|
-
*/
|
|
19
|
-
allocate(revision: RevisionTag | undefined, startId: ChangesetLocalId, count?: number): IdRange[];
|
|
20
|
-
/**
|
|
21
|
-
* Allocates a new range of IDs.
|
|
22
|
-
*
|
|
23
|
-
* @param count - The number of IDs to allocate. Interpreted as 1 if undefined.
|
|
24
|
-
*/
|
|
25
|
-
mint(count?: number): ChangesetLocalId;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
*/
|
|
29
|
-
export interface IdRange {
|
|
30
|
-
readonly first: ChangesetLocalId;
|
|
31
|
-
readonly count: number;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
*/
|
|
35
|
-
export declare const MemoizedIdRangeAllocator: {
|
|
36
|
-
fromNextId(nextId?: number): MemoizedIdRangeAllocator;
|
|
37
|
-
};
|
|
38
|
-
//# sourceMappingURL=memoizedIdRangeAllocator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"memoizedIdRangeAllocator.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/memoizedIdRangeAllocator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAUtE;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC;;;;;;;;OAQG;IACH,QAAQ,CACP,QAAQ,EAAE,WAAW,GAAG,SAAS,EACjC,OAAO,EAAE,gBAAgB,EACzB,KAAK,CAAC,EAAE,MAAM,GACZ,OAAO,EAAE,CAAC;IACb;;;;OAIG;IACH,IAAI,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAAC;CACvC;AAED;GACG;AACH,MAAM,WAAW,OAAO;IACvB,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC;IACjC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACvB;AAED;GACG;AACH,eAAO,MAAM,wBAAwB;wBACjB,MAAM,GAAO,wBAAwB;CA4DxD,CAAC"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { brand, getFirstEntryFromRangeMap, getOrAddEmptyToMap, setInRangeMap, } from "../util/index.js";
|
|
6
|
-
/**
|
|
7
|
-
*/
|
|
8
|
-
export const MemoizedIdRangeAllocator = {
|
|
9
|
-
fromNextId(nextId = 0) {
|
|
10
|
-
const rangeMap = new Map();
|
|
11
|
-
let _nextId = nextId;
|
|
12
|
-
return {
|
|
13
|
-
allocate(key, startId, length) {
|
|
14
|
-
let count = length ?? 1;
|
|
15
|
-
const out = [];
|
|
16
|
-
const ranges = getOrAddEmptyToMap(rangeMap, key);
|
|
17
|
-
let currId = startId;
|
|
18
|
-
while (count > 0) {
|
|
19
|
-
const firstRange = getFirstEntryFromRangeMap(ranges, currId, count);
|
|
20
|
-
if (firstRange === undefined) {
|
|
21
|
-
const newId = _nextId;
|
|
22
|
-
_nextId += count;
|
|
23
|
-
setInRangeMap(ranges, currId, count, newId);
|
|
24
|
-
out.push({ first: brand(newId), count });
|
|
25
|
-
count = 0;
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
const idRange = {
|
|
29
|
-
first: brand(firstRange.value),
|
|
30
|
-
count: firstRange.length,
|
|
31
|
-
};
|
|
32
|
-
if (currId < firstRange.start) {
|
|
33
|
-
const countToAdd = firstRange.start - currId;
|
|
34
|
-
setInRangeMap(ranges, currId, countToAdd, _nextId);
|
|
35
|
-
out.push({ first: brand(_nextId), count: countToAdd });
|
|
36
|
-
_nextId += countToAdd;
|
|
37
|
-
currId += countToAdd;
|
|
38
|
-
count -= countToAdd;
|
|
39
|
-
}
|
|
40
|
-
else if (firstRange.start < currId) {
|
|
41
|
-
const countToTrim = currId - firstRange.start;
|
|
42
|
-
idRange.first = brand(idRange.first + countToTrim);
|
|
43
|
-
idRange.count -= countToTrim;
|
|
44
|
-
}
|
|
45
|
-
if (idRange.count > count) {
|
|
46
|
-
idRange.count = count;
|
|
47
|
-
}
|
|
48
|
-
else if (idRange.count < count &&
|
|
49
|
-
firstRange.value + firstRange.length === _nextId) {
|
|
50
|
-
// The existing range can be extended
|
|
51
|
-
_nextId += count - idRange.count;
|
|
52
|
-
firstRange.length = count;
|
|
53
|
-
idRange.count = count;
|
|
54
|
-
}
|
|
55
|
-
out.push(idRange);
|
|
56
|
-
count -= idRange.count;
|
|
57
|
-
currId += idRange.count;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
return out;
|
|
61
|
-
},
|
|
62
|
-
mint(length) {
|
|
63
|
-
const count = length ?? 1;
|
|
64
|
-
const out = _nextId;
|
|
65
|
-
_nextId += count;
|
|
66
|
-
return brand(out);
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
},
|
|
70
|
-
};
|
|
71
|
-
//# sourceMappingURL=memoizedIdRangeAllocator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"memoizedIdRangeAllocator.js","sourceRoot":"","sources":["../../src/feature-libraries/memoizedIdRangeAllocator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAGN,KAAK,EACL,yBAAyB,EACzB,kBAAkB,EAClB,aAAa,GACb,MAAM,kBAAkB,CAAC;AAmC1B;GACG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACvC,UAAU,CAAC,SAAiB,CAAC;QAC5B,MAAM,QAAQ,GAAmD,I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contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ChangesetLocalId, RevisionTag } from \"../core/index.js\";\nimport {\n\ttype Mutable,\n\ttype RangeMap,\n\tbrand,\n\tgetFirstEntryFromRangeMap,\n\tgetOrAddEmptyToMap,\n\tsetInRangeMap,\n} from \"../util/index.js\";\n\n/**\n * A unique ID allocator that returns the output ID for the same input ID.\n */\nexport interface MemoizedIdRangeAllocator {\n\t/**\n\t * A unique ID allocator that returns the output ID for the same input ID.\n\t *\n\t * \"The same\" here includes cases where a prior call allocated a range of IDs that partially or fully overlap with the\n\t * current call.\n\t * @param revision - The revision associated with the range of IDs to allocate.\n\t * @param startId - The first ID to allocate.\n\t * @param count - The number of IDs to allocate. Interpreted as 1 if undefined.\n\t */\n\tallocate(\n\t\trevision: RevisionTag | undefined,\n\t\tstartId: ChangesetLocalId,\n\t\tcount?: number,\n\t): IdRange[];\n\t/**\n\t * Allocates a new range of IDs.\n\t *\n\t * @param count - The number of IDs to allocate. Interpreted as 1 if undefined.\n\t */\n\tmint(count?: number): ChangesetLocalId;\n}\n\n/**\n */\nexport interface IdRange {\n\treadonly first: ChangesetLocalId;\n\treadonly count: number;\n}\n\n/**\n */\nexport const MemoizedIdRangeAllocator = {\n\tfromNextId(nextId: number = 0): MemoizedIdRangeAllocator {\n\t\tconst rangeMap: Map<RevisionTag | undefined, RangeMap<number>> = new Map();\n\t\tlet _nextId = nextId;\n\t\treturn {\n\t\t\tallocate(key: string | number | undefined, startId: number, length?: number): IdRange[] {\n\t\t\t\tlet count = length ?? 1;\n\t\t\t\tconst out: IdRange[] = [];\n\t\t\t\tconst ranges = getOrAddEmptyToMap(rangeMap, key);\n\t\t\t\tlet currId = startId;\n\t\t\t\twhile (count > 0) {\n\t\t\t\t\tconst firstRange = getFirstEntryFromRangeMap(ranges, currId, count);\n\t\t\t\t\tif (firstRange === undefined) {\n\t\t\t\t\t\tconst newId = _nextId;\n\t\t\t\t\t\t_nextId += count;\n\t\t\t\t\t\tsetInRangeMap(ranges, currId, count, newId);\n\t\t\t\t\t\tout.push({ first: brand(newId), count });\n\t\t\t\t\t\tcount = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst idRange: Mutable<IdRange> = {\n\t\t\t\t\t\t\tfirst: brand(firstRange.value),\n\t\t\t\t\t\t\tcount: firstRange.length,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (currId < firstRange.start) {\n\t\t\t\t\t\t\tconst countToAdd = firstRange.start - currId;\n\t\t\t\t\t\t\tsetInRangeMap(ranges, currId, countToAdd, _nextId);\n\t\t\t\t\t\t\tout.push({ first: brand(_nextId), count: countToAdd });\n\t\t\t\t\t\t\t_nextId += countToAdd;\n\t\t\t\t\t\t\tcurrId += countToAdd;\n\t\t\t\t\t\t\tcount -= countToAdd;\n\t\t\t\t\t\t} else if (firstRange.start < currId) {\n\t\t\t\t\t\t\tconst countToTrim = currId - firstRange.start;\n\t\t\t\t\t\t\tidRange.first = brand((idRange.first as number) + countToTrim);\n\t\t\t\t\t\t\tidRange.count -= countToTrim;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (idRange.count > count) {\n\t\t\t\t\t\t\tidRange.count = count;\n\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\tidRange.count < count &&\n\t\t\t\t\t\t\tfirstRange.value + firstRange.length === _nextId\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// The existing range can be extended\n\t\t\t\t\t\t\t_nextId += count - idRange.count;\n\t\t\t\t\t\t\tfirstRange.length = count;\n\t\t\t\t\t\t\tidRange.count = count;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tout.push(idRange);\n\t\t\t\t\t\tcount -= idRange.count;\n\t\t\t\t\t\tcurrId += idRange.count;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn out;\n\t\t\t},\n\t\t\tmint(length?: number): ChangesetLocalId {\n\t\t\t\tconst count = length ?? 1;\n\t\t\t\tconst out = _nextId;\n\t\t\t\t_nextId += count;\n\t\t\t\treturn brand(out);\n\t\t\t},\n\t\t};\n\t},\n};\n"]}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import type { ChangesetLocalId, RevisionTag } from "../core/index.js";
|
|
7
|
-
import {
|
|
8
|
-
type Mutable,
|
|
9
|
-
type RangeMap,
|
|
10
|
-
brand,
|
|
11
|
-
getFirstEntryFromRangeMap,
|
|
12
|
-
getOrAddEmptyToMap,
|
|
13
|
-
setInRangeMap,
|
|
14
|
-
} from "../util/index.js";
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* A unique ID allocator that returns the output ID for the same input ID.
|
|
18
|
-
*/
|
|
19
|
-
export interface MemoizedIdRangeAllocator {
|
|
20
|
-
/**
|
|
21
|
-
* A unique ID allocator that returns the output ID for the same input ID.
|
|
22
|
-
*
|
|
23
|
-
* "The same" here includes cases where a prior call allocated a range of IDs that partially or fully overlap with the
|
|
24
|
-
* current call.
|
|
25
|
-
* @param revision - The revision associated with the range of IDs to allocate.
|
|
26
|
-
* @param startId - The first ID to allocate.
|
|
27
|
-
* @param count - The number of IDs to allocate. Interpreted as 1 if undefined.
|
|
28
|
-
*/
|
|
29
|
-
allocate(
|
|
30
|
-
revision: RevisionTag | undefined,
|
|
31
|
-
startId: ChangesetLocalId,
|
|
32
|
-
count?: number,
|
|
33
|
-
): IdRange[];
|
|
34
|
-
/**
|
|
35
|
-
* Allocates a new range of IDs.
|
|
36
|
-
*
|
|
37
|
-
* @param count - The number of IDs to allocate. Interpreted as 1 if undefined.
|
|
38
|
-
*/
|
|
39
|
-
mint(count?: number): ChangesetLocalId;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
*/
|
|
44
|
-
export interface IdRange {
|
|
45
|
-
readonly first: ChangesetLocalId;
|
|
46
|
-
readonly count: number;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
*/
|
|
51
|
-
export const MemoizedIdRangeAllocator = {
|
|
52
|
-
fromNextId(nextId: number = 0): MemoizedIdRangeAllocator {
|
|
53
|
-
const rangeMap: Map<RevisionTag | undefined, RangeMap<number>> = new Map();
|
|
54
|
-
let _nextId = nextId;
|
|
55
|
-
return {
|
|
56
|
-
allocate(key: string | number | undefined, startId: number, length?: number): IdRange[] {
|
|
57
|
-
let count = length ?? 1;
|
|
58
|
-
const out: IdRange[] = [];
|
|
59
|
-
const ranges = getOrAddEmptyToMap(rangeMap, key);
|
|
60
|
-
let currId = startId;
|
|
61
|
-
while (count > 0) {
|
|
62
|
-
const firstRange = getFirstEntryFromRangeMap(ranges, currId, count);
|
|
63
|
-
if (firstRange === undefined) {
|
|
64
|
-
const newId = _nextId;
|
|
65
|
-
_nextId += count;
|
|
66
|
-
setInRangeMap(ranges, currId, count, newId);
|
|
67
|
-
out.push({ first: brand(newId), count });
|
|
68
|
-
count = 0;
|
|
69
|
-
} else {
|
|
70
|
-
const idRange: Mutable<IdRange> = {
|
|
71
|
-
first: brand(firstRange.value),
|
|
72
|
-
count: firstRange.length,
|
|
73
|
-
};
|
|
74
|
-
if (currId < firstRange.start) {
|
|
75
|
-
const countToAdd = firstRange.start - currId;
|
|
76
|
-
setInRangeMap(ranges, currId, countToAdd, _nextId);
|
|
77
|
-
out.push({ first: brand(_nextId), count: countToAdd });
|
|
78
|
-
_nextId += countToAdd;
|
|
79
|
-
currId += countToAdd;
|
|
80
|
-
count -= countToAdd;
|
|
81
|
-
} else if (firstRange.start < currId) {
|
|
82
|
-
const countToTrim = currId - firstRange.start;
|
|
83
|
-
idRange.first = brand((idRange.first as number) + countToTrim);
|
|
84
|
-
idRange.count -= countToTrim;
|
|
85
|
-
}
|
|
86
|
-
if (idRange.count > count) {
|
|
87
|
-
idRange.count = count;
|
|
88
|
-
} else if (
|
|
89
|
-
idRange.count < count &&
|
|
90
|
-
firstRange.value + firstRange.length === _nextId
|
|
91
|
-
) {
|
|
92
|
-
// The existing range can be extended
|
|
93
|
-
_nextId += count - idRange.count;
|
|
94
|
-
firstRange.length = count;
|
|
95
|
-
idRange.count = count;
|
|
96
|
-
}
|
|
97
|
-
out.push(idRange);
|
|
98
|
-
count -= idRange.count;
|
|
99
|
-
currId += idRange.count;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
return out;
|
|
103
|
-
},
|
|
104
|
-
mint(length?: number): ChangesetLocalId {
|
|
105
|
-
const count = length ?? 1;
|
|
106
|
-
const out = _nextId;
|
|
107
|
-
_nextId += count;
|
|
108
|
-
return brand(out);
|
|
109
|
-
},
|
|
110
|
-
};
|
|
111
|
-
},
|
|
112
|
-
};
|