@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
|
@@ -151,16 +151,14 @@ class StackCursor<TNode> extends SynchronousCursor implements CursorWithNode<TNo
|
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
public getFieldKey(): FieldKey {
|
|
154
|
-
debugAssert(() =>
|
|
155
|
-
this.mode === CursorLocationType.Fields ? true : "must be in fields mode",
|
|
156
|
-
);
|
|
154
|
+
debugAssert(() => this.mode === CursorLocationType.Fields || "must be in fields mode");
|
|
157
155
|
// index is kept inbounds as an invariant of the class.
|
|
158
156
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
159
157
|
return (this.siblings as readonly FieldKey[])[this.index]!;
|
|
160
158
|
}
|
|
161
159
|
|
|
162
160
|
private getStackedFieldKey(height: number): FieldKey {
|
|
163
|
-
|
|
161
|
+
debugAssert(() => height % 2 === 1 || "expected odd height when in field");
|
|
164
162
|
const siblingStack = this.siblingStack[height] ?? oob();
|
|
165
163
|
const indexStack = this.indexStack[height] ?? oob();
|
|
166
164
|
// index is kept inbounds as an invariant of the class.
|
|
@@ -169,7 +167,7 @@ class StackCursor<TNode> extends SynchronousCursor implements CursorWithNode<TNo
|
|
|
169
167
|
}
|
|
170
168
|
|
|
171
169
|
private getStackedNodeIndex(height: number): number {
|
|
172
|
-
|
|
170
|
+
debugAssert(() => height % 2 === 0 || "must be node height");
|
|
173
171
|
return this.indexStack[height] ?? oob();
|
|
174
172
|
}
|
|
175
173
|
|
|
@@ -182,12 +180,12 @@ class StackCursor<TNode> extends SynchronousCursor implements CursorWithNode<TNo
|
|
|
182
180
|
}
|
|
183
181
|
|
|
184
182
|
public getFieldLength(): number {
|
|
185
|
-
|
|
183
|
+
debugAssert(() => this.mode === CursorLocationType.Fields || "must be in fields mode");
|
|
186
184
|
return this.getField().length;
|
|
187
185
|
}
|
|
188
186
|
|
|
189
187
|
public enterNode(index: number): void {
|
|
190
|
-
|
|
188
|
+
debugAssert(() => this.mode === CursorLocationType.Fields || "must be in fields mode");
|
|
191
189
|
const siblings = this.getField();
|
|
192
190
|
if (!(index in siblings)) {
|
|
193
191
|
throw new UsageError(
|
|
@@ -274,7 +272,7 @@ class StackCursor<TNode> extends SynchronousCursor implements CursorWithNode<TNo
|
|
|
274
272
|
}
|
|
275
273
|
|
|
276
274
|
public enterField(key: FieldKey): void {
|
|
277
|
-
|
|
275
|
+
debugAssert(() => this.mode === CursorLocationType.Nodes || "must be in nodes mode");
|
|
278
276
|
this.siblingStack.push(this.siblings);
|
|
279
277
|
this.indexStack.push(this.index);
|
|
280
278
|
|
|
@@ -303,7 +301,7 @@ class StackCursor<TNode> extends SynchronousCursor implements CursorWithNode<TNo
|
|
|
303
301
|
}
|
|
304
302
|
|
|
305
303
|
public firstField(): boolean {
|
|
306
|
-
|
|
304
|
+
debugAssert(() => this.mode === CursorLocationType.Nodes || "must be in nodes mode");
|
|
307
305
|
const fields = this.adapter.keysFromNode(this.getNode());
|
|
308
306
|
if (fields.length === 0) {
|
|
309
307
|
return false;
|
|
@@ -317,7 +315,9 @@ class StackCursor<TNode> extends SynchronousCursor implements CursorWithNode<TNo
|
|
|
317
315
|
}
|
|
318
316
|
|
|
319
317
|
public seekNodes(offset: number): boolean {
|
|
320
|
-
|
|
318
|
+
debugAssert(
|
|
319
|
+
() => this.mode === CursorLocationType.Nodes || "can only seekNodes when in Nodes",
|
|
320
|
+
);
|
|
321
321
|
this.index += offset;
|
|
322
322
|
if (this.index in this.siblings) {
|
|
323
323
|
return true;
|
|
@@ -327,7 +327,9 @@ class StackCursor<TNode> extends SynchronousCursor implements CursorWithNode<TNo
|
|
|
327
327
|
}
|
|
328
328
|
|
|
329
329
|
public firstNode(): boolean {
|
|
330
|
-
|
|
330
|
+
debugAssert(
|
|
331
|
+
() => this.mode === CursorLocationType.Fields || "firstNode only allowed in fields mode",
|
|
332
|
+
);
|
|
331
333
|
const nodes = this.getField();
|
|
332
334
|
if (nodes.length === 0) {
|
|
333
335
|
return false;
|
|
@@ -340,9 +342,8 @@ class StackCursor<TNode> extends SynchronousCursor implements CursorWithNode<TNo
|
|
|
340
342
|
}
|
|
341
343
|
|
|
342
344
|
public nextNode(): boolean {
|
|
343
|
-
|
|
344
|
-
this.mode === CursorLocationType.Nodes,
|
|
345
|
-
0x406 /* can only nextNode when in Nodes */,
|
|
345
|
+
debugAssert(
|
|
346
|
+
() => this.mode === CursorLocationType.Nodes || "can only nextNode when in Nodes",
|
|
346
347
|
);
|
|
347
348
|
this.index++;
|
|
348
349
|
if (this.index < (this.siblings as []).length) {
|
|
@@ -353,21 +354,31 @@ class StackCursor<TNode> extends SynchronousCursor implements CursorWithNode<TNo
|
|
|
353
354
|
}
|
|
354
355
|
|
|
355
356
|
public exitField(): void {
|
|
356
|
-
|
|
357
|
+
debugAssert(
|
|
358
|
+
() =>
|
|
359
|
+
this.mode === CursorLocationType.Fields ||
|
|
360
|
+
"can only navigate up from field when in field",
|
|
361
|
+
);
|
|
357
362
|
this.siblings =
|
|
358
363
|
this.siblingStack.pop() ?? fail(0xac3 /* Unexpected siblingStack.length */);
|
|
359
364
|
this.index = this.indexStack.pop() ?? fail(0xac4 /* Unexpected indexStack.length */);
|
|
360
365
|
}
|
|
361
366
|
|
|
362
367
|
public exitNode(): void {
|
|
363
|
-
|
|
368
|
+
debugAssert(
|
|
369
|
+
() =>
|
|
370
|
+
this.mode === CursorLocationType.Nodes ||
|
|
371
|
+
"can only navigate up from node when in node",
|
|
372
|
+
);
|
|
364
373
|
this.siblings =
|
|
365
374
|
this.siblingStack.pop() ?? fail(0xac5 /* Unexpected siblingStack.length */);
|
|
366
375
|
this.index = this.indexStack.pop() ?? fail(0xac6 /* Unexpected indexStack.length */);
|
|
367
376
|
}
|
|
368
377
|
|
|
369
378
|
public getNode(): TNode {
|
|
370
|
-
|
|
379
|
+
debugAssert(
|
|
380
|
+
() => this.mode === CursorLocationType.Nodes || "can only get node when in node",
|
|
381
|
+
);
|
|
371
382
|
// Can not use `?? oob()` since null and undefined are valid values.
|
|
372
383
|
// index is kept inbounds as an invariant of the class.
|
|
373
384
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -375,7 +386,9 @@ class StackCursor<TNode> extends SynchronousCursor implements CursorWithNode<TNo
|
|
|
375
386
|
}
|
|
376
387
|
|
|
377
388
|
private getField(): Field<TNode> {
|
|
378
|
-
|
|
389
|
+
debugAssert(
|
|
390
|
+
() => this.mode === CursorLocationType.Fields || "can only get field when in fields",
|
|
391
|
+
);
|
|
379
392
|
const parent = this.getStackedNode(this.indexStack.length - 1);
|
|
380
393
|
const key: FieldKey = this.getFieldKey();
|
|
381
394
|
const field = this.adapter.getFieldFromNode(parent, key);
|
|
@@ -397,7 +410,9 @@ class StackCursor<TNode> extends SynchronousCursor implements CursorWithNode<TNo
|
|
|
397
410
|
}
|
|
398
411
|
|
|
399
412
|
public get fieldIndex(): number {
|
|
400
|
-
|
|
413
|
+
debugAssert(
|
|
414
|
+
() => this.mode === CursorLocationType.Nodes || "can only node's index when in node",
|
|
415
|
+
);
|
|
401
416
|
return this.index;
|
|
402
417
|
}
|
|
403
418
|
|
package/src/index.ts
CHANGED
|
@@ -94,7 +94,8 @@ export {
|
|
|
94
94
|
SchemaFactory,
|
|
95
95
|
SchemaFactoryBeta,
|
|
96
96
|
SchemaFactoryAlpha,
|
|
97
|
-
type
|
|
97
|
+
type ObjectSchemaOptionsAlpha,
|
|
98
|
+
type ObjectSchemaOptions,
|
|
98
99
|
type ImplicitFieldSchema,
|
|
99
100
|
type TreeFieldFromImplicitField,
|
|
100
101
|
type TreeChangeEvents,
|
|
@@ -163,21 +164,16 @@ export {
|
|
|
163
164
|
type FactoryContentObject,
|
|
164
165
|
type ReadableField,
|
|
165
166
|
type ReadSchema,
|
|
166
|
-
type ImplicitAnnotatedAllowedTypes,
|
|
167
|
-
type ImplicitAnnotatedFieldSchema,
|
|
168
167
|
type AnnotatedAllowedType,
|
|
169
168
|
type AnnotatedAllowedTypes,
|
|
170
|
-
type
|
|
169
|
+
type AllowedTypesFullEvaluated,
|
|
171
170
|
type AllowedTypeMetadata,
|
|
172
171
|
type AllowedTypesMetadata,
|
|
173
|
-
type InsertableObjectFromAnnotatedSchemaRecord,
|
|
174
|
-
type UnannotateImplicitAllowedTypes,
|
|
175
|
-
type UnannotateAllowedTypes,
|
|
176
|
-
type UnannotateAllowedType,
|
|
177
172
|
type UnannotateAllowedTypesList,
|
|
178
|
-
type UnannotateImplicitFieldSchema,
|
|
179
|
-
type UnannotateSchemaRecord,
|
|
180
173
|
type SchemaStaticsAlpha,
|
|
174
|
+
type AnnotateAllowedTypesList,
|
|
175
|
+
type AllowedTypesFull,
|
|
176
|
+
type AllowedTypesFullFromMixed,
|
|
181
177
|
// Beta APIs
|
|
182
178
|
TreeBeta,
|
|
183
179
|
type TreeChangeEventsBeta,
|
|
@@ -273,6 +269,7 @@ export {
|
|
|
273
269
|
KeyEncodingOptions,
|
|
274
270
|
type TreeParsingOptions,
|
|
275
271
|
type SchemaFactory_base,
|
|
272
|
+
type NumberKeys,
|
|
276
273
|
} from "./simple-tree/index.js";
|
|
277
274
|
export {
|
|
278
275
|
SharedTree,
|
package/src/jsonDomainSchema.ts
CHANGED
|
@@ -37,7 +37,7 @@ const sf = new SchemaFactoryAlpha("com.fluidframework.json");
|
|
|
37
37
|
*
|
|
38
38
|
* 2. The order of fields on an object is not preserved. The resulting order is arbitrary.
|
|
39
39
|
*
|
|
40
|
-
* JSON data can be imported from JSON into this format using `JSON.parse` then {@link (
|
|
40
|
+
* JSON data can be imported from JSON into this format using `JSON.parse` then {@link (TreeBeta:interface).importConcise} with the {@link JsonAsTree.(Tree:variable)} schema.
|
|
41
41
|
*
|
|
42
42
|
* @alpha
|
|
43
43
|
*/
|
|
@@ -63,7 +63,7 @@ export namespace JsonAsTree {
|
|
|
63
63
|
* {@link AllowedTypes} for any content allowed in the {@link JsonAsTree} domain.
|
|
64
64
|
* @example
|
|
65
65
|
* ```typescript
|
|
66
|
-
* const tree =
|
|
66
|
+
* const tree = TreeBeta.importConcise(JsonAsTree.Union, { example: { nested: true }, value: 5 });
|
|
67
67
|
* ```
|
|
68
68
|
* @privateRemarks
|
|
69
69
|
* The order here should not matter for any functionality related reasons.
|
|
@@ -95,7 +95,7 @@ export namespace JsonAsTree {
|
|
|
95
95
|
* // Due to TypeScript restrictions on recursive types, the constructor and be somewhat limiting.
|
|
96
96
|
* const fromArray = new JsonAsTreeObject([["a", 0]]);
|
|
97
97
|
* // Using `importConcise` can work better for JSON data:
|
|
98
|
-
* const imported =
|
|
98
|
+
* const imported = TreeBeta.importConcise(JsonAsTree.Object, { a: 0 });
|
|
99
99
|
* // Node API is like a Map:
|
|
100
100
|
* const value = imported.get("a");
|
|
101
101
|
* ```
|
|
@@ -128,13 +128,13 @@ export namespace JsonAsTree {
|
|
|
128
128
|
/**
|
|
129
129
|
* Arbitrary JSON array as a {@link TreeNode}.
|
|
130
130
|
* @remarks
|
|
131
|
-
* This can be imported using {@link (
|
|
131
|
+
* This can be imported using {@link (TreeBeta:interface).importConcise}.
|
|
132
132
|
* @example
|
|
133
133
|
* ```typescript
|
|
134
134
|
* // Due to TypeScript restrictions on recursive types, the constructor can be somewhat limiting.
|
|
135
135
|
* const usingConstructor = new JsonAsTree.Array(["a", 0, new JsonAsTree.Array([1])]);
|
|
136
136
|
* // Using `importConcise` can work better for JSON data:
|
|
137
|
-
* const imported =
|
|
137
|
+
* const imported = TreeBeta.importConcise(JsonAsTree.Array, ["a", 0, [1]]);
|
|
138
138
|
* // Node API is like an Array:
|
|
139
139
|
* const inner: JsonAsTree.Tree = imported[2];
|
|
140
140
|
* assert(Tree.is(inner, JsonAsTree.Array));
|
package/src/packageVersion.ts
CHANGED
|
@@ -23,14 +23,14 @@ const sf = new SchemaFactoryAlpha("com.fluidframework.serializable");
|
|
|
23
23
|
* @remarks
|
|
24
24
|
* Schema which replicate the Fluid Serializable data model with {@link TreeNode}s.
|
|
25
25
|
*
|
|
26
|
-
* Fluid Serializable data can be imported from the {@link FluidSerializableAsTree.Data|Fluid Serializable format} into this format using {@link (
|
|
26
|
+
* Fluid Serializable data can be imported from the {@link FluidSerializableAsTree.Data|Fluid Serializable format} into this format using {@link (TreeBeta:interface).importConcise} with the {@link FluidSerializableAsTree.(Tree:variable)} schema.
|
|
27
27
|
* @alpha
|
|
28
28
|
*/
|
|
29
29
|
export namespace FluidSerializableAsTree {
|
|
30
30
|
/**
|
|
31
31
|
* Data which can be serialized by Fluid.
|
|
32
32
|
* @remarks
|
|
33
|
-
* Can be encoded as a {@link FluidSerializableAsTree.(Tree:type)} using {@link (
|
|
33
|
+
* Can be encoded as a {@link FluidSerializableAsTree.(Tree:type)} using {@link (TreeBeta:interface).importConcise}.
|
|
34
34
|
* @alpha
|
|
35
35
|
*/
|
|
36
36
|
export type Data = JsonCompatible<IFluidHandle>;
|
|
@@ -39,7 +39,7 @@ export namespace FluidSerializableAsTree {
|
|
|
39
39
|
* {@link AllowedTypes} for any content allowed in the {@link FluidSerializableAsTree} domain.
|
|
40
40
|
* @example
|
|
41
41
|
* ```typescript
|
|
42
|
-
* const tree =
|
|
42
|
+
* const tree = TreeBeta.importConcise(FluidSerializableAsTree.Tree, { example: { nested: true }, value: 5 });
|
|
43
43
|
* ```
|
|
44
44
|
* @alpha
|
|
45
45
|
*/
|
|
@@ -69,7 +69,7 @@ export namespace FluidSerializableAsTree {
|
|
|
69
69
|
* // Due to TypeScript restrictions on recursive types, the constructor and be somewhat limiting.
|
|
70
70
|
* const fromArray = new JsonAsTreeObject([["a", 0]]);
|
|
71
71
|
* // Using `importConcise` can work better for Fluid Serializable data:
|
|
72
|
-
* const imported =
|
|
72
|
+
* const imported = TreeBeta.importConcise(FluidSerializableAsTree.Object, { a: 0 });
|
|
73
73
|
* // Node API is like a Map:
|
|
74
74
|
* const value = imported.get("a");
|
|
75
75
|
* ```
|
|
@@ -102,13 +102,13 @@ export namespace FluidSerializableAsTree {
|
|
|
102
102
|
/**
|
|
103
103
|
* Arbitrary Fluid Serializable array as a {@link TreeNode}.
|
|
104
104
|
* @remarks
|
|
105
|
-
* This can be imported using {@link (
|
|
105
|
+
* This can be imported using {@link (TreeBeta:interface).importConcise}.
|
|
106
106
|
* @example
|
|
107
107
|
* ```typescript
|
|
108
108
|
* // Due to TypeScript restrictions on recursive types, the constructor can be somewhat limiting.
|
|
109
109
|
* const usingConstructor = new FluidSerializableAsTree.Array(["a", 0, new FluidSerializableAsTree.Array([1])]);
|
|
110
110
|
* // Using `importConcise` can work better for Fluid Serializable data:
|
|
111
|
-
* const imported =
|
|
111
|
+
* const imported = TreeBeta.importConcise(FluidSerializableAsTree.Array, ["a", 0, [1]]);
|
|
112
112
|
* // Node API is like an Array:
|
|
113
113
|
* const inner: FluidSerializableAsTree.Tree = imported[2];
|
|
114
114
|
* assert(Tree.is(inner, FluidSerializableAsTree.Array));
|
|
@@ -336,7 +336,7 @@ export class SchematizingSimpleTreeView<
|
|
|
336
336
|
new HydratedContext(
|
|
337
337
|
this.flexTreeContext,
|
|
338
338
|
HydratedContext.schemaMapFromRootSchema(
|
|
339
|
-
this.rootFieldSchema.
|
|
339
|
+
this.rootFieldSchema.allowedTypesFull.evaluate(),
|
|
340
340
|
),
|
|
341
341
|
),
|
|
342
342
|
);
|
|
@@ -29,8 +29,6 @@ import {
|
|
|
29
29
|
type TreeFieldFromImplicitField,
|
|
30
30
|
type TreeLeafValue,
|
|
31
31
|
type UnsafeUnknownSchema,
|
|
32
|
-
conciseFromCursor,
|
|
33
|
-
type ConciseTree,
|
|
34
32
|
applySchemaToParserOptions,
|
|
35
33
|
cursorFromVerbose,
|
|
36
34
|
verboseFromCursor,
|
|
@@ -56,6 +54,10 @@ import {
|
|
|
56
54
|
toUnhydratedSchema,
|
|
57
55
|
type TreeParsingOptions,
|
|
58
56
|
type NodeChangedData,
|
|
57
|
+
type ConciseTree,
|
|
58
|
+
importConcise,
|
|
59
|
+
exportConcise,
|
|
60
|
+
borrowCursorFromTreeNodeOrValue,
|
|
59
61
|
} from "../simple-tree/index.js";
|
|
60
62
|
import { brand, extractFromOpaque, type JsonCompatible } from "../util/index.js";
|
|
61
63
|
import {
|
|
@@ -200,12 +202,12 @@ export interface TreeIdentifierUtils {
|
|
|
200
202
|
* @remarks
|
|
201
203
|
* Use via the {@link (TreeAlpha:variable)} singleton.
|
|
202
204
|
*
|
|
203
|
-
* The unhydrated node creation APIs in this interface do not support {@link
|
|
205
|
+
* The unhydrated node creation APIs in this interface do not support {@link ObjectSchemaOptions.allowUnknownOptionalFields | unknown optional fields}.
|
|
204
206
|
* This is because unknown optional fields still must have a schema: its just that the schema may come from the document's stored schema.
|
|
205
207
|
* Unhydrated nodes created via this interface are not associated with any document, so there is nowhere for them to get schema for unknown optional fields.
|
|
206
208
|
* Note that {@link (TreeBeta:interface).clone} can create an unhydrated node with unknown optional fields, as it uses the source node's stored schema (if any).
|
|
207
209
|
*
|
|
208
|
-
* Export APIs in this interface include {@link
|
|
210
|
+
* Export APIs in this interface include {@link ObjectSchemaOptions.allowUnknownOptionalFields | unknown optional fields}
|
|
209
211
|
* if they are using {@link KeyEncodingOptions.allStoredKeys}.
|
|
210
212
|
*
|
|
211
213
|
* @privateRemarks
|
|
@@ -248,19 +250,7 @@ export interface TreeAlpha {
|
|
|
248
250
|
>;
|
|
249
251
|
|
|
250
252
|
/**
|
|
251
|
-
*
|
|
252
|
-
* @remarks
|
|
253
|
-
* Due to {@link ConciseTree} relying on type inference from the data, its use is somewhat limited.
|
|
254
|
-
* This does not support {@link ConciseTree|ConciseTrees} with customized handle encodings or using persisted keys.
|
|
255
|
-
* Use "compressed" or "verbose" formats for more flexibility.
|
|
256
|
-
*
|
|
257
|
-
* When using this function,
|
|
258
|
-
* it is recommend to ensure your schema is unambiguous with {@link ITreeConfigurationOptions.preventAmbiguity}.
|
|
259
|
-
* If the schema is ambiguous, consider using {@link (TreeAlpha:interface).create} and {@link Unhydrated} nodes where needed,
|
|
260
|
-
* or using {@link (TreeAlpha:interface).(importVerbose:1)} and specify all types.
|
|
261
|
-
*
|
|
262
|
-
* Documented (and thus recoverable) error handling/reporting for this is not yet implemented,
|
|
263
|
-
* but for now most invalid inputs will throw a recoverable error.
|
|
253
|
+
* {@inheritDoc (TreeBeta:interface).importConcise}
|
|
264
254
|
*/
|
|
265
255
|
importConcise<const TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema>(
|
|
266
256
|
schema: UnsafeUnknownSchema extends TSchema
|
|
@@ -273,13 +263,30 @@ export interface TreeAlpha {
|
|
|
273
263
|
: TreeNode | TreeLeafValue | undefined
|
|
274
264
|
>;
|
|
275
265
|
|
|
266
|
+
/**
|
|
267
|
+
* {@inheritDoc (TreeBeta:interface).(exportConcise:1)}
|
|
268
|
+
* @privateRemarks Note: this was retained on this interface because {@link (TreeAlpha:interface).importConcise} exists.
|
|
269
|
+
* It should be removed if/when that is removed from this interface.
|
|
270
|
+
*/
|
|
271
|
+
exportConcise(node: TreeNode | TreeLeafValue, options?: TreeEncodingOptions): ConciseTree;
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* {@inheritDoc (TreeBeta:interface).(exportConcise:2)}
|
|
275
|
+
* @privateRemarks Note: this was retained on this interface because {@link (TreeAlpha:interface).importConcise} exists.
|
|
276
|
+
* It should be removed if/when that is removed from this interface.
|
|
277
|
+
*/
|
|
278
|
+
exportConcise(
|
|
279
|
+
node: TreeNode | TreeLeafValue | undefined,
|
|
280
|
+
options?: TreeEncodingOptions,
|
|
281
|
+
): ConciseTree | undefined;
|
|
282
|
+
|
|
276
283
|
/**
|
|
277
284
|
* Construct tree content compatible with a field defined by the provided `schema`.
|
|
278
285
|
* @param schema - The schema for what to construct. As this is an {@link ImplicitFieldSchema}, a {@link FieldSchema}, {@link TreeNodeSchema} or {@link AllowedTypes} array can be provided.
|
|
279
286
|
* @param data - The data used to construct the field content. See {@link (TreeAlpha:interface).(exportVerbose:1)}.
|
|
280
287
|
* @remarks
|
|
281
288
|
* This currently does not support input containing
|
|
282
|
-
* {@link
|
|
289
|
+
* {@link ObjectSchemaOptions.allowUnknownOptionalFields| unknown optional fields} but does support
|
|
283
290
|
* {@link SchemaStaticsAlpha.staged | staged} allowed types.
|
|
284
291
|
* Non-empty default values for fields are currently not supported (must be provided in the input).
|
|
285
292
|
* The content will be validated against the schema and an error will be thrown if out of schema.
|
|
@@ -290,25 +297,12 @@ export interface TreeAlpha {
|
|
|
290
297
|
options?: TreeParsingOptions,
|
|
291
298
|
): Unhydrated<TreeFieldFromImplicitField<TSchema>>;
|
|
292
299
|
|
|
293
|
-
/**
|
|
294
|
-
* Copy a snapshot of the current version of a TreeNode into a {@link ConciseTree}.
|
|
295
|
-
*/
|
|
296
|
-
exportConcise(node: TreeNode | TreeLeafValue, options?: TreeEncodingOptions): ConciseTree;
|
|
297
|
-
|
|
298
|
-
/**
|
|
299
|
-
* Copy a snapshot of the current version of a TreeNode into a {@link ConciseTree}, allowing undefined.
|
|
300
|
-
*/
|
|
301
|
-
exportConcise(
|
|
302
|
-
node: TreeNode | TreeLeafValue | undefined,
|
|
303
|
-
options?: TreeEncodingOptions,
|
|
304
|
-
): ConciseTree | undefined;
|
|
305
|
-
|
|
306
300
|
/**
|
|
307
301
|
* Copy a snapshot of the current version of a TreeNode into a JSON compatible plain old JavaScript Object (except for {@link @fluidframework/core-interfaces#IFluidHandle|IFluidHandles}).
|
|
308
302
|
* Uses the {@link VerboseTree} format, with an explicit type on every node.
|
|
309
303
|
*
|
|
310
304
|
* @remarks
|
|
311
|
-
* There are several cases this may be preferred to {@link (
|
|
305
|
+
* There are several cases this may be preferred to {@link (TreeBeta:interface).(exportConcise:1)}:
|
|
312
306
|
*
|
|
313
307
|
* 1. When not using {@link ITreeConfigurationOptions.preventAmbiguity} (or when using `useStableFieldKeys`), `exportConcise` can produce ambiguous data (the type may be unclear on some nodes).
|
|
314
308
|
* `exportVerbose` will always be unambiguous and thus lossless.
|
|
@@ -385,7 +379,7 @@ export interface TreeAlpha {
|
|
|
385
379
|
/**
|
|
386
380
|
* Gets the child of the given node with the given property key if a child exists under that key.
|
|
387
381
|
*
|
|
388
|
-
* @remarks {@link
|
|
382
|
+
* @remarks {@link ObjectSchemaOptions.allowUnknownOptionalFields | Unknown optional fields} of Object nodes will not be returned by this method.
|
|
389
383
|
*
|
|
390
384
|
* @param node - The parent node whose child is being requested.
|
|
391
385
|
* @param key - The property key under the node under which the child is being requested.
|
|
@@ -406,7 +400,7 @@ export interface TreeAlpha {
|
|
|
406
400
|
*
|
|
407
401
|
* Optional properties of Object nodes with no value are not included in the result.
|
|
408
402
|
*
|
|
409
|
-
* {@link
|
|
403
|
+
* {@link ObjectSchemaOptions.allowUnknownOptionalFields | Unknown optional fields} of Object nodes are not included in the result.
|
|
410
404
|
*
|
|
411
405
|
* @param node - The node whose children are being requested.
|
|
412
406
|
*
|
|
@@ -767,7 +761,7 @@ export const TreeAlpha: TreeAlpha = {
|
|
|
767
761
|
>;
|
|
768
762
|
},
|
|
769
763
|
|
|
770
|
-
importConcise<TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema>(
|
|
764
|
+
importConcise<const TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema>(
|
|
771
765
|
schema: UnsafeUnknownSchema extends TSchema
|
|
772
766
|
? ImplicitFieldSchema
|
|
773
767
|
: TSchema & ImplicitFieldSchema,
|
|
@@ -777,12 +771,11 @@ export const TreeAlpha: TreeAlpha = {
|
|
|
777
771
|
? TreeFieldFromImplicitField<TSchema>
|
|
778
772
|
: TreeNode | TreeLeafValue | undefined
|
|
779
773
|
> {
|
|
780
|
-
|
|
781
|
-
// Perhaps it should error instead of hydrating nodes for example.
|
|
782
|
-
// For now however, it is a simple wrapper around `create`.
|
|
783
|
-
return this.create(schema, data as InsertableField<TSchema>);
|
|
774
|
+
return importConcise(schema, data);
|
|
784
775
|
},
|
|
785
776
|
|
|
777
|
+
exportConcise,
|
|
778
|
+
|
|
786
779
|
importVerbose<const TSchema extends ImplicitFieldSchema>(
|
|
787
780
|
schema: TSchema,
|
|
788
781
|
data: VerboseTree | undefined,
|
|
@@ -806,8 +799,6 @@ export const TreeAlpha: TreeAlpha = {
|
|
|
806
799
|
);
|
|
807
800
|
},
|
|
808
801
|
|
|
809
|
-
exportConcise,
|
|
810
|
-
|
|
811
802
|
exportVerbose(node: TreeNode | TreeLeafValue, options?: TreeEncodingOptions): VerboseTree {
|
|
812
803
|
if (isTreeValue(node)) {
|
|
813
804
|
return node;
|
|
@@ -1020,46 +1011,6 @@ export const TreeAlpha: TreeAlpha = {
|
|
|
1020
1011
|
},
|
|
1021
1012
|
};
|
|
1022
1013
|
|
|
1023
|
-
function exportConcise(
|
|
1024
|
-
node: TreeNode | TreeLeafValue,
|
|
1025
|
-
options?: TreeEncodingOptions,
|
|
1026
|
-
): ConciseTree;
|
|
1027
|
-
|
|
1028
|
-
function exportConcise(
|
|
1029
|
-
node: TreeNode | TreeLeafValue | undefined,
|
|
1030
|
-
options?: TreeEncodingOptions,
|
|
1031
|
-
): ConciseTree | undefined;
|
|
1032
|
-
|
|
1033
|
-
function exportConcise(
|
|
1034
|
-
node: TreeNode | TreeLeafValue | undefined,
|
|
1035
|
-
options?: TreeEncodingOptions,
|
|
1036
|
-
): ConciseTree | undefined {
|
|
1037
|
-
if (!isTreeNode(node)) {
|
|
1038
|
-
return node;
|
|
1039
|
-
}
|
|
1040
|
-
const config: TreeEncodingOptions = { ...options };
|
|
1041
|
-
|
|
1042
|
-
const kernel = getKernel(node);
|
|
1043
|
-
const cursor = borrowCursorFromTreeNodeOrValue(node);
|
|
1044
|
-
return conciseFromCursor(cursor, kernel.context, config);
|
|
1045
|
-
}
|
|
1046
|
-
|
|
1047
|
-
/**
|
|
1048
|
-
* Borrow a cursor from a node.
|
|
1049
|
-
* @remarks
|
|
1050
|
-
* The cursor must be put back to its original location before the node is used again.
|
|
1051
|
-
*/
|
|
1052
|
-
function borrowCursorFromTreeNodeOrValue(
|
|
1053
|
-
node: TreeNode | TreeLeafValue,
|
|
1054
|
-
): ITreeCursorSynchronous {
|
|
1055
|
-
if (isTreeValue(node)) {
|
|
1056
|
-
return cursorFromVerbose(node, {});
|
|
1057
|
-
}
|
|
1058
|
-
const kernel = getKernel(node);
|
|
1059
|
-
const cursor = kernel.getOrCreateInnerNode().borrowCursor();
|
|
1060
|
-
return cursor;
|
|
1061
|
-
}
|
|
1062
|
-
|
|
1063
1014
|
/**
|
|
1064
1015
|
* Borrow a cursor from a field.
|
|
1065
1016
|
* @remarks
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
* @privateRemarks
|
|
29
29
|
* This can store all possible simple trees,
|
|
30
30
|
* but it can not store all possible trees representable by our internal representations like FlexTree and JsonableTree.
|
|
31
|
-
* @
|
|
31
|
+
* @beta
|
|
32
32
|
*/
|
|
33
33
|
export type ConciseTree<THandle = IFluidHandle> =
|
|
34
34
|
| Exclude<TreeLeafValue, IFluidHandle>
|
|
@@ -19,10 +19,9 @@ import {
|
|
|
19
19
|
normalizeFieldSchema,
|
|
20
20
|
} from "../fieldSchema.js";
|
|
21
21
|
import {
|
|
22
|
+
type AllowedTypesFullEvaluated,
|
|
22
23
|
NodeKind,
|
|
23
24
|
type TreeNodeSchema,
|
|
24
|
-
isAnnotatedAllowedType,
|
|
25
|
-
evaluateLazySchema,
|
|
26
25
|
markSchemaMostDerived,
|
|
27
26
|
} from "../core/index.js";
|
|
28
27
|
import {
|
|
@@ -165,9 +164,6 @@ export interface ITreeViewConfiguration<
|
|
|
165
164
|
|
|
166
165
|
/**
|
|
167
166
|
* Configuration for {@link ViewableTree.viewWith}.
|
|
168
|
-
* @privateRemarks
|
|
169
|
-
* When `ImplicitAnnotatedFieldSchema` is stabilized, TSchema should be updated to use it.
|
|
170
|
-
* When doing this, the example for `staged` will need to be updated/simplified.
|
|
171
167
|
* @sealed @public
|
|
172
168
|
*/
|
|
173
169
|
export class TreeViewConfiguration<
|
|
@@ -235,9 +231,9 @@ export class TreeViewConfiguration<
|
|
|
235
231
|
debugAssert(() => !definitions.has(schema.identifier));
|
|
236
232
|
definitions.set(schema.identifier, schema as SimpleNodeSchema & TreeNodeSchema);
|
|
237
233
|
},
|
|
238
|
-
allowedTypes({ types }): void {
|
|
234
|
+
allowedTypes({ types }: AllowedTypesFullEvaluated): void {
|
|
239
235
|
checkUnion(
|
|
240
|
-
types.map((t) =>
|
|
236
|
+
types.map((t) => t.type),
|
|
241
237
|
config.preventAmbiguity,
|
|
242
238
|
ambiguityErrors,
|
|
243
239
|
);
|
|
@@ -35,7 +35,7 @@ import { isObjectNodeSchema } from "../node-kinds/index.js";
|
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* Options for how to interpret or encode a tree when schema information is available.
|
|
38
|
-
* @
|
|
38
|
+
* @beta
|
|
39
39
|
* @input
|
|
40
40
|
*/
|
|
41
41
|
export interface TreeEncodingOptions<TKeyOptions = KeyEncodingOptions> {
|
|
@@ -44,7 +44,7 @@ export interface TreeEncodingOptions<TKeyOptions = KeyEncodingOptions> {
|
|
|
44
44
|
* @remarks
|
|
45
45
|
* Has no effect on {@link NodeKind}s other than {@link NodeKind.Object}.
|
|
46
46
|
*
|
|
47
|
-
* {@link
|
|
47
|
+
* {@link ObjectSchemaOptions.allowUnknownOptionalFields|Unknown optional field} will be omitted when using property keys.
|
|
48
48
|
* @defaultValue {@link KeyEncodingOptions.usePropertyKeys}.
|
|
49
49
|
*/
|
|
50
50
|
readonly keys?: TKeyOptions;
|
|
@@ -61,7 +61,7 @@ export type TreeParsingOptions = TreeEncodingOptions<
|
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
63
|
* Options for how to encode keys in a tree.
|
|
64
|
-
* @
|
|
64
|
+
* @beta
|
|
65
65
|
* @input
|
|
66
66
|
*/
|
|
67
67
|
export enum KeyEncodingOptions {
|
|
@@ -69,21 +69,21 @@ export enum KeyEncodingOptions {
|
|
|
69
69
|
* Use property keys.
|
|
70
70
|
* @remarks
|
|
71
71
|
* Supported for import and export.
|
|
72
|
-
* {@link
|
|
72
|
+
* {@link ObjectSchemaOptions.allowUnknownOptionalFields|Unknown optional fields} will be omitted when using property keys.
|
|
73
73
|
*/
|
|
74
74
|
usePropertyKeys = "usePropertyKeys",
|
|
75
75
|
/**
|
|
76
|
-
* Use stored keys, and include {@link
|
|
76
|
+
* Use stored keys, and include {@link ObjectSchemaOptions.allowUnknownOptionalFields|Unknown optional fields}.
|
|
77
77
|
* @remarks
|
|
78
78
|
* Currently only supported for export.
|
|
79
79
|
*/
|
|
80
80
|
allStoredKeys = "allStoredKeys",
|
|
81
81
|
/**
|
|
82
|
-
* Use stored keys but do not include {@link
|
|
82
|
+
* Use stored keys but do not include {@link ObjectSchemaOptions.allowUnknownOptionalFields | unknown optional fields}.
|
|
83
83
|
* @remarks
|
|
84
84
|
* Supported for import and export.
|
|
85
85
|
* For export, this omits unknown optional fields.
|
|
86
|
-
* For import, any unexpected fields are errors, regardless of {@link
|
|
86
|
+
* For import, any unexpected fields are errors, regardless of {@link ObjectSchemaOptions.allowUnknownOptionalFields}.
|
|
87
87
|
*/
|
|
88
88
|
knownStoredKeys = "knownStoredKeys",
|
|
89
89
|
}
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
import { brand } from "../../util/index.js";
|
|
25
25
|
import {
|
|
26
26
|
NodeKind,
|
|
27
|
-
|
|
27
|
+
normalizeAndEvaluateAnnotatedAllowedTypes,
|
|
28
28
|
type AnnotatedAllowedType,
|
|
29
29
|
type TreeNodeSchema,
|
|
30
30
|
} from "../core/index.js";
|
|
@@ -237,7 +237,7 @@ function* getNodeDiscrepancies(
|
|
|
237
237
|
}
|
|
238
238
|
|
|
239
239
|
yield* getAllowedTypeDiscrepancies(
|
|
240
|
-
|
|
240
|
+
normalizeAndEvaluateAnnotatedAllowedTypes(view.info).types,
|
|
241
241
|
arrayStoredSchema,
|
|
242
242
|
brand(view.identifier),
|
|
243
243
|
EmptyKey,
|
|
@@ -346,7 +346,7 @@ function* getFieldDiscrepancies(
|
|
|
346
346
|
0xbee /* all field schema should be FieldSchemaAlpha */,
|
|
347
347
|
);
|
|
348
348
|
yield* getAllowedTypeDiscrepancies(
|
|
349
|
-
view.
|
|
349
|
+
view.allowedTypesFull.evaluate().types,
|
|
350
350
|
stored.types,
|
|
351
351
|
identifier,
|
|
352
352
|
fieldKey,
|
|
@@ -28,7 +28,8 @@ export { type SchemaStatics, schemaStatics } from "./schemaStatics.js";
|
|
|
28
28
|
export {
|
|
29
29
|
SchemaFactory,
|
|
30
30
|
type ScopedSchemaName,
|
|
31
|
-
type
|
|
31
|
+
type ObjectSchemaOptionsAlpha,
|
|
32
|
+
type ObjectSchemaOptions,
|
|
32
33
|
type NodeSchemaOptions,
|
|
33
34
|
type NodeSchemaOptionsAlpha,
|
|
34
35
|
type SchemaFactory_base,
|
|
@@ -118,7 +119,14 @@ export {
|
|
|
118
119
|
replaceConciseTreeHandles,
|
|
119
120
|
} from "./conciseTree.js";
|
|
120
121
|
|
|
121
|
-
export {
|
|
122
|
+
export {
|
|
123
|
+
borrowCursorFromTreeNodeOrValue,
|
|
124
|
+
exportConcise,
|
|
125
|
+
importConcise,
|
|
126
|
+
type NodeChangedData,
|
|
127
|
+
TreeBeta,
|
|
128
|
+
type TreeChangeEventsBeta,
|
|
129
|
+
} from "./treeBeta.js";
|
|
122
130
|
export { createSimpleTreeIndex, type SimpleTreeIndex } from "./simpleTreeIndex.js";
|
|
123
131
|
export {
|
|
124
132
|
createIdentifierIndex,
|