@fluidframework/tree 2.42.0 → 2.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +189 -0
- package/api-report/tree.alpha.api.md +72 -25
- package/api-report/tree.beta.api.md +34 -0
- package/api-report/tree.legacy.alpha.api.md +1 -0
- package/api-report/tree.legacy.public.api.md +1 -0
- package/api-report/tree.public.api.md +1 -0
- package/dist/alpha.d.ts +12 -6
- package/dist/beta.d.ts +6 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +5 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/schema-stored/formatV2.d.ts +80 -0
- package/dist/core/schema-stored/formatV2.d.ts.map +1 -0
- package/dist/core/schema-stored/formatV2.js +55 -0
- package/dist/core/schema-stored/formatV2.js.map +1 -0
- package/dist/core/schema-stored/index.d.ts +3 -1
- package/dist/core/schema-stored/index.d.ts.map +1 -1
- package/dist/core/schema-stored/index.js +5 -2
- package/dist/core/schema-stored/index.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +49 -17
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +65 -22
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +9 -7
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +13 -9
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +3 -3
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +6 -6
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.js +3 -3
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
- package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts +8 -3
- package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/detachedFieldIndexSummarizer.js +2 -5
- package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +24 -25
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/dist/feature-libraries/flex-tree/index.d.ts +0 -1
- package/dist/feature-libraries/flex-tree/index.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/index.js +1 -7
- package/dist/feature-libraries/flex-tree/index.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyEntity.d.ts +2 -2
- package/dist/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyEntity.js +3 -0
- package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.d.ts +1 -2
- package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +2 -5
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts +5 -5
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.js +15 -7
- package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +8 -3
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +2 -5
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +2 -2
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +1 -2
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/mapTreeCursor.d.ts +16 -2
- package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
- package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js +2 -0
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.js +2 -0
- package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +8 -4
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -36
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.js +3 -3
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
- package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/codec.js +59 -9
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/feature-libraries/schema-index/formatV1.d.ts +1 -1
- package/dist/feature-libraries/schema-index/formatV2.d.ts +42 -0
- package/dist/feature-libraries/schema-index/formatV2.d.ts.map +1 -0
- package/dist/feature-libraries/schema-index/formatV2.js +26 -0
- package/dist/feature-libraries/schema-index/formatV2.js.map +1 -0
- package/dist/feature-libraries/schema-index/index.d.ts +2 -1
- package/dist/feature-libraries/schema-index/index.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/index.js +4 -2
- package/dist/feature-libraries/schema-index/index.js.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +7 -2
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.js +6 -6
- package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
- package/dist/shared-tree/schematizeTree.js +1 -0
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +3 -3
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +5 -1
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +34 -5
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts +39 -1
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +117 -11
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.d.ts +8 -3
- package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.js +2 -5
- package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts +18 -7
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +15 -2
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/simple-tree/api/configuration.d.ts +15 -3
- package/dist/simple-tree/api/configuration.d.ts.map +1 -1
- package/dist/simple-tree/api/configuration.js +40 -22
- package/dist/simple-tree/api/configuration.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +1 -1
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +4 -4
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.js +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/dist/simple-tree/api/schemaCreationUtilities.d.ts +3 -3
- package/dist/simple-tree/api/schemaCreationUtilities.js +3 -3
- package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts +15 -11
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +4 -0
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +41 -11
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js +31 -4
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/storedSchema.js +2 -2
- package/dist/simple-tree/api/storedSchema.js.map +1 -1
- package/dist/simple-tree/api/treeChangeEvents.d.ts +8 -3
- package/dist/simple-tree/api/treeChangeEvents.d.ts.map +1 -1
- package/dist/simple-tree/api/treeChangeEvents.js.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.d.ts +3 -0
- package/dist/simple-tree/api/treeNodeApi.d.ts.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/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +5 -0
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
- package/dist/simple-tree/core/context.d.ts +3 -3
- 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/getOrCreateNode.d.ts +9 -0
- package/dist/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
- package/dist/simple-tree/core/getOrCreateNode.js +12 -1
- package/dist/simple-tree/core/getOrCreateNode.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 +3 -1
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +2 -2
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts +68 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.js +24 -1
- package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts +5 -9
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js +12 -31
- package/dist/simple-tree/core/unhydratedFlexTree.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 +9 -5
- package/dist/simple-tree/core/walkSchema.js.map +1 -1
- package/dist/simple-tree/createContext.js +1 -1
- package/dist/simple-tree/createContext.js.map +1 -1
- package/dist/simple-tree/getTreeNodeForField.d.ts +1 -1
- package/dist/simple-tree/getTreeNodeForField.d.ts.map +1 -1
- package/dist/simple-tree/getTreeNodeForField.js +3 -3
- package/dist/simple-tree/getTreeNodeForField.js.map +1 -1
- package/dist/simple-tree/index.d.ts +6 -6
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +8 -5
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts +4 -1
- package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js +1 -0
- package/dist/simple-tree/leafNodeSchema.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +3 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js +21 -16
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.d.ts +3 -2
- package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.js +11 -5
- package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts +3 -2
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.js +12 -7
- package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
- package/dist/simple-tree/prepareForInsertion.js +5 -1
- package/dist/simple-tree/prepareForInsertion.js.map +1 -1
- package/dist/simple-tree/schemaTypes.d.ts +63 -30
- package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
- package/dist/simple-tree/schemaTypes.js +73 -40
- package/dist/simple-tree/schemaTypes.js.map +1 -1
- package/dist/simple-tree/simpleSchema.d.ts +22 -4
- package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/simpleSchema.js.map +1 -1
- package/dist/simple-tree/toStoredSchema.d.ts +4 -0
- package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +15 -4
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/simple-tree/treeNodeValid.d.ts.map +1 -1
- package/dist/simple-tree/treeNodeValid.js +1 -2
- package/dist/simple-tree/treeNodeValid.js.map +1 -1
- package/dist/simple-tree/walkFieldSchema.d.ts.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 +1 -1
- package/dist/util/typeUtils.d.ts +2 -2
- package/dist/util/typeUtils.js.map +1 -1
- package/dist/util/utils.d.ts +2 -0
- package/dist/util/utils.d.ts.map +1 -1
- package/dist/util/utils.js.map +1 -1
- package/lib/alpha.d.ts +12 -6
- package/lib/beta.d.ts +6 -1
- package/lib/core/index.d.ts +1 -1
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +1 -1
- package/lib/core/index.js.map +1 -1
- package/lib/core/schema-stored/formatV2.d.ts +80 -0
- package/lib/core/schema-stored/formatV2.d.ts.map +1 -0
- package/lib/core/schema-stored/formatV2.js +52 -0
- package/lib/core/schema-stored/formatV2.js.map +1 -0
- package/lib/core/schema-stored/index.d.ts +3 -1
- package/lib/core/schema-stored/index.d.ts.map +1 -1
- package/lib/core/schema-stored/index.js +3 -1
- package/lib/core/schema-stored/index.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +49 -17
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +63 -21
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +9 -7
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +11 -7
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +3 -3
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +7 -7
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.js +3 -3
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
- package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts +8 -3
- package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/detachedFieldIndexSummarizer.js +2 -5
- package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +24 -25
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/lib/feature-libraries/flex-tree/index.d.ts +0 -1
- package/lib/feature-libraries/flex-tree/index.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/index.js +0 -1
- package/lib/feature-libraries/flex-tree/index.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyEntity.d.ts +2 -2
- package/lib/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyEntity.js +3 -0
- package/lib/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.d.ts +1 -2
- package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +3 -6
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts +5 -5
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.js +15 -7
- package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +8 -3
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +2 -5
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +2 -2
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +1 -1
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/mapTreeCursor.d.ts +16 -2
- package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
- package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js +2 -0
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js +2 -0
- package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +8 -4
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -36
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.js +3 -3
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
- package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/codec.js +60 -10
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/feature-libraries/schema-index/formatV1.d.ts +1 -1
- package/lib/feature-libraries/schema-index/formatV2.d.ts +42 -0
- package/lib/feature-libraries/schema-index/formatV2.d.ts.map +1 -0
- package/lib/feature-libraries/schema-index/formatV2.js +23 -0
- package/lib/feature-libraries/schema-index/formatV2.js.map +1 -0
- package/lib/feature-libraries/schema-index/index.d.ts +2 -1
- package/lib/feature-libraries/schema-index/index.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/index.js +2 -1
- package/lib/feature-libraries/schema-index/index.js.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +7 -2
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.js +6 -6
- package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
- package/lib/shared-tree/schematizeTree.js +1 -0
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +4 -4
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +5 -1
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +34 -5
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts +39 -1
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +111 -5
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.d.ts +8 -3
- package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.js +2 -5
- package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts +18 -7
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +15 -2
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/simple-tree/api/configuration.d.ts +15 -3
- package/lib/simple-tree/api/configuration.d.ts.map +1 -1
- package/lib/simple-tree/api/configuration.js +42 -24
- package/lib/simple-tree/api/configuration.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +1 -1
- 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/schemaCompatibilityTester.js +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/lib/simple-tree/api/schemaCreationUtilities.d.ts +3 -3
- package/lib/simple-tree/api/schemaCreationUtilities.js +3 -3
- package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts +15 -11
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +4 -0
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +41 -11
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js +31 -4
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/storedSchema.js +2 -2
- package/lib/simple-tree/api/storedSchema.js.map +1 -1
- package/lib/simple-tree/api/treeChangeEvents.d.ts +8 -3
- package/lib/simple-tree/api/treeChangeEvents.d.ts.map +1 -1
- package/lib/simple-tree/api/treeChangeEvents.js.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.d.ts +3 -0
- package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.js +2 -2
- package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +5 -0
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
- package/lib/simple-tree/core/context.d.ts +3 -3
- 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/getOrCreateNode.d.ts +9 -0
- package/lib/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
- package/lib/simple-tree/core/getOrCreateNode.js +10 -0
- package/lib/simple-tree/core/getOrCreateNode.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 +2 -2
- package/lib/simple-tree/core/index.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +2 -2
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts +68 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.js +21 -0
- package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts +5 -9
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js +15 -34
- package/lib/simple-tree/core/unhydratedFlexTree.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 +9 -5
- package/lib/simple-tree/core/walkSchema.js.map +1 -1
- package/lib/simple-tree/createContext.js +1 -1
- package/lib/simple-tree/createContext.js.map +1 -1
- package/lib/simple-tree/getTreeNodeForField.d.ts +1 -1
- package/lib/simple-tree/getTreeNodeForField.d.ts.map +1 -1
- package/lib/simple-tree/getTreeNodeForField.js +1 -1
- package/lib/simple-tree/getTreeNodeForField.js.map +1 -1
- package/lib/simple-tree/index.d.ts +6 -6
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +4 -4
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.d.ts +4 -1
- package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js +2 -1
- package/lib/simple-tree/leafNodeSchema.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +3 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js +13 -8
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.d.ts +3 -2
- package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.js +14 -8
- package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.d.ts +3 -2
- package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.js +14 -9
- package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
- package/lib/simple-tree/prepareForInsertion.js +5 -1
- package/lib/simple-tree/prepareForInsertion.js.map +1 -1
- package/lib/simple-tree/schemaTypes.d.ts +63 -30
- package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
- package/lib/simple-tree/schemaTypes.js +70 -36
- package/lib/simple-tree/schemaTypes.js.map +1 -1
- package/lib/simple-tree/simpleSchema.d.ts +22 -4
- package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/simpleSchema.js.map +1 -1
- package/lib/simple-tree/toStoredSchema.d.ts +4 -0
- package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +15 -4
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/simple-tree/treeNodeValid.d.ts.map +1 -1
- package/lib/simple-tree/treeNodeValid.js +1 -2
- package/lib/simple-tree/treeNodeValid.js.map +1 -1
- package/lib/simple-tree/walkFieldSchema.d.ts.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 +1 -1
- package/lib/util/typeUtils.d.ts +2 -2
- package/lib/util/typeUtils.js.map +1 -1
- package/lib/util/utils.d.ts +2 -0
- package/lib/util/utils.d.ts.map +1 -1
- package/lib/util/utils.js.map +1 -1
- package/package.json +23 -23
- package/src/core/index.ts +3 -1
- package/src/core/schema-stored/formatV2.ts +78 -0
- package/src/core/schema-stored/index.ts +4 -1
- package/src/core/schema-stored/schema.ts +123 -33
- package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +16 -11
- package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +16 -7
- package/src/feature-libraries/chunked-forest/codec/nodeShape.ts +4 -4
- package/src/feature-libraries/detachedFieldIndexSummarizer.ts +9 -16
- package/src/feature-libraries/flex-tree/flexTreeTypes.ts +33 -30
- package/src/feature-libraries/flex-tree/index.ts +0 -8
- package/src/feature-libraries/flex-tree/lazyEntity.ts +5 -1
- package/src/feature-libraries/flex-tree/lazyField.ts +5 -8
- package/src/feature-libraries/flex-tree/lazyNode.ts +17 -8
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +9 -16
- package/src/feature-libraries/index.ts +1 -1
- package/src/feature-libraries/mapTreeCursor.ts +17 -8
- package/src/feature-libraries/modular-schema/fieldKindWithEditor.ts +2 -0
- package/src/feature-libraries/object-forest/objectForest.ts +3 -0
- package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +11 -6
- package/src/feature-libraries/schema-edits/schemaChangeFormat.ts +3 -3
- package/src/feature-libraries/schema-index/codec.ts +73 -14
- package/src/feature-libraries/schema-index/formatV2.ts +30 -0
- package/src/feature-libraries/schema-index/index.ts +2 -1
- package/src/feature-libraries/schema-index/schemaSummarizer.ts +11 -18
- package/src/index.ts +6 -0
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/schematizeTree.ts +1 -0
- package/src/shared-tree/schematizingTreeView.ts +8 -5
- package/src/shared-tree/sharedTree.ts +42 -12
- package/src/shared-tree/treeAlpha.ts +196 -6
- package/src/shared-tree-core/editManagerSummarizer.ts +9 -16
- package/src/shared-tree-core/sharedTreeCore.ts +33 -24
- package/src/simple-tree/api/configuration.ts +59 -27
- package/src/simple-tree/api/index.ts +3 -3
- package/src/simple-tree/api/schemaCompatibilityTester.ts +1 -1
- package/src/simple-tree/api/schemaCreationUtilities.ts +3 -3
- package/src/simple-tree/api/schemaFactory.ts +16 -11
- package/src/simple-tree/api/schemaFactoryAlpha.ts +53 -8
- package/src/simple-tree/api/storedSchema.ts +4 -4
- package/src/simple-tree/api/treeChangeEvents.ts +8 -3
- package/src/simple-tree/api/treeNodeApi.ts +5 -2
- package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +5 -0
- package/src/simple-tree/core/context.ts +3 -3
- package/src/simple-tree/core/getOrCreateNode.ts +14 -0
- package/src/simple-tree/core/index.ts +7 -1
- package/src/simple-tree/core/treeNodeKernel.ts +2 -2
- package/src/simple-tree/core/treeNodeSchema.ts +113 -1
- package/src/simple-tree/core/unhydratedFlexTree.ts +22 -44
- package/src/simple-tree/core/walkSchema.ts +16 -7
- package/src/simple-tree/createContext.ts +1 -1
- package/src/simple-tree/getTreeNodeForField.ts +3 -1
- package/src/simple-tree/index.ts +12 -5
- package/src/simple-tree/leafNodeSchema.ts +9 -1
- package/src/simple-tree/node-kinds/array/arrayNode.ts +20 -9
- package/src/simple-tree/node-kinds/map/mapNode.ts +21 -6
- package/src/simple-tree/node-kinds/object/objectNode.ts +29 -12
- package/src/simple-tree/prepareForInsertion.ts +5 -1
- package/src/simple-tree/schemaTypes.ts +151 -71
- package/src/simple-tree/simpleSchema.ts +27 -5
- package/src/simple-tree/toStoredSchema.ts +17 -4
- package/src/simple-tree/treeNodeValid.ts +1 -1
- package/src/simple-tree/walkFieldSchema.ts +5 -1
- package/src/util/typeUtils.ts +2 -2
- package/src/util/utils.ts +2 -0
- package/dist/feature-libraries/flex-tree/navigation.d.ts +0 -46
- package/dist/feature-libraries/flex-tree/navigation.d.ts.map +0 -1
- package/dist/feature-libraries/flex-tree/navigation.js +0 -104
- package/dist/feature-libraries/flex-tree/navigation.js.map +0 -1
- package/lib/feature-libraries/flex-tree/navigation.d.ts +0 -46
- package/lib/feature-libraries/flex-tree/navigation.d.ts.map +0 -1
- package/lib/feature-libraries/flex-tree/navigation.js +0 -97
- package/lib/feature-libraries/flex-tree/navigation.js.map +0 -1
- package/src/feature-libraries/flex-tree/navigation.ts +0 -121
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
getOrCreate,
|
|
21
21
|
type RestrictiveStringRecord,
|
|
22
22
|
type IsUnion,
|
|
23
|
+
type JsonCompatibleReadOnlyObject,
|
|
23
24
|
} from "../util/index.js";
|
|
24
25
|
|
|
25
26
|
import type {
|
|
@@ -31,8 +32,10 @@ import type {
|
|
|
31
32
|
TreeNodeSchemaCore,
|
|
32
33
|
TreeNodeSchemaNonClass,
|
|
33
34
|
UnhydratedFlexTreeNode,
|
|
35
|
+
AnnotatedAllowedType,
|
|
36
|
+
NormalizedAnnotatedAllowedTypes,
|
|
34
37
|
} from "./core/index.js";
|
|
35
|
-
import { inPrototypeChain } from "./core/index.js";
|
|
38
|
+
import { inPrototypeChain, isAnnotatedAllowedTypes } from "./core/index.js";
|
|
36
39
|
import { isLazy, type FlexListToUnion, type LazyItem } from "./flexList.js";
|
|
37
40
|
import { LeafNodeSchema } from "./leafNodeSchema.js";
|
|
38
41
|
import type { SimpleFieldSchema, SimpleObjectFieldSchema } from "./simpleSchema.js";
|
|
@@ -105,17 +108,6 @@ export interface AnnotatedAllowedTypes {
|
|
|
105
108
|
readonly types: readonly (AnnotatedAllowedType | LazyItem<TreeNodeSchema>)[];
|
|
106
109
|
}
|
|
107
110
|
|
|
108
|
-
/**
|
|
109
|
-
* Checks if the input is an {@link AnnotatedAllowedTypes}.
|
|
110
|
-
*/
|
|
111
|
-
export function isAnnotatedAllowedTypes(
|
|
112
|
-
allowedTypes: ImplicitAnnotatedAllowedTypes,
|
|
113
|
-
): allowedTypes is AnnotatedAllowedTypes {
|
|
114
|
-
return (
|
|
115
|
-
typeof allowedTypes === "object" && "metadata" in allowedTypes && "types" in allowedTypes
|
|
116
|
-
);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
111
|
/**
|
|
120
112
|
* Annotations that apply to a set of allowed types.
|
|
121
113
|
* @remarks
|
|
@@ -129,21 +121,6 @@ export interface AllowedTypesMetadata {
|
|
|
129
121
|
readonly custom?: unknown;
|
|
130
122
|
}
|
|
131
123
|
|
|
132
|
-
/**
|
|
133
|
-
* Stores annotations for an individual allowed type.
|
|
134
|
-
* @alpha
|
|
135
|
-
*/
|
|
136
|
-
export interface AnnotatedAllowedType<T extends TreeNodeSchema = TreeNodeSchema> {
|
|
137
|
-
/**
|
|
138
|
-
* Annotations for the allowed type.
|
|
139
|
-
*/
|
|
140
|
-
readonly metadata: AllowedTypeMetadata;
|
|
141
|
-
/**
|
|
142
|
-
* The allowed type the annotations apply to in a particular schema.
|
|
143
|
-
*/
|
|
144
|
-
readonly type: LazyItem<T>;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
124
|
/**
|
|
148
125
|
* Checks if the given allowed type is annotated with {@link AllowedTypeMetadata}.
|
|
149
126
|
*/
|
|
@@ -206,7 +183,10 @@ export enum FieldKind {
|
|
|
206
183
|
* If an explicit stored key was specified in the schema, it will be used.
|
|
207
184
|
* Otherwise, the stored key is the same as the property key.
|
|
208
185
|
*/
|
|
209
|
-
export function getStoredKey(
|
|
186
|
+
export function getStoredKey(
|
|
187
|
+
propertyKey: string,
|
|
188
|
+
fieldSchema: ImplicitAnnotatedFieldSchema,
|
|
189
|
+
): FieldKey {
|
|
210
190
|
return brand(getExplicitStoredKey(fieldSchema) ?? propertyKey);
|
|
211
191
|
}
|
|
212
192
|
|
|
@@ -214,7 +194,9 @@ export function getStoredKey(propertyKey: string, fieldSchema: ImplicitFieldSche
|
|
|
214
194
|
* Gets the {@link FieldProps.key | stored key} specified by the schema, if one was explicitly specified.
|
|
215
195
|
* Otherwise, returns undefined.
|
|
216
196
|
*/
|
|
217
|
-
export function getExplicitStoredKey(
|
|
197
|
+
export function getExplicitStoredKey(
|
|
198
|
+
fieldSchema: ImplicitAnnotatedFieldSchema,
|
|
199
|
+
): string | undefined {
|
|
218
200
|
return fieldSchema instanceof FieldSchema ? fieldSchema.props?.key : undefined;
|
|
219
201
|
}
|
|
220
202
|
|
|
@@ -297,7 +279,23 @@ export interface FieldProps<TCustomMetadata = unknown> {
|
|
|
297
279
|
}
|
|
298
280
|
|
|
299
281
|
/**
|
|
300
|
-
*
|
|
282
|
+
* {@link FieldProps} extended with additional `alpha` options.
|
|
283
|
+
*
|
|
284
|
+
* @typeParam TCustomMetadata - Custom metadata properties to associate with the field.
|
|
285
|
+
* See {@link FieldSchemaMetadata.custom}.
|
|
286
|
+
*
|
|
287
|
+
* @alpha @input
|
|
288
|
+
*/
|
|
289
|
+
export interface FieldPropsAlpha<TCustomMetadata = unknown>
|
|
290
|
+
extends FieldProps<TCustomMetadata> {
|
|
291
|
+
/**
|
|
292
|
+
* The persisted metadata for this schema element.
|
|
293
|
+
*/
|
|
294
|
+
readonly persistedMetadata?: JsonCompatibleReadOnlyObject | undefined;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* A {@link FieldProvider} which requires additional context in order to produce its content
|
|
301
299
|
*/
|
|
302
300
|
export type ContextualFieldProvider = (
|
|
303
301
|
context: FlexTreeHydratedContextMinimal | "UseGlobalContext",
|
|
@@ -361,6 +359,22 @@ export interface FieldSchemaMetadata<TCustomMetadata = unknown> {
|
|
|
361
359
|
readonly description?: string | undefined;
|
|
362
360
|
}
|
|
363
361
|
|
|
362
|
+
/**
|
|
363
|
+
* Metadata associated with a {@link FieldSchema}. Includes fields used by alpha features.
|
|
364
|
+
*
|
|
365
|
+
* @remarks Specified via {@link FieldProps.metadata}.
|
|
366
|
+
*
|
|
367
|
+
* @sealed
|
|
368
|
+
* @alpha
|
|
369
|
+
*/
|
|
370
|
+
export interface FieldSchemaMetadataAlpha<TCustomMetadata = unknown>
|
|
371
|
+
extends FieldSchemaMetadata<TCustomMetadata> {
|
|
372
|
+
/**
|
|
373
|
+
* The persisted metadata for this schema element.
|
|
374
|
+
*/
|
|
375
|
+
readonly persistedMetadata?: JsonCompatibleReadOnlyObject | undefined;
|
|
376
|
+
}
|
|
377
|
+
|
|
364
378
|
/**
|
|
365
379
|
* Package internal construction API.
|
|
366
380
|
*/
|
|
@@ -508,13 +522,21 @@ export class FieldSchemaAlpha<
|
|
|
508
522
|
implements SimpleFieldSchema
|
|
509
523
|
{
|
|
510
524
|
private readonly lazyIdentifiers: Lazy<ReadonlySet<string>>;
|
|
511
|
-
private readonly lazyAnnotatedTypes: Lazy<
|
|
525
|
+
private readonly lazyAnnotatedTypes: Lazy<NormalizedAnnotatedAllowedTypes>;
|
|
526
|
+
private readonly propsAlpha: FieldPropsAlpha<TCustomMetadata> | undefined;
|
|
512
527
|
|
|
513
528
|
/**
|
|
514
529
|
* Metadata on the types of tree nodes allowed on this field.
|
|
515
530
|
*/
|
|
516
531
|
public readonly allowedTypesMetadata: AllowedTypesMetadata;
|
|
517
532
|
|
|
533
|
+
/**
|
|
534
|
+
* Persisted metadata for this field schema.
|
|
535
|
+
*/
|
|
536
|
+
public get persistedMetadata(): JsonCompatibleReadOnlyObject | undefined {
|
|
537
|
+
return this.propsAlpha?.persistedMetadata;
|
|
538
|
+
}
|
|
539
|
+
|
|
518
540
|
static {
|
|
519
541
|
createFieldSchemaPrivate = <
|
|
520
542
|
Kind2 extends FieldKind,
|
|
@@ -523,7 +545,7 @@ export class FieldSchemaAlpha<
|
|
|
523
545
|
>(
|
|
524
546
|
kind: Kind2,
|
|
525
547
|
annotatedAllowedTypes: Types2,
|
|
526
|
-
props?:
|
|
548
|
+
props?: FieldPropsAlpha<TCustomMetadata2>,
|
|
527
549
|
) =>
|
|
528
550
|
new FieldSchemaAlpha(
|
|
529
551
|
kind,
|
|
@@ -537,7 +559,7 @@ export class FieldSchemaAlpha<
|
|
|
537
559
|
kind: Kind,
|
|
538
560
|
types: Types,
|
|
539
561
|
public readonly annotatedAllowedTypes: ImplicitAnnotatedAllowedTypes,
|
|
540
|
-
props?:
|
|
562
|
+
props?: FieldPropsAlpha<TCustomMetadata>,
|
|
541
563
|
) {
|
|
542
564
|
super(kind, types, props);
|
|
543
565
|
|
|
@@ -545,11 +567,12 @@ export class FieldSchemaAlpha<
|
|
|
545
567
|
? annotatedAllowedTypes.metadata
|
|
546
568
|
: {};
|
|
547
569
|
this.lazyAnnotatedTypes = new Lazy(() =>
|
|
548
|
-
|
|
570
|
+
normalizeAnnotatedAllowedTypes(annotatedAllowedTypes),
|
|
549
571
|
);
|
|
550
572
|
this.lazyIdentifiers = new Lazy(
|
|
551
573
|
() => new Set([...this.allowedTypeSet].map((t) => t.identifier)),
|
|
552
574
|
);
|
|
575
|
+
this.propsAlpha = props;
|
|
553
576
|
}
|
|
554
577
|
|
|
555
578
|
public get allowedTypesIdentifiers(): ReadonlySet<string> {
|
|
@@ -560,7 +583,7 @@ export class FieldSchemaAlpha<
|
|
|
560
583
|
* What types of tree nodes are allowed in this field and their annotations.
|
|
561
584
|
* @remarks Counterpart to {@link FieldSchemaAlpha.annotatedAllowedTypes}, with any lazy definitions evaluated.
|
|
562
585
|
*/
|
|
563
|
-
public get
|
|
586
|
+
public get annotatedAllowedTypesNormalized(): NormalizedAnnotatedAllowedTypes {
|
|
564
587
|
return this.lazyAnnotatedTypes.value;
|
|
565
588
|
}
|
|
566
589
|
}
|
|
@@ -629,8 +652,8 @@ export function normalizeAllowedTypes(
|
|
|
629
652
|
* Normalizes an allowed type to an {@link AnnotatedAllowedType}, by adding empty annotations if they don't already exist.
|
|
630
653
|
*/
|
|
631
654
|
export function normalizeToAnnotatedAllowedType<T extends TreeNodeSchema>(
|
|
632
|
-
type: T | AnnotatedAllowedType<T
|
|
633
|
-
): AnnotatedAllowedType<T> {
|
|
655
|
+
type: T | AnnotatedAllowedType<T> | AnnotatedAllowedType<LazyItem<T>>,
|
|
656
|
+
): AnnotatedAllowedType<T> | AnnotatedAllowedType<LazyItem<T>> {
|
|
634
657
|
return isAnnotatedAllowedType(type)
|
|
635
658
|
? type
|
|
636
659
|
: {
|
|
@@ -639,6 +662,46 @@ export function normalizeToAnnotatedAllowedType<T extends TreeNodeSchema>(
|
|
|
639
662
|
};
|
|
640
663
|
}
|
|
641
664
|
|
|
665
|
+
/**
|
|
666
|
+
* Normalizes a {@link ImplicitAnnotatedAllowedTypes} to a set of {@link AnnotatedAllowedSchema}s, by eagerly evaluating any
|
|
667
|
+
* lazy schema declarations and adding empty metadata if it doesn't already exist.
|
|
668
|
+
*
|
|
669
|
+
* @remarks Note: this must only be called after all required schemas have been declared, otherwise evaluation of
|
|
670
|
+
* recursive schemas may fail.
|
|
671
|
+
*/
|
|
672
|
+
export function normalizeAnnotatedAllowedTypes(
|
|
673
|
+
types: ImplicitAnnotatedAllowedTypes,
|
|
674
|
+
): NormalizedAnnotatedAllowedTypes {
|
|
675
|
+
const typesWithoutAnnotation = isAnnotatedAllowedTypes(types) ? types.types : types;
|
|
676
|
+
const annotatedTypes: AnnotatedAllowedType<TreeNodeSchema>[] = [];
|
|
677
|
+
if (isReadonlyArray(typesWithoutAnnotation)) {
|
|
678
|
+
for (const annotatedType of typesWithoutAnnotation) {
|
|
679
|
+
if (isAnnotatedAllowedType(annotatedType)) {
|
|
680
|
+
annotatedTypes.push({
|
|
681
|
+
type: evaluateLazySchema(annotatedType.type),
|
|
682
|
+
metadata: annotatedType.metadata,
|
|
683
|
+
});
|
|
684
|
+
} else {
|
|
685
|
+
annotatedTypes.push({ type: evaluateLazySchema(annotatedType), metadata: {} });
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
} else {
|
|
689
|
+
if (isAnnotatedAllowedType(typesWithoutAnnotation)) {
|
|
690
|
+
annotatedTypes.push({
|
|
691
|
+
type: evaluateLazySchema(typesWithoutAnnotation.type),
|
|
692
|
+
metadata: typesWithoutAnnotation.metadata,
|
|
693
|
+
});
|
|
694
|
+
} else {
|
|
695
|
+
annotatedTypes.push({ type: evaluateLazySchema(typesWithoutAnnotation), metadata: {} });
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
return {
|
|
700
|
+
metadata: isAnnotatedAllowedTypes(types) ? types.metadata : {},
|
|
701
|
+
types: annotatedTypes,
|
|
702
|
+
};
|
|
703
|
+
}
|
|
704
|
+
|
|
642
705
|
/**
|
|
643
706
|
* Converts an {@link ImplicitAnnotatedAllowedTypes} to an {@link ImplicitAllowedTypes}s, by removing
|
|
644
707
|
* any annotations.
|
|
@@ -677,36 +740,6 @@ export function unannotateSchemaRecord<
|
|
|
677
740
|
) as UnannotateSchemaRecord<Schema>;
|
|
678
741
|
}
|
|
679
742
|
|
|
680
|
-
/**
|
|
681
|
-
* Converts annotated allowed types into a mapping between the type schema and their associated annotations.
|
|
682
|
-
*/
|
|
683
|
-
export function extractAnnotationsFromAllowedTypes(
|
|
684
|
-
types: ImplicitAnnotatedAllowedTypes,
|
|
685
|
-
): ReadonlyMap<TreeNodeSchema, AllowedTypeMetadata> {
|
|
686
|
-
const typesWithoutAnnotation = isAnnotatedAllowedTypes(types) ? types.types : types;
|
|
687
|
-
const annotations = new Map<TreeNodeSchema, AllowedTypeMetadata>();
|
|
688
|
-
if (isReadonlyArray(typesWithoutAnnotation)) {
|
|
689
|
-
for (const annotatedType of typesWithoutAnnotation) {
|
|
690
|
-
if (isAnnotatedAllowedType(annotatedType)) {
|
|
691
|
-
annotations.set(evaluateLazySchema(annotatedType.type), annotatedType.metadata);
|
|
692
|
-
} else {
|
|
693
|
-
annotations.set(evaluateLazySchema(annotatedType), {});
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
} else {
|
|
697
|
-
if (isAnnotatedAllowedType(typesWithoutAnnotation)) {
|
|
698
|
-
annotations.set(
|
|
699
|
-
evaluateLazySchema(typesWithoutAnnotation.type),
|
|
700
|
-
typesWithoutAnnotation.metadata,
|
|
701
|
-
);
|
|
702
|
-
} else {
|
|
703
|
-
annotations.set(evaluateLazySchema(typesWithoutAnnotation), {});
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
return annotations;
|
|
708
|
-
}
|
|
709
|
-
|
|
710
743
|
/**
|
|
711
744
|
* Returns true if the given {@link ImplicitFieldSchema} are equivalent, otherwise false.
|
|
712
745
|
* @remarks Two ImplicitFieldSchema are considered equivalent if all of the following are true:
|
|
@@ -775,17 +808,48 @@ function areFieldPropsEqual(a: FieldProps | undefined, b: FieldProps | undefined
|
|
|
775
808
|
* @remarks FieldSchemaMetadata are considered equivalent if their custom data and descriptions are (respectively) reference equal.
|
|
776
809
|
*/
|
|
777
810
|
function areMetadataEqual(
|
|
778
|
-
a:
|
|
779
|
-
b:
|
|
811
|
+
a: FieldSchemaMetadataAlpha | undefined,
|
|
812
|
+
b: FieldSchemaMetadataAlpha | undefined,
|
|
780
813
|
): boolean {
|
|
781
814
|
// If any new fields are added to FieldSchemaMetadata, this check will stop compiling as a reminder that this function needs to be updated.
|
|
782
|
-
type _keys = requireTrue<
|
|
815
|
+
type _keys = requireTrue<
|
|
816
|
+
areOnlyKeys<FieldSchemaMetadataAlpha, "custom" | "description" | "persistedMetadata">
|
|
817
|
+
>;
|
|
783
818
|
|
|
784
819
|
if (a === b) {
|
|
785
820
|
return true;
|
|
786
821
|
}
|
|
787
822
|
|
|
788
|
-
return
|
|
823
|
+
return (
|
|
824
|
+
Object.is(a?.custom, b?.custom) &&
|
|
825
|
+
a?.description === b?.description &&
|
|
826
|
+
arePersistedMetadataEqual(a?.persistedMetadata, b?.persistedMetadata)
|
|
827
|
+
);
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
/**
|
|
831
|
+
* Returns true if the given persisted metadata fields are equivalent, otherwise false.
|
|
832
|
+
* @remarks
|
|
833
|
+
* Currently only handles shallow equality in the case where the keys are in the same order. This is acceptable for current use cases.
|
|
834
|
+
*/
|
|
835
|
+
function arePersistedMetadataEqual(
|
|
836
|
+
a: JsonCompatibleReadOnlyObject | undefined,
|
|
837
|
+
b: JsonCompatibleReadOnlyObject | undefined,
|
|
838
|
+
): boolean {
|
|
839
|
+
if (Object.is(a, b)) {
|
|
840
|
+
return true;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
if (a === undefined || b === undefined) {
|
|
844
|
+
return false;
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
// Note that the key order matters. If `a` and `b` have the same content but the keys are in a different order,
|
|
848
|
+
// this method will return false.
|
|
849
|
+
const aStringified = JSON.stringify(a);
|
|
850
|
+
const bStringified = JSON.stringify(b);
|
|
851
|
+
|
|
852
|
+
return aStringified === bStringified;
|
|
789
853
|
}
|
|
790
854
|
|
|
791
855
|
const cachedLazyItem = new WeakMap<() => unknown, unknown>();
|
|
@@ -1313,6 +1377,22 @@ export interface NodeSchemaOptions<out TCustomMetadata = unknown> {
|
|
|
1313
1377
|
readonly metadata?: NodeSchemaMetadata<TCustomMetadata> | undefined;
|
|
1314
1378
|
}
|
|
1315
1379
|
|
|
1380
|
+
/**
|
|
1381
|
+
* Additional information to provide to Node Schema creation. Includes fields for alpha features.
|
|
1382
|
+
*
|
|
1383
|
+
* @typeParam TCustomMetadata - Custom metadata properties to associate with the Node Schema.
|
|
1384
|
+
* See {@link NodeSchemaMetadata.custom}.
|
|
1385
|
+
*
|
|
1386
|
+
* @alpha
|
|
1387
|
+
*/
|
|
1388
|
+
export interface NodeSchemaOptionsAlpha<out TCustomMetadata = unknown>
|
|
1389
|
+
extends NodeSchemaOptions<TCustomMetadata> {
|
|
1390
|
+
/**
|
|
1391
|
+
* The persisted metadata for this schema element.
|
|
1392
|
+
*/
|
|
1393
|
+
readonly persistedMetadata?: JsonCompatibleReadOnlyObject | undefined;
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1316
1396
|
/**
|
|
1317
1397
|
* Metadata associated with a Node Schema.
|
|
1318
1398
|
*
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { ValueSchema } from "../core/index.js";
|
|
7
|
-
|
|
7
|
+
import type { JsonCompatibleReadOnlyObject } from "../util/index.js";
|
|
8
8
|
import type { NodeKind } from "./core/index.js";
|
|
9
9
|
import type { FieldKind, FieldSchemaMetadata, NodeSchemaMetadata } from "./schemaTypes.js";
|
|
10
10
|
|
|
@@ -37,6 +37,23 @@ export interface SimpleNodeSchemaBase<
|
|
|
37
37
|
readonly metadata: NodeSchemaMetadata<TCustomMetadata>;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
/**
|
|
41
|
+
* A {@link SimpleNodeSchema} containing fields for alpha features.
|
|
42
|
+
*
|
|
43
|
+
* @system
|
|
44
|
+
* @alpha
|
|
45
|
+
* @sealed
|
|
46
|
+
*/
|
|
47
|
+
export interface SimpleNodeSchemaBaseAlpha<
|
|
48
|
+
out TNodeKind extends NodeKind,
|
|
49
|
+
out TCustomMetadata = unknown,
|
|
50
|
+
> extends SimpleNodeSchemaBase<TNodeKind, TCustomMetadata> {
|
|
51
|
+
/**
|
|
52
|
+
* Persisted metadata for this node schema.
|
|
53
|
+
*/
|
|
54
|
+
readonly persistedMetadata: JsonCompatibleReadOnlyObject | undefined;
|
|
55
|
+
}
|
|
56
|
+
|
|
40
57
|
/**
|
|
41
58
|
* A {@link SimpleNodeSchema} for an object node.
|
|
42
59
|
*
|
|
@@ -44,7 +61,7 @@ export interface SimpleNodeSchemaBase<
|
|
|
44
61
|
* @sealed
|
|
45
62
|
*/
|
|
46
63
|
export interface SimpleObjectNodeSchema<out TCustomMetadata = unknown>
|
|
47
|
-
extends
|
|
64
|
+
extends SimpleNodeSchemaBaseAlpha<NodeKind.Object, TCustomMetadata> {
|
|
48
65
|
/**
|
|
49
66
|
* Schemas for each of the object's fields, keyed off of schema's keys.
|
|
50
67
|
* @remarks
|
|
@@ -82,7 +99,7 @@ export interface SimpleObjectFieldSchema extends SimpleFieldSchema {
|
|
|
82
99
|
* @sealed
|
|
83
100
|
*/
|
|
84
101
|
export interface SimpleArrayNodeSchema<out TCustomMetadata = unknown>
|
|
85
|
-
extends
|
|
102
|
+
extends SimpleNodeSchemaBaseAlpha<NodeKind.Array, TCustomMetadata> {
|
|
86
103
|
/**
|
|
87
104
|
* The types allowed in the array.
|
|
88
105
|
*
|
|
@@ -99,7 +116,7 @@ export interface SimpleArrayNodeSchema<out TCustomMetadata = unknown>
|
|
|
99
116
|
* @sealed
|
|
100
117
|
*/
|
|
101
118
|
export interface SimpleMapNodeSchema<out TCustomMetadata = unknown>
|
|
102
|
-
extends
|
|
119
|
+
extends SimpleNodeSchemaBaseAlpha<NodeKind.Map, TCustomMetadata> {
|
|
103
120
|
/**
|
|
104
121
|
* The types allowed as values in the map.
|
|
105
122
|
*
|
|
@@ -115,7 +132,7 @@ export interface SimpleMapNodeSchema<out TCustomMetadata = unknown>
|
|
|
115
132
|
* @alpha
|
|
116
133
|
* @sealed
|
|
117
134
|
*/
|
|
118
|
-
export interface SimpleLeafNodeSchema extends
|
|
135
|
+
export interface SimpleLeafNodeSchema extends SimpleNodeSchemaBaseAlpha<NodeKind.Leaf> {
|
|
119
136
|
/**
|
|
120
137
|
* The kind of leaf node.
|
|
121
138
|
*/
|
|
@@ -170,6 +187,11 @@ export interface SimpleFieldSchema {
|
|
|
170
187
|
* {@inheritDoc FieldSchemaMetadata}
|
|
171
188
|
*/
|
|
172
189
|
readonly metadata: FieldSchemaMetadata;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Persisted metadata for this field schema.
|
|
193
|
+
*/
|
|
194
|
+
readonly persistedMetadata?: JsonCompatibleReadOnlyObject | undefined;
|
|
173
195
|
}
|
|
174
196
|
|
|
175
197
|
/**
|
|
@@ -37,6 +37,8 @@ const viewToStoredCache = new WeakMap<ImplicitFieldSchema, TreeStoredSchema>();
|
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* Converts a {@link ImplicitFieldSchema} into a {@link TreeStoredSchema}.
|
|
40
|
+
* @throws
|
|
41
|
+
* Throws a `UsageError` if multiple schemas are encountered with the same identifier.
|
|
40
42
|
*/
|
|
41
43
|
export function toStoredSchema(root: ImplicitFieldSchema): TreeStoredSchema {
|
|
42
44
|
return getOrCreate(viewToStoredCache, root, () => {
|
|
@@ -90,7 +92,7 @@ export function convertField(schema: SimpleFieldSchema): TreeFieldStoredSchema {
|
|
|
90
92
|
const kind: FieldKindIdentifier =
|
|
91
93
|
convertFieldKind.get(schema.kind)?.identifier ?? fail(0xae3 /* Invalid field kind */);
|
|
92
94
|
const types: TreeTypeSet = schema.allowedTypesIdentifiers as TreeTypeSet;
|
|
93
|
-
return { kind, types };
|
|
95
|
+
return { kind, types, persistedMetadata: schema.persistedMetadata };
|
|
94
96
|
}
|
|
95
97
|
|
|
96
98
|
/**
|
|
@@ -107,6 +109,8 @@ export const convertFieldKind: ReadonlyMap<FieldKind, FlexFieldKind> = new Map<
|
|
|
107
109
|
|
|
108
110
|
/**
|
|
109
111
|
* Converts a {@link TreeNodeSchema} into a {@link TreeNodeStoredSchema}.
|
|
112
|
+
* @privateRemarks
|
|
113
|
+
* TODO: Persist node metadata once schema FormatV2 is supported.
|
|
110
114
|
*/
|
|
111
115
|
export function getStoredSchema(schema: SimpleNodeSchema): TreeNodeStoredSchema {
|
|
112
116
|
const kind = schema.kind;
|
|
@@ -117,23 +121,32 @@ export function getStoredSchema(schema: SimpleNodeSchema): TreeNodeStoredSchema
|
|
|
117
121
|
}
|
|
118
122
|
case NodeKind.Map: {
|
|
119
123
|
const types = schema.allowedTypesIdentifiers as TreeTypeSet;
|
|
120
|
-
return new MapNodeStoredSchema(
|
|
124
|
+
return new MapNodeStoredSchema(
|
|
125
|
+
{
|
|
126
|
+
kind: FieldKinds.optional.identifier,
|
|
127
|
+
types,
|
|
128
|
+
persistedMetadata: schema.persistedMetadata,
|
|
129
|
+
},
|
|
130
|
+
// TODO: Find a way to avoid injecting persistedMetadata twice in these constructor calls.
|
|
131
|
+
schema.persistedMetadata,
|
|
132
|
+
);
|
|
121
133
|
}
|
|
122
134
|
case NodeKind.Array: {
|
|
123
135
|
const types = schema.allowedTypesIdentifiers as TreeTypeSet;
|
|
124
136
|
const field = {
|
|
125
137
|
kind: FieldKinds.sequence.identifier,
|
|
126
138
|
types,
|
|
139
|
+
persistedMetadata: schema.persistedMetadata,
|
|
127
140
|
};
|
|
128
141
|
const fields = new Map([[EmptyKey, field]]);
|
|
129
|
-
return new ObjectNodeStoredSchema(fields);
|
|
142
|
+
return new ObjectNodeStoredSchema(fields, schema.persistedMetadata);
|
|
130
143
|
}
|
|
131
144
|
case NodeKind.Object: {
|
|
132
145
|
const fields: Map<FieldKey, TreeFieldStoredSchema> = new Map();
|
|
133
146
|
for (const fieldSchema of schema.fields.values()) {
|
|
134
147
|
fields.set(brand(fieldSchema.storedKey), convertField(fieldSchema));
|
|
135
148
|
}
|
|
136
|
-
return new ObjectNodeStoredSchema(fields);
|
|
149
|
+
return new ObjectNodeStoredSchema(fields, schema.persistedMetadata);
|
|
137
150
|
}
|
|
138
151
|
default:
|
|
139
152
|
unreachableCase(kind);
|
|
@@ -20,8 +20,8 @@ import {
|
|
|
20
20
|
type InnerNode,
|
|
21
21
|
type Context,
|
|
22
22
|
type UnhydratedFlexTreeNode,
|
|
23
|
+
getSimpleNodeSchemaFromInnerNode,
|
|
23
24
|
} from "./core/index.js";
|
|
24
|
-
import { getSimpleNodeSchemaFromInnerNode } from "./core/index.js";
|
|
25
25
|
import { markEager } from "./flexList.js";
|
|
26
26
|
|
|
27
27
|
/**
|
|
@@ -14,5 +14,9 @@ export function walkFieldSchema(
|
|
|
14
14
|
visitor: SchemaVisitor,
|
|
15
15
|
visitedSet: Set<TreeNodeSchema> = new Set(),
|
|
16
16
|
): void {
|
|
17
|
-
walkAllowedTypes(
|
|
17
|
+
walkAllowedTypes(
|
|
18
|
+
normalizeFieldSchema(schema).annotatedAllowedTypesNormalized,
|
|
19
|
+
visitor,
|
|
20
|
+
visitedSet,
|
|
21
|
+
);
|
|
18
22
|
}
|
package/src/util/typeUtils.ts
CHANGED
|
@@ -168,7 +168,7 @@ export type UnionToIntersection<T> = (T extends T ? (k: T) => unknown : never) e
|
|
|
168
168
|
*
|
|
169
169
|
* @typeparam Union - The union to convert.
|
|
170
170
|
* @typeparam AsOverloadedFunction - Implementation detail: do not specify.
|
|
171
|
-
* @system @
|
|
171
|
+
* @system @beta
|
|
172
172
|
*/
|
|
173
173
|
export type PopUnion<
|
|
174
174
|
Union,
|
|
@@ -189,7 +189,7 @@ export type PopUnion<
|
|
|
189
189
|
*
|
|
190
190
|
* https://www.hacklewayne.com/typescript-convert-union-to-tuple-array-yes-but-how and https://catchts.com/union-array both explain the general approach this uses pretty well.
|
|
191
191
|
* This implementation is inspired to those, but slightly different in implementation.
|
|
192
|
-
* @
|
|
192
|
+
* @system @beta
|
|
193
193
|
*/
|
|
194
194
|
export type UnionToTuple<
|
|
195
195
|
Union,
|
package/src/util/utils.ts
CHANGED
|
@@ -317,6 +317,7 @@ export type JsonCompatibleObject<TExtra = never> = { [P in string]?: JsonCompati
|
|
|
317
317
|
* @remarks
|
|
318
318
|
* This does not robustly forbid non json comparable data via type checking,
|
|
319
319
|
* but instead mostly restricts access to it.
|
|
320
|
+
* @alpha
|
|
320
321
|
*/
|
|
321
322
|
export type JsonCompatibleReadOnly =
|
|
322
323
|
| string
|
|
@@ -332,6 +333,7 @@ export type JsonCompatibleReadOnly =
|
|
|
332
333
|
* @remarks
|
|
333
334
|
* This does not robustly forbid non json comparable data via type checking,
|
|
334
335
|
* but instead mostly restricts access to it.
|
|
336
|
+
* @alpha
|
|
335
337
|
*/
|
|
336
338
|
export type JsonCompatibleReadOnlyObject = { readonly [P in string]?: JsonCompatibleReadOnly };
|
|
337
339
|
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
export declare const Skip: unique symbol;
|
|
6
|
-
export type Skip = typeof Skip;
|
|
7
|
-
/**
|
|
8
|
-
* Visit iterable tree.
|
|
9
|
-
*
|
|
10
|
-
* @remarks
|
|
11
|
-
* Non-recursive depth first traversal.
|
|
12
|
-
*/
|
|
13
|
-
export declare function visitIterableTree<T>(root: T, iterator: (t: T) => Iterable<T>, visitor: (item: T) => Skip | void): void;
|
|
14
|
-
/**
|
|
15
|
-
* Visit iterable tree.
|
|
16
|
-
* Allows state to be computed in parents and passed to children.
|
|
17
|
-
*
|
|
18
|
-
* @remarks
|
|
19
|
-
* Non-recursive depth first traversal.
|
|
20
|
-
*/
|
|
21
|
-
export declare function visitIterableTreeWithState<T extends Iterable<T>, StatePassedDown>(root: T, initial: StatePassedDown, visitor: (item: T, fromAbove: StatePassedDown) => Skip | StatePassedDown): void;
|
|
22
|
-
/**
|
|
23
|
-
* Visit bipartite iterable tree.
|
|
24
|
-
*
|
|
25
|
-
* @remarks
|
|
26
|
-
* Non-recursive depth first traversal.
|
|
27
|
-
*
|
|
28
|
-
* Particularly useful for processing trees with their alternating node and field levels.
|
|
29
|
-
*/
|
|
30
|
-
export declare function visitBipartiteIterableTree<A extends Iterable<B>, B extends Iterable<A>>(root: A, visitorA: (item: A) => Skip | undefined, visitorB: (item: B) => Skip | undefined): void;
|
|
31
|
-
/**
|
|
32
|
-
* Visit bipartite iterable tree.
|
|
33
|
-
* Allows state to be computed in parents and passed to children.
|
|
34
|
-
*
|
|
35
|
-
* @remarks
|
|
36
|
-
* Non-recursive depth first traversal.
|
|
37
|
-
*
|
|
38
|
-
* Particularly useful for processing trees with their alternating node and field levels.
|
|
39
|
-
*
|
|
40
|
-
* @privateRemarks
|
|
41
|
-
* Other traversal cases, like ones passing data up (via map or reduce patterns) could be supported by extending this or adding more utilities.
|
|
42
|
-
* Such utility functions really only provide an improvement of hand coding each cases if the non-recessiveness is required.
|
|
43
|
-
* Since supporting very deeps trees hasn't been a priority, such visitors are also not a priority, and are thus not included here for now.
|
|
44
|
-
*/
|
|
45
|
-
export declare function visitBipartiteIterableTreeWithState<A, B, StateA, StateB>(root: A, fromAbove: StateA, iterateA: (a: A) => Iterable<B>, iterateB: (b: B) => Iterable<A>, visitorA: (item: A, fromAbove: StateA) => Skip | StateB, visitorB: (item: B, fromAbove: StateB) => Skip | StateA): void;
|
|
46
|
-
//# sourceMappingURL=navigation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/navigation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,IAAI,eAAiB,CAAC;AACnC,MAAM,MAAM,IAAI,GAAG,OAAO,IAAI,CAAC;AAE/B;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAClC,IAAI,EAAE,CAAC,EACP,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,EAC/B,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,GAAG,IAAI,GAC/B,IAAI,CAUN;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,EAAE,eAAe,EAChF,IAAI,EAAE,CAAC,EACP,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,eAAe,KAAK,IAAI,GAAG,eAAe,GACtE,IAAI,CAYN;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CAAC,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,EACtF,IAAI,EAAE,CAAC,EACP,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,GAAG,SAAS,EACvC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,GAAG,SAAS,GACrC,IAAI,CAcN;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mCAAmC,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EACvE,IAAI,EAAE,CAAC,EACP,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,EAC/B,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,EAC/B,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,GAAG,MAAM,EACvD,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,GAAG,MAAM,GACrD,IAAI,CAgBN"}
|