@fluidframework/tree 2.23.0 → 2.31.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 +1636 -1466
- package/api-extractor/api-extractor.current.json +0 -3
- package/api-report/tree.alpha.api.md +261 -100
- package/api-report/tree.beta.api.md +86 -61
- package/api-report/tree.legacy.alpha.api.md +86 -61
- package/api-report/tree.legacy.public.api.md +86 -61
- package/api-report/tree.public.api.md +86 -61
- package/dist/alpha.d.ts +32 -1
- package/dist/beta.d.ts +5 -1
- package/dist/codec/codec.d.ts +1 -1
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +3 -4
- package/dist/codec/codec.js.map +1 -1
- package/dist/codec/discriminatedUnions.d.ts.map +1 -1
- package/dist/codec/discriminatedUnions.js +1 -1
- package/dist/codec/discriminatedUnions.js.map +1 -1
- package/dist/core/forest/editableForest.d.ts +1 -14
- package/dist/core/forest/editableForest.d.ts.map +1 -1
- package/dist/core/forest/editableForest.js +1 -28
- package/dist/core/forest/editableForest.js.map +1 -1
- package/dist/core/forest/forest.d.ts +16 -3
- package/dist/core/forest/forest.d.ts.map +1 -1
- package/dist/core/forest/forest.js +4 -1
- package/dist/core/forest/forest.js.map +1 -1
- package/dist/core/forest/index.d.ts +1 -1
- package/dist/core/forest/index.d.ts.map +1 -1
- package/dist/core/forest/index.js +1 -2
- package/dist/core/forest/index.js.map +1 -1
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +3 -3
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/utils.js +1 -1
- package/dist/core/rebase/utils.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +4 -1
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +8 -4
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/tree/anchorSet.d.ts +8 -3
- package/dist/core/tree/anchorSet.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.js +16 -9
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/delta.d.ts +8 -23
- package/dist/core/tree/delta.d.ts.map +1 -1
- package/dist/core/tree/delta.js.map +1 -1
- package/dist/core/tree/deltaUtil.d.ts +3 -3
- package/dist/core/tree/deltaUtil.d.ts.map +1 -1
- package/dist/core/tree/deltaUtil.js +2 -2
- package/dist/core/tree/deltaUtil.js.map +1 -1
- package/dist/core/tree/index.d.ts +2 -2
- package/dist/core/tree/index.d.ts.map +1 -1
- package/dist/core/tree/index.js +2 -1
- package/dist/core/tree/index.js.map +1 -1
- package/dist/core/tree/pathTree.d.ts +54 -1
- package/dist/core/tree/pathTree.d.ts.map +1 -1
- package/dist/core/tree/pathTree.js +8 -1
- package/dist/core/tree/pathTree.js.map +1 -1
- package/dist/core/tree/treeTextFormat.js +2 -2
- package/dist/core/tree/treeTextFormat.js.map +1 -1
- package/dist/core/tree/visitDelta.d.ts +7 -5
- package/dist/core/tree/visitDelta.d.ts.map +1 -1
- package/dist/core/tree/visitDelta.js +19 -9
- package/dist/core/tree/visitDelta.js.map +1 -1
- package/dist/core/tree/visitorUtils.d.ts +5 -23
- package/dist/core/tree/visitorUtils.d.ts.map +1 -1
- package/dist/core/tree/visitorUtils.js +8 -5
- package/dist/core/tree/visitorUtils.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.js +9 -9
- package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +5 -3
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js +12 -9
- package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts +1 -0
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.js +8 -5
- package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +3 -3
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +2 -2
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +4 -4
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.js +2 -2
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/{schemaBasedEncoding.d.ts → schemaBasedEncode.d.ts} +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -0
- package/dist/feature-libraries/chunked-forest/codec/{schemaBasedEncoding.js → schemaBasedEncode.js} +4 -5
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -0
- package/dist/feature-libraries/chunked-forest/emptyChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/emptyChunk.js +15 -15
- package/dist/feature-libraries/chunked-forest/emptyChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts +3 -2
- package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.js +7 -6
- package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +12 -14
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js +5 -6
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +19 -19
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/default-schema/index.d.ts +1 -0
- package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/index.js +3 -1
- package/dist/feature-libraries/default-schema/index.js.map +1 -1
- package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts +21 -0
- package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -0
- package/dist/feature-libraries/default-schema/mappedEditBuilder.js +57 -0
- package/dist/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -0
- package/dist/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/schemaChecker.js +1 -2
- package/dist/feature-libraries/default-schema/schemaChecker.js.map +1 -1
- package/dist/feature-libraries/deltaUtils.js +1 -1
- package/dist/feature-libraries/deltaUtils.js.map +1 -1
- package/dist/feature-libraries/flex-tree/context.d.ts +5 -5
- package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/context.js.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +2 -2
- 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/lazyField.d.ts +5 -4
- package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +12 -9
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.js +4 -4
- package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +4 -5
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +2 -1
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +9 -7
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
- package/dist/feature-libraries/indexing/anchorTreeIndex.js +1 -1
- package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
- package/dist/feature-libraries/initializeForest.d.ts +18 -0
- package/dist/feature-libraries/initializeForest.d.ts.map +1 -0
- package/dist/feature-libraries/initializeForest.js +35 -0
- package/dist/feature-libraries/initializeForest.js.map +1 -0
- package/dist/feature-libraries/modular-schema/comparison.js +4 -4
- package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/dist/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/isNeverTree.js +2 -3
- package/dist/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +4 -4
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +5 -5
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +13 -19
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/node-identifier/index.d.ts +8 -0
- package/dist/feature-libraries/node-identifier/index.d.ts.map +1 -0
- package/dist/feature-libraries/node-identifier/index.js +16 -0
- package/dist/feature-libraries/node-identifier/index.js.map +1 -0
- package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.d.ts +22 -0
- package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.d.ts.map +1 -0
- package/dist/feature-libraries/{node-key/mockNodeKeyManager.js → node-identifier/mockNodeIdentifierManager.js} +18 -18
- package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -0
- package/dist/feature-libraries/node-identifier/nodeIdentifier.d.ts +38 -0
- package/dist/feature-libraries/node-identifier/nodeIdentifier.d.ts.map +1 -0
- package/dist/feature-libraries/node-identifier/nodeIdentifier.js +26 -0
- package/dist/feature-libraries/node-identifier/nodeIdentifier.js.map +1 -0
- package/dist/feature-libraries/node-identifier/nodeIdentifierManager.d.ts +37 -0
- package/dist/feature-libraries/node-identifier/nodeIdentifierManager.d.ts.map +1 -0
- package/dist/feature-libraries/node-identifier/nodeIdentifierManager.js +48 -0
- package/dist/feature-libraries/node-identifier/nodeIdentifierManager.js.map +1 -0
- package/dist/feature-libraries/object-forest/objectForest.d.ts +2 -1
- package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.js +7 -3
- package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/codec.js +2 -1
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.d.ts +1 -1
- package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.js +16 -17
- package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
- package/dist/feature-libraries/sequence-field/invert.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/invert.js +1 -1
- package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
- package/dist/feature-libraries/sequence-field/utils.js +1 -1
- package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
- package/dist/feature-libraries/treeCursorUtils.d.ts.map +1 -1
- package/dist/feature-libraries/treeCursorUtils.js +5 -6
- package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -3
- package/dist/index.js.map +1 -1
- package/dist/jsonDomainSchema.d.ts +15 -16
- package/dist/jsonDomainSchema.d.ts.map +1 -1
- package/dist/jsonDomainSchema.js +10 -5
- package/dist/jsonDomainSchema.js.map +1 -1
- package/dist/legacy.d.ts +5 -1
- 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 +5 -1
- package/dist/serializableDomainSchema.d.ts +8 -14
- package/dist/serializableDomainSchema.d.ts.map +1 -1
- package/dist/shared-tree/checkoutFlexTreeView.d.ts +3 -3
- package/dist/shared-tree/checkoutFlexTreeView.d.ts.map +1 -1
- package/dist/shared-tree/checkoutFlexTreeView.js.map +1 -1
- package/dist/shared-tree/independentView.d.ts.map +1 -1
- package/dist/shared-tree/independentView.js +3 -18
- package/dist/shared-tree/independentView.js.map +1 -1
- package/dist/shared-tree/index.d.ts +1 -1
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js +2 -1
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
- package/dist/shared-tree/schematizeTree.js +4 -3
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +4 -4
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +1 -0
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +27 -19
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js +2 -2
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts +1 -2
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.js +2 -2
- package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/dist/shared-tree/treeApiAlpha.d.ts +9 -30
- package/dist/shared-tree/treeApiAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeApiAlpha.js +22 -34
- package/dist/shared-tree/treeApiAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +2 -2
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts +4 -3
- package/dist/shared-tree-core/branch.d.ts.map +1 -1
- package/dist/shared-tree-core/branch.js +2 -2
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/shared-tree-core/editManager.d.ts.map +1 -1
- package/dist/shared-tree-core/editManager.js +37 -31
- package/dist/shared-tree-core/editManager.js.map +1 -1
- package/dist/sharedTreeAttributes.d.ts +18 -0
- package/dist/sharedTreeAttributes.d.ts.map +1 -0
- package/dist/sharedTreeAttributes.js +25 -0
- package/dist/sharedTreeAttributes.js.map +1 -0
- package/dist/simple-tree/api/conciseTree.d.ts +8 -2
- package/dist/simple-tree/api/conciseTree.d.ts.map +1 -1
- package/dist/simple-tree/api/conciseTree.js +10 -1
- package/dist/simple-tree/api/conciseTree.js.map +1 -1
- package/dist/simple-tree/api/create.d.ts +3 -3
- package/dist/simple-tree/api/create.d.ts.map +1 -1
- package/dist/simple-tree/api/create.js.map +1 -1
- package/dist/simple-tree/api/customTree.d.ts +42 -12
- package/dist/simple-tree/api/customTree.d.ts.map +1 -1
- package/dist/simple-tree/api/customTree.js +33 -5
- package/dist/simple-tree/api/customTree.js.map +1 -1
- package/dist/simple-tree/api/getJsonSchema.d.ts +10 -0
- package/dist/simple-tree/api/getJsonSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/getJsonSchema.js +10 -0
- package/dist/simple-tree/api/getJsonSchema.js.map +1 -1
- package/dist/simple-tree/api/getSimpleSchema.d.ts +13 -43
- package/dist/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/getSimpleSchema.js +13 -43
- package/dist/simple-tree/api/getSimpleSchema.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +7 -6
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +8 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaCreationUtilities.js +2 -2
- package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts +112 -67
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +80 -158
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +38 -23
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js +26 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +40 -5
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.d.ts +19 -0
- package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -0
- package/dist/simple-tree/api/schemaFromSimple.js +71 -0
- package/dist/simple-tree/api/schemaFromSimple.js.map +1 -0
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts +3 -2
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +7 -6
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/dist/simple-tree/api/simpleTreeIndex.d.ts.map +1 -1
- package/dist/simple-tree/api/simpleTreeIndex.js +4 -3
- package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
- package/dist/simple-tree/api/testRecursiveDomain.d.ts +10 -10
- package/dist/simple-tree/api/tree.d.ts +12 -6
- package/dist/simple-tree/api/tree.d.ts.map +1 -1
- package/dist/simple-tree/api/tree.js +17 -8
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.js +5 -20
- package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.d.ts +102 -36
- package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.js +0 -1
- package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
- package/dist/simple-tree/api/verboseTree.d.ts +16 -25
- package/dist/simple-tree/api/verboseTree.d.ts.map +1 -1
- package/dist/simple-tree/api/verboseTree.js +19 -14
- package/dist/simple-tree/api/verboseTree.js.map +1 -1
- package/dist/simple-tree/api/view.d.ts.map +1 -1
- package/dist/simple-tree/api/view.js +16 -17
- package/dist/simple-tree/api/view.js.map +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts +16 -3
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +70 -147
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
- package/dist/simple-tree/arrayNode.d.ts +5 -4
- package/dist/simple-tree/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/arrayNode.js +13 -9
- package/dist/simple-tree/arrayNode.js.map +1 -1
- package/dist/simple-tree/arrayNodeTypes.d.ts +46 -0
- package/dist/simple-tree/arrayNodeTypes.d.ts.map +1 -0
- package/dist/simple-tree/arrayNodeTypes.js +30 -0
- package/dist/simple-tree/arrayNodeTypes.js.map +1 -0
- package/dist/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
- package/dist/simple-tree/core/getOrCreateNode.js +1 -11
- package/dist/simple-tree/core/getOrCreateNode.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +1 -2
- package/dist/simple-tree/core/index.d.ts.map +1 -1
- package/dist/simple-tree/core/index.js +2 -3
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.d.ts +12 -5
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +36 -20
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts +14 -7
- 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/unhydratedFlexTree.d.ts +2 -2
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js +5 -5
- package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/dist/simple-tree/flexList.d.ts +4 -5
- package/dist/simple-tree/flexList.d.ts.map +1 -1
- package/dist/simple-tree/flexList.js +1 -14
- package/dist/simple-tree/flexList.js.map +1 -1
- package/dist/simple-tree/index.d.ts +9 -2
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +15 -2
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts +22 -5
- package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js +2 -0
- package/dist/simple-tree/leafNodeSchema.js.map +1 -1
- package/dist/simple-tree/mapNode.d.ts +3 -2
- package/dist/simple-tree/mapNode.d.ts.map +1 -1
- package/dist/simple-tree/mapNode.js +5 -1
- package/dist/simple-tree/mapNode.js.map +1 -1
- package/dist/simple-tree/mapNodeTypes.d.ts +46 -0
- package/dist/simple-tree/mapNodeTypes.d.ts.map +1 -0
- package/dist/simple-tree/mapNodeTypes.js +30 -0
- package/dist/simple-tree/mapNodeTypes.js.map +1 -0
- package/dist/simple-tree/objectNode.d.ts +10 -3
- package/dist/simple-tree/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/objectNode.js +12 -5
- package/dist/simple-tree/objectNode.js.map +1 -1
- package/dist/simple-tree/objectNodeTypes.d.ts +9 -5
- package/dist/simple-tree/objectNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/objectNodeTypes.js +3 -0
- package/dist/simple-tree/objectNodeTypes.js.map +1 -1
- package/dist/simple-tree/proxies.js +2 -1
- package/dist/simple-tree/proxies.js.map +1 -1
- package/dist/simple-tree/schemaTypes.d.ts +81 -8
- package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
- package/dist/simple-tree/schemaTypes.js +94 -5
- package/dist/simple-tree/schemaTypes.js.map +1 -1
- package/dist/simple-tree/{api/simpleSchema.d.ts → simpleSchema.d.ts} +55 -28
- package/dist/simple-tree/simpleSchema.d.ts.map +1 -0
- package/dist/simple-tree/simpleSchema.js.map +1 -0
- package/dist/simple-tree/toMapTree.d.ts +4 -4
- package/dist/simple-tree/toMapTree.d.ts.map +1 -1
- package/dist/simple-tree/toMapTree.js +3 -3
- package/dist/simple-tree/toMapTree.js.map +1 -1
- package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +2 -6
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/simple-tree/treeNodeValid.d.ts +7 -1
- package/dist/simple-tree/treeNodeValid.d.ts.map +1 -1
- package/dist/simple-tree/treeNodeValid.js +17 -10
- package/dist/simple-tree/treeNodeValid.js.map +1 -1
- package/dist/treeFactory.d.ts +0 -12
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +5 -21
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/cloneWithReplacements.d.ts +21 -0
- package/dist/util/cloneWithReplacements.d.ts.map +1 -0
- package/dist/util/cloneWithReplacements.js +38 -0
- package/dist/util/cloneWithReplacements.js.map +1 -0
- package/dist/util/idAllocator.d.ts.map +1 -1
- package/dist/util/idAllocator.js +1 -2
- package/dist/util/idAllocator.js.map +1 -1
- package/dist/util/index.d.ts +2 -1
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +4 -3
- package/dist/util/index.js.map +1 -1
- package/dist/util/referenceCounting.d.ts +18 -0
- package/dist/util/referenceCounting.d.ts.map +1 -1
- package/dist/util/referenceCounting.js.map +1 -1
- package/dist/util/typeCheck.d.ts +7 -0
- package/dist/util/typeCheck.d.ts.map +1 -1
- package/dist/util/typeCheck.js.map +1 -1
- package/dist/util/utils.d.ts +0 -1
- package/dist/util/utils.d.ts.map +1 -1
- package/dist/util/utils.js +1 -4
- package/dist/util/utils.js.map +1 -1
- package/lib/alpha.d.ts +32 -1
- package/lib/beta.d.ts +5 -1
- package/lib/codec/codec.d.ts +1 -1
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +1 -2
- package/lib/codec/codec.js.map +1 -1
- package/lib/codec/discriminatedUnions.d.ts.map +1 -1
- package/lib/codec/discriminatedUnions.js +2 -2
- package/lib/codec/discriminatedUnions.js.map +1 -1
- package/lib/core/forest/editableForest.d.ts +1 -14
- package/lib/core/forest/editableForest.d.ts.map +1 -1
- package/lib/core/forest/editableForest.js +0 -26
- package/lib/core/forest/editableForest.js.map +1 -1
- package/lib/core/forest/forest.d.ts +16 -3
- package/lib/core/forest/forest.d.ts.map +1 -1
- package/lib/core/forest/forest.js +4 -1
- package/lib/core/forest/forest.js.map +1 -1
- package/lib/core/forest/index.d.ts +1 -1
- package/lib/core/forest/index.d.ts.map +1 -1
- package/lib/core/forest/index.js +1 -1
- package/lib/core/forest/index.js.map +1 -1
- package/lib/core/index.d.ts +2 -2
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +2 -2
- package/lib/core/index.js.map +1 -1
- package/lib/core/rebase/utils.js +1 -1
- package/lib/core/rebase/utils.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +4 -1
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +6 -2
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/tree/anchorSet.d.ts +8 -3
- package/lib/core/tree/anchorSet.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.js +14 -7
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/core/tree/delta.d.ts +8 -23
- package/lib/core/tree/delta.d.ts.map +1 -1
- package/lib/core/tree/delta.js.map +1 -1
- package/lib/core/tree/deltaUtil.d.ts +3 -3
- package/lib/core/tree/deltaUtil.d.ts.map +1 -1
- package/lib/core/tree/deltaUtil.js +2 -2
- package/lib/core/tree/deltaUtil.js.map +1 -1
- package/lib/core/tree/index.d.ts +2 -2
- package/lib/core/tree/index.d.ts.map +1 -1
- package/lib/core/tree/index.js +1 -1
- package/lib/core/tree/index.js.map +1 -1
- package/lib/core/tree/pathTree.d.ts +54 -1
- package/lib/core/tree/pathTree.d.ts.map +1 -1
- package/lib/core/tree/pathTree.js +6 -0
- package/lib/core/tree/pathTree.js.map +1 -1
- package/lib/core/tree/treeTextFormat.js +1 -1
- package/lib/core/tree/treeTextFormat.js.map +1 -1
- package/lib/core/tree/visitDelta.d.ts +7 -5
- package/lib/core/tree/visitDelta.d.ts.map +1 -1
- package/lib/core/tree/visitDelta.js +19 -9
- package/lib/core/tree/visitDelta.js.map +1 -1
- package/lib/core/tree/visitorUtils.d.ts +5 -23
- package/lib/core/tree/visitorUtils.d.ts.map +1 -1
- package/lib/core/tree/visitorUtils.js +8 -5
- package/lib/core/tree/visitorUtils.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.js +3 -3
- package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +5 -3
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js +12 -9
- package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts +1 -0
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.js +8 -5
- package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +3 -3
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.js +2 -2
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/{schemaBasedEncoding.d.ts → schemaBasedEncode.d.ts} +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -0
- package/lib/feature-libraries/chunked-forest/codec/{schemaBasedEncoding.js → schemaBasedEncode.js} +2 -3
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -0
- package/lib/feature-libraries/chunked-forest/emptyChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/emptyChunk.js +1 -1
- package/lib/feature-libraries/chunked-forest/emptyChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts +3 -2
- package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js +5 -4
- package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +12 -14
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js +5 -6
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/lib/feature-libraries/default-schema/index.d.ts +1 -0
- package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/index.js +1 -0
- package/lib/feature-libraries/default-schema/index.js.map +1 -1
- package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts +21 -0
- package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -0
- package/lib/feature-libraries/default-schema/mappedEditBuilder.js +53 -0
- package/lib/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -0
- package/lib/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/schemaChecker.js +1 -2
- package/lib/feature-libraries/default-schema/schemaChecker.js.map +1 -1
- package/lib/feature-libraries/deltaUtils.js +1 -1
- package/lib/feature-libraries/deltaUtils.js.map +1 -1
- package/lib/feature-libraries/flex-tree/context.d.ts +5 -5
- package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/context.js.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +2 -2
- 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/lazyField.d.ts +5 -4
- package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +13 -10
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.js +2 -2
- package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +6 -7
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +2 -1
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +2 -1
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
- package/lib/feature-libraries/indexing/anchorTreeIndex.js +2 -2
- package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
- package/lib/feature-libraries/initializeForest.d.ts +18 -0
- package/lib/feature-libraries/initializeForest.d.ts.map +1 -0
- package/lib/feature-libraries/initializeForest.js +31 -0
- package/lib/feature-libraries/initializeForest.js.map +1 -0
- package/lib/feature-libraries/modular-schema/comparison.js +2 -2
- package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/lib/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/isNeverTree.js +1 -2
- package/lib/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +2 -2
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +5 -5
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +12 -18
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/node-identifier/index.d.ts +8 -0
- package/lib/feature-libraries/node-identifier/index.d.ts.map +1 -0
- package/lib/feature-libraries/node-identifier/index.js +8 -0
- package/lib/feature-libraries/node-identifier/index.js.map +1 -0
- package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.d.ts +22 -0
- package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.d.ts.map +1 -0
- package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js +45 -0
- package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -0
- package/lib/feature-libraries/node-identifier/nodeIdentifier.d.ts +38 -0
- package/lib/feature-libraries/node-identifier/nodeIdentifier.d.ts.map +1 -0
- package/lib/feature-libraries/node-identifier/nodeIdentifier.js +22 -0
- package/lib/feature-libraries/node-identifier/nodeIdentifier.js.map +1 -0
- package/lib/feature-libraries/node-identifier/nodeIdentifierManager.d.ts +37 -0
- package/lib/feature-libraries/node-identifier/nodeIdentifierManager.d.ts.map +1 -0
- package/lib/feature-libraries/node-identifier/nodeIdentifierManager.js +43 -0
- package/lib/feature-libraries/node-identifier/nodeIdentifierManager.js.map +1 -0
- package/lib/feature-libraries/object-forest/objectForest.d.ts +2 -1
- package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js +8 -4
- package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/codec.js +2 -1
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.d.ts +1 -1
- package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.js +1 -2
- package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
- package/lib/feature-libraries/sequence-field/invert.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/invert.js +2 -2
- package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js +2 -2
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +2 -2
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
- package/lib/feature-libraries/sequence-field/utils.js +2 -2
- package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
- package/lib/feature-libraries/treeCursorUtils.d.ts.map +1 -1
- package/lib/feature-libraries/treeCursorUtils.js +2 -3
- package/lib/feature-libraries/treeCursorUtils.js.map +1 -1
- package/lib/index.d.ts +5 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +5 -3
- package/lib/index.js.map +1 -1
- package/lib/jsonDomainSchema.d.ts +15 -16
- package/lib/jsonDomainSchema.d.ts.map +1 -1
- package/lib/jsonDomainSchema.js +11 -6
- package/lib/jsonDomainSchema.js.map +1 -1
- package/lib/legacy.d.ts +5 -1
- 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 +5 -1
- package/lib/serializableDomainSchema.d.ts +8 -14
- package/lib/serializableDomainSchema.d.ts.map +1 -1
- package/lib/shared-tree/checkoutFlexTreeView.d.ts +3 -3
- package/lib/shared-tree/checkoutFlexTreeView.d.ts.map +1 -1
- package/lib/shared-tree/checkoutFlexTreeView.js.map +1 -1
- package/lib/shared-tree/independentView.d.ts.map +1 -1
- package/lib/shared-tree/independentView.js +5 -20
- package/lib/shared-tree/independentView.js.map +1 -1
- package/lib/shared-tree/index.d.ts +1 -1
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js +1 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
- package/lib/shared-tree/schematizeTree.js +5 -4
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +4 -4
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +1 -0
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +23 -16
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js +3 -3
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts +1 -2
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.js +2 -2
- package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/lib/shared-tree/treeApiAlpha.d.ts +9 -30
- package/lib/shared-tree/treeApiAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeApiAlpha.js +12 -24
- package/lib/shared-tree/treeApiAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +4 -4
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts +4 -3
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +2 -2
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/shared-tree-core/editManager.d.ts.map +1 -1
- package/lib/shared-tree-core/editManager.js +35 -29
- package/lib/shared-tree-core/editManager.js.map +1 -1
- package/lib/sharedTreeAttributes.d.ts +18 -0
- package/lib/sharedTreeAttributes.d.ts.map +1 -0
- package/lib/sharedTreeAttributes.js +22 -0
- package/lib/sharedTreeAttributes.js.map +1 -0
- package/lib/simple-tree/api/conciseTree.d.ts +8 -2
- package/lib/simple-tree/api/conciseTree.d.ts.map +1 -1
- package/lib/simple-tree/api/conciseTree.js +9 -1
- package/lib/simple-tree/api/conciseTree.js.map +1 -1
- package/lib/simple-tree/api/create.d.ts +3 -3
- package/lib/simple-tree/api/create.d.ts.map +1 -1
- package/lib/simple-tree/api/create.js.map +1 -1
- package/lib/simple-tree/api/customTree.d.ts +42 -12
- package/lib/simple-tree/api/customTree.d.ts.map +1 -1
- package/lib/simple-tree/api/customTree.js +30 -3
- package/lib/simple-tree/api/customTree.js.map +1 -1
- package/lib/simple-tree/api/getJsonSchema.d.ts +10 -0
- package/lib/simple-tree/api/getJsonSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/getJsonSchema.js +10 -0
- package/lib/simple-tree/api/getJsonSchema.js.map +1 -1
- package/lib/simple-tree/api/getSimpleSchema.d.ts +13 -43
- package/lib/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/getSimpleSchema.js +13 -43
- package/lib/simple-tree/api/getSimpleSchema.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +7 -6
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +5 -3
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaCreationUtilities.js +1 -1
- package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts +112 -67
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +78 -155
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +38 -23
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js +27 -2
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +40 -5
- package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.d.ts +19 -0
- package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -0
- package/lib/simple-tree/api/schemaFromSimple.js +67 -0
- package/lib/simple-tree/api/schemaFromSimple.js.map +1 -0
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts +3 -2
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js +6 -6
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/lib/simple-tree/api/simpleTreeIndex.d.ts.map +1 -1
- package/lib/simple-tree/api/simpleTreeIndex.js +2 -1
- package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
- package/lib/simple-tree/api/testRecursiveDomain.d.ts +10 -10
- package/lib/simple-tree/api/tree.d.ts +12 -6
- package/lib/simple-tree/api/tree.d.ts.map +1 -1
- package/lib/simple-tree/api/tree.js +14 -5
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.js +5 -20
- package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.d.ts +102 -36
- package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.js +0 -1
- package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
- package/lib/simple-tree/api/verboseTree.d.ts +16 -25
- package/lib/simple-tree/api/verboseTree.d.ts.map +1 -1
- package/lib/simple-tree/api/verboseTree.js +16 -12
- package/lib/simple-tree/api/verboseTree.js.map +1 -1
- package/lib/simple-tree/api/view.d.ts.map +1 -1
- package/lib/simple-tree/api/view.js +1 -2
- package/lib/simple-tree/api/view.js.map +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts +16 -3
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +69 -146
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
- package/lib/simple-tree/arrayNode.d.ts +5 -4
- package/lib/simple-tree/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/arrayNode.js +7 -3
- package/lib/simple-tree/arrayNode.js.map +1 -1
- package/lib/simple-tree/arrayNodeTypes.d.ts +46 -0
- package/lib/simple-tree/arrayNodeTypes.d.ts.map +1 -0
- package/lib/simple-tree/arrayNodeTypes.js +26 -0
- package/lib/simple-tree/arrayNodeTypes.js.map +1 -0
- package/lib/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
- package/lib/simple-tree/core/getOrCreateNode.js +2 -12
- package/lib/simple-tree/core/getOrCreateNode.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +1 -2
- package/lib/simple-tree/core/index.d.ts.map +1 -1
- package/lib/simple-tree/core/index.js +1 -2
- package/lib/simple-tree/core/index.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.d.ts +12 -5
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +28 -14
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts +14 -7
- 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/unhydratedFlexTree.d.ts +2 -2
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js +2 -2
- package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/lib/simple-tree/flexList.d.ts +4 -5
- package/lib/simple-tree/flexList.d.ts.map +1 -1
- package/lib/simple-tree/flexList.js +0 -12
- package/lib/simple-tree/flexList.js.map +1 -1
- package/lib/simple-tree/index.d.ts +9 -2
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +5 -2
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.d.ts +22 -5
- package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js +2 -0
- package/lib/simple-tree/leafNodeSchema.js.map +1 -1
- package/lib/simple-tree/mapNode.d.ts +3 -2
- package/lib/simple-tree/mapNode.d.ts.map +1 -1
- package/lib/simple-tree/mapNode.js +5 -1
- package/lib/simple-tree/mapNode.js.map +1 -1
- package/lib/simple-tree/mapNodeTypes.d.ts +46 -0
- package/lib/simple-tree/mapNodeTypes.d.ts.map +1 -0
- package/lib/simple-tree/mapNodeTypes.js +26 -0
- package/lib/simple-tree/mapNodeTypes.js.map +1 -0
- package/lib/simple-tree/objectNode.d.ts +10 -3
- package/lib/simple-tree/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/objectNode.js +12 -5
- package/lib/simple-tree/objectNode.js.map +1 -1
- package/lib/simple-tree/objectNodeTypes.d.ts +9 -5
- package/lib/simple-tree/objectNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/objectNodeTypes.js +3 -0
- package/lib/simple-tree/objectNodeTypes.js.map +1 -1
- package/lib/simple-tree/proxies.js +2 -1
- package/lib/simple-tree/proxies.js.map +1 -1
- package/lib/simple-tree/schemaTypes.d.ts +81 -8
- package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
- package/lib/simple-tree/schemaTypes.js +91 -6
- package/lib/simple-tree/schemaTypes.js.map +1 -1
- package/lib/simple-tree/{api/simpleSchema.d.ts → simpleSchema.d.ts} +55 -28
- package/lib/simple-tree/simpleSchema.d.ts.map +1 -0
- package/lib/simple-tree/simpleSchema.js.map +1 -0
- package/lib/simple-tree/toMapTree.d.ts +4 -4
- package/lib/simple-tree/toMapTree.d.ts.map +1 -1
- package/lib/simple-tree/toMapTree.js +2 -2
- package/lib/simple-tree/toMapTree.js.map +1 -1
- package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +4 -8
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/simple-tree/treeNodeValid.d.ts +7 -1
- package/lib/simple-tree/treeNodeValid.d.ts.map +1 -1
- package/lib/simple-tree/treeNodeValid.js +14 -7
- package/lib/simple-tree/treeNodeValid.js.map +1 -1
- package/lib/treeFactory.d.ts +0 -12
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +1 -17
- package/lib/treeFactory.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/lib/util/cloneWithReplacements.d.ts +21 -0
- package/lib/util/cloneWithReplacements.d.ts.map +1 -0
- package/lib/util/cloneWithReplacements.js +34 -0
- package/lib/util/cloneWithReplacements.js.map +1 -0
- package/lib/util/idAllocator.d.ts.map +1 -1
- package/lib/util/idAllocator.js +1 -2
- package/lib/util/idAllocator.js.map +1 -1
- package/lib/util/index.d.ts +2 -1
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +2 -1
- package/lib/util/index.js.map +1 -1
- package/lib/util/referenceCounting.d.ts +18 -0
- package/lib/util/referenceCounting.d.ts.map +1 -1
- package/lib/util/referenceCounting.js.map +1 -1
- package/lib/util/typeCheck.d.ts +7 -0
- package/lib/util/typeCheck.d.ts.map +1 -1
- package/lib/util/typeCheck.js.map +1 -1
- package/lib/util/utils.d.ts +0 -1
- package/lib/util/utils.d.ts.map +1 -1
- package/lib/util/utils.js +0 -2
- package/lib/util/utils.js.map +1 -1
- package/package.json +37 -27
- package/src/codec/codec.ts +2 -2
- package/src/codec/discriminatedUnions.ts +2 -2
- package/src/core/forest/editableForest.ts +1 -52
- package/src/core/forest/forest.ts +17 -2
- package/src/core/forest/index.ts +0 -1
- package/src/core/index.ts +4 -2
- package/src/core/rebase/utils.ts +1 -1
- package/src/core/schema-stored/schema.ts +6 -2
- package/src/core/tree/anchorSet.ts +42 -12
- package/src/core/tree/delta.ts +8 -25
- package/src/core/tree/deltaUtil.ts +5 -5
- package/src/core/tree/index.ts +4 -1
- package/src/core/tree/pathTree.ts +72 -1
- package/src/core/tree/treeTextFormat.ts +1 -1
- package/src/core/tree/visitDelta.ts +38 -17
- package/src/core/tree/visitorUtils.ts +22 -36
- package/src/feature-libraries/chunked-forest/basicChunk.ts +3 -3
- package/src/feature-libraries/chunked-forest/chunkTree.ts +20 -9
- package/src/feature-libraries/chunked-forest/chunkedForest.ts +10 -6
- package/src/feature-libraries/chunked-forest/codec/README.md +3 -3
- package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +1 -1
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +1 -1
- package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +3 -3
- package/src/feature-libraries/chunked-forest/codec/nodeShape.ts +2 -2
- package/src/feature-libraries/chunked-forest/codec/{schemaBasedEncoding.ts → schemaBasedEncode.ts} +1 -2
- package/src/feature-libraries/chunked-forest/emptyChunk.ts +1 -1
- package/src/feature-libraries/chunked-forest/uniformChunk.ts +5 -4
- package/src/feature-libraries/default-schema/defaultEditBuilder.ts +21 -38
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +1 -1
- package/src/feature-libraries/default-schema/index.ts +2 -0
- package/src/feature-libraries/default-schema/mappedEditBuilder.ts +68 -0
- package/src/feature-libraries/default-schema/schemaChecker.ts +1 -2
- package/src/feature-libraries/deltaUtils.ts +1 -1
- package/src/feature-libraries/flex-tree/context.ts +4 -4
- package/src/feature-libraries/flex-tree/flexTreeTypes.ts +2 -2
- package/src/feature-libraries/flex-tree/lazyField.ts +21 -12
- package/src/feature-libraries/flex-tree/lazyNode.ts +2 -2
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +5 -9
- package/src/feature-libraries/index.ts +10 -8
- package/src/feature-libraries/indexing/anchorTreeIndex.ts +4 -4
- package/src/feature-libraries/initializeForest.ts +55 -0
- package/src/feature-libraries/modular-schema/comparison.ts +2 -2
- package/src/feature-libraries/modular-schema/isNeverTree.ts +1 -2
- package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +1 -2
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +13 -30
- package/src/feature-libraries/node-identifier/README.md +11 -0
- package/src/feature-libraries/node-identifier/index.ts +17 -0
- package/src/feature-libraries/node-identifier/mockNodeIdentifierManager.ts +59 -0
- package/src/feature-libraries/node-identifier/nodeIdentifier.ts +50 -0
- package/src/feature-libraries/node-identifier/nodeIdentifierManager.ts +95 -0
- package/src/feature-libraries/object-forest/objectForest.ts +11 -5
- package/src/feature-libraries/schema-index/codec.ts +2 -1
- package/src/feature-libraries/sequence-field/compose.ts +2 -2
- package/src/feature-libraries/sequence-field/invert.ts +2 -2
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV1.ts +2 -2
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +2 -2
- package/src/feature-libraries/sequence-field/utils.ts +2 -2
- package/src/feature-libraries/treeCursorUtils.ts +2 -3
- package/src/index.ts +43 -13
- package/src/jsonDomainSchema.ts +30 -11
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/checkoutFlexTreeView.ts +2 -2
- package/src/shared-tree/independentView.ts +5 -29
- package/src/shared-tree/index.ts +1 -0
- package/src/shared-tree/schematizeTree.ts +5 -4
- package/src/shared-tree/schematizingTreeView.ts +3 -3
- package/src/shared-tree/sharedTree.ts +29 -19
- package/src/shared-tree/sharedTreeChangeFamily.ts +1 -3
- package/src/shared-tree/sharedTreeEditBuilder.ts +5 -11
- package/src/shared-tree/treeApiAlpha.ts +45 -85
- package/src/shared-tree/treeCheckout.ts +4 -10
- package/src/shared-tree-core/branch.ts +5 -3
- package/src/shared-tree-core/editManager.ts +37 -45
- package/src/sharedTreeAttributes.ts +25 -0
- package/src/simple-tree/api/conciseTree.ts +25 -8
- package/src/simple-tree/api/create.ts +3 -3
- package/src/simple-tree/api/customTree.ts +60 -17
- package/src/simple-tree/api/getJsonSchema.ts +10 -0
- package/src/simple-tree/api/getSimpleSchema.ts +14 -44
- package/src/simple-tree/api/index.ts +17 -12
- package/src/simple-tree/api/schemaCreationUtilities.ts +1 -2
- package/src/simple-tree/api/schemaFactory.ts +179 -118
- package/src/simple-tree/api/schemaFactoryAlpha.ts +74 -67
- package/src/simple-tree/api/schemaFactoryRecursive.ts +44 -12
- package/src/simple-tree/api/schemaFromSimple.ts +96 -0
- package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +7 -7
- package/src/simple-tree/api/simpleTreeIndex.ts +2 -1
- package/src/simple-tree/api/tree.ts +16 -11
- package/src/simple-tree/api/treeNodeApi.ts +5 -18
- package/src/simple-tree/api/typesUnsafe.ts +166 -48
- package/src/simple-tree/api/verboseTree.ts +45 -57
- package/src/simple-tree/api/view.ts +1 -2
- package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +80 -185
- package/src/simple-tree/arrayNode.ts +20 -14
- package/src/simple-tree/arrayNodeTypes.ts +93 -0
- package/src/simple-tree/core/getOrCreateNode.ts +3 -13
- package/src/simple-tree/core/index.ts +1 -1
- package/src/simple-tree/core/treeNodeKernel.ts +32 -18
- package/src/simple-tree/core/treeNodeSchema.ts +14 -8
- package/src/simple-tree/core/unhydratedFlexTree.ts +4 -4
- package/src/simple-tree/flexList.ts +4 -14
- package/src/simple-tree/index.ts +36 -9
- package/src/simple-tree/leafNodeSchema.ts +28 -7
- package/src/simple-tree/mapNode.ts +13 -11
- package/src/simple-tree/mapNodeTypes.ts +90 -0
- package/src/simple-tree/objectNode.ts +40 -13
- package/src/simple-tree/objectNodeTypes.ts +21 -16
- package/src/simple-tree/proxies.ts +2 -2
- package/src/simple-tree/schemaTypes.ts +153 -23
- package/src/simple-tree/{api/simpleSchema.ts → simpleSchema.ts} +67 -28
- package/src/simple-tree/toMapTree.ts +8 -8
- package/src/simple-tree/toStoredSchema.ts +4 -7
- package/src/simple-tree/treeNodeValid.ts +17 -7
- package/src/treeFactory.ts +1 -19
- package/src/util/cloneWithReplacements.ts +41 -0
- package/src/util/idAllocator.ts +1 -3
- package/src/util/index.ts +2 -1
- package/src/util/referenceCounting.ts +18 -1
- package/src/util/typeCheck.ts +7 -0
- package/src/util/utils.ts +0 -3
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncoding.d.ts.map +0 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncoding.js.map +0 -1
- package/dist/feature-libraries/node-key/index.d.ts +0 -8
- package/dist/feature-libraries/node-key/index.d.ts.map +0 -1
- package/dist/feature-libraries/node-key/index.js +0 -16
- package/dist/feature-libraries/node-key/index.js.map +0 -1
- package/dist/feature-libraries/node-key/mockNodeKeyManager.d.ts +0 -22
- package/dist/feature-libraries/node-key/mockNodeKeyManager.d.ts.map +0 -1
- package/dist/feature-libraries/node-key/mockNodeKeyManager.js.map +0 -1
- package/dist/feature-libraries/node-key/nodeKey.d.ts +0 -38
- package/dist/feature-libraries/node-key/nodeKey.d.ts.map +0 -1
- package/dist/feature-libraries/node-key/nodeKey.js +0 -26
- package/dist/feature-libraries/node-key/nodeKey.js.map +0 -1
- package/dist/feature-libraries/node-key/nodeKeyManager.d.ts +0 -37
- package/dist/feature-libraries/node-key/nodeKeyManager.d.ts.map +0 -1
- package/dist/feature-libraries/node-key/nodeKeyManager.js +0 -48
- package/dist/feature-libraries/node-key/nodeKeyManager.js.map +0 -1
- package/dist/simple-tree/api/simpleSchema.d.ts.map +0 -1
- package/dist/simple-tree/api/simpleSchema.js.map +0 -1
- package/dist/simple-tree/core/schemaCaching.d.ts +0 -16
- package/dist/simple-tree/core/schemaCaching.d.ts.map +0 -1
- package/dist/simple-tree/core/schemaCaching.js +0 -32
- package/dist/simple-tree/core/schemaCaching.js.map +0 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncoding.d.ts.map +0 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncoding.js.map +0 -1
- package/lib/feature-libraries/node-key/index.d.ts +0 -8
- package/lib/feature-libraries/node-key/index.d.ts.map +0 -1
- package/lib/feature-libraries/node-key/index.js +0 -8
- package/lib/feature-libraries/node-key/index.js.map +0 -1
- package/lib/feature-libraries/node-key/mockNodeKeyManager.d.ts +0 -22
- package/lib/feature-libraries/node-key/mockNodeKeyManager.d.ts.map +0 -1
- package/lib/feature-libraries/node-key/mockNodeKeyManager.js +0 -45
- package/lib/feature-libraries/node-key/mockNodeKeyManager.js.map +0 -1
- package/lib/feature-libraries/node-key/nodeKey.d.ts +0 -38
- package/lib/feature-libraries/node-key/nodeKey.d.ts.map +0 -1
- package/lib/feature-libraries/node-key/nodeKey.js +0 -22
- package/lib/feature-libraries/node-key/nodeKey.js.map +0 -1
- package/lib/feature-libraries/node-key/nodeKeyManager.d.ts +0 -37
- package/lib/feature-libraries/node-key/nodeKeyManager.d.ts.map +0 -1
- package/lib/feature-libraries/node-key/nodeKeyManager.js +0 -43
- package/lib/feature-libraries/node-key/nodeKeyManager.js.map +0 -1
- package/lib/simple-tree/api/simpleSchema.d.ts.map +0 -1
- package/lib/simple-tree/api/simpleSchema.js.map +0 -1
- package/lib/simple-tree/core/schemaCaching.d.ts +0 -16
- package/lib/simple-tree/core/schemaCaching.d.ts.map +0 -1
- package/lib/simple-tree/core/schemaCaching.js +0 -27
- package/lib/simple-tree/core/schemaCaching.js.map +0 -1
- package/prettier.config.cjs +0 -8
- package/src/feature-libraries/node-key/README.md +0 -11
- package/src/feature-libraries/node-key/index.ts +0 -17
- package/src/feature-libraries/node-key/mockNodeKeyManager.ts +0 -54
- package/src/feature-libraries/node-key/nodeKey.ts +0 -47
- package/src/feature-libraries/node-key/nodeKeyManager.ts +0 -93
- package/src/simple-tree/core/schemaCaching.ts +0 -35
- /package/dist/simple-tree/{api/simpleSchema.js → simpleSchema.js} +0 -0
- /package/lib/simple-tree/{api/simpleSchema.js → simpleSchema.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unhydratedFlexTree.js","sourceRoot":"","sources":["../../../src/simple-tree/core/unhydratedFlexTree.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,kEAAkE;AAClE,+DAA6D;AAE7D,uEAAsE;AAEtE,kDAgB6B;AAC7B,kDAA4E;AAC5E,+DAiB0C;AAsB1C;;;;;;;GAOG;AACH,MAAa,sBAAsB;IAClC,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;IAC1B,CAAC;IAED,IAAW,YAAY;QACtB,OAAO,CACN,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAA,eAAI,EAAC,KAAK,CAAC,oBAAoB,CAAC,CACzF,CAAC;IACH,CAAC;IAKD,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,WAAW,CACxB,OAAgB,EAChB,OAAyB;QAEzB,OAAO,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI,sBAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;IAC1F,CAAC;IAED,IAAW,OAAO;QACjB,OAAO,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC;IACvC,CAAC;IAED;;;;;;;OAOG;IACH,YACiB,aAAsB;IACtC,4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AAE,CAAC;QAC1B,OAAO,MAAM,CAAC;IACf,CAAC;IAED,IACC,MAAM,KAAK,qBAAU,CAAC,QAAQ,CAAC,UAAU;QACzC,MAAM,KAAK,qBAAU,CAAC,UAAU,CAAC,UAAU,EAC1C,CAAC;QACF,OAAO,IAAI,yBAAyB,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACzF,CAAC;IAED,IAAI,MAAM,KAAK,qBAAU,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;QAC/C,OAAO,IAAI,yBAAyB,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACzF,CAAC;IAED,IAAI,MAAM,KAAK,qBAAU,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;QAC/C,OAAO,IAAI,2BAA2B,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3F,CAAC;IAED,OAAO,IAAI,uBAAuB,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AACvF,CAAC;AAED,4CAA4C;AAE5C,SAAgB,qBAAqB,CAAC,OAAgB;IACrD,OAAO,IAAI,qBAAU,CACpB,GACC,OAAO,IAAI,WACZ,4EAA4E,CAC5E,CAAC;AACH,CAAC;AAND,sDAMC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, oob } from \"@fluidframework/core-utils/internal\";\nimport { createEmitter } from \"@fluid-internal/client-utils\";\nimport type { Listenable } from \"@fluidframework/core-interfaces\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\ttype AnchorEvents,\n\ttype AnchorNode,\n\tEmptyKey,\n\ttype ExclusiveMapTree,\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\ttype FieldUpPath,\n\tforbiddenFieldKindIdentifier,\n\ttype ITreeCursorSynchronous,\n\ttype MapTree,\n\ttype SchemaPolicy,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\ttype Value,\n} from \"../../core/index.js\";\nimport { brand, fail, getOrCreate, mapIterable } from \"../../util/index.js\";\nimport {\n\ttype FlexTreeContext,\n\tFlexTreeEntityKind,\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeUnknownUnboxed,\n\tflexTreeMarker,\n\tindexForAt,\n\ttype FlexTreeHydratedContext,\n\ttype FlexFieldKind,\n\tFieldKinds,\n\ttype SequenceFieldEditBuilder,\n\tcursorForMapTreeNode,\n} from \"../../feature-libraries/index.js\";\nimport type { Context } from \"./context.js\";\n\ninterface UnhydratedTreeSequenceFieldEditBuilder\n\textends SequenceFieldEditBuilder<ExclusiveMapTree[]> {\n\t/**\n\t * Issues a change which removes `count` elements starting at the given `index`.\n\t * @param index - The index of the first removed element.\n\t * @param count - The number of elements to remove.\n\t * @returns the MapTrees that were removed\n\t */\n\tremove(index: number, count: number): ExclusiveMapTree[];\n}\n\ntype UnhydratedFlexTreeNodeEvents = Pick<AnchorEvents, \"childrenChangedAfterBatch\">;\n\n/** A node's parent field and its index in that field */\ninterface LocationInField {\n\treadonly parent: FlexTreeField;\n\treadonly index: number;\n}\n\n/**\n * An unhydrated implementation of {@link FlexTreeNode} which wraps a {@link MapTree}.\n * @remarks\n * MapTreeNodes are unconditionally cached -\n * when retrieved via {@link getOrCreateNode}, the same {@link MapTree} object will always produce the same `UnhydratedFlexTreeNode` object.\n *\n * Create a `UnhydratedFlexTreeNode` by calling {@link getOrCreate}.\n */\nexport class UnhydratedFlexTreeNode implements UnhydratedFlexTreeNode {\n\tpublic get schema(): TreeNodeSchemaIdentifier {\n\t\treturn this.mapTree.type;\n\t}\n\n\tpublic get storedSchema(): TreeNodeStoredSchema {\n\t\treturn (\n\t\t\tthis.context.schema.nodeSchema.get(this.mapTree.type) ?? fail(0xb46 /* missing schema */)\n\t\t);\n\t}\n\n\tpublic readonly [flexTreeMarker] = FlexTreeEntityKind.Node as const;\n\n\tprivate readonly _events = createEmitter<UnhydratedFlexTreeNodeEvents>();\n\tpublic get events(): Listenable<UnhydratedFlexTreeNodeEvents> {\n\t\treturn this._events;\n\t}\n\n\t/**\n\t * Create a {@link UnhydratedFlexTreeNode} that wraps the given {@link MapTree}, or get the node that already exists for that {@link MapTree} if there is one.\n\t * @param nodeSchema - the {@link FlexTreeNodeSchema | schema} that the node conforms to\n\t * @param mapTree - the {@link MapTree} containing the data for this node.\n\t * @remarks It must conform to the `nodeSchema`.\n\t */\n\tpublic static getOrCreate(\n\t\tcontext: Context,\n\t\tmapTree: ExclusiveMapTree,\n\t): UnhydratedFlexTreeNode {\n\t\treturn nodeCache.get(mapTree) ?? new UnhydratedFlexTreeNode(context, mapTree, undefined);\n\t}\n\n\tpublic get context(): FlexTreeContext {\n\t\treturn this.simpleContext.flexContext;\n\t}\n\n\t/**\n\t * Create a new UnhydratedFlexTreeNode.\n\t * @param location - the parentage of this node, if it is being created underneath an existing node and field, or undefined if not\n\t * @remarks This class (and its subclasses) should not be directly constructed outside of this module.\n\t * Instead, use {@link getOrCreateNode} to create a UnhydratedFlexTreeNode from a {@link MapTree}.\n\t * A `UnhydratedFlexTreeNode` may never be constructed more than once for the same {@link MapTree} object.\n\t * Instead, it should always be acquired via {@link getOrCreateNode}.\n\t */\n\tpublic constructor(\n\t\tpublic readonly simpleContext: Context,\n\t\t/** The underlying {@link MapTree} that this `UnhydratedFlexTreeNode` reads its data from */\n\t\tpublic readonly mapTree: ExclusiveMapTree,\n\t\tprivate location = unparentedLocation,\n\t) {\n\t\tassert(!nodeCache.has(mapTree), 0x98b /* A node already exists for the given MapTree */);\n\t\tnodeCache.set(mapTree, this);\n\n\t\t// Fully demand the tree to ensure that parent pointers are present and accurate on all nodes.\n\t\t// When a UnhydratedFlexTreeNode is constructed, its MapTree may contain nodes (anywhere below) that map (via the `nodeCache`) to pre-existing UnhydratedFlexTreeNodes.\n\t\t// Put another way, for a given MapTree, some ancestor UnhydratedFlexTreeNode can be created after any number of its descendant UnhydratedFlexTreeNodes already exist.\n\t\t// In such a case, the spine of nodes between the descendant and ancestor need to exist in order for the ancestor to be able to walk upwards via the `parentField` property.\n\t\t// This needs to happen for all UnhydratedFlexTreeNodes that are descendants of the ancestor UnhydratedFlexTreeNode.\n\t\t// Demanding the entire tree is overkill to solve this problem since not all descendant MapTree nodes will have corresponding UnhydratedFlexTreeNodes.\n\t\t// However, demanding the full tree also lets us eagerly validate that there are no duplicate MapTrees (i.e. same MapTree object) anywhere in the tree.\n\t\tthis.walkTree();\n\t}\n\n\tpublic get type(): TreeNodeSchemaIdentifier {\n\t\treturn this.mapTree.type;\n\t}\n\n\t/**\n\t * Set this node's parentage (see {@link FlexTreeNode.parentField}).\n\t * @remarks The node may be given a parent if it has none, or may have its parent removed (by passing `undefined`).\n\t * However, a node with a parent may not be directly re-assigned a different parent.\n\t * That likely indicates either an attempted multi-parenting or an attempt to \"move\" the node, neither of which are supported.\n\t * Removing a node's parent twice in a row is also not supported, as it likely indicates a bug.\n\t */\n\tpublic adoptBy(parent: undefined): void;\n\tpublic adoptBy(parent: UnhydratedFlexTreeField, index: number): void;\n\tpublic adoptBy(parent: UnhydratedFlexTreeField | undefined, index?: number): void {\n\t\tif (parent !== undefined) {\n\t\t\tassert(\n\t\t\t\tthis.location === unparentedLocation,\n\t\t\t\t0x98c /* Node may not be adopted if it already has a parent */,\n\t\t\t);\n\t\t\tassert(index !== undefined, 0xa08 /* Expected index */);\n\t\t\tthis.location = { parent, index };\n\t\t} else {\n\t\t\tassert(\n\t\t\t\tthis.location !== unparentedLocation,\n\t\t\t\t0xa09 /* Node may not be un-adopted if it does not have a parent */,\n\t\t\t);\n\t\t\tthis.location = unparentedLocation;\n\t\t}\n\t}\n\n\t/**\n\t * The field this tree is in, and the index within that field.\n\t * @remarks If this node is unparented, this method will return the special {@link unparentedLocation} as the parent.\n\t */\n\tpublic get parentField(): LocationInField {\n\t\treturn this.location;\n\t}\n\n\tpublic borrowCursor(): ITreeCursorSynchronous {\n\t\treturn cursorForMapTreeNode(this.mapTree);\n\t}\n\n\tpublic tryGetField(key: FieldKey): UnhydratedFlexTreeField | undefined {\n\t\tconst field = this.mapTree.fields.get(key);\n\t\t// Only return the field if it is not empty, in order to fulfill the contract of `tryGetField`.\n\t\tif (field !== undefined && field.length > 0) {\n\t\t\treturn getOrCreateField(this, key, this.storedSchema.getFieldSchema(key).kind, () =>\n\t\t\t\tthis.emitChangedEvent(key),\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic getBoxed(key: string): FlexTreeField {\n\t\tconst fieldKey: FieldKey = brand(key);\n\t\treturn getOrCreateField(\n\t\t\tthis,\n\t\t\tfieldKey,\n\t\t\tthis.storedSchema.getFieldSchema(fieldKey).kind,\n\t\t\t() => this.emitChangedEvent(fieldKey),\n\t\t);\n\t}\n\n\tpublic boxedIterator(): IterableIterator<FlexTreeField> {\n\t\treturn mapIterable(this.mapTree.fields.entries(), ([key]) =>\n\t\t\tgetOrCreateField(this, key, this.storedSchema.getFieldSchema(key).kind, () =>\n\t\t\t\tthis.emitChangedEvent(key),\n\t\t\t),\n\t\t);\n\t}\n\n\tpublic keys(): IterableIterator<FieldKey> {\n\t\t// TODO: how this should handle missing defaults (and empty keys if they end up being allowed) needs to be determined.\n\t\treturn this.mapTree.fields.keys();\n\t}\n\n\tpublic get value(): Value {\n\t\treturn this.mapTree.value;\n\t}\n\n\tpublic get anchorNode(): AnchorNode {\n\t\t// This API is relevant to `LazyTreeNode`s, but not `UnhydratedFlexTreeNode`s.\n\t\t// TODO: Refactor the FlexTreeNode interface so that stubbing this out isn't necessary.\n\t\treturn fail(0xb47 /* UnhydratedFlexTreeNode does not implement anchorNode */);\n\t}\n\n\tprivate walkTree(): void {\n\t\tfor (const [key, mapTrees] of this.mapTree.fields) {\n\t\t\tconst field = getOrCreateField(\n\t\t\t\tthis,\n\t\t\t\tkey,\n\t\t\t\tthis.storedSchema.getFieldSchema(key).kind,\n\t\t\t\t() => this.emitChangedEvent(key),\n\t\t\t);\n\t\t\tfor (let index = 0; index < field.length; index++) {\n\t\t\t\tconst child = getOrCreateChild(this.simpleContext, mapTrees[index] ?? oob(), {\n\t\t\t\t\tparent: field,\n\t\t\t\t\tindex,\n\t\t\t\t});\n\t\t\t\t// These next asserts detect the case where `getOrCreateChild` gets a cache hit of a different node than the one we're trying to create\n\t\t\t\tassert(child.location !== undefined, 0x98d /* Expected node to have parent */);\n\t\t\t\tassert(\n\t\t\t\t\tchild.location.parent.parent === this,\n\t\t\t\t\t0x98e /* Node may not be multi-parented */,\n\t\t\t\t);\n\t\t\t\tassert(child.location.index === index, 0x98f /* Node may not be multi-parented */);\n\t\t\t\tchild.walkTree();\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate emitChangedEvent(key: FieldKey): void {\n\t\tthis._events.emit(\"childrenChangedAfterBatch\", { changedFields: new Set([key]) });\n\t}\n}\n\n/**\n * Implementation of `FlexTreeContext`.\n *\n * @remarks An editor is required to edit the FlexTree.\n */\nexport class UnhydratedContext implements FlexTreeContext {\n\t/**\n\t * @param flexSchema - Schema to use when working with the tree.\n\t */\n\tpublic constructor(\n\t\tpublic readonly schemaPolicy: SchemaPolicy,\n\t\tpublic readonly schema: TreeStoredSchema,\n\t) {}\n\n\tpublic isHydrated(): this is FlexTreeHydratedContext {\n\t\treturn false;\n\t}\n}\n\n// #region Fields\n\n/**\n * A special singleton that is the implicit {@link LocationInField} of all un-parented {@link UnhydratedFlexTreeNode}s.\n * @remarks This exists because {@link UnhydratedFlexTreeNode.parentField} must return a field.\n * If a {@link UnhydratedFlexTreeNode} is created without a parent, its {@link UnhydratedFlexTreeNode.parentField} property will point to this object.\n * However, this field cannot be used in any practical way because it is empty, i.e. it does not actually contain the children that claim to be parented under it.\n * It has the \"empty\" schema and it will always contain zero children if queried.\n * Any nodes with this location will have a dummy parent index of `-1`.\n */\nconst unparentedLocation: LocationInField = {\n\tparent: {\n\t\t[flexTreeMarker]: FlexTreeEntityKind.Field as const,\n\t\tlength: 0,\n\t\tkey: EmptyKey,\n\t\tparent: undefined,\n\t\tis<TKind2 extends FlexFieldKind>(kind: TKind2) {\n\t\t\treturn this.schema === kind.identifier;\n\t\t},\n\t\tboxedIterator(): IterableIterator<FlexTreeNode> {\n\t\t\treturn [].values();\n\t\t},\n\t\tboxedAt(index: number): FlexTreeNode | undefined {\n\t\t\treturn undefined;\n\t\t},\n\t\tschema: brand(forbiddenFieldKindIdentifier),\n\t\tget context(): never {\n\t\t\treturn fail(0xb48 /* unsupported */);\n\t\t},\n\t\tgetFieldPath() {\n\t\t\tfail(0xb49 /* unsupported */);\n\t\t},\n\t},\n\tindex: -1,\n};\n\nclass UnhydratedFlexTreeField implements FlexTreeField {\n\tpublic [flexTreeMarker] = FlexTreeEntityKind.Field as const;\n\n\tpublic get context(): FlexTreeContext {\n\t\treturn this.simpleContext.flexContext;\n\t}\n\n\tpublic constructor(\n\t\tpublic readonly simpleContext: Context,\n\t\tpublic readonly schema: FieldKindIdentifier,\n\t\tpublic readonly key: FieldKey,\n\t\tpublic readonly parent: UnhydratedFlexTreeNode,\n\t\tpublic readonly onEdit?: () => void,\n\t) {\n\t\tconst fieldKeyCache = getFieldKeyCache(parent);\n\t\tassert(!fieldKeyCache.has(key), 0x990 /* A field already exists for the given MapTrees */);\n\t\tfieldKeyCache.set(key, this);\n\n\t\t// When this field is created (which only happens one time, because it is cached), all the children become parented for the first time.\n\t\t// \"Adopt\" each child by updating its parent information to point to this field.\n\t\tfor (const [i, mapTree] of this.mapTrees.entries()) {\n\t\t\tconst mapTreeNodeChild = nodeCache.get(mapTree);\n\t\t\tif (mapTreeNodeChild !== undefined) {\n\t\t\t\tif (mapTreeNodeChild.parentField !== unparentedLocation) {\n\t\t\t\t\tthrow new UsageError(\"A node may not be in more than one place in the tree\");\n\t\t\t\t}\n\t\t\t\tmapTreeNodeChild.adoptBy(this, i);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic get mapTrees(): readonly ExclusiveMapTree[] {\n\t\treturn this.parent.mapTree.fields.get(this.key) ?? [];\n\t}\n\n\tpublic get length(): number {\n\t\treturn this.mapTrees.length;\n\t}\n\n\tpublic is<TKind2 extends FlexFieldKind>(kind: TKind2): this is FlexTreeTypedField<TKind2> {\n\t\treturn this.schema === kind.identifier;\n\t}\n\n\tpublic boxedIterator(): IterableIterator<FlexTreeNode> {\n\t\treturn this.mapTrees\n\t\t\t.map(\n\t\t\t\t(m, index) =>\n\t\t\t\t\tgetOrCreateChild(this.simpleContext, m, {\n\t\t\t\t\t\tparent: this,\n\t\t\t\t\t\tindex,\n\t\t\t\t\t}) as FlexTreeNode,\n\t\t\t)\n\t\t\t.values();\n\t}\n\n\tpublic boxedAt(index: number): FlexTreeNode | undefined {\n\t\tconst i = indexForAt(index, this.length);\n\t\tif (i === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst m = this.mapTrees[i];\n\t\tif (m !== undefined) {\n\t\t\treturn getOrCreateChild(this.simpleContext, m, {\n\t\t\t\tparent: this,\n\t\t\t\tindex: i,\n\t\t\t}) as FlexTreeNode;\n\t\t}\n\t}\n\n\t/**\n\t * Mutate this field.\n\t * @param edit - A function which receives the current `MapTree`s that comprise the contents of the field so that it may be mutated.\n\t * The function may mutate the array in place or return a new array.\n\t * If a new array is returned then it will be used as the new contents of the field, otherwise the original array will be continue to be used.\n\t * @remarks All edits to the field (i.e. mutations of the field's MapTrees) should be directed through this function.\n\t * This function ensures that the parent MapTree has no empty fields (which is an invariant of `MapTree`) after the mutation.\n\t */\n\tprotected edit(edit: (mapTrees: ExclusiveMapTree[]) => void | ExclusiveMapTree[]): void {\n\t\tconst oldMapTrees = this.parent.mapTree.fields.get(this.key) ?? [];\n\t\tconst newMapTrees = edit(oldMapTrees) ?? oldMapTrees;\n\t\tif (newMapTrees.length > 0) {\n\t\t\tthis.parent.mapTree.fields.set(this.key, newMapTrees);\n\t\t} else {\n\t\t\tthis.parent.mapTree.fields.delete(this.key);\n\t\t}\n\n\t\tthis.onEdit?.();\n\t}\n\n\tpublic getFieldPath(): FieldUpPath {\n\t\tthrow unsupportedUsageError(\"Editing an array\");\n\t}\n\n\t/** Unboxes leaf nodes to their values */\n\tprotected unboxed(index: number): FlexTreeUnknownUnboxed {\n\t\tconst mapTree: ExclusiveMapTree = this.mapTrees[index] ?? oob();\n\t\tconst value = mapTree.value;\n\t\tif (value !== undefined) {\n\t\t\treturn value;\n\t\t}\n\n\t\treturn getOrCreateChild(this.simpleContext, mapTree, { parent: this, index });\n\t}\n}\n\nclass EagerMapTreeOptionalField\n\textends UnhydratedFlexTreeField\n\timplements FlexTreeOptionalField\n{\n\tpublic readonly editor = {\n\t\tset: (newContent: ExclusiveMapTree | undefined): void => {\n\t\t\t// If the new content is a UnhydratedFlexTreeNode, it needs to have its parent pointer updated\n\t\t\tif (newContent !== undefined) {\n\t\t\t\tnodeCache.get(newContent)?.adoptBy(this, 0);\n\t\t\t}\n\t\t\t// If the old content is a UnhydratedFlexTreeNode, it needs to have its parent pointer unset\n\t\t\tconst oldContent = this.mapTrees[0];\n\t\t\tif (oldContent !== undefined) {\n\t\t\t\tnodeCache.get(oldContent)?.adoptBy(undefined);\n\t\t\t}\n\n\t\t\tthis.edit((mapTrees) => {\n\t\t\t\tif (newContent !== undefined) {\n\t\t\t\t\tmapTrees[0] = newContent;\n\t\t\t\t} else {\n\t\t\t\t\tmapTrees.length = 0;\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t};\n\n\tpublic get content(): FlexTreeUnknownUnboxed | undefined {\n\t\tconst value = this.mapTrees[0];\n\t\tif (value !== undefined) {\n\t\t\treturn this.unboxed(0);\n\t\t}\n\n\t\treturn undefined;\n\t}\n}\n\nclass EagerMapTreeRequiredField\n\textends EagerMapTreeOptionalField\n\timplements FlexTreeRequiredField\n{\n\tpublic override get content(): FlexTreeUnknownUnboxed {\n\t\t// This cannot use ?? since null is a legal value here.\n\t\tassert(\n\t\t\tsuper.content !== undefined,\n\t\t\t0xa57 /* Expected EagerMapTree required field to have a value */,\n\t\t);\n\t\treturn super.content;\n\t}\n}\n\nexport class UnhydratedTreeSequenceField\n\textends UnhydratedFlexTreeField\n\timplements FlexTreeSequenceField\n{\n\tpublic readonly editor: UnhydratedTreeSequenceFieldEditBuilder = {\n\t\tinsert: (index, newContent): void => {\n\t\t\tfor (let i = 0; i < newContent.length; i++) {\n\t\t\t\tconst c = newContent[i];\n\t\t\t\tassert(c !== undefined, 0xa0a /* Unexpected sparse array content */);\n\t\t\t\tnodeCache.get(c)?.adoptBy(this, index + i);\n\t\t\t}\n\t\t\tthis.edit((mapTrees) => {\n\t\t\t\tif (newContent.length < 1000) {\n\t\t\t\t\t// For \"smallish arrays\" (`1000` is not empirically derived), the `splice` function is appropriate...\n\t\t\t\t\tmapTrees.splice(index, 0, ...newContent);\n\t\t\t\t} else {\n\t\t\t\t\t// ...but we avoid using `splice` + spread for very large input arrays since there is a limit on how many elements can be spread (too many will overflow the stack).\n\t\t\t\t\treturn mapTrees.slice(0, index).concat(newContent, mapTrees.slice(index));\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t\tremove: (index, count): ExclusiveMapTree[] => {\n\t\t\tfor (let i = index; i < index + count; i++) {\n\t\t\t\tconst c = this.mapTrees[i];\n\t\t\t\tassert(c !== undefined, 0xa0b /* Unexpected sparse array */);\n\t\t\t\tnodeCache.get(c)?.adoptBy(undefined);\n\t\t\t}\n\t\t\tlet removed: ExclusiveMapTree[] | undefined;\n\t\t\tthis.edit((mapTrees) => {\n\t\t\t\tremoved = mapTrees.splice(index, count);\n\t\t\t});\n\t\t\treturn removed ?? fail(0xb4a /* Expected removed to be set by edit */);\n\t\t},\n\t};\n\n\tpublic at(index: number): FlexTreeUnknownUnboxed | undefined {\n\t\tconst i = indexForAt(index, this.length);\n\t\tif (i === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn this.unboxed(i);\n\t}\n\tpublic map<U>(callbackfn: (value: FlexTreeUnknownUnboxed, index: number) => U): U[] {\n\t\treturn Array.from(this, callbackfn);\n\t}\n\n\tpublic *[Symbol.iterator](): IterableIterator<FlexTreeUnknownUnboxed> {\n\t\tfor (const [i] of this.mapTrees.entries()) {\n\t\t\tyield this.unboxed(i);\n\t\t}\n\t}\n}\n\n// #endregion Fields\n\n// #region Caching and unboxing utilities\n\nconst nodeCache = new WeakMap<MapTree, UnhydratedFlexTreeNode>();\n/** Node Parent -\\> Field Key -\\> Field */\nconst fieldCache = new WeakMap<\n\tUnhydratedFlexTreeNode,\n\tMap<FieldKey, UnhydratedFlexTreeField>\n>();\nfunction getFieldKeyCache(\n\tparent: UnhydratedFlexTreeNode,\n): WeakMap<FieldKey, UnhydratedFlexTreeField> {\n\treturn getOrCreate(fieldCache, parent, () => new Map());\n}\n\n/**\n * If there exists a {@link UnhydratedFlexTreeNode} for the given {@link MapTree}, returns it, otherwise returns `undefined`.\n * @remarks {@link UnhydratedFlexTreeNode | UnhydratedFlexTreeNodes} are created via {@link getOrCreateNode}.\n */\nexport function tryUnhydratedFlexTreeNode(\n\tmapTree: MapTree,\n): UnhydratedFlexTreeNode | undefined {\n\treturn nodeCache.get(mapTree);\n}\n\n/** Helper for creating a `UnhydratedFlexTreeNode` given the parent field (e.g. when \"walking down\") */\nfunction getOrCreateChild(\n\tcontext: Context,\n\tmapTree: ExclusiveMapTree,\n\tparent: LocationInField | undefined,\n): UnhydratedFlexTreeNode {\n\tconst cached = nodeCache.get(mapTree);\n\tif (cached !== undefined) {\n\t\treturn cached;\n\t}\n\n\treturn new UnhydratedFlexTreeNode(context, mapTree, parent);\n}\n\n/** Creates a field with the given attributes, or returns a cached field if there is one */\nfunction getOrCreateField(\n\tparent: UnhydratedFlexTreeNode,\n\tkey: FieldKey,\n\tschema: FieldKindIdentifier,\n\tonEdit?: () => void,\n): UnhydratedFlexTreeField {\n\tconst cached = getFieldKeyCache(parent).get(key);\n\tif (cached !== undefined) {\n\t\treturn cached;\n\t}\n\n\tif (\n\t\tschema === FieldKinds.required.identifier ||\n\t\tschema === FieldKinds.identifier.identifier\n\t) {\n\t\treturn new EagerMapTreeRequiredField(parent.simpleContext, schema, key, parent, onEdit);\n\t}\n\n\tif (schema === FieldKinds.optional.identifier) {\n\t\treturn new EagerMapTreeOptionalField(parent.simpleContext, schema, key, parent, onEdit);\n\t}\n\n\tif (schema === FieldKinds.sequence.identifier) {\n\t\treturn new UnhydratedTreeSequenceField(parent.simpleContext, schema, key, parent, onEdit);\n\t}\n\n\treturn new UnhydratedFlexTreeField(parent.simpleContext, schema, key, parent, onEdit);\n}\n\n// #endregion Caching and unboxing utilities\n\nexport function unsupportedUsageError(message?: string): Error {\n\treturn new UsageError(\n\t\t`${\n\t\t\tmessage ?? \"Operation\"\n\t\t} is not supported for content that has not yet been inserted into the tree`,\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"unhydratedFlexTree.js","sourceRoot":"","sources":["../../../src/simple-tree/core/unhydratedFlexTree.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,kEAAwE;AACxE,+DAA6D;AAE7D,uEAAsE;AAEtE,kDAgB6B;AAC7B,kDAAsE;AACtE,+DAiB0C;AAsB1C;;;;;;;GAOG;AACH,MAAa,sBAAsB;IAClC,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;IAC1B,CAAC;IAED,IAAW,YAAY;QACtB,OAAO,CACN,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAA,eAAI,EAAC,KAAK,CAAC,oBAAoB,CAAC,CACzF,CA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AgB;IACrD,OAAO,IAAI,qBAAU,CACpB,GACC,OAAO,IAAI,WACZ,4EAA4E,CAC5E,CAAC;AACH,CAAC;AAND,sDAMC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, oob, fail } from \"@fluidframework/core-utils/internal\";\nimport { createEmitter } from \"@fluid-internal/client-utils\";\nimport type { Listenable } from \"@fluidframework/core-interfaces\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\ttype AnchorEvents,\n\ttype AnchorNode,\n\tEmptyKey,\n\ttype ExclusiveMapTree,\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\tforbiddenFieldKindIdentifier,\n\ttype ITreeCursorSynchronous,\n\ttype MapTree,\n\ttype NormalizedFieldUpPath,\n\ttype SchemaPolicy,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\ttype Value,\n} from \"../../core/index.js\";\nimport { brand, getOrCreate, mapIterable } from \"../../util/index.js\";\nimport {\n\ttype FlexTreeContext,\n\tFlexTreeEntityKind,\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeUnknownUnboxed,\n\tflexTreeMarker,\n\tindexForAt,\n\ttype FlexTreeHydratedContext,\n\ttype FlexFieldKind,\n\tFieldKinds,\n\ttype SequenceFieldEditBuilder,\n\tcursorForMapTreeNode,\n} from \"../../feature-libraries/index.js\";\nimport type { Context } from \"./context.js\";\n\ninterface UnhydratedTreeSequenceFieldEditBuilder\n\textends SequenceFieldEditBuilder<ExclusiveMapTree[]> {\n\t/**\n\t * Issues a change which removes `count` elements starting at the given `index`.\n\t * @param index - The index of the first removed element.\n\t * @param count - The number of elements to remove.\n\t * @returns the MapTrees that were removed\n\t */\n\tremove(index: number, count: number): ExclusiveMapTree[];\n}\n\ntype UnhydratedFlexTreeNodeEvents = Pick<AnchorEvents, \"childrenChangedAfterBatch\">;\n\n/** A node's parent field and its index in that field */\ninterface LocationInField {\n\treadonly parent: FlexTreeField;\n\treadonly index: number;\n}\n\n/**\n * An unhydrated implementation of {@link FlexTreeNode} which wraps a {@link MapTree}.\n * @remarks\n * MapTreeNodes are unconditionally cached -\n * when retrieved via {@link getOrCreateNode}, the same {@link MapTree} object will always produce the same `UnhydratedFlexTreeNode` object.\n *\n * Create a `UnhydratedFlexTreeNode` by calling {@link getOrCreate}.\n */\nexport class UnhydratedFlexTreeNode implements UnhydratedFlexTreeNode {\n\tpublic get schema(): TreeNodeSchemaIdentifier {\n\t\treturn this.mapTree.type;\n\t}\n\n\tpublic get storedSchema(): TreeNodeStoredSchema {\n\t\treturn (\n\t\t\tthis.context.schema.nodeSchema.get(this.mapTree.type) ?? fail(0xb46 /* missing schema */)\n\t\t);\n\t}\n\n\tpublic readonly [flexTreeMarker] = FlexTreeEntityKind.Node as const;\n\n\tprivate readonly _events = createEmitter<UnhydratedFlexTreeNodeEvents>();\n\tpublic get events(): Listenable<UnhydratedFlexTreeNodeEvents> {\n\t\treturn this._events;\n\t}\n\n\t/**\n\t * Create a {@link UnhydratedFlexTreeNode} that wraps the given {@link MapTree}, or get the node that already exists for that {@link MapTree} if there is one.\n\t * @param nodeSchema - the {@link FlexTreeNodeSchema | schema} that the node conforms to\n\t * @param mapTree - the {@link MapTree} containing the data for this node.\n\t * @remarks It must conform to the `nodeSchema`.\n\t */\n\tpublic static getOrCreate(\n\t\tcontext: Context,\n\t\tmapTree: ExclusiveMapTree,\n\t): UnhydratedFlexTreeNode {\n\t\treturn nodeCache.get(mapTree) ?? new UnhydratedFlexTreeNode(context, mapTree, undefined);\n\t}\n\n\tpublic get context(): FlexTreeContext {\n\t\treturn this.simpleContext.flexContext;\n\t}\n\n\t/**\n\t * Create a new UnhydratedFlexTreeNode.\n\t * @param location - the parentage of this node, if it is being created underneath an existing node and field, or undefined if not\n\t * @remarks This class (and its subclasses) should not be directly constructed outside of this module.\n\t * Instead, use {@link getOrCreateNode} to create a UnhydratedFlexTreeNode from a {@link MapTree}.\n\t * A `UnhydratedFlexTreeNode` may never be constructed more than once for the same {@link MapTree} object.\n\t * Instead, it should always be acquired via {@link getOrCreateNode}.\n\t */\n\tpublic constructor(\n\t\tpublic readonly simpleContext: Context,\n\t\t/** The underlying {@link MapTree} that this `UnhydratedFlexTreeNode` reads its data from */\n\t\tpublic readonly mapTree: ExclusiveMapTree,\n\t\tprivate location = unparentedLocation,\n\t) {\n\t\tassert(!nodeCache.has(mapTree), 0x98b /* A node already exists for the given MapTree */);\n\t\tnodeCache.set(mapTree, this);\n\n\t\t// Fully demand the tree to ensure that parent pointers are present and accurate on all nodes.\n\t\t// When a UnhydratedFlexTreeNode is constructed, its MapTree may contain nodes (anywhere below) that map (via the `nodeCache`) to pre-existing UnhydratedFlexTreeNodes.\n\t\t// Put another way, for a given MapTree, some ancestor UnhydratedFlexTreeNode can be created after any number of its descendant UnhydratedFlexTreeNodes already exist.\n\t\t// In such a case, the spine of nodes between the descendant and ancestor need to exist in order for the ancestor to be able to walk upwards via the `parentField` property.\n\t\t// This needs to happen for all UnhydratedFlexTreeNodes that are descendants of the ancestor UnhydratedFlexTreeNode.\n\t\t// Demanding the entire tree is overkill to solve this problem since not all descendant MapTree nodes will have corresponding UnhydratedFlexTreeNodes.\n\t\t// However, demanding the full tree also lets us eagerly validate that there are no duplicate MapTrees (i.e. same MapTree object) anywhere in the tree.\n\t\tthis.walkTree();\n\t}\n\n\tpublic get type(): TreeNodeSchemaIdentifier {\n\t\treturn this.mapTree.type;\n\t}\n\n\t/**\n\t * Set this node's parentage (see {@link FlexTreeNode.parentField}).\n\t * @remarks The node may be given a parent if it has none, or may have its parent removed (by passing `undefined`).\n\t * However, a node with a parent may not be directly re-assigned a different parent.\n\t * That likely indicates either an attempted multi-parenting or an attempt to \"move\" the node, neither of which are supported.\n\t * Removing a node's parent twice in a row is also not supported, as it likely indicates a bug.\n\t */\n\tpublic adoptBy(parent: undefined): void;\n\tpublic adoptBy(parent: UnhydratedFlexTreeField, index: number): void;\n\tpublic adoptBy(parent: UnhydratedFlexTreeField | undefined, index?: number): void {\n\t\tif (parent !== undefined) {\n\t\t\tassert(\n\t\t\t\tthis.location === unparentedLocation,\n\t\t\t\t0x98c /* Node may not be adopted if it already has a parent */,\n\t\t\t);\n\t\t\tassert(index !== undefined, 0xa08 /* Expected index */);\n\t\t\tthis.location = { parent, index };\n\t\t} else {\n\t\t\tassert(\n\t\t\t\tthis.location !== unparentedLocation,\n\t\t\t\t0xa09 /* Node may not be un-adopted if it does not have a parent */,\n\t\t\t);\n\t\t\tthis.location = unparentedLocation;\n\t\t}\n\t}\n\n\t/**\n\t * The field this tree is in, and the index within that field.\n\t * @remarks If this node is unparented, this method will return the special {@link unparentedLocation} as the parent.\n\t */\n\tpublic get parentField(): LocationInField {\n\t\treturn this.location;\n\t}\n\n\tpublic borrowCursor(): ITreeCursorSynchronous {\n\t\treturn cursorForMapTreeNode(this.mapTree);\n\t}\n\n\tpublic tryGetField(key: FieldKey): UnhydratedFlexTreeField | undefined {\n\t\tconst field = this.mapTree.fields.get(key);\n\t\t// Only return the field if it is not empty, in order to fulfill the contract of `tryGetField`.\n\t\tif (field !== undefined && field.length > 0) {\n\t\t\treturn getOrCreateField(this, key, this.storedSchema.getFieldSchema(key).kind, () =>\n\t\t\t\tthis.emitChangedEvent(key),\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic getBoxed(key: string): FlexTreeField {\n\t\tconst fieldKey: FieldKey = brand(key);\n\t\treturn getOrCreateField(\n\t\t\tthis,\n\t\t\tfieldKey,\n\t\t\tthis.storedSchema.getFieldSchema(fieldKey).kind,\n\t\t\t() => this.emitChangedEvent(fieldKey),\n\t\t);\n\t}\n\n\tpublic boxedIterator(): IterableIterator<FlexTreeField> {\n\t\treturn mapIterable(this.mapTree.fields.entries(), ([key]) =>\n\t\t\tgetOrCreateField(this, key, this.storedSchema.getFieldSchema(key).kind, () =>\n\t\t\t\tthis.emitChangedEvent(key),\n\t\t\t),\n\t\t);\n\t}\n\n\tpublic keys(): IterableIterator<FieldKey> {\n\t\t// TODO: how this should handle missing defaults (and empty keys if they end up being allowed) needs to be determined.\n\t\treturn this.mapTree.fields.keys();\n\t}\n\n\tpublic get value(): Value {\n\t\treturn this.mapTree.value;\n\t}\n\n\tpublic get anchorNode(): AnchorNode {\n\t\t// This API is relevant to `LazyTreeNode`s, but not `UnhydratedFlexTreeNode`s.\n\t\t// TODO: Refactor the FlexTreeNode interface so that stubbing this out isn't necessary.\n\t\treturn fail(0xb47 /* UnhydratedFlexTreeNode does not implement anchorNode */);\n\t}\n\n\tprivate walkTree(): void {\n\t\tfor (const [key, mapTrees] of this.mapTree.fields) {\n\t\t\tconst field = getOrCreateField(\n\t\t\t\tthis,\n\t\t\t\tkey,\n\t\t\t\tthis.storedSchema.getFieldSchema(key).kind,\n\t\t\t\t() => this.emitChangedEvent(key),\n\t\t\t);\n\t\t\tfor (let index = 0; index < field.length; index++) {\n\t\t\t\tconst child = getOrCreateChild(this.simpleContext, mapTrees[index] ?? oob(), {\n\t\t\t\t\tparent: field,\n\t\t\t\t\tindex,\n\t\t\t\t});\n\t\t\t\t// These next asserts detect the case where `getOrCreateChild` gets a cache hit of a different node than the one we're trying to create\n\t\t\t\tassert(child.location !== undefined, 0x98d /* Expected node to have parent */);\n\t\t\t\tassert(\n\t\t\t\t\tchild.location.parent.parent === this,\n\t\t\t\t\t0x98e /* Node may not be multi-parented */,\n\t\t\t\t);\n\t\t\t\tassert(child.location.index === index, 0x98f /* Node may not be multi-parented */);\n\t\t\t\tchild.walkTree();\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate emitChangedEvent(key: FieldKey): void {\n\t\tthis._events.emit(\"childrenChangedAfterBatch\", { changedFields: new Set([key]) });\n\t}\n}\n\n/**\n * Implementation of `FlexTreeContext`.\n *\n * @remarks An editor is required to edit the FlexTree.\n */\nexport class UnhydratedContext implements FlexTreeContext {\n\t/**\n\t * @param flexSchema - Schema to use when working with the tree.\n\t */\n\tpublic constructor(\n\t\tpublic readonly schemaPolicy: SchemaPolicy,\n\t\tpublic readonly schema: TreeStoredSchema,\n\t) {}\n\n\tpublic isHydrated(): this is FlexTreeHydratedContext {\n\t\treturn false;\n\t}\n}\n\n// #region Fields\n\n/**\n * A special singleton that is the implicit {@link LocationInField} of all un-parented {@link UnhydratedFlexTreeNode}s.\n * @remarks This exists because {@link UnhydratedFlexTreeNode.parentField} must return a field.\n * If a {@link UnhydratedFlexTreeNode} is created without a parent, its {@link UnhydratedFlexTreeNode.parentField} property will point to this object.\n * However, this field cannot be used in any practical way because it is empty, i.e. it does not actually contain the children that claim to be parented under it.\n * It has the \"empty\" schema and it will always contain zero children if queried.\n * Any nodes with this location will have a dummy parent index of `-1`.\n */\nconst unparentedLocation: LocationInField = {\n\tparent: {\n\t\t[flexTreeMarker]: FlexTreeEntityKind.Field as const,\n\t\tlength: 0,\n\t\tkey: EmptyKey,\n\t\tparent: undefined,\n\t\tis<TKind2 extends FlexFieldKind>(kind: TKind2) {\n\t\t\treturn this.schema === kind.identifier;\n\t\t},\n\t\tboxedIterator(): IterableIterator<FlexTreeNode> {\n\t\t\treturn [].values();\n\t\t},\n\t\tboxedAt(index: number): FlexTreeNode | undefined {\n\t\t\treturn undefined;\n\t\t},\n\t\tschema: brand(forbiddenFieldKindIdentifier),\n\t\tget context(): never {\n\t\t\treturn fail(0xb48 /* unsupported */);\n\t\t},\n\t\tgetFieldPath() {\n\t\t\tfail(0xb49 /* unsupported */);\n\t\t},\n\t},\n\tindex: -1,\n};\n\nclass UnhydratedFlexTreeField implements FlexTreeField {\n\tpublic [flexTreeMarker] = FlexTreeEntityKind.Field as const;\n\n\tpublic get context(): FlexTreeContext {\n\t\treturn this.simpleContext.flexContext;\n\t}\n\n\tpublic constructor(\n\t\tpublic readonly simpleContext: Context,\n\t\tpublic readonly schema: FieldKindIdentifier,\n\t\tpublic readonly key: FieldKey,\n\t\tpublic readonly parent: UnhydratedFlexTreeNode,\n\t\tpublic readonly onEdit?: () => void,\n\t) {\n\t\tconst fieldKeyCache = getFieldKeyCache(parent);\n\t\tassert(!fieldKeyCache.has(key), 0x990 /* A field already exists for the given MapTrees */);\n\t\tfieldKeyCache.set(key, this);\n\n\t\t// When this field is created (which only happens one time, because it is cached), all the children become parented for the first time.\n\t\t// \"Adopt\" each child by updating its parent information to point to this field.\n\t\tfor (const [i, mapTree] of this.mapTrees.entries()) {\n\t\t\tconst mapTreeNodeChild = nodeCache.get(mapTree);\n\t\t\tif (mapTreeNodeChild !== undefined) {\n\t\t\t\tif (mapTreeNodeChild.parentField !== unparentedLocation) {\n\t\t\t\t\tthrow new UsageError(\"A node may not be in more than one place in the tree\");\n\t\t\t\t}\n\t\t\t\tmapTreeNodeChild.adoptBy(this, i);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic get mapTrees(): readonly ExclusiveMapTree[] {\n\t\treturn this.parent.mapTree.fields.get(this.key) ?? [];\n\t}\n\n\tpublic get length(): number {\n\t\treturn this.mapTrees.length;\n\t}\n\n\tpublic is<TKind2 extends FlexFieldKind>(kind: TKind2): this is FlexTreeTypedField<TKind2> {\n\t\treturn this.schema === kind.identifier;\n\t}\n\n\tpublic boxedIterator(): IterableIterator<FlexTreeNode> {\n\t\treturn this.mapTrees\n\t\t\t.map(\n\t\t\t\t(m, index) =>\n\t\t\t\t\tgetOrCreateChild(this.simpleContext, m, {\n\t\t\t\t\t\tparent: this,\n\t\t\t\t\t\tindex,\n\t\t\t\t\t}) as FlexTreeNode,\n\t\t\t)\n\t\t\t.values();\n\t}\n\n\tpublic boxedAt(index: number): FlexTreeNode | undefined {\n\t\tconst i = indexForAt(index, this.length);\n\t\tif (i === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst m = this.mapTrees[i];\n\t\tif (m !== undefined) {\n\t\t\treturn getOrCreateChild(this.simpleContext, m, {\n\t\t\t\tparent: this,\n\t\t\t\tindex: i,\n\t\t\t}) as FlexTreeNode;\n\t\t}\n\t}\n\n\t/**\n\t * Mutate this field.\n\t * @param edit - A function which receives the current `MapTree`s that comprise the contents of the field so that it may be mutated.\n\t * The function may mutate the array in place or return a new array.\n\t * If a new array is returned then it will be used as the new contents of the field, otherwise the original array will be continue to be used.\n\t * @remarks All edits to the field (i.e. mutations of the field's MapTrees) should be directed through this function.\n\t * This function ensures that the parent MapTree has no empty fields (which is an invariant of `MapTree`) after the mutation.\n\t */\n\tprotected edit(edit: (mapTrees: ExclusiveMapTree[]) => void | ExclusiveMapTree[]): void {\n\t\tconst oldMapTrees = this.parent.mapTree.fields.get(this.key) ?? [];\n\t\tconst newMapTrees = edit(oldMapTrees) ?? oldMapTrees;\n\t\tif (newMapTrees.length > 0) {\n\t\t\tthis.parent.mapTree.fields.set(this.key, newMapTrees);\n\t\t} else {\n\t\t\tthis.parent.mapTree.fields.delete(this.key);\n\t\t}\n\n\t\tthis.onEdit?.();\n\t}\n\n\tpublic getFieldPath(): NormalizedFieldUpPath {\n\t\tthrow unsupportedUsageError(\"Editing an array\");\n\t}\n\n\t/** Unboxes leaf nodes to their values */\n\tprotected unboxed(index: number): FlexTreeUnknownUnboxed {\n\t\tconst mapTree: ExclusiveMapTree = this.mapTrees[index] ?? oob();\n\t\tconst value = mapTree.value;\n\t\tif (value !== undefined) {\n\t\t\treturn value;\n\t\t}\n\n\t\treturn getOrCreateChild(this.simpleContext, mapTree, { parent: this, index });\n\t}\n}\n\nclass EagerMapTreeOptionalField\n\textends UnhydratedFlexTreeField\n\timplements FlexTreeOptionalField\n{\n\tpublic readonly editor = {\n\t\tset: (newContent: ExclusiveMapTree | undefined): void => {\n\t\t\t// If the new content is a UnhydratedFlexTreeNode, it needs to have its parent pointer updated\n\t\t\tif (newContent !== undefined) {\n\t\t\t\tnodeCache.get(newContent)?.adoptBy(this, 0);\n\t\t\t}\n\t\t\t// If the old content is a UnhydratedFlexTreeNode, it needs to have its parent pointer unset\n\t\t\tconst oldContent = this.mapTrees[0];\n\t\t\tif (oldContent !== undefined) {\n\t\t\t\tnodeCache.get(oldContent)?.adoptBy(undefined);\n\t\t\t}\n\n\t\t\tthis.edit((mapTrees) => {\n\t\t\t\tif (newContent !== undefined) {\n\t\t\t\t\tmapTrees[0] = newContent;\n\t\t\t\t} else {\n\t\t\t\t\tmapTrees.length = 0;\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t};\n\n\tpublic get content(): FlexTreeUnknownUnboxed | undefined {\n\t\tconst value = this.mapTrees[0];\n\t\tif (value !== undefined) {\n\t\t\treturn this.unboxed(0);\n\t\t}\n\n\t\treturn undefined;\n\t}\n}\n\nclass EagerMapTreeRequiredField\n\textends EagerMapTreeOptionalField\n\timplements FlexTreeRequiredField\n{\n\tpublic override get content(): FlexTreeUnknownUnboxed {\n\t\t// This cannot use ?? since null is a legal value here.\n\t\tassert(\n\t\t\tsuper.content !== undefined,\n\t\t\t0xa57 /* Expected EagerMapTree required field to have a value */,\n\t\t);\n\t\treturn super.content;\n\t}\n}\n\nexport class UnhydratedTreeSequenceField\n\textends UnhydratedFlexTreeField\n\timplements FlexTreeSequenceField\n{\n\tpublic readonly editor: UnhydratedTreeSequenceFieldEditBuilder = {\n\t\tinsert: (index, newContent): void => {\n\t\t\tfor (let i = 0; i < newContent.length; i++) {\n\t\t\t\tconst c = newContent[i];\n\t\t\t\tassert(c !== undefined, 0xa0a /* Unexpected sparse array content */);\n\t\t\t\tnodeCache.get(c)?.adoptBy(this, index + i);\n\t\t\t}\n\t\t\tthis.edit((mapTrees) => {\n\t\t\t\tif (newContent.length < 1000) {\n\t\t\t\t\t// For \"smallish arrays\" (`1000` is not empirically derived), the `splice` function is appropriate...\n\t\t\t\t\tmapTrees.splice(index, 0, ...newContent);\n\t\t\t\t} else {\n\t\t\t\t\t// ...but we avoid using `splice` + spread for very large input arrays since there is a limit on how many elements can be spread (too many will overflow the stack).\n\t\t\t\t\treturn mapTrees.slice(0, index).concat(newContent, mapTrees.slice(index));\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t\tremove: (index, count): ExclusiveMapTree[] => {\n\t\t\tfor (let i = index; i < index + count; i++) {\n\t\t\t\tconst c = this.mapTrees[i];\n\t\t\t\tassert(c !== undefined, 0xa0b /* Unexpected sparse array */);\n\t\t\t\tnodeCache.get(c)?.adoptBy(undefined);\n\t\t\t}\n\t\t\tlet removed: ExclusiveMapTree[] | undefined;\n\t\t\tthis.edit((mapTrees) => {\n\t\t\t\tremoved = mapTrees.splice(index, count);\n\t\t\t});\n\t\t\treturn removed ?? fail(0xb4a /* Expected removed to be set by edit */);\n\t\t},\n\t};\n\n\tpublic at(index: number): FlexTreeUnknownUnboxed | undefined {\n\t\tconst i = indexForAt(index, this.length);\n\t\tif (i === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn this.unboxed(i);\n\t}\n\tpublic map<U>(callbackfn: (value: FlexTreeUnknownUnboxed, index: number) => U): U[] {\n\t\treturn Array.from(this, callbackfn);\n\t}\n\n\tpublic *[Symbol.iterator](): IterableIterator<FlexTreeUnknownUnboxed> {\n\t\tfor (const [i] of this.mapTrees.entries()) {\n\t\t\tyield this.unboxed(i);\n\t\t}\n\t}\n}\n\n// #endregion Fields\n\n// #region Caching and unboxing utilities\n\nconst nodeCache = new WeakMap<MapTree, UnhydratedFlexTreeNode>();\n/** Node Parent -\\> Field Key -\\> Field */\nconst fieldCache = new WeakMap<\n\tUnhydratedFlexTreeNode,\n\tMap<FieldKey, UnhydratedFlexTreeField>\n>();\nfunction getFieldKeyCache(\n\tparent: UnhydratedFlexTreeNode,\n): WeakMap<FieldKey, UnhydratedFlexTreeField> {\n\treturn getOrCreate(fieldCache, parent, () => new Map());\n}\n\n/**\n * If there exists a {@link UnhydratedFlexTreeNode} for the given {@link MapTree}, returns it, otherwise returns `undefined`.\n * @remarks {@link UnhydratedFlexTreeNode | UnhydratedFlexTreeNodes} are created via {@link getOrCreateNode}.\n */\nexport function tryUnhydratedFlexTreeNode(\n\tmapTree: MapTree,\n): UnhydratedFlexTreeNode | undefined {\n\treturn nodeCache.get(mapTree);\n}\n\n/** Helper for creating a `UnhydratedFlexTreeNode` given the parent field (e.g. when \"walking down\") */\nfunction getOrCreateChild(\n\tcontext: Context,\n\tmapTree: ExclusiveMapTree,\n\tparent: LocationInField | undefined,\n): UnhydratedFlexTreeNode {\n\tconst cached = nodeCache.get(mapTree);\n\tif (cached !== undefined) {\n\t\treturn cached;\n\t}\n\n\treturn new UnhydratedFlexTreeNode(context, mapTree, parent);\n}\n\n/** Creates a field with the given attributes, or returns a cached field if there is one */\nfunction getOrCreateField(\n\tparent: UnhydratedFlexTreeNode,\n\tkey: FieldKey,\n\tschema: FieldKindIdentifier,\n\tonEdit?: () => void,\n): UnhydratedFlexTreeField {\n\tconst cached = getFieldKeyCache(parent).get(key);\n\tif (cached !== undefined) {\n\t\treturn cached;\n\t}\n\n\tif (\n\t\tschema === FieldKinds.required.identifier ||\n\t\tschema === FieldKinds.identifier.identifier\n\t) {\n\t\treturn new EagerMapTreeRequiredField(parent.simpleContext, schema, key, parent, onEdit);\n\t}\n\n\tif (schema === FieldKinds.optional.identifier) {\n\t\treturn new EagerMapTreeOptionalField(parent.simpleContext, schema, key, parent, onEdit);\n\t}\n\n\tif (schema === FieldKinds.sequence.identifier) {\n\t\treturn new UnhydratedTreeSequenceField(parent.simpleContext, schema, key, parent, onEdit);\n\t}\n\n\treturn new UnhydratedFlexTreeField(parent.simpleContext, schema, key, parent, onEdit);\n}\n\n// #endregion Caching and unboxing utilities\n\nexport function unsupportedUsageError(message?: string): Error {\n\treturn new UsageError(\n\t\t`${\n\t\t\tmessage ?? \"Operation\"\n\t\t} is not supported for content that has not yet been inserted into the tree`,\n\t);\n}\n"]}
|
|
@@ -19,18 +19,17 @@ export declare function markEager<T>(t: T): T;
|
|
|
19
19
|
* By default, items that are of type `"function"` will be considered lazy and all other items will be considered eager.
|
|
20
20
|
* To force a `"function"` item to be treated as an eager item, call `markEager` before putting it in the list.
|
|
21
21
|
* This is necessary e.g. when the eager list items are function types and the lazy items are functions that _return_ function types.
|
|
22
|
-
*
|
|
22
|
+
* Our one use of FlexList has some special normalization logic, see {@link normalizeAllowedTypes}.
|
|
23
23
|
* @system @public
|
|
24
24
|
*/
|
|
25
25
|
export type FlexList<Item = unknown> = readonly LazyItem<Item>[];
|
|
26
|
-
/**
|
|
27
|
-
* Given a `FlexList` of eager and lazy items, return an equivalent list where all items are eager.
|
|
28
|
-
*/
|
|
29
|
-
export declare function normalizeFlexListEager<T>(t: FlexList<T>): T[];
|
|
30
26
|
/**
|
|
31
27
|
* An "eager" or "lazy" Item in a `FlexList`.
|
|
32
28
|
* Lazy items are wrapped in a function to allow referring to themselves before they are declared.
|
|
33
29
|
* This makes recursive and co-recursive items possible.
|
|
30
|
+
* @privateRemarks
|
|
31
|
+
* `schemaTypes.ts`'s `evaluateLazySchema` (via {@link normalizeAllowedTypes})
|
|
32
|
+
* applies caching for the only current use of this type.
|
|
34
33
|
* @public
|
|
35
34
|
*/
|
|
36
35
|
export type LazyItem<Item = unknown> = Item | (() => Item);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flexList.d.ts","sourceRoot":"","sources":["../../src/simple-tree/flexList.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH,gFAAgF;AAChF,wBAAgB,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,MAAM,IAAI,CAErE;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CASpC;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,QAAQ,CAAC,IAAI,GAAG,OAAO,IAAI,SAAS,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;AAEjE
|
|
1
|
+
{"version":3,"file":"flexList.d.ts","sourceRoot":"","sources":["../../src/simple-tree/flexList.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH,gFAAgF;AAChF,wBAAgB,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,MAAM,IAAI,CAErE;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CASpC;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,QAAQ,CAAC,IAAI,GAAG,OAAO,IAAI,SAAS,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;AAEjE;;;;;;;;GAQG;AACH,MAAM,MAAM,QAAQ,CAAC,IAAI,GAAG,OAAO,IAAI,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC;AAE3D;;;GAGG;AACH,MAAM,MAAM,eAAe,CAAC,IAAI,SAAS,QAAQ,IAAI,IAAI,SAAS,MAAM,MAAM,MAAM,GACjF,MAAM,GACN,IAAI,CAAC;AAER;;;GAGG;AACH,MAAM,MAAM,eAAe,CAAC,KAAK,SAAS,QAAQ,IAAI,eAAe,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.
|
|
7
|
+
exports.markEager = exports.isLazy = void 0;
|
|
8
8
|
/** A symbol used to identify a `MarkedEager`. */
|
|
9
9
|
const flexListEager = Symbol("FlexList Eager");
|
|
10
10
|
/** Returns true iff the given item is a function and is not a `MarkedEager`. */
|
|
@@ -30,17 +30,4 @@ function markEager(t) {
|
|
|
30
30
|
: t;
|
|
31
31
|
}
|
|
32
32
|
exports.markEager = markEager;
|
|
33
|
-
/**
|
|
34
|
-
* Given a `FlexList` of eager and lazy items, return an equivalent list where all items are eager.
|
|
35
|
-
*/
|
|
36
|
-
function normalizeFlexListEager(t) {
|
|
37
|
-
const data = t.map((value) => {
|
|
38
|
-
if (isLazy(value)) {
|
|
39
|
-
return value();
|
|
40
|
-
}
|
|
41
|
-
return value;
|
|
42
|
-
});
|
|
43
|
-
return data;
|
|
44
|
-
}
|
|
45
|
-
exports.normalizeFlexListEager = normalizeFlexListEager;
|
|
46
33
|
//# sourceMappingURL=flexList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flexList.js","sourceRoot":"","sources":["../../src/simple-tree/flexList.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iDAAiD;AACjD,MAAM,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAU/C,gFAAgF;AAChF,SAAgB,MAAM,CAAO,IAAoB;IAChD,OAAO,OAAO,IAAI,KAAK,UAAU,IAAK,IAA6B,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;AAC7F,CAAC;AAFD,wBAEC;AAED;;;;;;GAMG;AACH,SAAgB,SAAS,CAAI,CAAI;IAChC,OAAO,MAAM,CAAC,CAAC,CAAC;QACf,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,aAAa,EAAE;YACxC,KAAK,EAAE,IAAI;YACX,YAAY,EAAE,IAAI;YAClB,UAAU,EAAE,KAAK;YACjB,QAAQ,EAAE,KAAK;SACf,CAAC;QACH,CAAC,CAAC,CAAC,CAAC;AACN,CAAC;AATD,8BASC
|
|
1
|
+
{"version":3,"file":"flexList.js","sourceRoot":"","sources":["../../src/simple-tree/flexList.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iDAAiD;AACjD,MAAM,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAU/C,gFAAgF;AAChF,SAAgB,MAAM,CAAO,IAAoB;IAChD,OAAO,OAAO,IAAI,KAAK,UAAU,IAAK,IAA6B,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;AAC7F,CAAC;AAFD,wBAEC;AAED;;;;;;GAMG;AACH,SAAgB,SAAS,CAAI,CAAI;IAChC,OAAO,MAAM,CAAC,CAAC,CAAC;QACf,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,aAAa,EAAE;YACxC,KAAK,EAAE,IAAI;YACX,YAAY,EAAE,IAAI;YAClB,UAAU,EAAE,KAAK;YACjB,QAAQ,EAAE,KAAK;SACf,CAAC;QACH,CAAC,CAAC,CAAC,CAAC;AACN,CAAC;AATD,8BASC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/** A symbol used to identify a `MarkedEager`. */\nconst flexListEager = Symbol(\"FlexList Eager\");\n\n/**\n * An object that has been marked as eager (as opposed to lazy) when used as an item in a `FlexList`.\n * It will be considered to be an eager item in a `FlexList` even if it is a function.\n */\ninterface MarkedEager {\n\t[flexListEager]: true;\n}\n\n/** Returns true iff the given item is a function and is not a `MarkedEager`. */\nexport function isLazy<Item>(item: LazyItem<Item>): item is () => Item {\n\treturn typeof item === \"function\" && (item as Partial<MarkedEager>)[flexListEager] !== true;\n}\n\n/**\n * Mark the given object as an eager item in a `FlexList`.\n * @remarks\n * This only has an effect on function objects that would otherwise be considered to be lazy items in a `FlexList`.\n * @param t - The object to mark as eager.\n * @returns `t`, marked as eager if applicable.\n */\nexport function markEager<T>(t: T): T {\n\treturn isLazy(t)\n\t\t? Object.defineProperty(t, flexListEager, {\n\t\t\t\tvalue: true,\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: false,\n\t\t\t\twritable: false,\n\t\t\t})\n\t\t: t;\n}\n\n/**\n * A flexible way to list values.\n * Each item in the list can either be an \"eager\" **value** or a \"lazy\" **function that returns a value** (the latter allows cyclic references to work).\n * @privateRemarks\n * By default, items that are of type `\"function\"` will be considered lazy and all other items will be considered eager.\n * To force a `\"function\"` item to be treated as an eager item, call `markEager` before putting it in the list.\n * This is necessary e.g. when the eager list items are function types and the lazy items are functions that _return_ function types.\n * Our one use of FlexList has some special normalization logic, see {@link normalizeAllowedTypes}.\n * @system @public\n */\nexport type FlexList<Item = unknown> = readonly LazyItem<Item>[];\n\n/**\n * An \"eager\" or \"lazy\" Item in a `FlexList`.\n * Lazy items are wrapped in a function to allow referring to themselves before they are declared.\n * This makes recursive and co-recursive items possible.\n * @privateRemarks\n * `schemaTypes.ts`'s `evaluateLazySchema` (via {@link normalizeAllowedTypes})\n * applies caching for the only current use of this type.\n * @public\n */\nexport type LazyItem<Item = unknown> = Item | (() => Item);\n\n/**\n * Get the `Item` type from a `LazyItem<Item>`.\n * @system @public\n */\nexport type ExtractItemType<Item extends LazyItem> = Item extends () => infer Result\n\t? Result\n\t: Item;\n\n/**\n * Normalize FlexList type to a union.\n * @system @public\n */\nexport type FlexListToUnion<TList extends FlexList> = ExtractItemType<TList[number]>;\n"]}
|
|
@@ -3,14 +3,21 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
export { typeNameSymbol, typeSchemaSymbol, type WithType, type TreeNodeSchema, NodeKind, type TreeNodeSchemaClass, type TreeNodeSchemaNonClass, type TreeNodeSchemaCore, type TreeChangeEvents, type TreeNode, type Unhydrated, type InternalTreeNode, isTreeNode, tryDisposeTreeNode, HydratedContext, SimpleContextSlot, getOrCreateInnerNode, getKernel, } from "./core/index.js";
|
|
6
|
-
export { type ITree, type TreeView, type ViewableTree, type TreeViewEvents, TreeViewConfiguration, type ITreeViewConfiguration, type SchemaCompatibilityStatus, type ITreeConfigurationOptions, SchemaFactory, SchemaFactoryAlpha, type SchemaFactoryObjectOptions, type ScopedSchemaName, type ValidateRecursiveSchema, type FixRecursiveArraySchema, adaptEnum, enumFromStrings, singletonSchema, test_RecursiveObject, test_RecursiveObject_base, test_RecursiveObjectPojoMode, treeNodeApi, type TreeNodeApi, cursorFromInsertable, createFromInsertable, type NodeChangedData, TreeBeta, type TreeChangeEventsBeta, type SimpleTreeIndex, type IdentifierIndex, createSimpleTreeIndex, createIdentifierIndex, type
|
|
7
|
-
export
|
|
6
|
+
export { type ITree, type TreeView, type ViewableTree, type TreeViewEvents, TreeViewConfiguration, type ITreeViewConfiguration, type SchemaCompatibilityStatus, type ITreeConfigurationOptions, SchemaFactory, SchemaFactoryAlpha, type SchemaFactoryObjectOptions, type ScopedSchemaName, type ValidateRecursiveSchema, type FixRecursiveArraySchema, adaptEnum, enumFromStrings, singletonSchema, test_RecursiveObject, test_RecursiveObject_base, test_RecursiveObjectPojoMode, treeNodeApi, type TreeNodeApi, cursorFromInsertable, createFromInsertable, type NodeChangedData, TreeBeta, type TreeChangeEventsBeta, type SimpleTreeIndex, type IdentifierIndex, createSimpleTreeIndex, createIdentifierIndex, type JsonSchemaId, type JsonSchemaType, type JsonObjectNodeSchema, type JsonArrayNodeSchema, type JsonMapNodeSchema, type JsonLeafNodeSchema, type JsonSchemaRef, type JsonRefPath, type JsonNodeSchema, type JsonNodeSchemaBase, type JsonTreeSchema, type JsonFieldSchema, type JsonLeafSchemaType, getJsonSchema, getSimpleSchema, type VerboseTreeNode, type EncodeOptions, type ParseOptions, type VerboseTree, extractPersistedSchema, comparePersistedSchema, type ConciseTree, comparePersistedSchemaInternal, ViewSchema, type Unenforced, type FieldHasDefaultUnsafe, type ObjectFromSchemaRecordUnsafe, type TreeObjectNodeUnsafe, type TreeFieldFromImplicitFieldUnsafe, type TreeNodeFromImplicitAllowedTypesUnsafe, type FieldSchemaUnsafe, type InsertableTreeNodeFromImplicitAllowedTypesUnsafe, type TreeArrayNodeUnsafe, type TreeMapNodeUnsafe, type InsertableObjectFromSchemaRecordUnsafe, type InsertableTreeFieldFromImplicitFieldUnsafe, type InsertableTypedNodeUnsafe, type NodeBuilderDataUnsafe, type NodeFromSchemaUnsafe, type ReadonlyMapInlined, type TreeNodeSchemaClassUnsafe, type TreeNodeSchemaUnsafe, type AllowedTypesUnsafe, type ImplicitAllowedTypesUnsafe, type ImplicitFieldSchemaUnsafe, type TreeNodeSchemaNonClassUnsafe, type InsertableTreeNodeFromAllowedTypesUnsafe, type ArrayNodeCustomizableSchemaUnsafe, type MapNodeCustomizableSchemaUnsafe, type TreeViewAlpha, type TreeBranch, type TreeBranchEvents, tryGetSchema, applySchemaToParserOptions, cursorFromVerbose, verboseFromCursor, conciseFromCursor, createFromCursor, asTreeViewAlpha, customFromCursorStored, type CustomTreeNode, type CustomTreeValue, tryStoredSchemaAsArray, type SchemaStatics, type ITreeAlpha, type TransactionConstraint, type NodeInDocumentConstraint, type RunTransactionParams, type VoidTransactionCallbackStatus, type TransactionCallbackStatus, type TransactionResult, type TransactionResultExt, type TransactionResultSuccess, type TransactionResultFailed, rollback, generateSchemaFromSimpleSchema, replaceConciseTreeHandles, replaceHandles, replaceVerboseTreeHandles, type HandleConverter, type FieldSchemaAlphaUnsafe, } from "./api/index.js";
|
|
7
|
+
export type { SimpleTreeSchema, SimpleNodeSchema, SimpleFieldSchema, SimpleLeafNodeSchema, SimpleMapNodeSchema, SimpleArrayNodeSchema, SimpleObjectNodeSchema, SimpleNodeSchemaBase, SimpleObjectFieldSchema, } from "./simpleSchema.js";
|
|
8
|
+
export { type NodeFromSchema, isTreeNodeSchemaClass, type ImplicitFieldSchema, type TreeFieldFromImplicitField, type ImplicitAllowedTypes, type TreeNodeFromImplicitAllowedTypes, type InsertableTreeNodeFromImplicitAllowedTypes, type TreeLeafValue, type AllowedTypes, FieldKind, FieldSchema, type FieldSchemaAlpha, type InsertableTreeFieldFromImplicitField, type InsertableTypedNode, type NodeBuilderData, type DefaultProvider, type FieldProps, normalizeFieldSchema, areFieldSchemaEqual, areImplicitFieldSchemaEqual, type ApplyKind, type FieldSchemaMetadata, type InsertableField, type Insertable, type UnsafeUnknownSchema, normalizeAllowedTypes, type ApplyKindInput, type InsertableTreeNodeFromAllowedTypes, type Input, type ReadableField, type ReadSchema, type NodeSchemaOptions, type NodeSchemaMetadata, evaluateLazySchema, } from "./schemaTypes.js";
|
|
8
9
|
export { getTreeNodeForField, prepareContentForHydration, } from "./proxies.js";
|
|
9
10
|
export { TreeArrayNode, IterableTreeArrayContent, type ReadonlyArrayNode, } from "./arrayNode.js";
|
|
11
|
+
export type { ArrayNodeCustomizableSchema, ArrayNodePojoEmulationSchema, } from "./arrayNodeTypes.js";
|
|
12
|
+
export { ArrayNodeSchema, isArrayNodeSchema } from "./arrayNodeTypes.js";
|
|
13
|
+
export type { MapNodeCustomizableSchema, MapNodePojoEmulationSchema, } from "./mapNodeTypes.js";
|
|
14
|
+
export { MapNodeSchema, isMapNodeSchema } from "./mapNodeTypes.js";
|
|
10
15
|
export { type FieldHasDefault, type InsertableObjectFromSchemaRecord, type ObjectFromSchemaRecord, type TreeObjectNode, setField, createUnknownOptionalFieldPolicy, } from "./objectNode.js";
|
|
16
|
+
export { ObjectNodeSchema } from "./objectNodeTypes.js";
|
|
11
17
|
export type { TreeMapNode, MapNodeInsertableData } from "./mapNode.js";
|
|
12
18
|
export { mapTreeFromNodeData, type InsertableContent, type FactoryContent, type FactoryContentObject, } from "./toMapTree.js";
|
|
13
19
|
export { toStoredSchema, getStoredSchema } from "./toStoredSchema.js";
|
|
14
20
|
export { numberSchema, stringSchema, booleanSchema, handleSchema, nullSchema, } from "./leafNodeSchema.js";
|
|
21
|
+
export type { LeafSchema } from "./leafNodeSchema.js";
|
|
15
22
|
export type { LazyItem, FlexList, FlexListToUnion, ExtractItemType } from "./flexList.js";
|
|
16
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/simple-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,QAAQ,EACR,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EAGrB,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,SAAS,GACT,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACN,KAAK,KAAK,EACV,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,qBAAqB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,aAAa,EACb,kBAAkB,EAClB,KAAK,0BAA0B,EAC/B,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,SAAS,EACT,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,yBAAyB,EACzB,4BAA4B,EAC5B,WAAW,EACX,KAAK,WAAW,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,KAAK,eAAe,EACpB,QAAQ,EACR,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/simple-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,QAAQ,EACR,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EAGrB,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,SAAS,GACT,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACN,KAAK,KAAK,EACV,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,qBAAqB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,aAAa,EACb,kB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EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.
|
|
8
|
-
exports.nullSchema = exports.handleSchema = exports.booleanSchema = exports.stringSchema = exports.numberSchema = exports.getStoredSchema = exports.toStoredSchema = exports.mapTreeFromNodeData = exports.createUnknownOptionalFieldPolicy = exports.setField = exports.IterableTreeArrayContent = void 0;
|
|
7
|
+
exports.areImplicitFieldSchemaEqual = exports.areFieldSchemaEqual = exports.normalizeFieldSchema = exports.FieldSchema = exports.FieldKind = exports.isTreeNodeSchemaClass = exports.replaceVerboseTreeHandles = exports.replaceHandles = exports.replaceConciseTreeHandles = exports.generateSchemaFromSimpleSchema = exports.rollback = exports.tryStoredSchemaAsArray = exports.customFromCursorStored = exports.asTreeViewAlpha = exports.createFromCursor = exports.conciseFromCursor = exports.verboseFromCursor = exports.cursorFromVerbose = exports.applySchemaToParserOptions = exports.tryGetSchema = exports.ViewSchema = exports.comparePersistedSchemaInternal = exports.comparePersistedSchema = exports.extractPersistedSchema = exports.getSimpleSchema = exports.getJsonSchema = exports.createIdentifierIndex = exports.createSimpleTreeIndex = exports.TreeBeta = exports.createFromInsertable = exports.cursorFromInsertable = exports.treeNodeApi = exports.test_RecursiveObjectPojoMode = exports.test_RecursiveObject_base = exports.test_RecursiveObject = exports.singletonSchema = exports.enumFromStrings = exports.adaptEnum = exports.SchemaFactoryAlpha = exports.SchemaFactory = exports.TreeViewConfiguration = exports.getKernel = exports.getOrCreateInnerNode = exports.SimpleContextSlot = exports.HydratedContext = exports.tryDisposeTreeNode = exports.isTreeNode = exports.NodeKind = exports.typeSchemaSymbol = exports.typeNameSymbol = void 0;
|
|
8
|
+
exports.nullSchema = exports.handleSchema = exports.booleanSchema = exports.stringSchema = exports.numberSchema = exports.getStoredSchema = exports.toStoredSchema = exports.mapTreeFromNodeData = exports.ObjectNodeSchema = exports.createUnknownOptionalFieldPolicy = exports.setField = exports.isMapNodeSchema = exports.MapNodeSchema = exports.isArrayNodeSchema = exports.ArrayNodeSchema = exports.IterableTreeArrayContent = exports.TreeArrayNode = exports.prepareContentForHydration = exports.getTreeNodeForField = exports.evaluateLazySchema = exports.normalizeAllowedTypes = void 0;
|
|
9
9
|
var index_js_1 = require("./core/index.js");
|
|
10
10
|
Object.defineProperty(exports, "typeNameSymbol", { enumerable: true, get: function () { return index_js_1.typeNameSymbol; } });
|
|
11
11
|
Object.defineProperty(exports, "typeSchemaSymbol", { enumerable: true, get: function () { return index_js_1.typeSchemaSymbol; } });
|
|
@@ -48,6 +48,10 @@ Object.defineProperty(exports, "asTreeViewAlpha", { enumerable: true, get: funct
|
|
|
48
48
|
Object.defineProperty(exports, "customFromCursorStored", { enumerable: true, get: function () { return index_js_2.customFromCursorStored; } });
|
|
49
49
|
Object.defineProperty(exports, "tryStoredSchemaAsArray", { enumerable: true, get: function () { return index_js_2.tryStoredSchemaAsArray; } });
|
|
50
50
|
Object.defineProperty(exports, "rollback", { enumerable: true, get: function () { return index_js_2.rollback; } });
|
|
51
|
+
Object.defineProperty(exports, "generateSchemaFromSimpleSchema", { enumerable: true, get: function () { return index_js_2.generateSchemaFromSimpleSchema; } });
|
|
52
|
+
Object.defineProperty(exports, "replaceConciseTreeHandles", { enumerable: true, get: function () { return index_js_2.replaceConciseTreeHandles; } });
|
|
53
|
+
Object.defineProperty(exports, "replaceHandles", { enumerable: true, get: function () { return index_js_2.replaceHandles; } });
|
|
54
|
+
Object.defineProperty(exports, "replaceVerboseTreeHandles", { enumerable: true, get: function () { return index_js_2.replaceVerboseTreeHandles; } });
|
|
51
55
|
var schemaTypes_js_1 = require("./schemaTypes.js");
|
|
52
56
|
Object.defineProperty(exports, "isTreeNodeSchemaClass", { enumerable: true, get: function () { return schemaTypes_js_1.isTreeNodeSchemaClass; } });
|
|
53
57
|
Object.defineProperty(exports, "FieldKind", { enumerable: true, get: function () { return schemaTypes_js_1.FieldKind; } });
|
|
@@ -56,15 +60,24 @@ Object.defineProperty(exports, "normalizeFieldSchema", { enumerable: true, get:
|
|
|
56
60
|
Object.defineProperty(exports, "areFieldSchemaEqual", { enumerable: true, get: function () { return schemaTypes_js_1.areFieldSchemaEqual; } });
|
|
57
61
|
Object.defineProperty(exports, "areImplicitFieldSchemaEqual", { enumerable: true, get: function () { return schemaTypes_js_1.areImplicitFieldSchemaEqual; } });
|
|
58
62
|
Object.defineProperty(exports, "normalizeAllowedTypes", { enumerable: true, get: function () { return schemaTypes_js_1.normalizeAllowedTypes; } });
|
|
63
|
+
Object.defineProperty(exports, "evaluateLazySchema", { enumerable: true, get: function () { return schemaTypes_js_1.evaluateLazySchema; } });
|
|
59
64
|
var proxies_js_1 = require("./proxies.js");
|
|
60
65
|
Object.defineProperty(exports, "getTreeNodeForField", { enumerable: true, get: function () { return proxies_js_1.getTreeNodeForField; } });
|
|
61
66
|
Object.defineProperty(exports, "prepareContentForHydration", { enumerable: true, get: function () { return proxies_js_1.prepareContentForHydration; } });
|
|
62
67
|
var arrayNode_js_1 = require("./arrayNode.js");
|
|
63
68
|
Object.defineProperty(exports, "TreeArrayNode", { enumerable: true, get: function () { return arrayNode_js_1.TreeArrayNode; } });
|
|
64
69
|
Object.defineProperty(exports, "IterableTreeArrayContent", { enumerable: true, get: function () { return arrayNode_js_1.IterableTreeArrayContent; } });
|
|
70
|
+
var arrayNodeTypes_js_1 = require("./arrayNodeTypes.js");
|
|
71
|
+
Object.defineProperty(exports, "ArrayNodeSchema", { enumerable: true, get: function () { return arrayNodeTypes_js_1.ArrayNodeSchema; } });
|
|
72
|
+
Object.defineProperty(exports, "isArrayNodeSchema", { enumerable: true, get: function () { return arrayNodeTypes_js_1.isArrayNodeSchema; } });
|
|
73
|
+
var mapNodeTypes_js_1 = require("./mapNodeTypes.js");
|
|
74
|
+
Object.defineProperty(exports, "MapNodeSchema", { enumerable: true, get: function () { return mapNodeTypes_js_1.MapNodeSchema; } });
|
|
75
|
+
Object.defineProperty(exports, "isMapNodeSchema", { enumerable: true, get: function () { return mapNodeTypes_js_1.isMapNodeSchema; } });
|
|
65
76
|
var objectNode_js_1 = require("./objectNode.js");
|
|
66
77
|
Object.defineProperty(exports, "setField", { enumerable: true, get: function () { return objectNode_js_1.setField; } });
|
|
67
78
|
Object.defineProperty(exports, "createUnknownOptionalFieldPolicy", { enumerable: true, get: function () { return objectNode_js_1.createUnknownOptionalFieldPolicy; } });
|
|
79
|
+
var objectNodeTypes_js_1 = require("./objectNodeTypes.js");
|
|
80
|
+
Object.defineProperty(exports, "ObjectNodeSchema", { enumerable: true, get: function () { return objectNodeTypes_js_1.ObjectNodeSchema; } });
|
|
68
81
|
var toMapTree_js_1 = require("./toMapTree.js");
|
|
69
82
|
Object.defineProperty(exports, "mapTreeFromNodeData", { enumerable: true, get: function () { return toMapTree_js_1.mapTreeFromNodeData; } });
|
|
70
83
|
var toStoredSchema_js_1 = require("./toStoredSchema.js");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/simple-tree/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,4CAqByB;AApBxB,0GAAA,cAAc,OAAA;AACd,4GAAA,gBAAgB,OAAA;AAGhB,oGAAA,QAAQ,OAAA;AAUR,sGAAA,UAAU,OAAA;AACV,8GAAA,kBAAkB,OAAA;AAClB,2GAAA,eAAe,OAAA;AACf,6GAAA,iBAAiB,OAAA;AACjB,gHAAA,oBAAoB,OAAA;AACpB,qGAAA,SAAS,OAAA;AAEV,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/simple-tree/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,4CAqByB;AApBxB,0GAAA,cAAc,OAAA;AACd,4GAAA,gBAAgB,OAAA;AAGhB,oGAAA,QAAQ,OAAA;AAUR,sGAAA,UAAU,OAAA;AACV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AmB,OAAA;AACnB,6HAAA,2BAA2B,OAAA;AAM3B,uHAAA,qBAAqB,OAAA;AAQrB,oHAAA,kBAAkB,OAAA;AAEnB,2CAGsB;AAFrB,iHAAA,mBAAmB,OAAA;AACnB,wHAAA,0BAA0B,OAAA;AAE3B,+CAIwB;AAHvB,6GAAA,aAAa,OAAA;AACb,wHAAA,wBAAwB,OAAA;AAOzB,yDAAyE;AAAhE,oHAAA,eAAe,OAAA;AAAE,sHAAA,iBAAiB,OAAA;AAK3C,qDAAmE;AAA1D,gHAAA,aAAa,OAAA;AAAE,kHAAA,eAAe,OAAA;AACvC,iDAOyB;AAFxB,yGAAA,QAAQ,OAAA;AACR,iIAAA,gCAAgC,OAAA;AAEjC,2DAAwD;AAA/C,sHAAA,gBAAgB,OAAA;AAEzB,+CAKwB;AAJvB,mHAAA,mBAAmB,OAAA;AAKpB,yDAAsE;AAA7D,mHAAA,cAAc,OAAA;AAAE,oHAAA,eAAe,OAAA;AACxC,yDAM6B;AAL5B,iHAAA,YAAY,OAAA;AACZ,iHAAA,YAAY,OAAA;AACZ,kHAAA,aAAa,OAAA;AACb,iHAAA,YAAY,OAAA;AACZ,+GAAA,UAAU,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttypeNameSymbol,\n\ttypeSchemaSymbol,\n\ttype WithType,\n\ttype TreeNodeSchema,\n\tNodeKind,\n\ttype TreeNodeSchemaClass,\n\ttype TreeNodeSchemaNonClass,\n\ttype TreeNodeSchemaCore,\n\ttype TreeChangeEvents,\n\t// TreeNode is only type exported, which prevents use of the class object for unsupported use-cases like direct sub-classing and instanceof.\n\t// See docs on TreeNode for more details.\n\ttype TreeNode,\n\ttype Unhydrated,\n\ttype InternalTreeNode,\n\tisTreeNode,\n\ttryDisposeTreeNode,\n\tHydratedContext,\n\tSimpleContextSlot,\n\tgetOrCreateInnerNode,\n\tgetKernel,\n} from \"./core/index.js\";\nexport {\n\ttype ITree,\n\ttype TreeView,\n\ttype ViewableTree,\n\ttype TreeViewEvents,\n\tTreeViewConfiguration,\n\ttype ITreeViewConfiguration,\n\ttype SchemaCompatibilityStatus,\n\ttype ITreeConfigurationOptions,\n\tSchemaFactory,\n\tSchemaFactoryAlpha,\n\ttype SchemaFactoryObjectOptions,\n\ttype ScopedSchemaName,\n\ttype ValidateRecursiveSchema,\n\ttype FixRecursiveArraySchema,\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n\ttest_RecursiveObject,\n\ttest_RecursiveObject_base,\n\ttest_RecursiveObjectPojoMode,\n\ttreeNodeApi,\n\ttype TreeNodeApi,\n\tcursorFromInsertable,\n\tcreateFromInsertable,\n\ttype NodeChangedData,\n\tTreeBeta,\n\ttype TreeChangeEventsBeta,\n\ttype SimpleTreeIndex,\n\ttype IdentifierIndex,\n\tcreateSimpleTreeIndex,\n\tcreateIdentifierIndex,\n\ttype JsonSchemaId,\n\ttype JsonSchemaType,\n\ttype JsonObjectNodeSchema,\n\ttype JsonArrayNodeSchema,\n\ttype JsonMapNodeSchema,\n\ttype JsonLeafNodeSchema,\n\ttype JsonSchemaRef,\n\ttype JsonRefPath,\n\ttype JsonNodeSchema,\n\ttype JsonNodeSchemaBase,\n\ttype JsonTreeSchema,\n\ttype JsonFieldSchema,\n\ttype JsonLeafSchemaType,\n\tgetJsonSchema,\n\tgetSimpleSchema,\n\ttype VerboseTreeNode,\n\ttype EncodeOptions,\n\ttype ParseOptions,\n\ttype VerboseTree,\n\textractPersistedSchema,\n\tcomparePersistedSchema,\n\ttype ConciseTree,\n\tcomparePersistedSchemaInternal,\n\tViewSchema,\n\ttype Unenforced,\n\ttype FieldHasDefaultUnsafe,\n\ttype ObjectFromSchemaRecordUnsafe,\n\ttype TreeObjectNodeUnsafe,\n\ttype TreeFieldFromImplicitFieldUnsafe,\n\ttype TreeNodeFromImplicitAllowedTypesUnsafe,\n\ttype FieldSchemaUnsafe,\n\ttype InsertableTreeNodeFromImplicitAllowedTypesUnsafe,\n\ttype TreeArrayNodeUnsafe,\n\ttype TreeMapNodeUnsafe,\n\ttype InsertableObjectFromSchemaRecordUnsafe,\n\ttype InsertableTreeFieldFromImplicitFieldUnsafe,\n\ttype InsertableTypedNodeUnsafe,\n\ttype NodeBuilderDataUnsafe,\n\ttype NodeFromSchemaUnsafe,\n\ttype ReadonlyMapInlined,\n\ttype TreeNodeSchemaClassUnsafe,\n\ttype TreeNodeSchemaUnsafe,\n\ttype AllowedTypesUnsafe,\n\ttype ImplicitAllowedTypesUnsafe,\n\ttype ImplicitFieldSchemaUnsafe,\n\ttype TreeNodeSchemaNonClassUnsafe,\n\ttype InsertableTreeNodeFromAllowedTypesUnsafe,\n\ttype ArrayNodeCustomizableSchemaUnsafe,\n\ttype MapNodeCustomizableSchemaUnsafe,\n\ttype TreeViewAlpha,\n\ttype TreeBranch,\n\ttype TreeBranchEvents,\n\ttryGetSchema,\n\tapplySchemaToParserOptions,\n\tcursorFromVerbose,\n\tverboseFromCursor,\n\tconciseFromCursor,\n\tcreateFromCursor,\n\tasTreeViewAlpha,\n\tcustomFromCursorStored,\n\ttype CustomTreeNode,\n\ttype CustomTreeValue,\n\ttryStoredSchemaAsArray,\n\ttype SchemaStatics,\n\ttype ITreeAlpha,\n\ttype TransactionConstraint,\n\ttype NodeInDocumentConstraint,\n\ttype RunTransactionParams,\n\ttype VoidTransactionCallbackStatus,\n\ttype TransactionCallbackStatus,\n\ttype TransactionResult,\n\ttype TransactionResultExt,\n\ttype TransactionResultSuccess,\n\ttype TransactionResultFailed,\n\trollback,\n\tgenerateSchemaFromSimpleSchema,\n\treplaceConciseTreeHandles,\n\treplaceHandles,\n\treplaceVerboseTreeHandles,\n\ttype HandleConverter,\n\ttype FieldSchemaAlphaUnsafe,\n} from \"./api/index.js\";\nexport type {\n\tSimpleTreeSchema,\n\tSimpleNodeSchema,\n\tSimpleFieldSchema,\n\tSimpleLeafNodeSchema,\n\tSimpleMapNodeSchema,\n\tSimpleArrayNodeSchema,\n\tSimpleObjectNodeSchema,\n\tSimpleNodeSchemaBase,\n\tSimpleObjectFieldSchema,\n} from \"./simpleSchema.js\";\nexport {\n\ttype NodeFromSchema,\n\tisTreeNodeSchemaClass,\n\ttype ImplicitFieldSchema,\n\ttype TreeFieldFromImplicitField,\n\ttype ImplicitAllowedTypes,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype TreeLeafValue,\n\ttype AllowedTypes,\n\tFieldKind,\n\tFieldSchema,\n\ttype FieldSchemaAlpha,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype InsertableTypedNode,\n\ttype NodeBuilderData,\n\ttype DefaultProvider,\n\ttype FieldProps,\n\tnormalizeFieldSchema,\n\tareFieldSchemaEqual,\n\tareImplicitFieldSchemaEqual,\n\ttype ApplyKind,\n\ttype FieldSchemaMetadata,\n\ttype InsertableField,\n\ttype Insertable,\n\ttype UnsafeUnknownSchema,\n\tnormalizeAllowedTypes,\n\ttype ApplyKindInput,\n\ttype InsertableTreeNodeFromAllowedTypes,\n\ttype Input,\n\ttype ReadableField,\n\ttype ReadSchema,\n\ttype NodeSchemaOptions,\n\ttype NodeSchemaMetadata,\n\tevaluateLazySchema,\n} from \"./schemaTypes.js\";\nexport {\n\tgetTreeNodeForField,\n\tprepareContentForHydration,\n} from \"./proxies.js\";\nexport {\n\tTreeArrayNode,\n\tIterableTreeArrayContent,\n\ttype ReadonlyArrayNode,\n} from \"./arrayNode.js\";\nexport type {\n\tArrayNodeCustomizableSchema,\n\tArrayNodePojoEmulationSchema,\n} from \"./arrayNodeTypes.js\";\nexport { ArrayNodeSchema, isArrayNodeSchema } from \"./arrayNodeTypes.js\";\nexport type {\n\tMapNodeCustomizableSchema,\n\tMapNodePojoEmulationSchema,\n} from \"./mapNodeTypes.js\";\nexport { MapNodeSchema, isMapNodeSchema } from \"./mapNodeTypes.js\";\nexport {\n\ttype FieldHasDefault,\n\ttype InsertableObjectFromSchemaRecord,\n\ttype ObjectFromSchemaRecord,\n\ttype TreeObjectNode,\n\tsetField,\n\tcreateUnknownOptionalFieldPolicy,\n} from \"./objectNode.js\";\nexport { ObjectNodeSchema } from \"./objectNodeTypes.js\";\nexport type { TreeMapNode, MapNodeInsertableData } from \"./mapNode.js\";\nexport {\n\tmapTreeFromNodeData,\n\ttype InsertableContent,\n\ttype FactoryContent,\n\ttype FactoryContentObject,\n} from \"./toMapTree.js\";\nexport { toStoredSchema, getStoredSchema } from \"./toStoredSchema.js\";\nexport {\n\tnumberSchema,\n\tstringSchema,\n\tbooleanSchema,\n\thandleSchema,\n\tnullSchema,\n} from \"./leafNodeSchema.js\";\nexport type { LeafSchema } from \"./leafNodeSchema.js\";\nexport type { LazyItem, FlexList, FlexListToUnion, ExtractItemType } from \"./flexList.js\";\n"]}
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
import { type TreeValue, ValueSchema } from "../core/index.js";
|
|
6
6
|
import { type FlexTreeNode } from "../feature-libraries/index.js";
|
|
7
7
|
import { NodeKind, type TreeNodeSchema, type TreeNodeSchemaNonClass } from "./core/index.js";
|
|
8
|
+
import type { NodeSchemaMetadata, TreeLeafValue } from "./schemaTypes.js";
|
|
9
|
+
import type { SimpleLeafNodeSchema } from "./simpleSchema.js";
|
|
8
10
|
/**
|
|
9
11
|
* Instances of this class are schema for leaf nodes.
|
|
10
12
|
* @remarks
|
|
@@ -22,11 +24,26 @@ export declare class LeafNodeSchema<Name extends string, const T extends ValueSc
|
|
|
22
24
|
readonly childTypes: ReadonlySet<TreeNodeSchema>;
|
|
23
25
|
create(data: TreeValue<T> | FlexTreeNode): TreeValue<T>;
|
|
24
26
|
createFromInsertable(data: TreeValue<T>): TreeValue<T>;
|
|
27
|
+
readonly leafKind: ValueSchema;
|
|
28
|
+
readonly metadata: NodeSchemaMetadata;
|
|
25
29
|
constructor(name: Name, t: T);
|
|
26
30
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
/**
|
|
32
|
+
* A {@link TreeNodeSchema} for a {@link TreeLeafValue}.
|
|
33
|
+
* @remarks
|
|
34
|
+
* This is just a more specific alias for a particular {@link TreeNodeSchemaNonClass}.
|
|
35
|
+
* It only exists to make the API (particularly errors, IntelliSense, and generated .d.ts files) more readable.
|
|
36
|
+
*
|
|
37
|
+
* See {@link SchemaFactory} and its various properties for actual leaf schema objects.
|
|
38
|
+
* @privateRemarks
|
|
39
|
+
* This is an interface so its name will show up in things like type errors instead of the fully expanded TreeNodeSchemaNonClass.
|
|
40
|
+
* @system @sealed @public
|
|
41
|
+
*/
|
|
42
|
+
export interface LeafSchema<Name extends string, T extends TreeLeafValue> extends TreeNodeSchemaNonClass<`com.fluidframework.leaf.${Name}`, NodeKind.Leaf, T, T, true> {
|
|
43
|
+
}
|
|
44
|
+
export declare const stringSchema: LeafSchema<"string", string> & SimpleLeafNodeSchema;
|
|
45
|
+
export declare const numberSchema: LeafSchema<"number", number> & SimpleLeafNodeSchema;
|
|
46
|
+
export declare const booleanSchema: LeafSchema<"boolean", boolean> & SimpleLeafNodeSchema;
|
|
47
|
+
export declare const nullSchema: LeafSchema<"null", null> & SimpleLeafNodeSchema;
|
|
48
|
+
export declare const handleSchema: LeafSchema<"handle", import("@fluidframework/core-interfaces").IFluidHandle<unknown>> & SimpleLeafNodeSchema;
|
|
32
49
|
//# sourceMappingURL=leafNodeSchema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leafNodeSchema.d.ts","sourceRoot":"","sources":["../../src/simple-tree/leafNodeSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,KAAK,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EACN,KAAK,YAAY,EAGjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,KAAK,cAAc,EAAE,KAAK,sBAAsB,E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;;;;;;GAUG;AACH,MAAM,WAAW,UAAU,CAAC,IAAI,SAAS,MAAM,EAAE,CAAC,SAAS,aAAa,CACvE,SAAQ,sBAAsB,CAC7B,2BAA2B,IAAI,EAAE,EACjC,QAAQ,CAAC,IAAI,EACD,CAAC,EACK,CAAC,EACW,IAAI,CAClC;CAAG;AAGL,eAAO,MAAM,YAAY,qDAAyC,CAAC;AACnE,eAAO,MAAM,YAAY,qDAAyC,CAAC;AACnE,eAAO,MAAM,aAAa,uDAA2C,CAAC;AACtE,eAAO,MAAM,UAAU,iDAAqC,CAAC;AAC7D,eAAO,MAAM,YAAY,8GAA8C,CAAC"}
|
|
@@ -34,8 +34,10 @@ class LeafNodeSchema {
|
|
|
34
34
|
this.kind = index_js_3.NodeKind.Leaf;
|
|
35
35
|
this.implicitlyConstructable = true;
|
|
36
36
|
this.childTypes = new Set();
|
|
37
|
+
this.metadata = {};
|
|
37
38
|
this.identifier = name;
|
|
38
39
|
this.info = t;
|
|
40
|
+
this.leafKind = t;
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
43
|
exports.LeafNodeSchema = LeafNodeSchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leafNodeSchema.js","sourceRoot":"","sources":["../../src/simple-tree/leafNodeSchema.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D,+CAA+D;AAC/D,4DAIuC;AACvC,8CAA6F;
|
|
1
|
+
{"version":3,"file":"leafNodeSchema.js","sourceRoot":"","sources":["../../src/simple-tree/leafNodeSchema.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D,+CAA+D;AAC/D,4DAIuC;AACvC,8CAA6F;AAI7F;;;;;;;;GAQG;AACH,MAAa,cAAc;IASnB,MAAM,CAAC,IAAiC;QAC9C,IAAI,IAAA,yBAAc,EAAC,IAAI,CAAC,EAAE,CAAC;YAC1B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;Y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* Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport { type TreeValue, ValueSchema } from \"../core/index.js\";\nimport {\n\ttype FlexTreeNode,\n\tisFlexTreeNode,\n\tvalueSchemaAllows,\n} from \"../feature-libraries/index.js\";\nimport { NodeKind, type TreeNodeSchema, type TreeNodeSchemaNonClass } from \"./core/index.js\";\nimport type { NodeSchemaMetadata, TreeLeafValue } from \"./schemaTypes.js\";\nimport type { SimpleLeafNodeSchema } from \"./simpleSchema.js\";\n\n/**\n * Instances of this class are schema for leaf nodes.\n * @remarks\n * Unlike other schema, leaf schema are class instances instead of classes themselves.\n * This is because the instance type (the tree node type) for leaves are not objects,\n * so those instances can't be instances of a schema based class.\n * @privateRemarks\n * This class refers to the underlying flex tree schema in its constructor, so this class can't be included in the package API.\n */\nexport class LeafNodeSchema<Name extends string, const T extends ValueSchema>\n\timplements TreeNodeSchemaNonClass<Name, NodeKind.Leaf, TreeValue<T>, TreeValue<T>>\n{\n\tpublic readonly identifier: Name;\n\tpublic readonly kind = NodeKind.Leaf;\n\tpublic readonly info: T;\n\tpublic readonly implicitlyConstructable = true as const;\n\tpublic readonly childTypes: ReadonlySet<TreeNodeSchema> = new Set();\n\n\tpublic create(data: TreeValue<T> | FlexTreeNode): TreeValue<T> {\n\t\tif (isFlexTreeNode(data)) {\n\t\t\tconst value = data.value;\n\t\t\tassert(valueSchemaAllows(this.info, value), 0x916 /* invalid value */);\n\t\t\treturn value;\n\t\t}\n\t\treturn data;\n\t}\n\n\tpublic createFromInsertable(data: TreeValue<T>): TreeValue<T> {\n\t\treturn data;\n\t}\n\n\tpublic readonly leafKind: ValueSchema;\n\n\tpublic readonly metadata: NodeSchemaMetadata = {};\n\n\tpublic constructor(name: Name, t: T) {\n\t\tthis.identifier = name;\n\t\tthis.info = t;\n\t\tthis.leafKind = t;\n\t}\n}\n\n/**\n * Wrapper around LeafNodeSchema's constructor that provides the return type that is desired in the package public API.\n */\nfunction makeLeaf<Name extends string, const T extends ValueSchema>(\n\tname: Name,\n\tt: T,\n): LeafSchema<Name, TreeValue<T>> & SimpleLeafNodeSchema {\n\t// Names in this domain follow https://en.wikipedia.org/wiki/Reverse_domain_name_notation\n\treturn new LeafNodeSchema(`com.fluidframework.leaf.${name}`, t);\n}\n\n/**\n * A {@link TreeNodeSchema} for a {@link TreeLeafValue}.\n * @remarks\n * This is just a more specific alias for a particular {@link TreeNodeSchemaNonClass}.\n * It only exists to make the API (particularly errors, IntelliSense, and generated .d.ts files) more readable.\n *\n * See {@link SchemaFactory} and its various properties for actual leaf schema objects.\n * @privateRemarks\n * This is an interface so its name will show up in things like type errors instead of the fully expanded TreeNodeSchemaNonClass.\n * @system @sealed @public\n */\nexport interface LeafSchema<Name extends string, T extends TreeLeafValue>\n\textends TreeNodeSchemaNonClass<\n\t\t`com.fluidframework.leaf.${Name}`,\n\t\tNodeKind.Leaf,\n\t\t/* TNode */ T,\n\t\t/* TInsertable */ T,\n\t\t/* ImplicitlyConstructable */ true\n\t> {}\n\n// Leaf schema shared between all SchemaFactory instances.\nexport const stringSchema = makeLeaf(\"string\", ValueSchema.String);\nexport const numberSchema = makeLeaf(\"number\", ValueSchema.Number);\nexport const booleanSchema = makeLeaf(\"boolean\", ValueSchema.Boolean);\nexport const nullSchema = makeLeaf(\"null\", ValueSchema.Null);\nexport const handleSchema = makeLeaf(\"handle\", ValueSchema.FluidHandle);\n"]}
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { type ImplicitAllowedTypes, type InsertableTreeNodeFromImplicitAllowedTypes, type NodeSchemaMetadata, type TreeNodeFromImplicitAllowedTypes } from "./schemaTypes.js";
|
|
6
|
-
import {
|
|
6
|
+
import { type TreeNode } from "./core/index.js";
|
|
7
7
|
import { type RestrictiveStringRecord } from "../util/index.js";
|
|
8
|
+
import type { MapNodeCustomizableSchema, MapNodePojoEmulationSchema } from "./mapNodeTypes.js";
|
|
8
9
|
/**
|
|
9
10
|
* A map of string keys to tree objects.
|
|
10
11
|
*
|
|
@@ -78,7 +79,7 @@ export interface TreeMapNode<T extends ImplicitAllowedTypes = ImplicitAllowedTyp
|
|
|
78
79
|
* @param base - base schema type to extend.
|
|
79
80
|
* @param useMapPrototype - should this type emulate a ES6 Map object (by faking its prototype with a proxy).
|
|
80
81
|
*/
|
|
81
|
-
export declare function mapSchema<TName extends string, const T extends ImplicitAllowedTypes, const ImplicitlyConstructable extends boolean, const TCustomMetadata = unknown>(identifier: TName, info: T, implicitlyConstructable: ImplicitlyConstructable, useMapPrototype: boolean, metadata?: NodeSchemaMetadata<TCustomMetadata>):
|
|
82
|
+
export declare function mapSchema<TName extends string, const T extends ImplicitAllowedTypes, const ImplicitlyConstructable extends boolean, const TCustomMetadata = unknown>(identifier: TName, info: T, implicitlyConstructable: ImplicitlyConstructable, useMapPrototype: boolean, metadata?: NodeSchemaMetadata<TCustomMetadata>): MapNodeCustomizableSchema<TName, T, ImplicitlyConstructable, TCustomMetadata> & MapNodePojoEmulationSchema<TName, T, ImplicitlyConstructable, TCustomMetadata>;
|
|
82
83
|
/**
|
|
83
84
|
* Content which can be used to construct a Map node, explicitly or implicitly.
|
|
84
85
|
* @system @public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapNode.d.ts","sourceRoot":"","sources":["../../src/simple-tree/mapNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,OAAO,EAIN,KAAK,oBAAoB,EACzB,KAAK,0CAA0C,EAC/C,KAAK,kBAAkB,EACvB,KAAK,gCAAgC,EACrC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,
|
|
1
|
+
{"version":3,"file":"mapNode.d.ts","sourceRoot":"","sources":["../../src/simple-tree/mapNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,OAAO,EAIN,KAAK,oBAAoB,EACzB,KAAK,0CAA0C,EAC/C,KAAK,kBAAkB,EACvB,KAAK,gCAAgC,EACrC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AC,uBAAuB,SAAS,OAAO,EAC7C,KAAK,CAAC,eAAe,GAAG,OAAO,EAE/B,UAAU,EAAE,KAAK,EACjB,IAAI,EAAE,CAAC,EACP,uBAAuB,EAAE,uBAAuB,EAChD,eAAe,EAAE,OAAO,EACxB,QAAQ,CAAC,EAAE,kBAAkB,CAAC,eAAe,CAAC,kKAqE9C;AAED;;;GAGG;AACH,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,oBAAoB,IAC7D,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,0CAA0C,CAAC,CAAC,CAAC,CAAC,CAAC,GAC1E,uBAAuB,CAAC,0CAA0C,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -97,6 +97,7 @@ CustomMapNodeBase.kind = index_js_2.NodeKind.Map;
|
|
|
97
97
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
98
98
|
function mapSchema(identifier, info, implicitlyConstructable, useMapPrototype, metadata) {
|
|
99
99
|
const lazyChildTypes = new internal_1.Lazy(() => (0, schemaTypes_js_1.normalizeAllowedTypes)(info));
|
|
100
|
+
const lazyAllowedTypesIdentifiers = new internal_1.Lazy(() => new Set([...lazyChildTypes.value].map((type) => type.identifier)));
|
|
100
101
|
let unhydratedContext;
|
|
101
102
|
class Schema extends CustomMapNodeBase {
|
|
102
103
|
static prepareInstance(instance, flexNode) {
|
|
@@ -108,6 +109,9 @@ function mapSchema(identifier, info, implicitlyConstructable, useMapPrototype, m
|
|
|
108
109
|
static buildRawNode(instance, input) {
|
|
109
110
|
return index_js_2.UnhydratedFlexTreeNode.getOrCreate(unhydratedContext, (0, toMapTree_js_1.mapTreeFromNodeData)(input, this));
|
|
110
111
|
}
|
|
112
|
+
static get allowedTypesIdentifiers() {
|
|
113
|
+
return lazyAllowedTypesIdentifiers.value;
|
|
114
|
+
}
|
|
111
115
|
static oneTimeSetup() {
|
|
112
116
|
const schema = this;
|
|
113
117
|
unhydratedContext = (0, createContext_js_1.getUnhydratedContext)(schema);
|
|
@@ -128,7 +132,7 @@ function mapSchema(identifier, info, implicitlyConstructable, useMapPrototype, m
|
|
|
128
132
|
Schema.identifier = identifier;
|
|
129
133
|
Schema.info = info;
|
|
130
134
|
Schema.implicitlyConstructable = implicitlyConstructable;
|
|
131
|
-
Schema.metadata = metadata;
|
|
135
|
+
Schema.metadata = metadata ?? {};
|
|
132
136
|
const schemaErased = Schema;
|
|
133
137
|
return schemaErased;
|
|
134
138
|
}
|