@fluidframework/tree 2.63.0-359461 → 2.63.0-359734
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/.mocharc.cjs +9 -1
- package/api-report/tree.alpha.api.md +93 -98
- package/api-report/tree.beta.api.md +37 -2
- package/api-report/tree.legacy.beta.api.md +37 -2
- package/api-report/tree.legacy.public.api.md +9 -2
- package/api-report/tree.public.api.md +9 -2
- package/dist/alpha.d.ts +11 -13
- package/dist/beta.d.ts +5 -0
- package/dist/feature-libraries/treeCursorUtils.d.ts.map +1 -1
- package/dist/feature-libraries/treeCursorUtils.js +17 -15
- package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/jsonDomainSchema.d.ts +5 -5
- package/dist/jsonDomainSchema.js +5 -5
- package/dist/jsonDomainSchema.js.map +1 -1
- package/dist/legacy.d.ts +5 -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 +1 -0
- package/dist/serializableDomainSchema.d.ts +6 -6
- package/dist/serializableDomainSchema.js +5 -5
- package/dist/serializableDomainSchema.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +1 -1
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts +20 -28
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +4 -29
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/simple-tree/api/conciseTree.d.ts +1 -1
- package/dist/simple-tree/api/conciseTree.js.map +1 -1
- package/dist/simple-tree/api/configuration.d.ts +0 -3
- package/dist/simple-tree/api/configuration.d.ts.map +1 -1
- package/dist/simple-tree/api/configuration.js +1 -4
- package/dist/simple-tree/api/configuration.js.map +1 -1
- package/dist/simple-tree/api/customTree.d.ts +7 -7
- package/dist/simple-tree/api/customTree.js +5 -5
- package/dist/simple-tree/api/customTree.js.map +1 -1
- package/dist/simple-tree/api/discrepancies.js +2 -2
- package/dist/simple-tree/api/discrepancies.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +2 -2
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +4 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts +12 -4
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +3 -8
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +27 -26
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js +11 -0
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryBeta.d.ts +13 -2
- package/dist/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryBeta.js +14 -0
- package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
- package/dist/simple-tree/api/schemaStatics.d.ts +9 -14
- package/dist/simple-tree/api/schemaStatics.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaStatics.js +9 -12
- package/dist/simple-tree/api/schemaStatics.js.map +1 -1
- package/dist/simple-tree/api/storedSchema.d.ts +2 -2
- package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/storedSchema.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +3 -3
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/treeBeta.d.ts +52 -2
- package/dist/simple-tree/api/treeBeta.d.ts.map +1 -1
- package/dist/simple-tree/api/treeBeta.js +36 -1
- package/dist/simple-tree/api/treeBeta.js.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.js +1 -1
- package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
- package/dist/simple-tree/core/allowedTypes.d.ts +120 -62
- package/dist/simple-tree/core/allowedTypes.d.ts.map +1 -1
- package/dist/simple-tree/core/allowedTypes.js +162 -84
- package/dist/simple-tree/core/allowedTypes.js.map +1 -1
- package/dist/simple-tree/core/context.d.ts +2 -2
- package/dist/simple-tree/core/context.d.ts.map +1 -1
- package/dist/simple-tree/core/context.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +2 -2
- package/dist/simple-tree/core/index.d.ts.map +1 -1
- package/dist/simple-tree/core/index.js +4 -3
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/toStored.d.ts +3 -3
- package/dist/simple-tree/core/toStored.d.ts.map +1 -1
- package/dist/simple-tree/core/toStored.js +2 -2
- package/dist/simple-tree/core/toStored.js.map +1 -1
- package/dist/simple-tree/core/treeNode.d.ts +1 -1
- package/dist/simple-tree/core/treeNode.js +1 -1
- package/dist/simple-tree/core/treeNode.js.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts +3 -3
- 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/core/treeNodeValid.d.ts +2 -2
- package/dist/simple-tree/core/treeNodeValid.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeValid.js.map +1 -1
- package/dist/simple-tree/core/walkSchema.d.ts +3 -3
- package/dist/simple-tree/core/walkSchema.d.ts.map +1 -1
- package/dist/simple-tree/core/walkSchema.js +1 -1
- package/dist/simple-tree/core/walkSchema.js.map +1 -1
- package/dist/simple-tree/createContext.js +2 -2
- package/dist/simple-tree/createContext.js.map +1 -1
- package/dist/simple-tree/fieldSchema.d.ts +9 -32
- package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
- package/dist/simple-tree/fieldSchema.js +12 -20
- package/dist/simple-tree/fieldSchema.js.map +1 -1
- package/dist/simple-tree/index.d.ts +4 -4
- 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/node-kinds/array/arrayNode.d.ts +2 -2
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js +5 -6
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +3 -3
- package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
- package/dist/simple-tree/node-kinds/common.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/common.js +2 -2
- package/dist/simple-tree/node-kinds/common.js.map +1 -1
- package/dist/simple-tree/node-kinds/index.d.ts +1 -1
- package/dist/simple-tree/node-kinds/index.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/index.js.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.d.ts +2 -2
- package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.js +3 -3
- package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts +3 -3
- package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/index.d.ts +2 -2
- package/dist/simple-tree/node-kinds/object/index.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/index.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts +5 -18
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.js +5 -15
- package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +4 -11
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.d.ts +3 -3
- package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.js +3 -3
- package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts +5 -5
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
- package/dist/simple-tree/prepareForInsertion.d.ts +5 -5
- package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
- package/dist/simple-tree/prepareForInsertion.js.map +1 -1
- package/dist/simple-tree/toStoredSchema.d.ts +8 -8
- package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +5 -5
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +2 -2
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/dist/simple-tree/unsafeUnknownSchema.d.ts.map +1 -1
- package/dist/simple-tree/unsafeUnknownSchema.js.map +1 -1
- package/dist/simple-tree/walkFieldSchema.js +1 -1
- package/dist/simple-tree/walkFieldSchema.js.map +1 -1
- package/dist/tableSchema.d.ts +19 -19
- package/dist/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +2 -2
- package/dist/tableSchema.js.map +1 -1
- package/lib/alpha.d.ts +11 -13
- package/lib/beta.d.ts +5 -0
- package/lib/feature-libraries/treeCursorUtils.d.ts.map +1 -1
- package/lib/feature-libraries/treeCursorUtils.js +17 -15
- package/lib/feature-libraries/treeCursorUtils.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/jsonDomainSchema.d.ts +5 -5
- package/lib/jsonDomainSchema.js +5 -5
- package/lib/jsonDomainSchema.js.map +1 -1
- package/lib/legacy.d.ts +5 -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 +1 -0
- package/lib/serializableDomainSchema.d.ts +6 -6
- package/lib/serializableDomainSchema.js +5 -5
- package/lib/serializableDomainSchema.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +1 -1
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts +20 -28
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +3 -28
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/simple-tree/api/conciseTree.d.ts +1 -1
- package/lib/simple-tree/api/conciseTree.js.map +1 -1
- package/lib/simple-tree/api/configuration.d.ts +0 -3
- package/lib/simple-tree/api/configuration.d.ts.map +1 -1
- package/lib/simple-tree/api/configuration.js +2 -5
- package/lib/simple-tree/api/configuration.js.map +1 -1
- package/lib/simple-tree/api/customTree.d.ts +7 -7
- package/lib/simple-tree/api/customTree.js +5 -5
- package/lib/simple-tree/api/customTree.js.map +1 -1
- package/lib/simple-tree/api/discrepancies.js +3 -3
- package/lib/simple-tree/api/discrepancies.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +2 -2
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +1 -1
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts +12 -4
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +3 -8
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +27 -26
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js +12 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryBeta.d.ts +13 -2
- package/lib/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryBeta.js +16 -2
- package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
- package/lib/simple-tree/api/schemaStatics.d.ts +9 -14
- package/lib/simple-tree/api/schemaStatics.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaStatics.js +9 -12
- package/lib/simple-tree/api/schemaStatics.js.map +1 -1
- package/lib/simple-tree/api/storedSchema.d.ts +2 -2
- package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/storedSchema.js +1 -1
- package/lib/simple-tree/api/storedSchema.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +3 -3
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/treeBeta.d.ts +52 -2
- package/lib/simple-tree/api/treeBeta.d.ts.map +1 -1
- package/lib/simple-tree/api/treeBeta.js +33 -1
- package/lib/simple-tree/api/treeBeta.js.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.js +1 -1
- package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/core/allowedTypes.d.ts +120 -62
- package/lib/simple-tree/core/allowedTypes.d.ts.map +1 -1
- package/lib/simple-tree/core/allowedTypes.js +158 -80
- package/lib/simple-tree/core/allowedTypes.js.map +1 -1
- package/lib/simple-tree/core/context.d.ts +2 -2
- package/lib/simple-tree/core/context.d.ts.map +1 -1
- package/lib/simple-tree/core/context.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +2 -2
- package/lib/simple-tree/core/index.d.ts.map +1 -1
- package/lib/simple-tree/core/index.js +1 -1
- package/lib/simple-tree/core/index.js.map +1 -1
- package/lib/simple-tree/core/toStored.d.ts +3 -3
- package/lib/simple-tree/core/toStored.d.ts.map +1 -1
- package/lib/simple-tree/core/toStored.js +3 -3
- package/lib/simple-tree/core/toStored.js.map +1 -1
- package/lib/simple-tree/core/treeNode.d.ts +1 -1
- package/lib/simple-tree/core/treeNode.js +1 -1
- package/lib/simple-tree/core/treeNode.js.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts +3 -3
- 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/core/treeNodeValid.d.ts +2 -2
- package/lib/simple-tree/core/treeNodeValid.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeValid.js.map +1 -1
- package/lib/simple-tree/core/walkSchema.d.ts +3 -3
- package/lib/simple-tree/core/walkSchema.d.ts.map +1 -1
- package/lib/simple-tree/core/walkSchema.js +2 -2
- package/lib/simple-tree/core/walkSchema.js.map +1 -1
- package/lib/simple-tree/createContext.js +3 -3
- package/lib/simple-tree/createContext.js.map +1 -1
- package/lib/simple-tree/fieldSchema.d.ts +9 -32
- package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
- package/lib/simple-tree/fieldSchema.js +13 -21
- package/lib/simple-tree/fieldSchema.js.map +1 -1
- package/lib/simple-tree/index.d.ts +4 -4
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +2 -2
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +2 -2
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js +6 -7
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +3 -3
- package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
- package/lib/simple-tree/node-kinds/common.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/common.js +3 -3
- package/lib/simple-tree/node-kinds/common.js.map +1 -1
- package/lib/simple-tree/node-kinds/index.d.ts +1 -1
- package/lib/simple-tree/node-kinds/index.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/index.js.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.d.ts +2 -2
- package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.js +4 -4
- package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts +3 -3
- package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/index.d.ts +2 -2
- package/lib/simple-tree/node-kinds/object/index.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/index.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.d.ts +5 -18
- package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.js +6 -15
- package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +4 -11
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNode.d.ts +3 -3
- package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNode.js +4 -4
- package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts +5 -5
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
- package/lib/simple-tree/prepareForInsertion.d.ts +5 -5
- package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
- package/lib/simple-tree/prepareForInsertion.js.map +1 -1
- package/lib/simple-tree/toStoredSchema.d.ts +8 -8
- package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +5 -5
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +2 -2
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/lib/simple-tree/unsafeUnknownSchema.d.ts.map +1 -1
- package/lib/simple-tree/unsafeUnknownSchema.js.map +1 -1
- package/lib/simple-tree/walkFieldSchema.js +1 -1
- package/lib/simple-tree/walkFieldSchema.js.map +1 -1
- package/lib/tableSchema.d.ts +19 -19
- package/lib/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +2 -2
- package/lib/tableSchema.js.map +1 -1
- package/package.json +23 -21
- package/src/feature-libraries/treeCursorUtils.ts +34 -19
- package/src/index.ts +7 -10
- package/src/jsonDomainSchema.ts +5 -5
- package/src/packageVersion.ts +1 -1
- package/src/serializableDomainSchema.ts +6 -6
- package/src/shared-tree/schematizingTreeView.ts +1 -1
- package/src/shared-tree/treeAlpha.ts +32 -81
- package/src/simple-tree/api/conciseTree.ts +1 -1
- package/src/simple-tree/api/configuration.ts +3 -7
- package/src/simple-tree/api/customTree.ts +7 -7
- package/src/simple-tree/api/discrepancies.ts +3 -3
- package/src/simple-tree/api/index.ts +10 -2
- package/src/simple-tree/api/schemaFactory.ts +18 -73
- package/src/simple-tree/api/schemaFactoryAlpha.ts +45 -12
- package/src/simple-tree/api/schemaFactoryBeta.ts +76 -1
- package/src/simple-tree/api/schemaStatics.ts +16 -61
- package/src/simple-tree/api/storedSchema.ts +2 -6
- package/src/simple-tree/api/tree.ts +3 -3
- package/src/simple-tree/api/treeBeta.ts +136 -3
- package/src/simple-tree/api/treeNodeApi.ts +1 -1
- package/src/simple-tree/core/allowedTypes.ts +355 -159
- package/src/simple-tree/core/context.ts +2 -2
- package/src/simple-tree/core/index.ts +10 -8
- package/src/simple-tree/core/toStored.ts +7 -5
- package/src/simple-tree/core/treeNode.ts +1 -1
- package/src/simple-tree/core/treeNodeSchema.ts +3 -6
- package/src/simple-tree/core/treeNodeValid.ts +2 -2
- package/src/simple-tree/core/walkSchema.ts +9 -5
- package/src/simple-tree/createContext.ts +3 -3
- package/src/simple-tree/fieldSchema.ts +24 -98
- package/src/simple-tree/index.ts +11 -10
- package/src/simple-tree/node-kinds/array/arrayNode.ts +9 -14
- package/src/simple-tree/node-kinds/array/arrayNodeTypes.ts +7 -8
- package/src/simple-tree/node-kinds/common.ts +5 -3
- package/src/simple-tree/node-kinds/index.ts +0 -2
- package/src/simple-tree/node-kinds/map/mapNode.ts +5 -13
- package/src/simple-tree/node-kinds/map/mapNodeTypes.ts +7 -8
- package/src/simple-tree/node-kinds/object/index.ts +0 -2
- package/src/simple-tree/node-kinds/object/objectNode.ts +13 -51
- package/src/simple-tree/node-kinds/object/objectNodeTypes.ts +5 -19
- package/src/simple-tree/node-kinds/record/recordNode.ts +9 -16
- package/src/simple-tree/node-kinds/record/recordNodeTypes.ts +7 -11
- package/src/simple-tree/prepareForInsertion.ts +5 -5
- package/src/simple-tree/toStoredSchema.ts +8 -9
- package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +2 -6
- package/src/simple-tree/unsafeUnknownSchema.ts +2 -3
- package/src/simple-tree/walkFieldSchema.ts +1 -1
- package/src/tableSchema.ts +24 -37
|
@@ -43,6 +43,11 @@ export interface CommitMetadata {
|
|
|
43
43
|
readonly kind: CommitKind;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
// @beta
|
|
47
|
+
export type ConciseTree<THandle = IFluidHandle> = Exclude<TreeLeafValue, IFluidHandle> | THandle | ConciseTree<THandle>[] | {
|
|
48
|
+
[key: string]: ConciseTree<THandle>;
|
|
49
|
+
};
|
|
50
|
+
|
|
46
51
|
// @beta
|
|
47
52
|
export function configuredSharedTreeBeta(options: SharedTreeOptionsBeta): SharedObjectKind<ITree>;
|
|
48
53
|
|
|
@@ -162,8 +167,10 @@ export type InsertableTreeFieldFromImplicitField<TSchemaInput extends ImplicitFi
|
|
|
162
167
|
|
|
163
168
|
// @public @system
|
|
164
169
|
export type InsertableTreeNodeFromAllowedTypes<TList extends AllowedTypes> = IsUnion<TList> extends true ? never : {
|
|
165
|
-
readonly [Property in keyof TList]: TList[Property] extends
|
|
166
|
-
|
|
170
|
+
readonly [Property in keyof TList]: [TList[Property]] extends [
|
|
171
|
+
LazyItem<infer TSchema extends TreeNodeSchema>
|
|
172
|
+
] ? InsertableTypedNode<TSchema> : never;
|
|
173
|
+
}[NumberKeys<TList>];
|
|
167
174
|
|
|
168
175
|
// @public
|
|
169
176
|
export type InsertableTreeNodeFromImplicitAllowedTypes<TSchema extends ImplicitAllowedTypes> = [
|
|
@@ -222,6 +229,13 @@ export interface ITreeViewConfiguration<TSchema extends ImplicitFieldSchema = Im
|
|
|
222
229
|
readonly schema: TSchema;
|
|
223
230
|
}
|
|
224
231
|
|
|
232
|
+
// @beta @input
|
|
233
|
+
export enum KeyEncodingOptions {
|
|
234
|
+
allStoredKeys = "allStoredKeys",
|
|
235
|
+
knownStoredKeys = "knownStoredKeys",
|
|
236
|
+
usePropertyKeys = "usePropertyKeys"
|
|
237
|
+
}
|
|
238
|
+
|
|
225
239
|
// @public
|
|
226
240
|
export type LazyItem<Item = unknown> = Item | (() => Item);
|
|
227
241
|
|
|
@@ -281,11 +295,21 @@ export interface NodeSchemaOptions<out TCustomMetadata = unknown> {
|
|
|
281
295
|
readonly metadata?: NodeSchemaMetadata<TCustomMetadata> | undefined;
|
|
282
296
|
}
|
|
283
297
|
|
|
298
|
+
// @public @system
|
|
299
|
+
export type NumberKeys<T, Transformed = {
|
|
300
|
+
readonly [Property in keyof T as number extends Property ? never : Property]: Property;
|
|
301
|
+
}> = Transformed[`${number}` & keyof Transformed];
|
|
302
|
+
|
|
284
303
|
// @public @system
|
|
285
304
|
export type ObjectFromSchemaRecord<T extends RestrictiveStringRecord<ImplicitFieldSchema>> = RestrictiveStringRecord<ImplicitFieldSchema> extends T ? {} : {
|
|
286
305
|
-readonly [Property in keyof T]: Property extends string ? TreeFieldFromImplicitField<T[Property]> : unknown;
|
|
287
306
|
};
|
|
288
307
|
|
|
308
|
+
// @beta @input
|
|
309
|
+
export interface ObjectSchemaOptions<TCustomMetadata = unknown> extends NodeSchemaOptions<TCustomMetadata> {
|
|
310
|
+
readonly allowUnknownOptionalFields?: boolean;
|
|
311
|
+
}
|
|
312
|
+
|
|
289
313
|
// @public @deprecated
|
|
290
314
|
export type Off = Off_2;
|
|
291
315
|
|
|
@@ -387,6 +411,9 @@ export const SchemaFactory_base: SchemaStatics & (new () => SchemaStatics);
|
|
|
387
411
|
|
|
388
412
|
// @beta
|
|
389
413
|
export class SchemaFactoryBeta<out TScope extends string | undefined = string | undefined, TName extends number | string = string> extends SchemaFactory<TScope, TName> {
|
|
414
|
+
object<const Name extends TName, const T extends RestrictiveStringRecord<ImplicitFieldSchema>, const TCustomMetadata = unknown>(name: Name, fields: T, options?: ObjectSchemaOptions<TCustomMetadata>): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNode<T, ScopedSchemaName<TScope, Name>>, object & InsertableObjectFromSchemaRecord<T>, true, T>;
|
|
415
|
+
// (undocumented)
|
|
416
|
+
objectRecursive<const Name extends TName, const T extends RestrictiveStringRecord<System_Unsafe.ImplicitFieldSchemaUnsafe>, const TCustomMetadata = unknown>(name: Name, t: T, options?: ObjectSchemaOptions<TCustomMetadata>): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, System_Unsafe.TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>, object & System_Unsafe.InsertableObjectFromSchemaRecordUnsafe<T>, false, T>;
|
|
390
417
|
record<const T extends TreeNodeSchema | readonly TreeNodeSchema[]>(allowedTypes: T): TreeNodeSchemaNonClass<ScopedSchemaName<TScope, `Record<${string}>`>, NodeKind.Record, TreeRecordNode<T> & WithType<ScopedSchemaName<TScope, `Record<${string}>`>, NodeKind.Record>, RecordNodeInsertableData<T>, true, T, undefined>;
|
|
391
418
|
record<const Name extends TName, const T extends ImplicitAllowedTypes>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Record, TreeRecordNode<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Record>, RecordNodeInsertableData<T>, true, T, undefined>;
|
|
392
419
|
recordRecursive<Name extends TName, const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptions<TCustomMetadata>): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Record, TreeRecordNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Record, unknown>, {
|
|
@@ -567,6 +594,9 @@ export const TreeArrayNode: {
|
|
|
567
594
|
export interface TreeBeta {
|
|
568
595
|
clone<const TSchema extends ImplicitFieldSchema>(node: TreeFieldFromImplicitField<TSchema>): TreeFieldFromImplicitField<TSchema>;
|
|
569
596
|
create<const TSchema extends ImplicitFieldSchema>(schema: TSchema, data: InsertableTreeFieldFromImplicitField<TSchema>): Unhydrated<TreeFieldFromImplicitField<TSchema>>;
|
|
597
|
+
exportConcise(node: TreeNode | TreeLeafValue, options?: TreeEncodingOptions): ConciseTree;
|
|
598
|
+
exportConcise(node: TreeNode | TreeLeafValue | undefined, options?: TreeEncodingOptions): ConciseTree | undefined;
|
|
599
|
+
importConcise<const TSchema extends ImplicitFieldSchema>(schema: TSchema, data: ConciseTree | undefined): Unhydrated<TreeFieldFromImplicitField<TSchema>>;
|
|
570
600
|
on<K extends keyof TreeChangeEventsBeta<TNode>, TNode extends TreeNode>(node: TNode, eventName: K, listener: NoInfer<TreeChangeEventsBeta<TNode>[K]>): () => void;
|
|
571
601
|
}
|
|
572
602
|
|
|
@@ -584,6 +614,11 @@ export interface TreeChangeEventsBeta<TNode extends TreeNode = TreeNode> extends
|
|
|
584
614
|
nodeChanged: (data: NodeChangedData<TNode> & (TNode extends WithType<string, NodeKind.Map | NodeKind.Object | NodeKind.Record> ? Required<Pick<NodeChangedData<TNode>, "changedProperties">> : unknown)) => void;
|
|
585
615
|
}
|
|
586
616
|
|
|
617
|
+
// @beta @input
|
|
618
|
+
export interface TreeEncodingOptions<TKeyOptions = KeyEncodingOptions> {
|
|
619
|
+
readonly keys?: TKeyOptions;
|
|
620
|
+
}
|
|
621
|
+
|
|
587
622
|
// @public
|
|
588
623
|
export type TreeFieldFromImplicitField<TSchema extends ImplicitFieldSchema = FieldSchema> = TSchema extends FieldSchema<infer Kind, infer Types> ? ApplyKind<TreeNodeFromImplicitAllowedTypes<Types>, Kind> : TSchema extends ImplicitAllowedTypes ? TreeNodeFromImplicitAllowedTypes<TSchema> : TreeNode | TreeLeafValue | undefined;
|
|
589
624
|
|
|
@@ -116,8 +116,10 @@ export type InsertableTreeFieldFromImplicitField<TSchemaInput extends ImplicitFi
|
|
|
116
116
|
|
|
117
117
|
// @public @system
|
|
118
118
|
export type InsertableTreeNodeFromAllowedTypes<TList extends AllowedTypes> = IsUnion<TList> extends true ? never : {
|
|
119
|
-
readonly [Property in keyof TList]: TList[Property] extends
|
|
120
|
-
|
|
119
|
+
readonly [Property in keyof TList]: [TList[Property]] extends [
|
|
120
|
+
LazyItem<infer TSchema extends TreeNodeSchema>
|
|
121
|
+
] ? InsertableTypedNode<TSchema> : never;
|
|
122
|
+
}[NumberKeys<TList>];
|
|
121
123
|
|
|
122
124
|
// @public
|
|
123
125
|
export type InsertableTreeNodeFromImplicitAllowedTypes<TSchema extends ImplicitAllowedTypes> = [
|
|
@@ -230,6 +232,11 @@ export interface NodeSchemaOptions<out TCustomMetadata = unknown> {
|
|
|
230
232
|
readonly metadata?: NodeSchemaMetadata<TCustomMetadata> | undefined;
|
|
231
233
|
}
|
|
232
234
|
|
|
235
|
+
// @public @system
|
|
236
|
+
export type NumberKeys<T, Transformed = {
|
|
237
|
+
readonly [Property in keyof T as number extends Property ? never : Property]: Property;
|
|
238
|
+
}> = Transformed[`${number}` & keyof Transformed];
|
|
239
|
+
|
|
233
240
|
// @public @system
|
|
234
241
|
export type ObjectFromSchemaRecord<T extends RestrictiveStringRecord<ImplicitFieldSchema>> = RestrictiveStringRecord<ImplicitFieldSchema> extends T ? {} : {
|
|
235
242
|
-readonly [Property in keyof T]: Property extends string ? TreeFieldFromImplicitField<T[Property]> : unknown;
|
|
@@ -116,8 +116,10 @@ export type InsertableTreeFieldFromImplicitField<TSchemaInput extends ImplicitFi
|
|
|
116
116
|
|
|
117
117
|
// @public @system
|
|
118
118
|
export type InsertableTreeNodeFromAllowedTypes<TList extends AllowedTypes> = IsUnion<TList> extends true ? never : {
|
|
119
|
-
readonly [Property in keyof TList]: TList[Property] extends
|
|
120
|
-
|
|
119
|
+
readonly [Property in keyof TList]: [TList[Property]] extends [
|
|
120
|
+
LazyItem<infer TSchema extends TreeNodeSchema>
|
|
121
|
+
] ? InsertableTypedNode<TSchema> : never;
|
|
122
|
+
}[NumberKeys<TList>];
|
|
121
123
|
|
|
122
124
|
// @public
|
|
123
125
|
export type InsertableTreeNodeFromImplicitAllowedTypes<TSchema extends ImplicitAllowedTypes> = [
|
|
@@ -230,6 +232,11 @@ export interface NodeSchemaOptions<out TCustomMetadata = unknown> {
|
|
|
230
232
|
readonly metadata?: NodeSchemaMetadata<TCustomMetadata> | undefined;
|
|
231
233
|
}
|
|
232
234
|
|
|
235
|
+
// @public @system
|
|
236
|
+
export type NumberKeys<T, Transformed = {
|
|
237
|
+
readonly [Property in keyof T as number extends Property ? never : Property]: Property;
|
|
238
|
+
}> = Transformed[`${number}` & keyof Transformed];
|
|
239
|
+
|
|
233
240
|
// @public @system
|
|
234
241
|
export type ObjectFromSchemaRecord<T extends RestrictiveStringRecord<ImplicitFieldSchema>> = RestrictiveStringRecord<ImplicitFieldSchema> extends T ? {} : {
|
|
235
242
|
-readonly [Property in keyof T]: Property extends string ? TreeFieldFromImplicitField<T[Property]> : unknown;
|
package/dist/alpha.d.ts
CHANGED
|
@@ -46,6 +46,7 @@ export {
|
|
|
46
46
|
NodeKind,
|
|
47
47
|
NodeSchemaMetadata,
|
|
48
48
|
NodeSchemaOptions,
|
|
49
|
+
NumberKeys,
|
|
49
50
|
ObjectFromSchemaRecord,
|
|
50
51
|
Off,
|
|
51
52
|
ReadonlyArrayNode,
|
|
@@ -92,18 +93,22 @@ export {
|
|
|
92
93
|
// #endregion
|
|
93
94
|
|
|
94
95
|
// #region @beta APIs
|
|
96
|
+
ConciseTree,
|
|
95
97
|
ForestOptions,
|
|
96
98
|
ForestType,
|
|
97
99
|
ForestTypeExpensiveDebug,
|
|
98
100
|
ForestTypeOptimized,
|
|
99
101
|
ForestTypeReference,
|
|
102
|
+
KeyEncodingOptions,
|
|
100
103
|
NodeChangedData,
|
|
104
|
+
ObjectSchemaOptions,
|
|
101
105
|
PopUnion,
|
|
102
106
|
RecordNodeInsertableData,
|
|
103
107
|
SchemaFactoryBeta,
|
|
104
108
|
SharedTreeOptionsBeta,
|
|
105
109
|
TreeBeta,
|
|
106
110
|
TreeChangeEventsBeta,
|
|
111
|
+
TreeEncodingOptions,
|
|
107
112
|
TreeRecordNode,
|
|
108
113
|
TreeRecordNodeUnsafe,
|
|
109
114
|
UnionToTuple,
|
|
@@ -115,7 +120,11 @@ export {
|
|
|
115
120
|
|
|
116
121
|
// #region @alpha APIs
|
|
117
122
|
AllowedTypeMetadata,
|
|
123
|
+
AllowedTypesFull,
|
|
124
|
+
AllowedTypesFullEvaluated,
|
|
125
|
+
AllowedTypesFullFromMixed,
|
|
118
126
|
AllowedTypesMetadata,
|
|
127
|
+
AnnotateAllowedTypesList,
|
|
119
128
|
AnnotatedAllowedType,
|
|
120
129
|
AnnotatedAllowedTypes,
|
|
121
130
|
ArrayNodeCustomizableSchema,
|
|
@@ -124,7 +133,6 @@ export {
|
|
|
124
133
|
ArrayNodeSchema,
|
|
125
134
|
BranchableTree,
|
|
126
135
|
CodecWriteOptions,
|
|
127
|
-
ConciseTree,
|
|
128
136
|
DirtyTreeMap,
|
|
129
137
|
DirtyTreeStatus,
|
|
130
138
|
FactoryContent,
|
|
@@ -142,12 +150,9 @@ export {
|
|
|
142
150
|
ICodecOptions,
|
|
143
151
|
ITreeAlpha,
|
|
144
152
|
IdentifierIndex,
|
|
145
|
-
ImplicitAnnotatedAllowedTypes,
|
|
146
|
-
ImplicitAnnotatedFieldSchema,
|
|
147
153
|
Insertable,
|
|
148
154
|
InsertableContent,
|
|
149
155
|
InsertableField,
|
|
150
|
-
InsertableObjectFromAnnotatedSchemaRecord,
|
|
151
156
|
JsonArrayNodeSchema,
|
|
152
157
|
JsonAsTree,
|
|
153
158
|
JsonCompatible,
|
|
@@ -168,14 +173,13 @@ export {
|
|
|
168
173
|
JsonSchemaType,
|
|
169
174
|
JsonStringKeyPatternProperties,
|
|
170
175
|
JsonTreeSchema,
|
|
171
|
-
KeyEncodingOptions,
|
|
172
176
|
MapNodeCustomizableSchema,
|
|
173
177
|
MapNodeCustomizableSchemaUnsafe,
|
|
174
178
|
MapNodePojoEmulationSchema,
|
|
175
179
|
MapNodeSchema,
|
|
176
180
|
NodeSchemaOptionsAlpha,
|
|
177
|
-
NormalizedAnnotatedAllowedTypes,
|
|
178
181
|
ObjectNodeSchema,
|
|
182
|
+
ObjectSchemaOptionsAlpha,
|
|
179
183
|
ObservationResults,
|
|
180
184
|
ReadSchema,
|
|
181
185
|
ReadableField,
|
|
@@ -186,7 +190,6 @@ export {
|
|
|
186
190
|
RevertibleAlphaFactory,
|
|
187
191
|
RunTransactionParams,
|
|
188
192
|
SchemaFactoryAlpha,
|
|
189
|
-
SchemaFactoryObjectOptions,
|
|
190
193
|
SchemaStaticsAlpha,
|
|
191
194
|
SchemaUpgrade,
|
|
192
195
|
SharedTreeFormatOptions,
|
|
@@ -215,7 +218,6 @@ export {
|
|
|
215
218
|
TreeBranchEvents,
|
|
216
219
|
TreeBranchFork,
|
|
217
220
|
TreeCompressionStrategy,
|
|
218
|
-
TreeEncodingOptions,
|
|
219
221
|
TreeIdentifierUtils,
|
|
220
222
|
TreeIndex,
|
|
221
223
|
TreeIndexKey,
|
|
@@ -225,12 +227,7 @@ export {
|
|
|
225
227
|
TreeSchemaEncodingOptions,
|
|
226
228
|
TreeViewAlpha,
|
|
227
229
|
TreeViewConfigurationAlpha,
|
|
228
|
-
UnannotateAllowedType,
|
|
229
|
-
UnannotateAllowedTypes,
|
|
230
230
|
UnannotateAllowedTypesList,
|
|
231
|
-
UnannotateImplicitAllowedTypes,
|
|
232
|
-
UnannotateImplicitFieldSchema,
|
|
233
|
-
UnannotateSchemaRecord,
|
|
234
231
|
UnsafeUnknownSchema,
|
|
235
232
|
ValueSchema,
|
|
236
233
|
VerboseTree,
|
|
@@ -252,6 +249,7 @@ export {
|
|
|
252
249
|
getSimpleSchema,
|
|
253
250
|
independentInitializedView,
|
|
254
251
|
independentView,
|
|
252
|
+
normalizeAllowedTypes,
|
|
255
253
|
persistedToSimpleSchema,
|
|
256
254
|
replaceConciseTreeHandles,
|
|
257
255
|
replaceHandles,
|
package/dist/beta.d.ts
CHANGED
|
@@ -46,6 +46,7 @@ export {
|
|
|
46
46
|
NodeKind,
|
|
47
47
|
NodeSchemaMetadata,
|
|
48
48
|
NodeSchemaOptions,
|
|
49
|
+
NumberKeys,
|
|
49
50
|
ObjectFromSchemaRecord,
|
|
50
51
|
Off,
|
|
51
52
|
ReadonlyArrayNode,
|
|
@@ -92,18 +93,22 @@ export {
|
|
|
92
93
|
// #endregion
|
|
93
94
|
|
|
94
95
|
// #region @beta APIs
|
|
96
|
+
ConciseTree,
|
|
95
97
|
ForestOptions,
|
|
96
98
|
ForestType,
|
|
97
99
|
ForestTypeExpensiveDebug,
|
|
98
100
|
ForestTypeOptimized,
|
|
99
101
|
ForestTypeReference,
|
|
102
|
+
KeyEncodingOptions,
|
|
100
103
|
NodeChangedData,
|
|
104
|
+
ObjectSchemaOptions,
|
|
101
105
|
PopUnion,
|
|
102
106
|
RecordNodeInsertableData,
|
|
103
107
|
SchemaFactoryBeta,
|
|
104
108
|
SharedTreeOptionsBeta,
|
|
105
109
|
TreeBeta,
|
|
106
110
|
TreeChangeEventsBeta,
|
|
111
|
+
TreeEncodingOptions,
|
|
107
112
|
TreeRecordNode,
|
|
108
113
|
TreeRecordNodeUnsafe,
|
|
109
114
|
UnionToTuple,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treeCursorUtils.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/treeCursorUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAEN,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,MAAM,EACX,KAAK,KAAK,EAGV,MAAM,kBAAkB,CAAC;AAE1B;;GAEG;AACH,MAAM,WAAW,cAAc,CAAC,KAAK,CAAE,SAAQ,sBAAsB;IACpE;;;;OAIG;IACH,OAAO,IAAI,KAAK,CAAC;IAEjB;;;;;;;OAOG;IACH,IAAI,IAAI,cAAc,CAAC,KAAK,CAAC,CAAC;CAC9B;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EACxC,OAAO,EAAE,aAAa,CAAC,KAAK,CAAC,EAC7B,IAAI,EAAE,KAAK,GACT,cAAc,CAAC,KAAK,CAAC,CAEvB;AAED;;;;GAIG;AACH,wBAAgB,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G;AACH,wBAAgB,eAAe,CAC9B,MAAM,EAAE,cAAc,GAAG,SAAS,EAClC,IAAI,EAAE,WAAW,GACf,WAAW,CAeb;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,GAAG,cAAc,CAgB5F;AAgBD;;;;GAIG;AACH,qBAAa,YAAa,YAAW,MAAM;aAIzB,MAAM,EAAE,cAAc;aACtB,IAAI,EAAE,MAAM;IAJ7B,SAAgB,WAAW,EAAE,QAAQ,CAAC;IACtC,SAAgB,WAAW,EAAE,MAAM,CAAC;gBAEnB,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,MAAM;IAU7B,IAAW,MAAM,IAAI,MAAM,GAAG,SAAS,CAEtC;CACD"}
|
|
@@ -82,13 +82,13 @@ class StackCursor extends SynchronousCursor {
|
|
|
82
82
|
this.chunkLength = 1;
|
|
83
83
|
}
|
|
84
84
|
getFieldKey() {
|
|
85
|
-
(0, internal_1.debugAssert)(() => this.mode === 1 /* CursorLocationType.Fields */
|
|
85
|
+
(0, internal_1.debugAssert)(() => this.mode === 1 /* CursorLocationType.Fields */ || "must be in fields mode");
|
|
86
86
|
// index is kept inbounds as an invariant of the class.
|
|
87
87
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
88
88
|
return this.siblings[this.index];
|
|
89
89
|
}
|
|
90
90
|
getStackedFieldKey(height) {
|
|
91
|
-
(0, internal_1.
|
|
91
|
+
(0, internal_1.debugAssert)(() => height % 2 === 1 || "expected odd height when in field");
|
|
92
92
|
const siblingStack = this.siblingStack[height] ?? (0, internal_1.oob)();
|
|
93
93
|
const indexStack = this.indexStack[height] ?? (0, internal_1.oob)();
|
|
94
94
|
// index is kept inbounds as an invariant of the class.
|
|
@@ -96,7 +96,7 @@ class StackCursor extends SynchronousCursor {
|
|
|
96
96
|
return siblingStack[indexStack];
|
|
97
97
|
}
|
|
98
98
|
getStackedNodeIndex(height) {
|
|
99
|
-
|
|
99
|
+
(0, internal_1.debugAssert)(() => height % 2 === 0 || "must be node height");
|
|
100
100
|
return this.indexStack[height] ?? (0, internal_1.oob)();
|
|
101
101
|
}
|
|
102
102
|
getStackedNode(height) {
|
|
@@ -107,11 +107,11 @@ class StackCursor extends SynchronousCursor {
|
|
|
107
107
|
return this.siblingStack[height][index];
|
|
108
108
|
}
|
|
109
109
|
getFieldLength() {
|
|
110
|
-
|
|
110
|
+
(0, internal_1.debugAssert)(() => this.mode === 1 /* CursorLocationType.Fields */ || "must be in fields mode");
|
|
111
111
|
return this.getField().length;
|
|
112
112
|
}
|
|
113
113
|
enterNode(index) {
|
|
114
|
-
|
|
114
|
+
(0, internal_1.debugAssert)(() => this.mode === 1 /* CursorLocationType.Fields */ || "must be in fields mode");
|
|
115
115
|
const siblings = this.getField();
|
|
116
116
|
if (!(index in siblings)) {
|
|
117
117
|
throw new internal_2.UsageError(`A child does not exist at index '${index}' in field containing ${siblings.length} nodes.`);
|
|
@@ -174,7 +174,7 @@ class StackCursor extends SynchronousCursor {
|
|
|
174
174
|
return new StackCursor(this.adapter, [...this.siblingStack], [...this.indexStack], this.siblings, this.index);
|
|
175
175
|
}
|
|
176
176
|
enterField(key) {
|
|
177
|
-
|
|
177
|
+
(0, internal_1.debugAssert)(() => this.mode === 0 /* CursorLocationType.Nodes */ || "must be in nodes mode");
|
|
178
178
|
this.siblingStack.push(this.siblings);
|
|
179
179
|
this.indexStack.push(this.index);
|
|
180
180
|
// For fields, siblings are only used for key lookup and
|
|
@@ -199,7 +199,7 @@ class StackCursor extends SynchronousCursor {
|
|
|
199
199
|
return true;
|
|
200
200
|
}
|
|
201
201
|
firstField() {
|
|
202
|
-
|
|
202
|
+
(0, internal_1.debugAssert)(() => this.mode === 0 /* CursorLocationType.Nodes */ || "must be in nodes mode");
|
|
203
203
|
const fields = this.adapter.keysFromNode(this.getNode());
|
|
204
204
|
if (fields.length === 0) {
|
|
205
205
|
return false;
|
|
@@ -211,7 +211,7 @@ class StackCursor extends SynchronousCursor {
|
|
|
211
211
|
return true;
|
|
212
212
|
}
|
|
213
213
|
seekNodes(offset) {
|
|
214
|
-
|
|
214
|
+
(0, internal_1.debugAssert)(() => this.mode === 0 /* CursorLocationType.Nodes */ || "can only seekNodes when in Nodes");
|
|
215
215
|
this.index += offset;
|
|
216
216
|
if (this.index in this.siblings) {
|
|
217
217
|
return true;
|
|
@@ -220,7 +220,7 @@ class StackCursor extends SynchronousCursor {
|
|
|
220
220
|
return false;
|
|
221
221
|
}
|
|
222
222
|
firstNode() {
|
|
223
|
-
|
|
223
|
+
(0, internal_1.debugAssert)(() => this.mode === 1 /* CursorLocationType.Fields */ || "firstNode only allowed in fields mode");
|
|
224
224
|
const nodes = this.getField();
|
|
225
225
|
if (nodes.length === 0) {
|
|
226
226
|
return false;
|
|
@@ -232,7 +232,7 @@ class StackCursor extends SynchronousCursor {
|
|
|
232
232
|
return true;
|
|
233
233
|
}
|
|
234
234
|
nextNode() {
|
|
235
|
-
(0, internal_1.
|
|
235
|
+
(0, internal_1.debugAssert)(() => this.mode === 0 /* CursorLocationType.Nodes */ || "can only nextNode when in Nodes");
|
|
236
236
|
this.index++;
|
|
237
237
|
if (this.index < this.siblings.length) {
|
|
238
238
|
return true;
|
|
@@ -241,26 +241,28 @@ class StackCursor extends SynchronousCursor {
|
|
|
241
241
|
return false;
|
|
242
242
|
}
|
|
243
243
|
exitField() {
|
|
244
|
-
|
|
244
|
+
(0, internal_1.debugAssert)(() => this.mode === 1 /* CursorLocationType.Fields */ ||
|
|
245
|
+
"can only navigate up from field when in field");
|
|
245
246
|
this.siblings =
|
|
246
247
|
this.siblingStack.pop() ?? (0, internal_1.fail)(0xac3 /* Unexpected siblingStack.length */);
|
|
247
248
|
this.index = this.indexStack.pop() ?? (0, internal_1.fail)(0xac4 /* Unexpected indexStack.length */);
|
|
248
249
|
}
|
|
249
250
|
exitNode() {
|
|
250
|
-
|
|
251
|
+
(0, internal_1.debugAssert)(() => this.mode === 0 /* CursorLocationType.Nodes */ ||
|
|
252
|
+
"can only navigate up from node when in node");
|
|
251
253
|
this.siblings =
|
|
252
254
|
this.siblingStack.pop() ?? (0, internal_1.fail)(0xac5 /* Unexpected siblingStack.length */);
|
|
253
255
|
this.index = this.indexStack.pop() ?? (0, internal_1.fail)(0xac6 /* Unexpected indexStack.length */);
|
|
254
256
|
}
|
|
255
257
|
getNode() {
|
|
256
|
-
|
|
258
|
+
(0, internal_1.debugAssert)(() => this.mode === 0 /* CursorLocationType.Nodes */ || "can only get node when in node");
|
|
257
259
|
// Can not use `?? oob()` since null and undefined are valid values.
|
|
258
260
|
// index is kept inbounds as an invariant of the class.
|
|
259
261
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
260
262
|
return this.siblings[this.index];
|
|
261
263
|
}
|
|
262
264
|
getField() {
|
|
263
|
-
|
|
265
|
+
(0, internal_1.debugAssert)(() => this.mode === 1 /* CursorLocationType.Fields */ || "can only get field when in fields");
|
|
264
266
|
const parent = this.getStackedNode(this.indexStack.length - 1);
|
|
265
267
|
const key = this.getFieldKey();
|
|
266
268
|
const field = this.adapter.getFieldFromNode(parent, key);
|
|
@@ -279,7 +281,7 @@ class StackCursor extends SynchronousCursor {
|
|
|
279
281
|
return this.adapter.type(this.getNode());
|
|
280
282
|
}
|
|
281
283
|
get fieldIndex() {
|
|
282
|
-
|
|
284
|
+
(0, internal_1.debugAssert)(() => this.mode === 0 /* CursorLocationType.Nodes */ || "can only node's index when in node");
|
|
283
285
|
return this.index;
|
|
284
286
|
}
|
|
285
287
|
get chunkStart() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treeCursorUtils.js","sourceRoot":"","sources":["../../src/feature-libraries/treeCursorUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,kEAAqF;AACrF,uEAAsE;AAEtE,+CAa0B;AAwB1B;;;;GAIG;AACH,SAAgB,mBAAmB,CAClC,OAA6B,EAC7B,IAAW;IAEX,OAAO,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ACP,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;YACpC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QACrC,CAAC;IACF,CAAC;IACD,IAAW,MAAM;QAChB,OAAO,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACnD,CAAC;CACD;AAlBD,oCAkBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, oob, debugAssert, fail } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\tCursorLocationType,\n\tCursorMarker,\n\ttype DetachedField,\n\ttype FieldKey,\n\ttype FieldUpPath,\n\ttype ITreeCursorSynchronous,\n\ttype PathRootPrefix,\n\ttype TreeType,\n\ttype UpPath,\n\ttype Value,\n\tdetachedFieldAsKey,\n\trootField,\n} from \"../core/index.js\";\n\n/**\n * {@link ITreeCursorSynchronous} that can return the underlying node objects.\n */\nexport interface CursorWithNode<TNode> extends ITreeCursorSynchronous {\n\t/**\n\t * Gets the underlying object for the current node.\n\t *\n\t * Only valid when `mode` is `Nodes`.\n\t */\n\tgetNode(): TNode;\n\n\t/**\n\t * Create a copy of this cursor which navigates independently,\n\t * and is initially located at the same place as this one.\n\t *\n\t * Depending on the cursor implementation this may be significantly faster\n\t * than other ways to copy the cursor\n\t * (such as creating a new one and walking the path from this one).\n\t */\n\tfork(): CursorWithNode<TNode>;\n}\n\n/**\n * Create a cursor, in `nodes` mode at the root of the provided tree.\n *\n * @returns an {@link ITreeCursorSynchronous} for a single root in `nodes` mode.\n */\nexport function stackTreeNodeCursor<TNode>(\n\tadapter: CursorAdapter<TNode>,\n\troot: TNode,\n): CursorWithNode<TNode> {\n\treturn new StackCursor(adapter, [], [], [root], 0);\n}\n\n/**\n * Create a cursor, in `fields` mode at the `detachedField` under the provided `root`.\n *\n * @returns an {@link ITreeCursorSynchronous} for `detachedField` of `root` in `fields` mode.\n */\nexport function stackTreeFieldCursor<TNode>(\n\tadapter: CursorAdapter<TNode>,\n\troot: TNode,\n\tdetachedField: DetachedField = rootField,\n): CursorWithNode<TNode> {\n\tconst cursor = stackTreeNodeCursor(adapter, root);\n\t// Because the root node in `stackTreeNodeCursor` is treated as the above detached fields node,\n\t// using it then just entering the correct field doesn't mess up the paths reported by the cursor.\n\tcursor.enterField(detachedFieldAsKey(detachedField));\n\treturn cursor;\n}\n\n/**\n * The representation of a field used by {@link CursorAdapter}.\n */\nexport type Field<TNode> = Pick<readonly TNode[], typeof Symbol.iterator | \"length\" | number>;\n\n/**\n * Provides functionality to allow a {@link stackTreeNodeCursor} and {@link stackTreeFieldCursor} to implement cursors.\n */\nexport interface CursorAdapter<TNode> {\n\t/**\n\t * @returns the value of the given node.\n\t */\n\tvalue(node: TNode): Value;\n\t/**\n\t * @returns the type of the given node.\n\t */\n\ttype(node: TNode): TreeType;\n\t/**\n\t * @returns the keys for non-empty fields on the given node.\n\t */\n\tkeysFromNode(node: TNode): readonly FieldKey[];\n\t/**\n\t * @returns the child nodes for the given node and key.\n\t */\n\tgetFieldFromNode(node: TNode, key: FieldKey): Field<TNode>;\n}\n\ntype SiblingsOrKey<TNode> = Field<TNode> | readonly FieldKey[];\n\n/**\n * A class that satisfies part of the ITreeCursorSynchronous implementation.\n */\nexport abstract class SynchronousCursor {\n\tpublic readonly [CursorMarker] = true;\n\tpublic readonly pending = false;\n\n\tpublic skipPendingFields(): boolean {\n\t\treturn true;\n\t}\n}\n\n/**\n * A simple general purpose ITreeCursorSynchronous implementation.\n *\n * As this is a generic implementation, it's ability to optimize is limited.\n *\n * @privateRemarks\n * Note that TNode can be `null` (and we should support `undefined` as well),\n * so be careful using types like `TNode | undefined` and expressions like `TNode ??`.\n *\n * TODO:\n * 1. Unit tests for this.\n * 2. Support for cursors which are field cursors at the root.\n */\nclass StackCursor<TNode> extends SynchronousCursor implements CursorWithNode<TNode> {\n\tpublic override readonly [CursorMarker] = true;\n\t/**\n\t * Might start at special root where fields are detached sequences.\n\t *\n\t * @param adapter - policy logic.\n\t * @param siblingStack - Stack of collections of siblings along the path through the tree:\n\t * does not include current level (which is stored in `siblings`).\n\t * Even levels in the stack (starting from 0) are sequences of nodes and odd levels\n\t * are for fields keys on a node.\n\t * @param indexStack - Stack of indices into the corresponding levels in `siblingStack`.\n\t * @param siblings - Siblings at the current level (not included in `siblingStack`).\n\t * @param index - Index into `siblings`.\n\t */\n\tpublic constructor(\n\t\tprivate readonly adapter: CursorAdapter<TNode>,\n\t\tprivate readonly siblingStack: SiblingsOrKey<TNode>[],\n\t\tprivate readonly indexStack: number[],\n\t\tprivate siblings: SiblingsOrKey<TNode>,\n\t\tprivate index: number,\n\t) {\n\t\tsuper();\n\t}\n\n\tpublic getFieldKey(): FieldKey {\n\t\tdebugAssert(() =>\n\t\t\tthis.mode === CursorLocationType.Fields ? true : \"must be in fields mode\",\n\t\t);\n\t\t// index is kept inbounds as an invariant of the class.\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\treturn (this.siblings as readonly FieldKey[])[this.index]!;\n\t}\n\n\tprivate getStackedFieldKey(height: number): FieldKey {\n\t\tassert(height % 2 === 1, 0x3b8 /* must field height */);\n\t\tconst siblingStack = this.siblingStack[height] ?? oob();\n\t\tconst indexStack = this.indexStack[height] ?? oob();\n\t\t// index is kept inbounds as an invariant of the class.\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\treturn (siblingStack as readonly FieldKey[])[indexStack]!;\n\t}\n\n\tprivate getStackedNodeIndex(height: number): number {\n\t\t// assert(height % 2 === 0, \"must be node height\");\n\t\treturn this.indexStack[height] ?? oob();\n\t}\n\n\tprivate getStackedNode(height: number): TNode {\n\t\tconst index = this.getStackedNodeIndex(height);\n\t\t// Can not use `?? oob()` since null and undefined are valid values.\n\t\t// index is kept inbounds as an invariant of the class.\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\treturn (this.siblingStack[height] as Field<TNode>)[index]!;\n\t}\n\n\tpublic getFieldLength(): number {\n\t\t// assert(this.mode === CursorLocationType.Fields, \"must be in fields mode\");\n\t\treturn this.getField().length;\n\t}\n\n\tpublic enterNode(index: number): void {\n\t\t// assert(this.mode === CursorLocationType.Fields, \"must be in fields mode\");\n\t\tconst siblings = this.getField();\n\t\tif (!(index in siblings)) {\n\t\t\tthrow new UsageError(\n\t\t\t\t`A child does not exist at index '${index}' in field containing ${siblings.length} nodes.`,\n\t\t\t);\n\t\t}\n\t\tthis.siblingStack.push(this.siblings);\n\t\tthis.indexStack.push(this.index);\n\t\tthis.index = index;\n\t\tthis.siblings = siblings;\n\t}\n\n\tpublic getPath(prefix?: PathRootPrefix): UpPath | undefined {\n\t\tassert(this.mode === CursorLocationType.Nodes, 0x3b9 /* must be in nodes mode */);\n\t\treturn this.getOffsetPath(0, prefix);\n\t}\n\n\tpublic getFieldPath(prefix?: PathRootPrefix): FieldUpPath {\n\t\tassert(this.mode === CursorLocationType.Fields, 0x449 /* must be in fields mode */);\n\t\treturn {\n\t\t\tfield:\n\t\t\t\tthis.indexStack.length === 1\n\t\t\t\t\t? (prefix?.rootFieldOverride ?? this.getFieldKey())\n\t\t\t\t\t: this.getFieldKey(),\n\t\t\tparent: this.getOffsetPath(1, prefix),\n\t\t};\n\t}\n\n\tprivate getOffsetPath(\n\t\toffset: number,\n\t\tprefix: PathRootPrefix | undefined,\n\t): UpPath | undefined {\n\t\t// It is more efficient to handle prefix directly in here rather than delegating to PrefixedPath.\n\n\t\tconst length = this.indexStack.length - offset;\n\t\tif (length === 0) {\n\t\t\treturn prefix?.parent; // At root\n\t\t}\n\n\t\tassert(length > 0, 0x44a /* invalid offset to above root */);\n\t\tassert(length % 2 === 0, 0x44b /* offset path must point to node not field */);\n\n\t\tconst getIndex = (height: number): number => {\n\t\t\tlet parentIndex: number =\n\t\t\t\theight === this.indexStack.length ? this.index : this.getStackedNodeIndex(height);\n\t\t\tif (prefix !== undefined && height === 2) {\n\t\t\t\tparentIndex += prefix.indexOffset ?? 0;\n\t\t\t}\n\t\t\treturn parentIndex;\n\t\t};\n\n\t\t// Perf Note:\n\t\t// This is O(depth) in tree.\n\t\t// If many different anchors are created, this could be optimized to amortize the costs.\n\t\t// For example, the cursor could cache UpPaths from the anchorSet when creating an anchor,\n\t\t// then reuse them as a starting point when making another.\n\t\t// Could cache this at one depth, and remember the depth.\n\t\t// When navigating up, adjust cached anchor if present.\n\n\t\tlet path: UpPath | undefined = prefix?.parent;\n\t\t// Skip top level, since root node in path is \"undefined\" and does not have a parent or index.\n\t\tfor (let height = 2; height <= length; height += 2) {\n\t\t\tconst fieldOverride = height === 2 ? prefix?.rootFieldOverride : undefined;\n\t\t\tpath = {\n\t\t\t\tparent: path,\n\t\t\t\tparentIndex: getIndex(height),\n\t\t\t\tparentField: fieldOverride ?? this.getStackedFieldKey(height - 1),\n\t\t\t};\n\t\t}\n\n\t\treturn path;\n\t}\n\n\tpublic fork(): StackCursor<TNode> {\n\t\t// Siblings arrays are not modified during navigation and do not need be be copied.\n\t\t// This allows this copy to be shallow, and `this.siblings` below to not be copied as all.\n\t\treturn new StackCursor<TNode>(\n\t\t\tthis.adapter,\n\t\t\t[...this.siblingStack],\n\t\t\t[...this.indexStack],\n\t\t\tthis.siblings,\n\t\t\tthis.index,\n\t\t);\n\t}\n\n\tpublic enterField(key: FieldKey): void {\n\t\t// assert(this.mode === CursorLocationType.Nodes, \"must be in nodes mode\");\n\t\tthis.siblingStack.push(this.siblings);\n\t\tthis.indexStack.push(this.index);\n\n\t\t// For fields, siblings are only used for key lookup and\n\t\t// nextField and which has arbitrary iteration order,\n\t\t// so making a array of just key here works.\n\t\t// This adds an allocation, so it's optimizing code simplicity and for the other use case (enumeration)\n\t\t// at the cost of an allocation here.\n\t\tthis.index = 0;\n\t\tthis.siblings = [key];\n\t}\n\n\tpublic get mode(): CursorLocationType {\n\t\treturn this.siblingStack.length % 2 === 0\n\t\t\t? CursorLocationType.Nodes\n\t\t\t: CursorLocationType.Fields;\n\t}\n\n\tpublic nextField(): boolean {\n\t\tthis.index += 1;\n\t\tif (this.index === (this.siblings as []).length) {\n\t\t\tthis.exitField();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic firstField(): boolean {\n\t\t// assert(this.mode === CursorLocationType.Nodes, \"must be in nodes mode\");\n\t\tconst fields = this.adapter.keysFromNode(this.getNode());\n\t\tif (fields.length === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.siblingStack.push(this.siblings);\n\t\tthis.indexStack.push(this.index);\n\t\tthis.index = 0;\n\t\tthis.siblings = fields;\n\t\treturn true;\n\t}\n\n\tpublic seekNodes(offset: number): boolean {\n\t\t// assert(this.mode === CursorLocationType.Nodes, \"can only seekNodes when in Nodes\");\n\t\tthis.index += offset;\n\t\tif (this.index in this.siblings) {\n\t\t\treturn true;\n\t\t}\n\t\tthis.exitNode();\n\t\treturn false;\n\t}\n\n\tpublic firstNode(): boolean {\n\t\t// assert(this.mode === CursorLocationType.Fields, \"firstNode only allowed in fields mode\");\n\t\tconst nodes = this.getField();\n\t\tif (nodes.length === 0) {\n\t\t\treturn false;\n\t\t}\n\t\tthis.siblingStack.push(this.siblings);\n\t\tthis.indexStack.push(this.index);\n\t\tthis.index = 0;\n\t\tthis.siblings = nodes;\n\t\treturn true;\n\t}\n\n\tpublic nextNode(): boolean {\n\t\tassert(\n\t\t\tthis.mode === CursorLocationType.Nodes,\n\t\t\t0x406 /* can only nextNode when in Nodes */,\n\t\t);\n\t\tthis.index++;\n\t\tif (this.index < (this.siblings as []).length) {\n\t\t\treturn true;\n\t\t}\n\t\tthis.exitNode();\n\t\treturn false;\n\t}\n\n\tpublic exitField(): void {\n\t\t// assert(this.mode === CursorLocationType.Fields, \"can only navigate up from field when in field\");\n\t\tthis.siblings =\n\t\t\tthis.siblingStack.pop() ?? fail(0xac3 /* Unexpected siblingStack.length */);\n\t\tthis.index = this.indexStack.pop() ?? fail(0xac4 /* Unexpected indexStack.length */);\n\t}\n\n\tpublic exitNode(): void {\n\t\t// assert(this.mode === CursorLocationType.Nodes, \"can only navigate up from node when in node\");\n\t\tthis.siblings =\n\t\t\tthis.siblingStack.pop() ?? fail(0xac5 /* Unexpected siblingStack.length */);\n\t\tthis.index = this.indexStack.pop() ?? fail(0xac6 /* Unexpected indexStack.length */);\n\t}\n\n\tpublic getNode(): TNode {\n\t\t// assert(this.mode === CursorLocationType.Nodes, \"can only get node when in node\");\n\t\t// Can not use `?? oob()` since null and undefined are valid values.\n\t\t// index is kept inbounds as an invariant of the class.\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\treturn (this.siblings as Field<TNode>)[this.index]!;\n\t}\n\n\tprivate getField(): Field<TNode> {\n\t\t// assert(this.mode === CursorLocationType.Fields, \"can only get field when in fields\");\n\t\tconst parent = this.getStackedNode(this.indexStack.length - 1);\n\t\tconst key: FieldKey = this.getFieldKey();\n\t\tconst field = this.adapter.getFieldFromNode(parent, key);\n\t\treturn field;\n\t}\n\n\t/**\n\t * The value of the current node\n\t */\n\tpublic get value(): Value {\n\t\treturn this.adapter.value(this.getNode());\n\t}\n\n\t/**\n\t * The type of the current node\n\t */\n\tpublic get type(): TreeType {\n\t\treturn this.adapter.type(this.getNode());\n\t}\n\n\tpublic get fieldIndex(): number {\n\t\t// assert(this.mode === CursorLocationType.Nodes, \"can only node's index when in node\");\n\t\treturn this.index;\n\t}\n\n\tpublic get chunkStart(): number {\n\t\treturn this.fieldIndex;\n\t}\n\n\tpublic readonly chunkLength = 1;\n}\n\n/**\n * Apply `prefix` to `path`.\n */\nexport function prefixPath(\n\tprefix: PathRootPrefix | undefined,\n\tpath: UpPath | undefined,\n): UpPath | undefined {\n\tif (prefix === undefined) {\n\t\treturn path;\n\t}\n\tif (\n\t\tprefix.parent === undefined &&\n\t\tprefix.rootFieldOverride === undefined &&\n\t\t(prefix.indexOffset ?? 0) === 0\n\t) {\n\t\treturn path;\n\t}\n\treturn applyPrefix(prefix, path);\n}\n\n/**\n * Apply `prefix` to `path`.\n */\nexport function prefixFieldPath(\n\tprefix: PathRootPrefix | undefined,\n\tpath: FieldUpPath,\n): FieldUpPath {\n\tif (prefix === undefined) {\n\t\treturn path;\n\t}\n\tif (\n\t\tprefix.parent === undefined &&\n\t\tprefix.rootFieldOverride === undefined &&\n\t\t(prefix.indexOffset ?? 0) === 0\n\t) {\n\t\treturn path;\n\t}\n\treturn {\n\t\tfield: path.parent === undefined ? (prefix.rootFieldOverride ?? path.field) : path.field,\n\t\tparent: prefixPath(prefix, path.parent),\n\t};\n}\n\n/**\n * Compose two prefixes together.\n * `prefixFieldPath(root, prefixFieldPath(inner, path))` should be the same as `prefixFieldPath(prefixPathPrefix(root, inner), path))`\n *\n * TODO: tests for this.\n */\nexport function prefixPathPrefix(root: PathRootPrefix, inner: PathRootPrefix): PathRootPrefix {\n\tif (inner.parent !== undefined) {\n\t\tconst composedPrefix: PathRootPrefix = {\n\t\t\tparent: new PrefixedPath(root, inner.parent),\n\t\t\trootFieldOverride: inner.rootFieldOverride,\n\t\t\tindexOffset: inner.indexOffset,\n\t\t};\n\t\treturn composedPrefix;\n\t} else {\n\t\tconst composedPrefix: PathRootPrefix = {\n\t\t\tparent: root.parent,\n\t\t\trootFieldOverride: root.rootFieldOverride ?? inner.rootFieldOverride,\n\t\t\tindexOffset: (inner.indexOffset ?? 0) + (root.indexOffset ?? 0),\n\t\t};\n\t\treturn composedPrefix;\n\t}\n}\n\nfunction applyPrefix(prefix: PathRootPrefix, path: UpPath | undefined): UpPath | undefined {\n\tif (path === undefined) {\n\t\treturn prefix.parent;\n\t} else {\n\t\t// As an optimization, avoid double wrapping paths with multiple prefixes\n\t\tif (path instanceof PrefixedPath) {\n\t\t\tconst composedPrefix: PathRootPrefix = prefixPathPrefix(prefix, path.prefix);\n\t\t\treturn new PrefixedPath(composedPrefix, path.path);\n\t\t} else {\n\t\t\treturn new PrefixedPath(prefix, path);\n\t\t}\n\t}\n}\n\n/**\n * Wrapper around a path that adds a prefix to the root.\n *\n * Exported for testing: use `prefixPath` and `prefixFieldPath` to construct.\n */\nexport class PrefixedPath implements UpPath {\n\tpublic readonly parentField: FieldKey;\n\tpublic readonly parentIndex: number;\n\tpublic constructor(\n\t\tpublic readonly prefix: PathRootPrefix,\n\t\tpublic readonly path: UpPath,\n\t) {\n\t\tif (path.parent === undefined) {\n\t\t\tthis.parentField = prefix.rootFieldOverride ?? path.parentField;\n\t\t\tthis.parentIndex = path.parentIndex + (prefix.indexOffset ?? 0);\n\t\t} else {\n\t\t\tthis.parentField = path.parentField;\n\t\t\tthis.parentIndex = path.parentIndex;\n\t\t}\n\t}\n\tpublic get parent(): UpPath | undefined {\n\t\treturn applyPrefix(this.prefix, this.path.parent);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"treeCursorUtils.js","sourceRoot":"","sources":["../../src/feature-libraries/treeCursorUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,kEAAqF;AACrF,uEAAsE;AAEtE,+CAa0B;AAwB1B;;;;GAIG;AACH,SAAgB,mBAAmB,CAClC,OAA6B,EAC7B,IAAW;IAEX,OAAO,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;AACpD,CAAC;AALD,kDAKC;AAED;;;;GAIG;AACH,SAAgB,oBAAoB,CACnC,OAA6B,EAC7B,IAAW,EACX,gBAA+B,oBAAS;IAExC,MAAM,MAAM,GAAG,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAClD,+FAA+F;IAC/F,kGAAkG;IAClG,MAAM,CAAC,UAAU,CAAC,IAAA,6BAAkB,EAAC,aAAa,CAAC,CAAC,CAAC;IACrD,OAAO,MAAM,CAAC;AACf,CAAC;AAVD,oDAUC;AA+BD;;GAEG;AACH,MAAsB,iBAAiB;IA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,OAAO,IAAI,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACvC,CAAC;IACF,CAAC;AACF,CAAC;AAED;;;;GAIG;AACH,MAAa,YAAY;IAGxB,YACiB,MAAsB,EACtB,IAAY;QADZ,WAAM,GAAN,MAAM,CAAgB;QACtB,SAAI,GAAJ,IAAI,CAAQ;QAE5B,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YAC/B,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,iBAAiB,IAAI,IAAI,CAAC,WAAW,CAAC;YAChE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,GAAG,CAAC,MAAM,CAAC,WAAW,IAAI,CAAC,CAAC,CAAC;QACjE,CAAC;aAAM,CAAC;YACP,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;YACpC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QACrC,CAAC;IACF,CAAC;IACD,IAAW,MAAM;QAChB,OAAO,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACnD,CAAC;CACD;AAlBD,oCAkBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, oob, debugAssert, fail } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\tCursorLocationType,\n\tCursorMarker,\n\ttype DetachedField,\n\ttype FieldKey,\n\ttype FieldUpPath,\n\ttype ITreeCursorSynchronous,\n\ttype PathRootPrefix,\n\ttype TreeType,\n\ttype UpPath,\n\ttype Value,\n\tdetachedFieldAsKey,\n\trootField,\n} from \"../core/index.js\";\n\n/**\n * {@link ITreeCursorSynchronous} that can return the underlying node objects.\n */\nexport interface CursorWithNode<TNode> extends ITreeCursorSynchronous {\n\t/**\n\t * Gets the underlying object for the current node.\n\t *\n\t * Only valid when `mode` is `Nodes`.\n\t */\n\tgetNode(): TNode;\n\n\t/**\n\t * Create a copy of this cursor which navigates independently,\n\t * and is initially located at the same place as this one.\n\t *\n\t * Depending on the cursor implementation this may be significantly faster\n\t * than other ways to copy the cursor\n\t * (such as creating a new one and walking the path from this one).\n\t */\n\tfork(): CursorWithNode<TNode>;\n}\n\n/**\n * Create a cursor, in `nodes` mode at the root of the provided tree.\n *\n * @returns an {@link ITreeCursorSynchronous} for a single root in `nodes` mode.\n */\nexport function stackTreeNodeCursor<TNode>(\n\tadapter: CursorAdapter<TNode>,\n\troot: TNode,\n): CursorWithNode<TNode> {\n\treturn new StackCursor(adapter, [], [], [root], 0);\n}\n\n/**\n * Create a cursor, in `fields` mode at the `detachedField` under the provided `root`.\n *\n * @returns an {@link ITreeCursorSynchronous} for `detachedField` of `root` in `fields` mode.\n */\nexport function stackTreeFieldCursor<TNode>(\n\tadapter: CursorAdapter<TNode>,\n\troot: TNode,\n\tdetachedField: DetachedField = rootField,\n): CursorWithNode<TNode> {\n\tconst cursor = stackTreeNodeCursor(adapter, root);\n\t// Because the root node in `stackTreeNodeCursor` is treated as the above detached fields node,\n\t// using it then just entering the correct field doesn't mess up the paths reported by the cursor.\n\tcursor.enterField(detachedFieldAsKey(detachedField));\n\treturn cursor;\n}\n\n/**\n * The representation of a field used by {@link CursorAdapter}.\n */\nexport type Field<TNode> = Pick<readonly TNode[], typeof Symbol.iterator | \"length\" | number>;\n\n/**\n * Provides functionality to allow a {@link stackTreeNodeCursor} and {@link stackTreeFieldCursor} to implement cursors.\n */\nexport interface CursorAdapter<TNode> {\n\t/**\n\t * @returns the value of the given node.\n\t */\n\tvalue(node: TNode): Value;\n\t/**\n\t * @returns the type of the given node.\n\t */\n\ttype(node: TNode): TreeType;\n\t/**\n\t * @returns the keys for non-empty fields on the given node.\n\t */\n\tkeysFromNode(node: TNode): readonly FieldKey[];\n\t/**\n\t * @returns the child nodes for the given node and key.\n\t */\n\tgetFieldFromNode(node: TNode, key: FieldKey): Field<TNode>;\n}\n\ntype SiblingsOrKey<TNode> = Field<TNode> | readonly FieldKey[];\n\n/**\n * A class that satisfies part of the ITreeCursorSynchronous implementation.\n */\nexport abstract class SynchronousCursor {\n\tpublic readonly [CursorMarker] = true;\n\tpublic readonly pending = false;\n\n\tpublic skipPendingFields(): boolean {\n\t\treturn true;\n\t}\n}\n\n/**\n * A simple general purpose ITreeCursorSynchronous implementation.\n *\n * As this is a generic implementation, it's ability to optimize is limited.\n *\n * @privateRemarks\n * Note that TNode can be `null` (and we should support `undefined` as well),\n * so be careful using types like `TNode | undefined` and expressions like `TNode ??`.\n *\n * TODO:\n * 1. Unit tests for this.\n * 2. Support for cursors which are field cursors at the root.\n */\nclass StackCursor<TNode> extends SynchronousCursor implements CursorWithNode<TNode> {\n\tpublic override readonly [CursorMarker] = true;\n\t/**\n\t * Might start at special root where fields are detached sequences.\n\t *\n\t * @param adapter - policy logic.\n\t * @param siblingStack - Stack of collections of siblings along the path through the tree:\n\t * does not include current level (which is stored in `siblings`).\n\t * Even levels in the stack (starting from 0) are sequences of nodes and odd levels\n\t * are for fields keys on a node.\n\t * @param indexStack - Stack of indices into the corresponding levels in `siblingStack`.\n\t * @param siblings - Siblings at the current level (not included in `siblingStack`).\n\t * @param index - Index into `siblings`.\n\t */\n\tpublic constructor(\n\t\tprivate readonly adapter: CursorAdapter<TNode>,\n\t\tprivate readonly siblingStack: SiblingsOrKey<TNode>[],\n\t\tprivate readonly indexStack: number[],\n\t\tprivate siblings: SiblingsOrKey<TNode>,\n\t\tprivate index: number,\n\t) {\n\t\tsuper();\n\t}\n\n\tpublic getFieldKey(): FieldKey {\n\t\tdebugAssert(() => this.mode === CursorLocationType.Fields || \"must be in fields mode\");\n\t\t// index is kept inbounds as an invariant of the class.\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\treturn (this.siblings as readonly FieldKey[])[this.index]!;\n\t}\n\n\tprivate getStackedFieldKey(height: number): FieldKey {\n\t\tdebugAssert(() => height % 2 === 1 || \"expected odd height when in field\");\n\t\tconst siblingStack = this.siblingStack[height] ?? oob();\n\t\tconst indexStack = this.indexStack[height] ?? oob();\n\t\t// index is kept inbounds as an invariant of the class.\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\treturn (siblingStack as readonly FieldKey[])[indexStack]!;\n\t}\n\n\tprivate getStackedNodeIndex(height: number): number {\n\t\tdebugAssert(() => height % 2 === 0 || \"must be node height\");\n\t\treturn this.indexStack[height] ?? oob();\n\t}\n\n\tprivate getStackedNode(height: number): TNode {\n\t\tconst index = this.getStackedNodeIndex(height);\n\t\t// Can not use `?? oob()` since null and undefined are valid values.\n\t\t// index is kept inbounds as an invariant of the class.\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\treturn (this.siblingStack[height] as Field<TNode>)[index]!;\n\t}\n\n\tpublic getFieldLength(): number {\n\t\tdebugAssert(() => this.mode === CursorLocationType.Fields || \"must be in fields mode\");\n\t\treturn this.getField().length;\n\t}\n\n\tpublic enterNode(index: number): void {\n\t\tdebugAssert(() => this.mode === CursorLocationType.Fields || \"must be in fields mode\");\n\t\tconst siblings = this.getField();\n\t\tif (!(index in siblings)) {\n\t\t\tthrow new UsageError(\n\t\t\t\t`A child does not exist at index '${index}' in field containing ${siblings.length} nodes.`,\n\t\t\t);\n\t\t}\n\t\tthis.siblingStack.push(this.siblings);\n\t\tthis.indexStack.push(this.index);\n\t\tthis.index = index;\n\t\tthis.siblings = siblings;\n\t}\n\n\tpublic getPath(prefix?: PathRootPrefix): UpPath | undefined {\n\t\tassert(this.mode === CursorLocationType.Nodes, 0x3b9 /* must be in nodes mode */);\n\t\treturn this.getOffsetPath(0, prefix);\n\t}\n\n\tpublic getFieldPath(prefix?: PathRootPrefix): FieldUpPath {\n\t\tassert(this.mode === CursorLocationType.Fields, 0x449 /* must be in fields mode */);\n\t\treturn {\n\t\t\tfield:\n\t\t\t\tthis.indexStack.length === 1\n\t\t\t\t\t? (prefix?.rootFieldOverride ?? this.getFieldKey())\n\t\t\t\t\t: this.getFieldKey(),\n\t\t\tparent: this.getOffsetPath(1, prefix),\n\t\t};\n\t}\n\n\tprivate getOffsetPath(\n\t\toffset: number,\n\t\tprefix: PathRootPrefix | undefined,\n\t): UpPath | undefined {\n\t\t// It is more efficient to handle prefix directly in here rather than delegating to PrefixedPath.\n\n\t\tconst length = this.indexStack.length - offset;\n\t\tif (length === 0) {\n\t\t\treturn prefix?.parent; // At root\n\t\t}\n\n\t\tassert(length > 0, 0x44a /* invalid offset to above root */);\n\t\tassert(length % 2 === 0, 0x44b /* offset path must point to node not field */);\n\n\t\tconst getIndex = (height: number): number => {\n\t\t\tlet parentIndex: number =\n\t\t\t\theight === this.indexStack.length ? this.index : this.getStackedNodeIndex(height);\n\t\t\tif (prefix !== undefined && height === 2) {\n\t\t\t\tparentIndex += prefix.indexOffset ?? 0;\n\t\t\t}\n\t\t\treturn parentIndex;\n\t\t};\n\n\t\t// Perf Note:\n\t\t// This is O(depth) in tree.\n\t\t// If many different anchors are created, this could be optimized to amortize the costs.\n\t\t// For example, the cursor could cache UpPaths from the anchorSet when creating an anchor,\n\t\t// then reuse them as a starting point when making another.\n\t\t// Could cache this at one depth, and remember the depth.\n\t\t// When navigating up, adjust cached anchor if present.\n\n\t\tlet path: UpPath | undefined = prefix?.parent;\n\t\t// Skip top level, since root node in path is \"undefined\" and does not have a parent or index.\n\t\tfor (let height = 2; height <= length; height += 2) {\n\t\t\tconst fieldOverride = height === 2 ? prefix?.rootFieldOverride : undefined;\n\t\t\tpath = {\n\t\t\t\tparent: path,\n\t\t\t\tparentIndex: getIndex(height),\n\t\t\t\tparentField: fieldOverride ?? this.getStackedFieldKey(height - 1),\n\t\t\t};\n\t\t}\n\n\t\treturn path;\n\t}\n\n\tpublic fork(): StackCursor<TNode> {\n\t\t// Siblings arrays are not modified during navigation and do not need be be copied.\n\t\t// This allows this copy to be shallow, and `this.siblings` below to not be copied as all.\n\t\treturn new StackCursor<TNode>(\n\t\t\tthis.adapter,\n\t\t\t[...this.siblingStack],\n\t\t\t[...this.indexStack],\n\t\t\tthis.siblings,\n\t\t\tthis.index,\n\t\t);\n\t}\n\n\tpublic enterField(key: FieldKey): void {\n\t\tdebugAssert(() => this.mode === CursorLocationType.Nodes || \"must be in nodes mode\");\n\t\tthis.siblingStack.push(this.siblings);\n\t\tthis.indexStack.push(this.index);\n\n\t\t// For fields, siblings are only used for key lookup and\n\t\t// nextField and which has arbitrary iteration order,\n\t\t// so making a array of just key here works.\n\t\t// This adds an allocation, so it's optimizing code simplicity and for the other use case (enumeration)\n\t\t// at the cost of an allocation here.\n\t\tthis.index = 0;\n\t\tthis.siblings = [key];\n\t}\n\n\tpublic get mode(): CursorLocationType {\n\t\treturn this.siblingStack.length % 2 === 0\n\t\t\t? CursorLocationType.Nodes\n\t\t\t: CursorLocationType.Fields;\n\t}\n\n\tpublic nextField(): boolean {\n\t\tthis.index += 1;\n\t\tif (this.index === (this.siblings as []).length) {\n\t\t\tthis.exitField();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\tpublic firstField(): boolean {\n\t\tdebugAssert(() => this.mode === CursorLocationType.Nodes || \"must be in nodes mode\");\n\t\tconst fields = this.adapter.keysFromNode(this.getNode());\n\t\tif (fields.length === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.siblingStack.push(this.siblings);\n\t\tthis.indexStack.push(this.index);\n\t\tthis.index = 0;\n\t\tthis.siblings = fields;\n\t\treturn true;\n\t}\n\n\tpublic seekNodes(offset: number): boolean {\n\t\tdebugAssert(\n\t\t\t() => this.mode === CursorLocationType.Nodes || \"can only seekNodes when in Nodes\",\n\t\t);\n\t\tthis.index += offset;\n\t\tif (this.index in this.siblings) {\n\t\t\treturn true;\n\t\t}\n\t\tthis.exitNode();\n\t\treturn false;\n\t}\n\n\tpublic firstNode(): boolean {\n\t\tdebugAssert(\n\t\t\t() => this.mode === CursorLocationType.Fields || \"firstNode only allowed in fields mode\",\n\t\t);\n\t\tconst nodes = this.getField();\n\t\tif (nodes.length === 0) {\n\t\t\treturn false;\n\t\t}\n\t\tthis.siblingStack.push(this.siblings);\n\t\tthis.indexStack.push(this.index);\n\t\tthis.index = 0;\n\t\tthis.siblings = nodes;\n\t\treturn true;\n\t}\n\n\tpublic nextNode(): boolean {\n\t\tdebugAssert(\n\t\t\t() => this.mode === CursorLocationType.Nodes || \"can only nextNode when in Nodes\",\n\t\t);\n\t\tthis.index++;\n\t\tif (this.index < (this.siblings as []).length) {\n\t\t\treturn true;\n\t\t}\n\t\tthis.exitNode();\n\t\treturn false;\n\t}\n\n\tpublic exitField(): void {\n\t\tdebugAssert(\n\t\t\t() =>\n\t\t\t\tthis.mode === CursorLocationType.Fields ||\n\t\t\t\t\"can only navigate up from field when in field\",\n\t\t);\n\t\tthis.siblings =\n\t\t\tthis.siblingStack.pop() ?? fail(0xac3 /* Unexpected siblingStack.length */);\n\t\tthis.index = this.indexStack.pop() ?? fail(0xac4 /* Unexpected indexStack.length */);\n\t}\n\n\tpublic exitNode(): void {\n\t\tdebugAssert(\n\t\t\t() =>\n\t\t\t\tthis.mode === CursorLocationType.Nodes ||\n\t\t\t\t\"can only navigate up from node when in node\",\n\t\t);\n\t\tthis.siblings =\n\t\t\tthis.siblingStack.pop() ?? fail(0xac5 /* Unexpected siblingStack.length */);\n\t\tthis.index = this.indexStack.pop() ?? fail(0xac6 /* Unexpected indexStack.length */);\n\t}\n\n\tpublic getNode(): TNode {\n\t\tdebugAssert(\n\t\t\t() => this.mode === CursorLocationType.Nodes || \"can only get node when in node\",\n\t\t);\n\t\t// Can not use `?? oob()` since null and undefined are valid values.\n\t\t// index is kept inbounds as an invariant of the class.\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\treturn (this.siblings as Field<TNode>)[this.index]!;\n\t}\n\n\tprivate getField(): Field<TNode> {\n\t\tdebugAssert(\n\t\t\t() => this.mode === CursorLocationType.Fields || \"can only get field when in fields\",\n\t\t);\n\t\tconst parent = this.getStackedNode(this.indexStack.length - 1);\n\t\tconst key: FieldKey = this.getFieldKey();\n\t\tconst field = this.adapter.getFieldFromNode(parent, key);\n\t\treturn field;\n\t}\n\n\t/**\n\t * The value of the current node\n\t */\n\tpublic get value(): Value {\n\t\treturn this.adapter.value(this.getNode());\n\t}\n\n\t/**\n\t * The type of the current node\n\t */\n\tpublic get type(): TreeType {\n\t\treturn this.adapter.type(this.getNode());\n\t}\n\n\tpublic get fieldIndex(): number {\n\t\tdebugAssert(\n\t\t\t() => this.mode === CursorLocationType.Nodes || \"can only node's index when in node\",\n\t\t);\n\t\treturn this.index;\n\t}\n\n\tpublic get chunkStart(): number {\n\t\treturn this.fieldIndex;\n\t}\n\n\tpublic readonly chunkLength = 1;\n}\n\n/**\n * Apply `prefix` to `path`.\n */\nexport function prefixPath(\n\tprefix: PathRootPrefix | undefined,\n\tpath: UpPath | undefined,\n): UpPath | undefined {\n\tif (prefix === undefined) {\n\t\treturn path;\n\t}\n\tif (\n\t\tprefix.parent === undefined &&\n\t\tprefix.rootFieldOverride === undefined &&\n\t\t(prefix.indexOffset ?? 0) === 0\n\t) {\n\t\treturn path;\n\t}\n\treturn applyPrefix(prefix, path);\n}\n\n/**\n * Apply `prefix` to `path`.\n */\nexport function prefixFieldPath(\n\tprefix: PathRootPrefix | undefined,\n\tpath: FieldUpPath,\n): FieldUpPath {\n\tif (prefix === undefined) {\n\t\treturn path;\n\t}\n\tif (\n\t\tprefix.parent === undefined &&\n\t\tprefix.rootFieldOverride === undefined &&\n\t\t(prefix.indexOffset ?? 0) === 0\n\t) {\n\t\treturn path;\n\t}\n\treturn {\n\t\tfield: path.parent === undefined ? (prefix.rootFieldOverride ?? path.field) : path.field,\n\t\tparent: prefixPath(prefix, path.parent),\n\t};\n}\n\n/**\n * Compose two prefixes together.\n * `prefixFieldPath(root, prefixFieldPath(inner, path))` should be the same as `prefixFieldPath(prefixPathPrefix(root, inner), path))`\n *\n * TODO: tests for this.\n */\nexport function prefixPathPrefix(root: PathRootPrefix, inner: PathRootPrefix): PathRootPrefix {\n\tif (inner.parent !== undefined) {\n\t\tconst composedPrefix: PathRootPrefix = {\n\t\t\tparent: new PrefixedPath(root, inner.parent),\n\t\t\trootFieldOverride: inner.rootFieldOverride,\n\t\t\tindexOffset: inner.indexOffset,\n\t\t};\n\t\treturn composedPrefix;\n\t} else {\n\t\tconst composedPrefix: PathRootPrefix = {\n\t\t\tparent: root.parent,\n\t\t\trootFieldOverride: root.rootFieldOverride ?? inner.rootFieldOverride,\n\t\t\tindexOffset: (inner.indexOffset ?? 0) + (root.indexOffset ?? 0),\n\t\t};\n\t\treturn composedPrefix;\n\t}\n}\n\nfunction applyPrefix(prefix: PathRootPrefix, path: UpPath | undefined): UpPath | undefined {\n\tif (path === undefined) {\n\t\treturn prefix.parent;\n\t} else {\n\t\t// As an optimization, avoid double wrapping paths with multiple prefixes\n\t\tif (path instanceof PrefixedPath) {\n\t\t\tconst composedPrefix: PathRootPrefix = prefixPathPrefix(prefix, path.prefix);\n\t\t\treturn new PrefixedPath(composedPrefix, path.path);\n\t\t} else {\n\t\t\treturn new PrefixedPath(prefix, path);\n\t\t}\n\t}\n}\n\n/**\n * Wrapper around a path that adds a prefix to the root.\n *\n * Exported for testing: use `prefixPath` and `prefixFieldPath` to construct.\n */\nexport class PrefixedPath implements UpPath {\n\tpublic readonly parentField: FieldKey;\n\tpublic readonly parentIndex: number;\n\tpublic constructor(\n\t\tpublic readonly prefix: PathRootPrefix,\n\t\tpublic readonly path: UpPath,\n\t) {\n\t\tif (path.parent === undefined) {\n\t\t\tthis.parentField = prefix.rootFieldOverride ?? path.parentField;\n\t\t\tthis.parentIndex = path.parentIndex + (prefix.indexOffset ?? 0);\n\t\t} else {\n\t\t\tthis.parentField = path.parentField;\n\t\t\tthis.parentIndex = path.parentIndex;\n\t\t}\n\t}\n\tpublic get parent(): UpPath | undefined {\n\t\treturn applyPrefix(this.prefix, this.path.parent);\n\t}\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export type Listenable<T extends object> = EventListenable<T>;
|
|
|
30
30
|
export type Off = EventOff;
|
|
31
31
|
export { TreeStatus, TreeCompressionStrategy, type TreeIndex, type TreeIndexKey, type TreeIndexNodes, } from "./feature-libraries/index.js";
|
|
32
32
|
export { type ITreeInternal, type SharedTreeOptions, type SharedTreeOptionsBeta, type ForestType, type SharedTreeFormatOptions, SharedTreeFormatVersion, Tree, type RunTransaction, type ForestOptions, getBranch, type BranchableTree, type TreeBranchFork, independentInitializedView, type ViewContent, TreeAlpha, type ObservationResults, type TreeIdentifierUtils, independentView, ForestTypeOptimized, ForestTypeExpensiveDebug, ForestTypeReference, } from "./shared-tree/index.js";
|
|
33
|
-
export { TreeArrayNode, type Unhydrated, IterableTreeArrayContent, TreeNode, type ViewableTree, type ITree, type TreeNodeSchema, TreeViewConfiguration, type ITreeViewConfiguration, type ITreeConfigurationOptions, type TreeView, type TreeViewEvents, SchemaFactory, SchemaFactoryBeta, SchemaFactoryAlpha, type
|
|
33
|
+
export { TreeArrayNode, type Unhydrated, IterableTreeArrayContent, TreeNode, type ViewableTree, type ITree, type TreeNodeSchema, TreeViewConfiguration, type ITreeViewConfiguration, type ITreeConfigurationOptions, type TreeView, type TreeViewEvents, SchemaFactory, SchemaFactoryBeta, SchemaFactoryAlpha, type ObjectSchemaOptionsAlpha, type ObjectSchemaOptions, type ImplicitFieldSchema, type TreeFieldFromImplicitField, type TreeChangeEvents, type NodeFromSchema, type TreeMapNode, type InsertableTreeNodeFromImplicitAllowedTypes, type TreeLeafValue, FieldKind, FieldSchema, type FieldSchemaAlpha, type FieldSchemaMetadata, type ImplicitAllowedTypes, type InsertableTreeFieldFromImplicitField, type InsertableTypedNode, NodeKind, type TreeObjectNode, ObjectNodeSchema, type TreeNodeFromImplicitAllowedTypes, type TreeNodeSchemaClass, type SchemaCompatibilityStatus, type FieldProps, type FieldPropsAlpha, normalizeFieldSchema, type InternalTreeNode, type WithType, type NodeChangedData, type SchemaUpgrade, type TreeNodeApi, type TreeNodeSchemaCore, type AllowedTypes, type System_Unsafe, type FieldSchemaAlphaUnsafe, type ArrayNodeCustomizableSchemaUnsafe, type MapNodeCustomizableSchemaUnsafe, type TreeRecordNodeUnsafe, type typeSchemaSymbol, type TreeNodeSchemaNonClass, type ValidateRecursiveSchema, type FixRecursiveArraySchema, type SimpleTreeIndex, type IdentifierIndex, createSimpleTreeIndex, createIdentifierIndex, type DirtyTreeStatus, trackDirtyNodes, type DirtyTreeMap, adaptEnum, enumFromStrings, singletonSchema, type UnsafeUnknownSchema, type TreeViewAlpha, type InsertableField, type Insertable, type InsertableContent, type FactoryContent, type FactoryContentObject, type ReadableField, type ReadSchema, type AnnotatedAllowedType, type AnnotatedAllowedTypes, type AllowedTypesFullEvaluated, type AllowedTypeMetadata, type AllowedTypesMetadata, type UnannotateAllowedTypesList, type SchemaStaticsAlpha, type AnnotateAllowedTypesList, type AllowedTypesFull, type AllowedTypesFullFromMixed, TreeBeta, type TreeChangeEventsBeta, type VerboseTreeNode, type TreeEncodingOptions, type TreeSchemaEncodingOptions, type TreeSchema, TreeViewConfigurationAlpha, type VerboseTree, extractPersistedSchema, comparePersistedSchema, type ConciseTree, type JsonTreeSchema, type JsonSchemaId, type JsonNodeSchema, type JsonNodeSchemaBase, type JsonLeafNodeSchema, type JsonMapNodeSchema, type JsonArrayNodeSchema, type JsonObjectNodeSchema, type JsonFieldSchema, type JsonSchemaRef, type JsonRefPath, type JsonSchemaType, type JsonLeafSchemaType, type JsonRecordNodeSchema, type JsonStringKeyPatternProperties, getJsonSchema, type LazyItem, type Unenforced, type SimpleNodeSchemaBase, type SimpleNodeSchemaBaseAlpha, type SimpleTreeSchema, type SimpleNodeSchema, type SimpleFieldSchema, type SimpleLeafNodeSchema, type SimpleMapNodeSchema, type SimpleArrayNodeSchema, type SimpleObjectNodeSchema, type SimpleObjectFieldSchema, type SimpleRecordNodeSchema, normalizeAllowedTypes, walkFieldSchema, walkNodeSchema, walkAllowedTypes, type SchemaVisitor, getSimpleSchema, type ReadonlyArrayNode, type InsertableTreeNodeFromAllowedTypes, type Input, type TreeBranch, type TreeBranchEvents, asTreeViewAlpha, type NodeSchemaOptions, type NodeSchemaOptionsAlpha, type NodeSchemaMetadata, type SchemaStatics, type ITreeAlpha, type TransactionConstraint, type NodeInDocumentConstraint, type RunTransactionParams, type VoidTransactionCallbackStatus, type TransactionCallbackStatus, type TransactionResult, type TransactionResultExt, type TransactionResultSuccess, type TransactionResultFailed, rollback, generateSchemaFromSimpleSchema, evaluateLazySchema, replaceConciseTreeHandles, replaceHandles, replaceVerboseTreeHandles, type HandleConverter, allowUnused, type LeafSchema, type ArrayNodeCustomizableSchema, type ArrayNodePojoEmulationSchema, ArrayNodeSchema, type MapNodeCustomizableSchema, type MapNodePojoEmulationSchema, MapNodeSchema, type ObjectFromSchemaRecord, type ValidateRecursiveSchemaTemplate, type FixRecursiveRecursionLimit, RecordNodeSchema, type RecordNodeCustomizableSchema, type RecordNodeInsertableData, type RecordNodePojoEmulationSchema, type TreeRecordNode, KeyEncodingOptions, type TreeParsingOptions, type SchemaFactory_base, type NumberKeys, } from "./simple-tree/index.js";
|
|
34
34
|
export { SharedTree, configuredSharedTree, configuredSharedTreeBeta, configuredSharedTreeBetaLegacy, } from "./treeFactory.js";
|
|
35
35
|
export { SharedTreeAttributes, SharedTreeFactoryType } from "./sharedTreeAttributes.js";
|
|
36
36
|
export { persistedToSimpleSchema } from "./shared-tree/index.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,WAAW,EACX,KAAK,UAAU,EACf,UAAU,EACV,gBAAgB,EAChB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,eAAe,GACpB,MA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