@fluidframework/tree 2.102.0 → 2.110.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 +65 -0
- package/api-report/tree.alpha.api.md +12 -3
- package/api-report/tree.beta.api.md +11 -3
- package/api-report/tree.legacy.beta.api.md +11 -3
- package/dist/codec/versioned/format.d.ts +5 -4
- package/dist/codec/versioned/format.d.ts.map +1 -1
- package/dist/codec/versioned/format.js +4 -3
- package/dist/codec/versioned/format.js.map +1 -1
- package/dist/core/rebase/types.d.ts +4 -3
- package/dist/core/rebase/types.d.ts.map +1 -1
- package/dist/core/rebase/types.js +5 -4
- package/dist/core/rebase/types.js.map +1 -1
- package/dist/core/schema-stored/formatV1.d.ts +16 -15
- package/dist/core/schema-stored/formatV1.d.ts.map +1 -1
- package/dist/core/schema-stored/formatV1.js +9 -8
- package/dist/core/schema-stored/formatV1.js.map +1 -1
- package/dist/core/schema-stored/formatV2.d.ts +29 -28
- package/dist/core/schema-stored/formatV2.d.ts.map +1 -1
- package/dist/core/schema-stored/formatV2.js +11 -10
- package/dist/core/schema-stored/formatV2.js.map +1 -1
- package/dist/core/schema-stored/index.js +3 -25
- package/dist/core/schema-stored/index.js.map +1 -1
- package/dist/core/tree/anchorSet.js +4 -8
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts +11 -10
- package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.js +11 -10
- package/dist/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatV2.d.ts +7 -6
- package/dist/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatV2.js +3 -2
- package/dist/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
- package/dist/core/tree/persistedTreeTextFormat.d.ts +19 -18
- package/dist/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
- package/dist/core/tree/persistedTreeTextFormat.js +11 -10
- package/dist/core/tree/persistedTreeTextFormat.js.map +1 -1
- package/dist/entrypoints/internal.js +2 -15
- package/dist/entrypoints/internal.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.js +7 -11
- package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts +13 -12
- package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.js +14 -13
- package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format/formatV1.d.ts +36 -35
- package/dist/feature-libraries/chunked-forest/codec/format/formatV1.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format/formatV1.js +19 -18
- package/dist/feature-libraries/chunked-forest/codec/format/formatV1.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format/formatV2.d.ts +26 -25
- package/dist/feature-libraries/chunked-forest/codec/format/formatV2.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format/formatV2.js +5 -4
- package/dist/feature-libraries/chunked-forest/codec/format/formatV2.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format/formatVText.d.ts +24 -23
- package/dist/feature-libraries/chunked-forest/codec/format/formatVText.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format/formatVText.js +8 -7
- package/dist/feature-libraries/chunked-forest/codec/format/formatVText.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts +66 -14
- package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.js +101 -36
- package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js +36 -14
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyEntity.js +9 -19
- package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.js +3 -13
- package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/dist/feature-libraries/forest-summary/formatCommon.d.ts +6 -5
- package/dist/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/formatCommon.js +4 -3
- package/dist/feature-libraries/forest-summary/formatCommon.js.map +1 -1
- package/dist/feature-libraries/index.js +2 -24
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindFormat.d.ts +4 -3
- package/dist/feature-libraries/modular-schema/genericFieldKindFormat.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindFormat.js +4 -3
- package/dist/feature-libraries/modular-schema/genericFieldKindFormat.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +10 -30
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts +45 -44
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js +26 -25
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +23 -22
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js +7 -6
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +0 -5
- 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/object-forest/objectForest.js +11 -55
- package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +9 -8
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.js +9 -8
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +14 -13
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.js +12 -11
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +5 -4
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.js +3 -2
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
- package/dist/feature-libraries/schema-index/formatV1.d.ts +15 -14
- package/dist/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/formatV1.js +5 -4
- package/dist/feature-libraries/schema-index/formatV1.js.map +1 -1
- package/dist/feature-libraries/schema-index/formatV2.d.ts +20 -19
- package/dist/feature-libraries/schema-index/formatV2.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/formatV2.js +5 -4
- package/dist/feature-libraries/schema-index/formatV2.js.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.js +1 -3
- package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV1.d.ts +283 -282
- package/dist/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV1.js +41 -40
- package/dist/feature-libraries/sequence-field/formatV1.js.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV2.d.ts +180 -179
- package/dist/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV2.js +33 -32
- package/dist/feature-libraries/sequence-field/formatV2.js.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV3.d.ts +126 -125
- package/dist/feature-libraries/sequence-field/formatV3.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV3.js +5 -4
- package/dist/feature-libraries/sequence-field/formatV3.js.map +1 -1
- package/dist/index.js +2 -24
- 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/schematizingTreeView.d.ts +1 -0
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +7 -41
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +2 -3
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +6 -45
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFormat.d.ts +8 -7
- package/dist/shared-tree/sharedTreeChangeFormat.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFormat.js +6 -5
- package/dist/shared-tree/sharedTreeChangeFormat.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +14 -5
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +106 -136
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/branch.js +13 -17
- 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.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts +35 -34
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js +17 -16
- package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +15 -15
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.js +11 -10
- package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts +40 -40
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.js +5 -4
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.js +3 -2
- package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +5 -5
- package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.js +9 -8
- package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts +7 -7
- package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormatVSharedBranches.js +7 -6
- package/dist/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +6 -43
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/shared-tree-core/transaction.js +20 -30
- package/dist/shared-tree-core/transaction.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaCodec.js +2 -24
- package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js +2 -24
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +10 -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/core/treeNodeKernel.d.ts +5 -0
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +119 -105
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js +6 -10
- package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js +2 -12
- package/dist/simple-tree/leafNodeSchema.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js +2 -6
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/simpleSchemaFormatV1.d.ts +121 -120
- package/dist/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
- package/dist/simple-tree/simpleSchemaFormatV1.js +32 -31
- package/dist/simple-tree/simpleSchemaFormatV1.js.map +1 -1
- package/dist/tableSchema.d.ts +50 -4
- package/dist/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +202 -106
- package/dist/tableSchema.js.map +1 -1
- package/dist/util/arrayUtilities.d.ts +20 -0
- package/dist/util/arrayUtilities.d.ts.map +1 -1
- package/dist/util/arrayUtilities.js +24 -1
- package/dist/util/arrayUtilities.js.map +1 -1
- package/dist/util/index.d.ts +1 -1
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +3 -2
- package/dist/util/index.js.map +1 -1
- package/dist/util/rangeMap.d.ts +13 -0
- package/dist/util/rangeMap.d.ts.map +1 -1
- package/dist/util/rangeMap.js +69 -8
- package/dist/util/rangeMap.js.map +1 -1
- package/dist/util/typeboxBrand.d.ts +1 -1
- package/dist/util/typeboxBrand.d.ts.map +1 -1
- package/dist/util/typeboxBrand.js +4 -3
- package/dist/util/typeboxBrand.js.map +1 -1
- package/dist/util/utils.d.ts +2 -2
- package/dist/util/utils.d.ts.map +1 -1
- package/dist/util/utils.js +3 -2
- package/dist/util/utils.js.map +1 -1
- package/eslint.config.mts +14 -0
- package/lib/codec/versioned/format.d.ts +5 -4
- package/lib/codec/versioned/format.d.ts.map +1 -1
- package/lib/codec/versioned/format.js +1 -1
- package/lib/codec/versioned/format.js.map +1 -1
- package/lib/core/rebase/types.d.ts +4 -3
- package/lib/core/rebase/types.d.ts.map +1 -1
- package/lib/core/rebase/types.js +1 -1
- package/lib/core/rebase/types.js.map +1 -1
- package/lib/core/schema-stored/formatV1.d.ts +16 -15
- package/lib/core/schema-stored/formatV1.d.ts.map +1 -1
- package/lib/core/schema-stored/formatV1.js +1 -1
- package/lib/core/schema-stored/formatV1.js.map +1 -1
- package/lib/core/schema-stored/formatV2.d.ts +29 -28
- package/lib/core/schema-stored/formatV2.d.ts.map +1 -1
- package/lib/core/schema-stored/formatV2.js +1 -1
- package/lib/core/schema-stored/formatV2.js.map +1 -1
- package/lib/core/tree/anchorSet.js +1 -5
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts +11 -10
- package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatCommon.js +1 -1
- package/lib/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatV2.d.ts +7 -6
- package/lib/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatV2.js +1 -1
- package/lib/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
- package/lib/core/tree/persistedTreeTextFormat.d.ts +19 -18
- package/lib/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
- package/lib/core/tree/persistedTreeTextFormat.js +1 -1
- package/lib/core/tree/persistedTreeTextFormat.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.js +1 -5
- package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts +13 -12
- package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.js +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format/formatV1.d.ts +36 -35
- package/lib/feature-libraries/chunked-forest/codec/format/formatV1.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format/formatV1.js +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format/formatV1.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format/formatV2.d.ts +26 -25
- package/lib/feature-libraries/chunked-forest/codec/format/formatV2.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format/formatV2.js +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format/formatV2.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format/formatVText.d.ts +24 -23
- package/lib/feature-libraries/chunked-forest/codec/format/formatVText.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format/formatVText.js +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format/formatVText.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts +66 -14
- package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js +101 -36
- package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js +36 -14
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyEntity.js +1 -11
- package/lib/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.js +1 -11
- package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/lib/feature-libraries/forest-summary/formatCommon.d.ts +6 -5
- package/lib/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/formatCommon.js +1 -1
- package/lib/feature-libraries/forest-summary/formatCommon.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindFormat.d.ts +4 -3
- package/lib/feature-libraries/modular-schema/genericFieldKindFormat.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindFormat.js +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindFormat.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +10 -30
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts +45 -44
- package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +23 -22
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +0 -5
- 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/object-forest/objectForest.js +1 -45
- package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +9 -8
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.js +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +14 -13
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.js +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +5 -4
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.js +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
- package/lib/feature-libraries/schema-index/formatV1.d.ts +15 -14
- package/lib/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/formatV1.js +1 -1
- package/lib/feature-libraries/schema-index/formatV1.js.map +1 -1
- package/lib/feature-libraries/schema-index/formatV2.d.ts +20 -19
- package/lib/feature-libraries/schema-index/formatV2.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/formatV2.js +1 -1
- package/lib/feature-libraries/schema-index/formatV2.js.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.js +1 -3
- package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV1.d.ts +283 -282
- package/lib/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV1.js +1 -1
- package/lib/feature-libraries/sequence-field/formatV1.js.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV2.d.ts +180 -179
- package/lib/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV2.js +1 -1
- package/lib/feature-libraries/sequence-field/formatV2.js.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV3.d.ts +126 -125
- package/lib/feature-libraries/sequence-field/formatV3.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV3.js +1 -1
- package/lib/feature-libraries/sequence-field/formatV3.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/schematizingTreeView.d.ts +1 -0
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +4 -38
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +2 -3
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +2 -41
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFormat.d.ts +8 -7
- package/lib/shared-tree/sharedTreeChangeFormat.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFormat.js +1 -1
- package/lib/shared-tree/sharedTreeChangeFormat.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +14 -5
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +63 -93
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/branch.js +1 -5
- 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.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts +35 -34
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.js +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +15 -15
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.js +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts +40 -40
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.js +1 -1
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecVSharedBranches.js +1 -1
- package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +5 -5
- package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.js +1 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
- package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts +7 -7
- package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormatVSharedBranches.js +1 -1
- package/lib/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +1 -38
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/shared-tree-core/transaction.js +1 -11
- package/lib/shared-tree-core/transaction.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +10 -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/core/treeNodeKernel.d.ts +5 -0
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +36 -23
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js +1 -5
- package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js +1 -11
- package/lib/simple-tree/leafNodeSchema.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js +1 -5
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/simpleSchemaFormatV1.d.ts +121 -120
- package/lib/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
- package/lib/simple-tree/simpleSchemaFormatV1.js +1 -1
- package/lib/simple-tree/simpleSchemaFormatV1.js.map +1 -1
- package/lib/tableSchema.d.ts +50 -4
- package/lib/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +171 -75
- package/lib/tableSchema.js.map +1 -1
- package/lib/util/arrayUtilities.d.ts +20 -0
- package/lib/util/arrayUtilities.d.ts.map +1 -1
- package/lib/util/arrayUtilities.js +22 -0
- package/lib/util/arrayUtilities.js.map +1 -1
- package/lib/util/index.d.ts +1 -1
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +1 -1
- package/lib/util/index.js.map +1 -1
- package/lib/util/rangeMap.d.ts +13 -0
- package/lib/util/rangeMap.d.ts.map +1 -1
- package/lib/util/rangeMap.js +69 -8
- package/lib/util/rangeMap.js.map +1 -1
- package/lib/util/typeboxBrand.d.ts +1 -1
- package/lib/util/typeboxBrand.d.ts.map +1 -1
- package/lib/util/typeboxBrand.js +1 -1
- package/lib/util/typeboxBrand.js.map +1 -1
- package/lib/util/utils.d.ts +2 -2
- package/lib/util/utils.d.ts.map +1 -1
- package/lib/util/utils.js +1 -1
- package/lib/util/utils.js.map +1 -1
- package/package.json +24 -23
- package/src/codec/versioned/format.ts +2 -1
- package/src/core/rebase/types.ts +1 -1
- package/src/core/schema-stored/formatV1.ts +2 -1
- package/src/core/schema-stored/formatV2.ts +2 -1
- package/src/core/tree/detachedFieldIndexFormatCommon.ts +2 -1
- package/src/core/tree/detachedFieldIndexFormatV2.ts +2 -1
- package/src/core/tree/persistedTreeTextFormat.ts +2 -1
- package/src/feature-libraries/chunked-forest/chunkTree.ts +3 -2
- package/src/feature-libraries/chunked-forest/codec/format/formatGeneric.ts +2 -1
- package/src/feature-libraries/chunked-forest/codec/format/formatV1.ts +2 -1
- package/src/feature-libraries/chunked-forest/codec/format/formatV2.ts +2 -1
- package/src/feature-libraries/chunked-forest/codec/format/formatVText.ts +2 -1
- package/src/feature-libraries/chunked-forest/uniformChunk.ts +131 -44
- package/src/feature-libraries/default-schema/defaultEditBuilder.ts +36 -14
- package/src/feature-libraries/forest-summary/formatCommon.ts +2 -1
- package/src/feature-libraries/modular-schema/genericFieldKindFormat.ts +2 -1
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +14 -47
- package/src/feature-libraries/modular-schema/modularChangeFormatV1.ts +2 -1
- package/src/feature-libraries/modular-schema/modularChangeFormatV2.ts +2 -1
- package/src/feature-libraries/modular-schema/modularChangeTypes.ts +0 -5
- package/src/feature-libraries/optional-field/optionalFieldChangeFormatV1.ts +2 -1
- package/src/feature-libraries/optional-field/optionalFieldChangeFormatV2.ts +2 -1
- package/src/feature-libraries/schema-edits/schemaChangeFormat.ts +2 -1
- package/src/feature-libraries/schema-index/formatV1.ts +2 -1
- package/src/feature-libraries/schema-index/formatV2.ts +2 -1
- package/src/feature-libraries/sequence-field/compose.ts +1 -4
- package/src/feature-libraries/sequence-field/formatV1.ts +2 -1
- package/src/feature-libraries/sequence-field/formatV2.ts +2 -1
- package/src/feature-libraries/sequence-field/formatV3.ts +2 -1
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/schematizingTreeView.ts +4 -0
- package/src/shared-tree/sharedTree.ts +3 -10
- package/src/shared-tree/sharedTreeChangeFormat.ts +2 -1
- package/src/shared-tree/treeCheckout.ts +61 -56
- package/src/shared-tree-core/editManager.ts +2 -2
- package/src/shared-tree-core/editManagerFormatCommons.ts +2 -1
- package/src/shared-tree-core/editManagerFormatV1toV4.ts +2 -1
- package/src/shared-tree-core/editManagerFormatVSharedBranches.ts +2 -1
- package/src/shared-tree-core/messageCodecVSharedBranches.ts +2 -1
- package/src/shared-tree-core/messageFormatV1ToV4.ts +2 -1
- package/src/shared-tree-core/messageFormatVSharedBranches.ts +2 -1
- package/src/simple-tree/api/tree.ts +11 -0
- package/src/simple-tree/core/treeNodeKernel.ts +39 -15
- package/src/simple-tree/simpleSchemaFormatV1.ts +2 -1
- package/src/tableSchema.ts +306 -80
- package/src/util/arrayUtilities.ts +35 -0
- package/src/util/index.ts +2 -0
- package/src/util/rangeMap.ts +108 -9
- package/src/util/typeboxBrand.ts +2 -1
- package/src/util/utils.ts +2 -1
- package/tsconfig.json +5 -0
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import * as Type from "@sinclair/typebox";
|
|
6
|
+
import type { Static } from "@sinclair/typebox";
|
|
6
7
|
/**
|
|
7
8
|
* A node shape that derives from another node shape by overlaying property-level overrides.
|
|
8
9
|
*
|
|
@@ -27,14 +28,14 @@ import { type Static } from "@sinclair/typebox";
|
|
|
27
28
|
* Decoded by {@link applySpecialization}.
|
|
28
29
|
*/
|
|
29
30
|
export type EncodedSpecializedNodeShape = Static<typeof EncodedSpecializedNodeShape>;
|
|
30
|
-
export declare const EncodedSpecializedNodeShape:
|
|
31
|
+
export declare const EncodedSpecializedNodeShape: Type.TObject<{
|
|
31
32
|
/**
|
|
32
33
|
* Index into the enclosing batch's shapes array of the shape this specializes.
|
|
33
34
|
* Must resolve to either an {@link EncodedNodeShape} or another
|
|
34
35
|
* `EncodedSpecializedNodeShape`; chains are followed transitively until a node shape
|
|
35
36
|
* is reached. This restriction is enforced at runtime, not by the schema.
|
|
36
37
|
*/
|
|
37
|
-
base:
|
|
38
|
+
base: Type.TNumber;
|
|
38
39
|
/**
|
|
39
40
|
* Field-level overrides applied to the resolved base's `fields`. Entries whose key
|
|
40
41
|
* matches a base field replace that field's shape index in place; entries with new
|
|
@@ -42,17 +43,17 @@ export declare const EncodedSpecializedNodeShape: import("@sinclair/typebox").TO
|
|
|
42
43
|
* is preserved — this is the stream consumption order at decode time, so encoders
|
|
43
44
|
* must serialize per-field tokens in the resulting field order, not in this list's order.
|
|
44
45
|
*/
|
|
45
|
-
fields:
|
|
46
|
+
fields: Type.TOptional<Type.TArray<Type.TTuple<[Type.TUnion<[Type.TString, Type.TNumber]>, Type.TNumber]>>>;
|
|
46
47
|
/**
|
|
47
48
|
* If absent, inherits the resolved base's value shape. If `null`, the resulting shape
|
|
48
49
|
* has no value shape (explicit clear). Any other value replaces the base's.
|
|
49
50
|
*/
|
|
50
|
-
value:
|
|
51
|
+
value: Type.TOptional<Type.TUnion<[Type.TUnion<[Type.TBoolean, Type.TArray<Type.TAny>, Type.TEnum<typeof import("./formatV1.js").SpecialField>]>, Type.TNull]>>;
|
|
51
52
|
/**
|
|
52
53
|
* If absent, inherits the resolved base's extraFields shape. If `null`, the resulting
|
|
53
54
|
* shape has no extraFields (explicit clear). Any other value replaces the base's.
|
|
54
55
|
*/
|
|
55
|
-
extraFields:
|
|
56
|
+
extraFields: Type.TOptional<Type.TUnion<[Type.TNumber, Type.TNull]>>;
|
|
56
57
|
}>;
|
|
57
58
|
/**
|
|
58
59
|
* Experimental extension of {@link EncodedChunkShapeV2}.
|
|
@@ -60,15 +61,15 @@ export declare const EncodedSpecializedNodeShape: import("@sinclair/typebox").TO
|
|
|
60
61
|
* See {@link DiscriminatedUnionDispatcher} for more information on this pattern.
|
|
61
62
|
*/
|
|
62
63
|
export type EncodedChunkShapeVTextExperimental = Static<typeof EncodedChunkShapeVTextExperimental>;
|
|
63
|
-
export declare const EncodedChunkShapeVTextExperimental:
|
|
64
|
-
f:
|
|
64
|
+
export declare const EncodedChunkShapeVTextExperimental: Type.TObject<{
|
|
65
|
+
f: Type.TOptional<Type.TObject<{
|
|
65
66
|
/**
|
|
66
67
|
* Index into the enclosing batch's shapes array of the shape this specializes.
|
|
67
68
|
* Must resolve to either an {@link EncodedNodeShape} or another
|
|
68
69
|
* `EncodedSpecializedNodeShape`; chains are followed transitively until a node shape
|
|
69
70
|
* is reached. This restriction is enforced at runtime, not by the schema.
|
|
70
71
|
*/
|
|
71
|
-
base:
|
|
72
|
+
base: Type.TNumber;
|
|
72
73
|
/**
|
|
73
74
|
* Field-level overrides applied to the resolved base's `fields`. Entries whose key
|
|
74
75
|
* matches a base field replace that field's shape index in place; entries with new
|
|
@@ -76,30 +77,30 @@ export declare const EncodedChunkShapeVTextExperimental: import("@sinclair/typeb
|
|
|
76
77
|
* is preserved — this is the stream consumption order at decode time, so encoders
|
|
77
78
|
* must serialize per-field tokens in the resulting field order, not in this list's order.
|
|
78
79
|
*/
|
|
79
|
-
fields:
|
|
80
|
+
fields: Type.TOptional<Type.TArray<Type.TTuple<[Type.TUnion<[Type.TString, Type.TNumber]>, Type.TNumber]>>>;
|
|
80
81
|
/**
|
|
81
82
|
* If absent, inherits the resolved base's value shape. If `null`, the resulting shape
|
|
82
83
|
* has no value shape (explicit clear). Any other value replaces the base's.
|
|
83
84
|
*/
|
|
84
|
-
value:
|
|
85
|
+
value: Type.TOptional<Type.TUnion<[Type.TUnion<[Type.TBoolean, Type.TArray<Type.TAny>, Type.TEnum<typeof import("./formatV1.js").SpecialField>]>, Type.TNull]>>;
|
|
85
86
|
/**
|
|
86
87
|
* If absent, inherits the resolved base's extraFields shape. If `null`, the resulting
|
|
87
88
|
* shape has no extraFields (explicit clear). Any other value replaces the base's.
|
|
88
89
|
*/
|
|
89
|
-
extraFields:
|
|
90
|
+
extraFields: Type.TOptional<Type.TUnion<[Type.TNumber, Type.TNull]>>;
|
|
90
91
|
}>>;
|
|
91
|
-
e:
|
|
92
|
-
a:
|
|
93
|
-
b:
|
|
94
|
-
length:
|
|
95
|
-
shape:
|
|
92
|
+
e: Type.TOptional<Type.TLiteral<0>>;
|
|
93
|
+
a: Type.TOptional<Type.TNumber>;
|
|
94
|
+
b: Type.TOptional<Type.TObject<{
|
|
95
|
+
length: Type.TNumber;
|
|
96
|
+
shape: Type.TNumber;
|
|
96
97
|
}>>;
|
|
97
|
-
c:
|
|
98
|
-
type:
|
|
99
|
-
value:
|
|
100
|
-
fields:
|
|
101
|
-
extraFields:
|
|
98
|
+
c: Type.TOptional<Type.TObject<{
|
|
99
|
+
type: Type.TOptional<Type.TUnion<[Type.TString, Type.TNumber]>>;
|
|
100
|
+
value: Type.TOptional<Type.TUnion<[Type.TBoolean, Type.TArray<Type.TAny>, Type.TEnum<typeof import("./formatV1.js").SpecialField>]>>;
|
|
101
|
+
fields: Type.TOptional<Type.TArray<Type.TTuple<[Type.TUnion<[Type.TString, Type.TNumber]>, Type.TNumber]>>>;
|
|
102
|
+
extraFields: Type.TOptional<Type.TNumber>;
|
|
102
103
|
}>>;
|
|
103
|
-
d:
|
|
104
|
+
d: Type.TOptional<Type.TLiteral<0>>;
|
|
104
105
|
}>;
|
|
105
106
|
//# sourceMappingURL=formatVText.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatVText.d.ts","sourceRoot":"","sources":["../../../../../src/feature-libraries/chunked-forest/codec/format/formatVText.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"formatVText.d.ts","sourceRoot":"","sources":["../../../../../src/feature-libraries/chunked-forest/codec/format/formatVText.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAQhD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,2BAA2B,GAAG,MAAM,CAAC,OAAO,2BAA2B,CAAC,CAAC;AACrF,eAAO,MAAM,2BAA2B;IAEtC;;;;;OAKG;;IAEH;;;;;;OAMG;;IAEH;;;OAGG;;IAEH;;;OAGG;;EAIJ,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,kCAAkC,GAAG,MAAM,CACtD,OAAO,kCAAkC,CACzC,CAAC;AACF,eAAO,MAAM,kCAAkC;;QArC7C;;;;;WAKG;;QAEH;;;;;;WAMG;;QAEH;;;WAGG;;QAEH;;;WAGG;;;;;;;;;;;;;;;;EAoBJ,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import * as Type from "@sinclair/typebox";
|
|
6
6
|
import { unionOptions } from "../../../../codec/index.js";
|
|
7
7
|
import { ShapeIndex } from "./formatGeneric.js";
|
|
8
8
|
import { EncodedFieldShape, EncodedValueShape } from "./formatV1.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatVText.js","sourceRoot":"","sources":["../../../../../src/feature-libraries/chunked-forest/codec/format/formatVText.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"formatVText.js","sourceRoot":"","sources":["../../../../../src/feature-libraries/chunked-forest/codec/format/formatVText.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAG1C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AA0BzC,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,CAAC,MAAM,CACrD;IACC;;;;;OAKG;IACH,IAAI,EAAE,UAAU;IAChB;;;;;;OAMG;IACH,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpD;;;OAGG;IACH,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,iBAAiB,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAClE;;;OAGG;IACH,WAAW,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;CACjE,EACD,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAC/B,CAAC;AAUF,MAAM,CAAC,MAAM,kCAAkC,GAAG,IAAI,CAAC,MAAM,CAC5D;IACC,GAAG,QAAQ;IACX,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,2BAA2B,CAAC;CAC7C,EACD,YAAY,CACZ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as Type from \"@sinclair/typebox\";\nimport type { Static } from \"@sinclair/typebox\";\n\nimport { unionOptions } from \"../../../../codec/index.js\";\n\nimport { ShapeIndex } from \"./formatGeneric.js\";\nimport { EncodedFieldShape, EncodedValueShape } from \"./formatV1.js\";\nimport { shapesV2 } from \"./formatV2.js\";\n\n/**\n * A node shape that derives from another node shape by overlaying property-level overrides.\n *\n * @remarks\n * Compresses runs of node shapes that differ only in a few properties: a base node shape\n * defines the structural skeleton, and the specialization narrows specific properties.\n *\n * For example, a base `FormatNode` with a variable-boolean `bold` field can be specialized\n * to a shape that pins `bold` to a constant `true` — every node decoded with the\n * specialization contributes zero stream tokens for `bold`.\n *\n * Specialization rules: `type` is always inherited from the resolved base. `fields` overrides\n * apply per-key: entries whose key matches a base field replace that entry's shape index in\n * place; entries with new keys are appended after all base fields. For `value` and\n * `extraFields`: if the property is absent on the wire, the base's value is inherited; if\n * `null`, the resulting shape has no value / no extraFields (explicit clear); any other value\n * replaces the base's.\n *\n * The `null` sentinel exists because JSON does not preserve `undefined`-valued properties,\n * so override-vs-inherit cannot be discriminated by property presence after persistence.\n *\n * Decoded by {@link applySpecialization}.\n */\nexport type EncodedSpecializedNodeShape = Static<typeof EncodedSpecializedNodeShape>;\nexport const EncodedSpecializedNodeShape = Type.Object(\n\t{\n\t\t/**\n\t\t * Index into the enclosing batch's shapes array of the shape this specializes.\n\t\t * Must resolve to either an {@link EncodedNodeShape} or another\n\t\t * `EncodedSpecializedNodeShape`; chains are followed transitively until a node shape\n\t\t * is reached. This restriction is enforced at runtime, not by the schema.\n\t\t */\n\t\tbase: ShapeIndex,\n\t\t/**\n\t\t * Field-level overrides applied to the resolved base's `fields`. Entries whose key\n\t\t * matches a base field replace that field's shape index in place; entries with new\n\t\t * keys are appended after all base fields, in the order given here. Base field order\n\t\t * is preserved — this is the stream consumption order at decode time, so encoders\n\t\t * must serialize per-field tokens in the resulting field order, not in this list's order.\n\t\t */\n\t\tfields: Type.Optional(Type.Array(EncodedFieldShape)),\n\t\t/**\n\t\t * If absent, inherits the resolved base's value shape. If `null`, the resulting shape\n\t\t * has no value shape (explicit clear). Any other value replaces the base's.\n\t\t */\n\t\tvalue: Type.Optional(Type.Union([EncodedValueShape, Type.Null()])),\n\t\t/**\n\t\t * If absent, inherits the resolved base's extraFields shape. If `null`, the resulting\n\t\t * shape has no extraFields (explicit clear). Any other value replaces the base's.\n\t\t */\n\t\textraFields: Type.Optional(Type.Union([ShapeIndex, Type.Null()])),\n\t},\n\t{ additionalProperties: false },\n);\n\n/**\n * Experimental extension of {@link EncodedChunkShapeV2}.\n * @remarks\n * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.\n */\nexport type EncodedChunkShapeVTextExperimental = Static<\n\ttypeof EncodedChunkShapeVTextExperimental\n>;\nexport const EncodedChunkShapeVTextExperimental = Type.Object(\n\t{\n\t\t...shapesV2,\n\t\tf: Type.Optional(EncodedSpecializedNodeShape),\n\t},\n\tunionOptions,\n);\n"]}
|
|
@@ -57,6 +57,15 @@ export declare class TreeShape {
|
|
|
57
57
|
readonly fields: ReadonlyMap<FieldKey, OffsetShape>;
|
|
58
58
|
readonly fieldsOffsetArray: readonly OffsetShape[];
|
|
59
59
|
readonly valuesPerTopLevelNode: number;
|
|
60
|
+
/**
|
|
61
|
+
* Information about every node in this shape.
|
|
62
|
+
* The root is first, and all indexes it uses to refer to other nodes are indexes into this array.
|
|
63
|
+
* Beyond that the ordering is an implementation detail of this shape.
|
|
64
|
+
* @remarks
|
|
65
|
+
* Use of this in contexts where there might be multiple top-level nodes requires some additional care.
|
|
66
|
+
* For example {@link Cursor} derives each node's actual position info from this shared
|
|
67
|
+
* array plus the node's top-level index within the chunk.
|
|
68
|
+
*/
|
|
60
69
|
readonly positions: readonly NodePositionInfo[];
|
|
61
70
|
/**
|
|
62
71
|
* Whether chunks using this shape (including any descendant leaf within it) may contain values compressed by the {@link UniformChunk.idCompressor}.
|
|
@@ -89,16 +98,16 @@ export declare class TreeShape {
|
|
|
89
98
|
/**
|
|
90
99
|
* The shape (see `TreeShape`) of a sequence of trees, all with the same shape (like `FieldShape`, but without a field key).
|
|
91
100
|
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
101
|
+
* @remarks
|
|
102
|
+
* Paired with a value array, this lets a {@link UniformChunk} be traversed like a tree by an
|
|
103
|
+
* {@link ITreeCursorSynchronous}. The {@link Cursor} derives each node's position info from the
|
|
104
|
+
* shared {@link TreeShape.positions} plus the node's top-level index.
|
|
95
105
|
*
|
|
96
106
|
* TODO: consider storing shape information in WASM
|
|
97
107
|
*/
|
|
98
108
|
export declare class ChunkShape {
|
|
99
109
|
readonly treeShape: TreeShape;
|
|
100
110
|
readonly topLevelLength: number;
|
|
101
|
-
readonly positions: readonly (NodePositionInfo | undefined)[];
|
|
102
111
|
constructor(treeShape: TreeShape, topLevelLength: number);
|
|
103
112
|
equals(other: ChunkShape): boolean;
|
|
104
113
|
}
|
|
@@ -122,7 +131,7 @@ declare class OffsetShape {
|
|
|
122
131
|
constructor(shape: TreeShape, topLevelLength: number, offset: number, key: FieldKey, indexOfParentField: number | undefined);
|
|
123
132
|
}
|
|
124
133
|
/**
|
|
125
|
-
* Information about a node at a specific position within a
|
|
134
|
+
* Information about a node at a specific position within one top-level tree of a {@link TreeShape}.
|
|
126
135
|
*/
|
|
127
136
|
declare class NodePositionInfo implements UpPath {
|
|
128
137
|
readonly parent: NodePositionInfo | undefined;
|
|
@@ -134,13 +143,15 @@ declare class NodePositionInfo implements UpPath {
|
|
|
134
143
|
readonly topLevelLength: number;
|
|
135
144
|
readonly valueOffset: number;
|
|
136
145
|
/**
|
|
137
|
-
* @param parent -
|
|
138
|
-
* @param parentField -
|
|
146
|
+
* @param parent - The parent node's {@link NodePositionInfo} or `undefined` for a root.
|
|
147
|
+
* @param parentField - The {@link FieldKey} of the field this node occupies within its parent.
|
|
139
148
|
* @param parentIndex - indexWithinParentField
|
|
140
|
-
* @param indexOfParentField -
|
|
141
|
-
* @param indexOfParentPosition - Index of parent
|
|
149
|
+
* @param indexOfParentField - Which field of the parent `parentIndex` is indexing into to locate this.
|
|
150
|
+
* @param indexOfParentPosition - Index of this node's parent in {@link TreeShape.positions}
|
|
142
151
|
* @param shape - Shape of the top level sequence this node is part of
|
|
143
|
-
* @param
|
|
152
|
+
* @param topLevelLength - Number of siblings in this node's field. For a root this is unused
|
|
153
|
+
* @param valueOffset - Offset of this node's value within one top-level tree's slice of the chunk's flat `values` array;
|
|
154
|
+
* only valid when `shape.hasValue` (otherwise it's where the value would have gone, and should not be used to read a value).
|
|
144
155
|
*/
|
|
145
156
|
constructor(parent: NodePositionInfo | undefined, // TODO; general UpPath to allow prefixing here?
|
|
146
157
|
parentField: FieldKey, parentIndex: number, indexOfParentField: number | undefined, indexOfParentPosition: number | undefined, shape: TreeShape, // Shape of sequence that contains this node (top level is parent of this node)
|
|
@@ -149,14 +160,25 @@ declare class NodePositionInfo implements UpPath {
|
|
|
149
160
|
/**
|
|
150
161
|
* The cursor implementation for `UniformChunk`.
|
|
151
162
|
*
|
|
152
|
-
*
|
|
163
|
+
* @remarks
|
|
164
|
+
* Tracks a flat `positionIndex` and derives each node's position info from the shape's shared
|
|
165
|
+
* {@link TreeShape.positions} plus the node's top-level index.
|
|
153
166
|
*/
|
|
154
167
|
declare class Cursor extends SynchronousCursor implements ChunkedCursor {
|
|
155
168
|
private readonly chunk;
|
|
156
169
|
private positionIndex;
|
|
170
|
+
/** Position info for the current node, or `undefined` when in root field. */
|
|
157
171
|
private nodePositionInfo;
|
|
172
|
+
/** Which top-level node of the chunk the current position is within. Valid when nodePositionInfo !== undefined. */
|
|
173
|
+
private topLevelIndex;
|
|
174
|
+
/** The chunk's shape. */
|
|
158
175
|
private readonly shape;
|
|
159
|
-
|
|
176
|
+
/** The chunk's per-tree shape (shape of each top-level tree). */
|
|
177
|
+
private readonly treeShape;
|
|
178
|
+
/** Number of positions in one top-level tree (treeShape.positions.length). */
|
|
179
|
+
private readonly nodeLength;
|
|
180
|
+
/** Number of values per top-level node (treeShape.valuesPerTopLevelNode). */
|
|
181
|
+
private readonly stride;
|
|
160
182
|
mode: CursorLocationType;
|
|
161
183
|
private fieldKey?;
|
|
162
184
|
private indexOfField;
|
|
@@ -166,12 +188,32 @@ declare class Cursor extends SynchronousCursor implements ChunkedCursor {
|
|
|
166
188
|
fork(): Cursor;
|
|
167
189
|
/**
|
|
168
190
|
* Change the current node within the chunk.
|
|
191
|
+
*
|
|
192
|
+
* @param positionIndex - flat position index of the newly selected node. This is NOT an index
|
|
193
|
+
* within a field, and is not bounds checked.
|
|
194
|
+
*
|
|
195
|
+
* @remarks
|
|
196
|
+
* Decomposes the index into {@link Cursor.topLevelIndex} and {@link Cursor.nodePositionInfo}.
|
|
169
197
|
* See `nodeInfo` for getting data about the current node.
|
|
170
198
|
*
|
|
171
|
-
* @param positionIndex - index of the position of the newly selected node in `positions`.
|
|
172
|
-
* This is NOT an index within a field, and is not bounds checked.
|
|
173
199
|
*/
|
|
174
200
|
private moveToPosition;
|
|
201
|
+
/**
|
|
202
|
+
* Decode a flat `positionIndex` into its components.
|
|
203
|
+
*
|
|
204
|
+
* @param positionIndex - flat position index of the node to decode. Must be greater than 0;
|
|
205
|
+
* @returns the node's index within {@link TreeShape.positions} (`withinTree`), which top-level
|
|
206
|
+
* tree holds it (`topLevelIndex`), and the corresponding shared {@link NodePositionInfo} (`info`).
|
|
207
|
+
*/
|
|
208
|
+
private decodePosition;
|
|
209
|
+
/**
|
|
210
|
+
* Build a standalone {@link UpPath} for the node at `positionIndex`. O(depth) allocation.
|
|
211
|
+
*
|
|
212
|
+
* @remarks
|
|
213
|
+
* walks the shared per-tree {@link TreeShape.positions} and applies the top-level index
|
|
214
|
+
* at each level. Mirrors how the `BasicChunk` cursor allocates paths.
|
|
215
|
+
*/
|
|
216
|
+
private materializePath;
|
|
175
217
|
/**
|
|
176
218
|
* Gets information about the current node.
|
|
177
219
|
*
|
|
@@ -199,6 +241,16 @@ declare class Cursor extends SynchronousCursor implements ChunkedCursor {
|
|
|
199
241
|
getPath(prefix?: PathRootPrefix): UpPath | undefined;
|
|
200
242
|
get fieldIndex(): number;
|
|
201
243
|
readonly chunkStart: number;
|
|
244
|
+
/**
|
|
245
|
+
* Number of nodes in `info`'s field including `info` itself.
|
|
246
|
+
*
|
|
247
|
+
* @remarks
|
|
248
|
+
* For top-level nodes this is the chunk's `topLevelLength`, read from the chunk
|
|
249
|
+
* rather than the node, so the shared per-tree {@link TreeShape.positions} stays independent of
|
|
250
|
+
* chunk length; the root entry's own `topLevelLength` field is unused. Nested nodes use the
|
|
251
|
+
* field length stored on the node.
|
|
252
|
+
*/
|
|
253
|
+
private siblingCount;
|
|
202
254
|
get chunkLength(): number;
|
|
203
255
|
seekNodes(offset: number): boolean;
|
|
204
256
|
nextNode(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uniformChunk.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/chunked-forest/uniformChunk.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAA4B,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAE7F,OAAO,EACN,kBAAkB,EAClB,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAC7B,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,KAAK,EACV,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,WAAW,EAEX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAwB,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAA+B,MAAM,uBAAuB,CAAC;AAEvF;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,SAAS,CAE9E;AAED;;;;;GAKG;AACH,qBAAa,YAAa,SAAQ,oBAAqB,YAAW,SAAS;IASlE,KAAK,EAAE,UAAU;IACjB,MAAM,EAAE,SAAS,EAAE;IATpB,YAAY,EAAE,SAAS,GAAG,aAAa,CAAC;IAC/C;;;;;OAKG;gBAEK,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,SAAS,EAAE,EAC1B,YAAY,CAAC,EAAE,aAAa;IAU7B,IAAW,cAAc,IAAI,MAAM,CAElC;IAEM,KAAK,IAAI,YAAY;IAIrB,MAAM,IAAI,MAAM;IAIvB,SAAS,CAAC,cAAc,IAAI,IAAI;CAChC;AAED;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;AAmBhE;;;;;;;GAOG;AACH,qBAAa,SAAS;
|
|
1
|
+
{"version":3,"file":"uniformChunk.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/chunked-forest/uniformChunk.ts"],"names":[],"mappings":"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"}
|
|
@@ -147,9 +147,10 @@ function clonePositions(indexOfParentInOutput, [key, shape, copies], indexOfPare
|
|
|
147
147
|
/**
|
|
148
148
|
* The shape (see `TreeShape`) of a sequence of trees, all with the same shape (like `FieldShape`, but without a field key).
|
|
149
149
|
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
150
|
+
* @remarks
|
|
151
|
+
* Paired with a value array, this lets a {@link UniformChunk} be traversed like a tree by an
|
|
152
|
+
* {@link ITreeCursorSynchronous}. The {@link Cursor} derives each node's position info from the
|
|
153
|
+
* shared {@link TreeShape.positions} plus the node's top-level index.
|
|
153
154
|
*
|
|
154
155
|
* TODO: consider storing shape information in WASM
|
|
155
156
|
*/
|
|
@@ -158,10 +159,6 @@ export class ChunkShape {
|
|
|
158
159
|
this.treeShape = treeShape;
|
|
159
160
|
this.topLevelLength = topLevelLength;
|
|
160
161
|
assert(topLevelLength > 0, 0x4c6 /* topLevelLength must be greater than 0 */);
|
|
161
|
-
// TODO: avoid duplication from inner loop
|
|
162
|
-
const positions = [undefined];
|
|
163
|
-
clonePositions(0, [dummyRoot, treeShape, topLevelLength], 0, 0, positions);
|
|
164
|
-
this.positions = positions;
|
|
165
162
|
}
|
|
166
163
|
equals(other) {
|
|
167
164
|
// TODO: either dedup instances and/or store a collision resistant hash for fast compare.
|
|
@@ -189,17 +186,19 @@ class OffsetShape {
|
|
|
189
186
|
}
|
|
190
187
|
}
|
|
191
188
|
/**
|
|
192
|
-
* Information about a node at a specific position within a
|
|
189
|
+
* Information about a node at a specific position within one top-level tree of a {@link TreeShape}.
|
|
193
190
|
*/
|
|
194
191
|
class NodePositionInfo {
|
|
195
192
|
/**
|
|
196
|
-
* @param parent -
|
|
197
|
-
* @param parentField -
|
|
193
|
+
* @param parent - The parent node's {@link NodePositionInfo} or `undefined` for a root.
|
|
194
|
+
* @param parentField - The {@link FieldKey} of the field this node occupies within its parent.
|
|
198
195
|
* @param parentIndex - indexWithinParentField
|
|
199
|
-
* @param indexOfParentField -
|
|
200
|
-
* @param indexOfParentPosition - Index of parent
|
|
196
|
+
* @param indexOfParentField - Which field of the parent `parentIndex` is indexing into to locate this.
|
|
197
|
+
* @param indexOfParentPosition - Index of this node's parent in {@link TreeShape.positions}
|
|
201
198
|
* @param shape - Shape of the top level sequence this node is part of
|
|
202
|
-
* @param
|
|
199
|
+
* @param topLevelLength - Number of siblings in this node's field. For a root this is unused
|
|
200
|
+
* @param valueOffset - Offset of this node's value within one top-level tree's slice of the chunk's flat `values` array;
|
|
201
|
+
* only valid when `shape.hasValue` (otherwise it's where the value would have gone, and should not be used to read a value).
|
|
203
202
|
*/
|
|
204
203
|
constructor(parent, // TODO; general UpPath to allow prefixing here?
|
|
205
204
|
parentField, parentIndex, indexOfParentField, indexOfParentPosition, shape, // Shape of sequence that contains this node (top level is parent of this node)
|
|
@@ -217,20 +216,26 @@ class NodePositionInfo {
|
|
|
217
216
|
/**
|
|
218
217
|
* The cursor implementation for `UniformChunk`.
|
|
219
218
|
*
|
|
220
|
-
*
|
|
219
|
+
* @remarks
|
|
220
|
+
* Tracks a flat `positionIndex` and derives each node's position info from the shape's shared
|
|
221
|
+
* {@link TreeShape.positions} plus the node's top-level index.
|
|
221
222
|
*/
|
|
222
223
|
class Cursor extends SynchronousCursor {
|
|
223
224
|
// TODO: support prefix (path above root, including index offset of chunk in its containing field)
|
|
224
225
|
constructor(chunk) {
|
|
225
226
|
super();
|
|
226
227
|
this.chunk = chunk;
|
|
228
|
+
/** Which top-level node of the chunk the current position is within. Valid when nodePositionInfo !== undefined. */
|
|
229
|
+
this.topLevelIndex = 0;
|
|
227
230
|
this.mode = 1 /* CursorLocationType.Fields */;
|
|
228
231
|
// Valid only in fields mode. Can be past end for empty fields.
|
|
229
232
|
// This is redundant with fieldKey above (but might be worth keeping for perf), and could be removed.
|
|
230
233
|
this.indexOfField = 0;
|
|
231
234
|
this.chunkStart = 0;
|
|
232
235
|
this.shape = this.chunk.shape;
|
|
233
|
-
this.
|
|
236
|
+
this.treeShape = this.shape.treeShape;
|
|
237
|
+
this.nodeLength = this.treeShape.positions.length;
|
|
238
|
+
this.stride = this.treeShape.valuesPerTopLevelNode;
|
|
234
239
|
this.fieldKey = dummyRoot;
|
|
235
240
|
this.moveToPosition(0);
|
|
236
241
|
}
|
|
@@ -252,18 +257,62 @@ class Cursor extends SynchronousCursor {
|
|
|
252
257
|
}
|
|
253
258
|
/**
|
|
254
259
|
* Change the current node within the chunk.
|
|
260
|
+
*
|
|
261
|
+
* @param positionIndex - flat position index of the newly selected node. This is NOT an index
|
|
262
|
+
* within a field, and is not bounds checked.
|
|
263
|
+
*
|
|
264
|
+
* @remarks
|
|
265
|
+
* Decomposes the index into {@link Cursor.topLevelIndex} and {@link Cursor.nodePositionInfo}.
|
|
255
266
|
* See `nodeInfo` for getting data about the current node.
|
|
256
267
|
*
|
|
257
|
-
* @param positionIndex - index of the position of the newly selected node in `positions`.
|
|
258
|
-
* This is NOT an index within a field, and is not bounds checked.
|
|
259
268
|
*/
|
|
260
269
|
moveToPosition(positionIndex) {
|
|
261
|
-
this.nodePositionInfo = this.positions[positionIndex];
|
|
262
270
|
this.positionIndex = positionIndex;
|
|
263
|
-
if (
|
|
264
|
-
|
|
271
|
+
if (positionIndex === 0) {
|
|
272
|
+
this.nodePositionInfo = undefined;
|
|
265
273
|
assert(this.mode === 1 /* CursorLocationType.Fields */, 0x562 /* expected root to be a field */);
|
|
274
|
+
return;
|
|
266
275
|
}
|
|
276
|
+
const decoded = this.decodePosition(positionIndex);
|
|
277
|
+
this.topLevelIndex = decoded.topLevelIndex;
|
|
278
|
+
this.nodePositionInfo = decoded.info;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Decode a flat `positionIndex` into its components.
|
|
282
|
+
*
|
|
283
|
+
* @param positionIndex - flat position index of the node to decode. Must be greater than 0;
|
|
284
|
+
* @returns the node's index within {@link TreeShape.positions} (`withinTree`), which top-level
|
|
285
|
+
* tree holds it (`topLevelIndex`), and the corresponding shared {@link NodePositionInfo} (`info`).
|
|
286
|
+
*/
|
|
287
|
+
decodePosition(positionIndex) {
|
|
288
|
+
const offset = positionIndex - 1;
|
|
289
|
+
// Find the node's index within treeShape.positions, then which top-level tree holds it.
|
|
290
|
+
const withinTree = offset % this.nodeLength; // remainder
|
|
291
|
+
const topLevelIndex = (offset - withinTree) / this.nodeLength; // quotient
|
|
292
|
+
const info = this.treeShape.positions[withinTree] ?? oob();
|
|
293
|
+
return { withinTree, topLevelIndex, info };
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Build a standalone {@link UpPath} for the node at `positionIndex`. O(depth) allocation.
|
|
297
|
+
*
|
|
298
|
+
* @remarks
|
|
299
|
+
* walks the shared per-tree {@link TreeShape.positions} and applies the top-level index
|
|
300
|
+
* at each level. Mirrors how the `BasicChunk` cursor allocates paths.
|
|
301
|
+
*/
|
|
302
|
+
materializePath(positionIndex) {
|
|
303
|
+
if (positionIndex === 0) {
|
|
304
|
+
return undefined;
|
|
305
|
+
}
|
|
306
|
+
const { withinTree, topLevelIndex, info } = this.decodePosition(positionIndex);
|
|
307
|
+
if (info.parent === undefined) {
|
|
308
|
+
// Top-level node: its parent is the (prefixed) chunk root.
|
|
309
|
+
return { parent: undefined, parentField: info.parentField, parentIndex: topLevelIndex };
|
|
310
|
+
}
|
|
311
|
+
return {
|
|
312
|
+
parent: this.materializePath(positionIndex - withinTree + (info.indexOfParentPosition ?? oob())),
|
|
313
|
+
parentField: info.parentField,
|
|
314
|
+
parentIndex: info.parentIndex,
|
|
315
|
+
};
|
|
267
316
|
}
|
|
268
317
|
/**
|
|
269
318
|
* Gets information about the current node.
|
|
@@ -357,29 +406,43 @@ class Cursor extends SynchronousCursor {
|
|
|
357
406
|
enterRootNodeInner(childIndex) {
|
|
358
407
|
this.mode = 0 /* CursorLocationType.Nodes */;
|
|
359
408
|
this.fieldKey = undefined;
|
|
360
|
-
// 1 for the "undefined"
|
|
361
|
-
this.moveToPosition(1 + childIndex * this.
|
|
409
|
+
// 1 for the "undefined" root-field marker at position 0, then stride by one top-level tree (nodeLength).
|
|
410
|
+
this.moveToPosition(1 + childIndex * this.nodeLength);
|
|
362
411
|
assert(this.fieldIndex === childIndex, 0x543 /* should be at selected child */);
|
|
363
412
|
}
|
|
364
413
|
getFieldPath(prefix) {
|
|
365
414
|
return prefixFieldPath(prefix, {
|
|
366
415
|
field: this.getFieldKey(),
|
|
367
|
-
parent: this.
|
|
416
|
+
parent: this.materializePath(this.positionIndex),
|
|
368
417
|
});
|
|
369
418
|
}
|
|
370
419
|
getPath(prefix) {
|
|
371
|
-
|
|
420
|
+
this.nodeInfo(0 /* CursorLocationType.Nodes */); // assert: in nodes mode at a node
|
|
421
|
+
return prefixPath(prefix, this.materializePath(this.positionIndex));
|
|
372
422
|
}
|
|
373
423
|
get fieldIndex() {
|
|
374
|
-
|
|
424
|
+
const info = this.nodeInfo(0 /* CursorLocationType.Nodes */);
|
|
425
|
+
return info.parent === undefined ? this.topLevelIndex : info.parentIndex;
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* Number of nodes in `info`'s field including `info` itself.
|
|
429
|
+
*
|
|
430
|
+
* @remarks
|
|
431
|
+
* For top-level nodes this is the chunk's `topLevelLength`, read from the chunk
|
|
432
|
+
* rather than the node, so the shared per-tree {@link TreeShape.positions} stays independent of
|
|
433
|
+
* chunk length; the root entry's own `topLevelLength` field is unused. Nested nodes use the
|
|
434
|
+
* field length stored on the node.
|
|
435
|
+
*/
|
|
436
|
+
siblingCount(info) {
|
|
437
|
+
return info.parent === undefined ? this.shape.topLevelLength : info.topLevelLength;
|
|
375
438
|
}
|
|
376
439
|
get chunkLength() {
|
|
377
|
-
return this.nodeInfo(0 /* CursorLocationType.Nodes */)
|
|
440
|
+
return this.siblingCount(this.nodeInfo(0 /* CursorLocationType.Nodes */));
|
|
378
441
|
}
|
|
379
442
|
seekNodes(offset) {
|
|
380
443
|
const info = this.nodeInfo(0 /* CursorLocationType.Nodes */);
|
|
381
|
-
const index = offset +
|
|
382
|
-
if (index >= 0 && index < info
|
|
444
|
+
const index = offset + this.fieldIndex;
|
|
445
|
+
if (index >= 0 && index < this.siblingCount(info)) {
|
|
383
446
|
this.moveToPosition(this.positionIndex + offset * info.shape.positions.length);
|
|
384
447
|
return true;
|
|
385
448
|
}
|
|
@@ -389,8 +452,8 @@ class Cursor extends SynchronousCursor {
|
|
|
389
452
|
nextNode() {
|
|
390
453
|
// This is the same as `return this.seekNodes(1);` but slightly faster.
|
|
391
454
|
const info = this.nodeInfo(0 /* CursorLocationType.Nodes */);
|
|
392
|
-
const index =
|
|
393
|
-
if (index === info
|
|
455
|
+
const index = this.fieldIndex + 1;
|
|
456
|
+
if (index === this.siblingCount(info)) {
|
|
394
457
|
this.exitNode();
|
|
395
458
|
return false;
|
|
396
459
|
}
|
|
@@ -399,13 +462,15 @@ class Cursor extends SynchronousCursor {
|
|
|
399
462
|
}
|
|
400
463
|
exitNode() {
|
|
401
464
|
const info = this.nodeInfo(0 /* CursorLocationType.Nodes */);
|
|
402
|
-
this.
|
|
403
|
-
|
|
404
|
-
|
|
465
|
+
const withinTree = this.positionIndex - 1 - this.topLevelIndex * this.nodeLength;
|
|
466
|
+
// Top-level nodes (no parent) exit to the root field at position 0;
|
|
467
|
+
// nested nodes' parent is `indexOfParentPosition` within the same top-level instance.
|
|
468
|
+
this.indexOfField = info.indexOfParentField ?? 0;
|
|
405
469
|
this.fieldKey = info.parentField;
|
|
406
470
|
this.mode = 1 /* CursorLocationType.Fields */;
|
|
407
|
-
this.moveToPosition(info.indexOfParentPosition
|
|
408
|
-
|
|
471
|
+
this.moveToPosition(info.indexOfParentPosition === undefined
|
|
472
|
+
? 0
|
|
473
|
+
: this.positionIndex - withinTree + info.indexOfParentPosition);
|
|
409
474
|
}
|
|
410
475
|
firstField() {
|
|
411
476
|
const fieldsArray = this.nodeInfo(0 /* CursorLocationType.Nodes */).shape.fieldsArray;
|
|
@@ -434,7 +499,7 @@ class Cursor extends SynchronousCursor {
|
|
|
434
499
|
get value() {
|
|
435
500
|
const info = this.nodeInfo(0 /* CursorLocationType.Nodes */);
|
|
436
501
|
if (info.shape.hasValue) {
|
|
437
|
-
const value = this.chunk.values[info.valueOffset];
|
|
502
|
+
const value = this.chunk.values[info.valueOffset + this.topLevelIndex * this.stride];
|
|
438
503
|
// If mayContainCompressedIds is set, check if the value is a number (i.e. a compressed ID that needs decompression).
|
|
439
504
|
if (info.shape.mayContainCompressedIds && typeof value === "number") {
|
|
440
505
|
const idCompressor = this.chunk.idCompressor;
|