@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
|
@@ -3,25 +3,26 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
export { type ITree, type TreeView, type ViewableTree, type TreeViewEvents, TreeViewConfiguration, type ITreeViewConfiguration, type SchemaCompatibilityStatus, type ITreeConfigurationOptions, type TreeViewAlpha, type TreeBranch, type TreeBranchEvents, type ITreeAlpha, asTreeViewAlpha, } from "./tree.js";
|
|
6
|
-
export { SchemaFactory, type ScopedSchemaName, type SchemaFactoryObjectOptions, type
|
|
6
|
+
export { SchemaFactory, type ScopedSchemaName, type SchemaFactoryObjectOptions, type SchemaStatics, } from "./schemaFactory.js";
|
|
7
7
|
export { SchemaFactoryAlpha } from "./schemaFactoryAlpha.js";
|
|
8
8
|
export type { ValidateRecursiveSchema, FixRecursiveArraySchema, } from "./schemaFactoryRecursive.js";
|
|
9
9
|
export { adaptEnum, enumFromStrings, singletonSchema, } from "./schemaCreationUtilities.js";
|
|
10
10
|
export { treeNodeApi, type TreeNodeApi, tryGetSchema } from "./treeNodeApi.js";
|
|
11
11
|
export { createFromInsertable, cursorFromInsertable, createFromCursor } from "./create.js";
|
|
12
|
-
export type { SimpleTreeSchema, SimpleNodeSchema, SimpleFieldSchema, SimpleLeafNodeSchema, SimpleMapNodeSchema, SimpleArrayNodeSchema, SimpleObjectNodeSchema, SimpleNodeSchemaBase, } from "./simpleSchema.js";
|
|
13
12
|
export { 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, } from "./jsonSchema.js";
|
|
14
13
|
export { getJsonSchema } from "./getJsonSchema.js";
|
|
15
14
|
export { getSimpleSchema } from "./getSimpleSchema.js";
|
|
16
15
|
export { ViewSchema } from "./view.js";
|
|
17
|
-
export type { Unenforced, FieldHasDefaultUnsafe, ObjectFromSchemaRecordUnsafe, TreeObjectNodeUnsafe, TreeFieldFromImplicitFieldUnsafe, TreeNodeFromImplicitAllowedTypesUnsafe, FieldSchemaUnsafe, InsertableTreeNodeFromImplicitAllowedTypesUnsafe, TreeArrayNodeUnsafe, TreeMapNodeUnsafe, InsertableObjectFromSchemaRecordUnsafe, InsertableTreeFieldFromImplicitFieldUnsafe, InsertableTypedNodeUnsafe, NodeBuilderDataUnsafe, NodeFromSchemaUnsafe, ReadonlyMapInlined, TreeNodeSchemaClassUnsafe, TreeNodeSchemaUnsafe, AllowedTypesUnsafe, TreeNodeSchemaNonClassUnsafe, InsertableTreeNodeFromAllowedTypesUnsafe, } from "./typesUnsafe.js";
|
|
18
|
-
export { type VerboseTreeNode, type ParseOptions, type VerboseTree, applySchemaToParserOptions, cursorFromVerbose, verboseFromCursor, } from "./verboseTree.js";
|
|
19
|
-
export { type EncodeOptions, customFromCursorStored, type CustomTreeNode, type CustomTreeValue, tryStoredSchemaAsArray, } from "./customTree.js";
|
|
20
|
-
export { type ConciseTree, conciseFromCursor } from "./conciseTree.js";
|
|
16
|
+
export type { Unenforced, FieldHasDefaultUnsafe, ObjectFromSchemaRecordUnsafe, TreeObjectNodeUnsafe, TreeFieldFromImplicitFieldUnsafe, TreeNodeFromImplicitAllowedTypesUnsafe, FieldSchemaUnsafe, InsertableTreeNodeFromImplicitAllowedTypesUnsafe, TreeArrayNodeUnsafe, TreeMapNodeUnsafe, InsertableObjectFromSchemaRecordUnsafe, InsertableTreeFieldFromImplicitFieldUnsafe, InsertableTypedNodeUnsafe, NodeBuilderDataUnsafe, NodeFromSchemaUnsafe, ReadonlyMapInlined, TreeNodeSchemaClassUnsafe, TreeNodeSchemaUnsafe, AllowedTypesUnsafe, ImplicitAllowedTypesUnsafe, ImplicitFieldSchemaUnsafe, TreeNodeSchemaNonClassUnsafe, InsertableTreeNodeFromAllowedTypesUnsafe, FieldSchemaAlphaUnsafe, ArrayNodeCustomizableSchemaUnsafe, MapNodeCustomizableSchemaUnsafe, } from "./typesUnsafe.js";
|
|
17
|
+
export { type VerboseTreeNode, type ParseOptions, type VerboseTree, applySchemaToParserOptions, cursorFromVerbose, verboseFromCursor, replaceVerboseTreeHandles, } from "./verboseTree.js";
|
|
18
|
+
export { type EncodeOptions, customFromCursorStored, type CustomTreeNode, type CustomTreeValue, tryStoredSchemaAsArray, replaceHandles, type HandleConverter, } from "./customTree.js";
|
|
19
|
+
export { type ConciseTree, conciseFromCursor, replaceConciseTreeHandles, } from "./conciseTree.js";
|
|
21
20
|
export { TreeBeta, type NodeChangedData, type TreeChangeEventsBeta } from "./treeApiBeta.js";
|
|
22
21
|
export { createSimpleTreeIndex, type SimpleTreeIndex } from "./simpleTreeIndex.js";
|
|
23
22
|
export { createIdentifierIndex, type IdentifierIndex, } from "./identifierIndex.js";
|
|
24
23
|
export { extractPersistedSchema, comparePersistedSchemaInternal, comparePersistedSchema, } from "./storedSchema.js";
|
|
25
24
|
export { type TransactionConstraint, type NodeInDocumentConstraint, type RunTransactionParams, type VoidTransactionCallbackStatus, type TransactionCallbackStatus, type TransactionResult, type TransactionResultExt, type TransactionResultSuccess, type TransactionResultFailed, rollback, } from "./transactionTypes.js";
|
|
25
|
+
export { generateSchemaFromSimpleSchema } from "./schemaFromSimple.js";
|
|
26
|
+
export { toSimpleTreeSchema } from "./viewSchemaToSimpleSchema.js";
|
|
26
27
|
export { RecursiveObject as test_RecursiveObject, base as test_RecursiveObject_base, RecursiveObjectPojoMode as test_RecursiveObjectPojoMode, } from "./testRecursiveDomain.js";
|
|
27
28
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,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,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,eAAe,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,aAAa,EACb,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,EAC/B,KAAK,aAAa,GAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,YAAY,EACX,uBAAuB,EACvB,uBAAuB,GACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACN,SAAS,EACT,eAAe,EACf,eAAe,GACf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC3F,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,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,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,eAAe,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,aAAa,EACb,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,EAC/B,KAAK,aAAa,GAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,YAAY,EACX,uBAAuB,EACvB,uBAAuB,GACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACN,SAAS,EACT,eAAe,EACf,eAAe,GACf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC3F,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,kBAAkB,GACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,YAAY,EACX,UAAU,EACV,qBAAqB,EACrB,4BAA4B,EAC5B,oBAAoB,EACpB,gCAAgC,EAChC,sCAAsC,EACtC,iBAAiB,EACjB,gDAAgD,EAChD,mBAAmB,EACnB,iBAAiB,EACjB,sCAAsC,EACtC,0CAA0C,EAC1C,yBAAyB,EACzB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,yBAAyB,EACzB,oBAAoB,EACpB,kBAAkB,EAClB,0BAA0B,EAC1B,yBAAyB,EACzB,4BAA4B,EAC5B,wCAAwC,EACxC,sBAAsB,EACtB,iCAAiC,EACjC,+BAA+B,GAC/B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACN,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,0BAA0B,EAC1B,iBAAiB,EACjB,iBAAiB,EACjB,yBAAyB,GACzB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACN,KAAK,aAAa,EAClB,sBAAsB,EACtB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,sBAAsB,EACtB,cAAc,EACd,KAAK,eAAe,GACpB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACN,KAAK,WAAW,EAChB,iBAAiB,EACjB,yBAAyB,GACzB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,KAAK,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7F,OAAO,EAAE,qBAAqB,EAAE,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EACN,qBAAqB,EACrB,KAAK,eAAe,GACpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACN,sBAAsB,EACtB,8BAA8B,EAC9B,sBAAsB,GACtB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACN,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,6BAA6B,EAClC,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,QAAQ,GACR,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAInE,OAAO,EACN,eAAe,IAAI,oBAAoB,EACvC,IAAI,IAAI,yBAAyB,EACjC,uBAAuB,IAAI,4BAA4B,GACvD,MAAM,0BAA0B,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.test_RecursiveObjectPojoMode = exports.test_RecursiveObject_base = exports.test_RecursiveObject = exports.rollback = exports.comparePersistedSchema = exports.comparePersistedSchemaInternal = exports.extractPersistedSchema = exports.createIdentifierIndex = exports.createSimpleTreeIndex = exports.TreeBeta = exports.conciseFromCursor = exports.tryStoredSchemaAsArray = exports.customFromCursorStored = exports.verboseFromCursor = exports.cursorFromVerbose = exports.applySchemaToParserOptions = exports.ViewSchema = exports.getSimpleSchema = exports.getJsonSchema = exports.createFromCursor = exports.cursorFromInsertable = exports.createFromInsertable = exports.tryGetSchema = exports.treeNodeApi = exports.singletonSchema = exports.enumFromStrings = exports.adaptEnum = exports.SchemaFactoryAlpha = exports.SchemaFactory = exports.asTreeViewAlpha = exports.TreeViewConfiguration = void 0;
|
|
7
|
+
exports.test_RecursiveObjectPojoMode = exports.test_RecursiveObject_base = exports.test_RecursiveObject = exports.toSimpleTreeSchema = exports.generateSchemaFromSimpleSchema = exports.rollback = exports.comparePersistedSchema = exports.comparePersistedSchemaInternal = exports.extractPersistedSchema = exports.createIdentifierIndex = exports.createSimpleTreeIndex = exports.TreeBeta = exports.replaceConciseTreeHandles = exports.conciseFromCursor = exports.replaceHandles = exports.tryStoredSchemaAsArray = exports.customFromCursorStored = exports.replaceVerboseTreeHandles = exports.verboseFromCursor = exports.cursorFromVerbose = exports.applySchemaToParserOptions = exports.ViewSchema = exports.getSimpleSchema = exports.getJsonSchema = exports.createFromCursor = exports.cursorFromInsertable = exports.createFromInsertable = exports.tryGetSchema = exports.treeNodeApi = exports.singletonSchema = exports.enumFromStrings = exports.adaptEnum = exports.SchemaFactoryAlpha = exports.SchemaFactory = exports.asTreeViewAlpha = exports.TreeViewConfiguration = void 0;
|
|
8
8
|
var tree_js_1 = require("./tree.js");
|
|
9
9
|
Object.defineProperty(exports, "TreeViewConfiguration", { enumerable: true, get: function () { return tree_js_1.TreeViewConfiguration; } });
|
|
10
10
|
Object.defineProperty(exports, "asTreeViewAlpha", { enumerable: true, get: function () { return tree_js_1.asTreeViewAlpha; } });
|
|
@@ -33,11 +33,14 @@ var verboseTree_js_1 = require("./verboseTree.js");
|
|
|
33
33
|
Object.defineProperty(exports, "applySchemaToParserOptions", { enumerable: true, get: function () { return verboseTree_js_1.applySchemaToParserOptions; } });
|
|
34
34
|
Object.defineProperty(exports, "cursorFromVerbose", { enumerable: true, get: function () { return verboseTree_js_1.cursorFromVerbose; } });
|
|
35
35
|
Object.defineProperty(exports, "verboseFromCursor", { enumerable: true, get: function () { return verboseTree_js_1.verboseFromCursor; } });
|
|
36
|
+
Object.defineProperty(exports, "replaceVerboseTreeHandles", { enumerable: true, get: function () { return verboseTree_js_1.replaceVerboseTreeHandles; } });
|
|
36
37
|
var customTree_js_1 = require("./customTree.js");
|
|
37
38
|
Object.defineProperty(exports, "customFromCursorStored", { enumerable: true, get: function () { return customTree_js_1.customFromCursorStored; } });
|
|
38
39
|
Object.defineProperty(exports, "tryStoredSchemaAsArray", { enumerable: true, get: function () { return customTree_js_1.tryStoredSchemaAsArray; } });
|
|
40
|
+
Object.defineProperty(exports, "replaceHandles", { enumerable: true, get: function () { return customTree_js_1.replaceHandles; } });
|
|
39
41
|
var conciseTree_js_1 = require("./conciseTree.js");
|
|
40
42
|
Object.defineProperty(exports, "conciseFromCursor", { enumerable: true, get: function () { return conciseTree_js_1.conciseFromCursor; } });
|
|
43
|
+
Object.defineProperty(exports, "replaceConciseTreeHandles", { enumerable: true, get: function () { return conciseTree_js_1.replaceConciseTreeHandles; } });
|
|
41
44
|
var treeApiBeta_js_1 = require("./treeApiBeta.js");
|
|
42
45
|
Object.defineProperty(exports, "TreeBeta", { enumerable: true, get: function () { return treeApiBeta_js_1.TreeBeta; } });
|
|
43
46
|
var simpleTreeIndex_js_1 = require("./simpleTreeIndex.js");
|
|
@@ -50,6 +53,10 @@ Object.defineProperty(exports, "comparePersistedSchemaInternal", { enumerable: t
|
|
|
50
53
|
Object.defineProperty(exports, "comparePersistedSchema", { enumerable: true, get: function () { return storedSchema_js_1.comparePersistedSchema; } });
|
|
51
54
|
var transactionTypes_js_1 = require("./transactionTypes.js");
|
|
52
55
|
Object.defineProperty(exports, "rollback", { enumerable: true, get: function () { return transactionTypes_js_1.rollback; } });
|
|
56
|
+
var schemaFromSimple_js_1 = require("./schemaFromSimple.js");
|
|
57
|
+
Object.defineProperty(exports, "generateSchemaFromSimpleSchema", { enumerable: true, get: function () { return schemaFromSimple_js_1.generateSchemaFromSimpleSchema; } });
|
|
58
|
+
var viewSchemaToSimpleSchema_js_1 = require("./viewSchemaToSimpleSchema.js");
|
|
59
|
+
Object.defineProperty(exports, "toSimpleTreeSchema", { enumerable: true, get: function () { return viewSchemaToSimpleSchema_js_1.toSimpleTreeSchema; } });
|
|
53
60
|
// Exporting the schema (RecursiveObject) to test that recursive types are working correctly.
|
|
54
61
|
// These are `@internal` so they can't be included in the `InternalClassTreeTypes` due to https://github.com/microsoft/rushstack/issues/3639
|
|
55
62
|
var testRecursiveDomain_js_1 = require("./testRecursiveDomain.js");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/simple-tree/api/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qCAcmB;AATlB,gHAAA,qBAAqB,OAAA;AAQrB,0GAAA,eAAe,OAAA;AAEhB,uDAK4B;AAJ3B,iHAAA,aAAa,OAAA;AAKd,iEAA6D;AAApD,2HAAA,kBAAkB,OAAA;AAK3B,2EAIsC;AAHrC,uHAAA,SAAS,OAAA;AACT,6HAAA,eAAe,OAAA;AACf,6HAAA,eAAe,OAAA;AAEhB,mDAA+E;AAAtE,6GAAA,WAAW,OAAA;AAAoB,8GAAA,YAAY,OAAA;AACpD,yCAA2F;AAAlF,iHAAA,oBAAoB,OAAA;AAAE,iHAAA,oBAAoB,OAAA;AAAE,6GAAA,gBAAgB,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/simple-tree/api/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qCAcmB;AATlB,gHAAA,qBAAqB,OAAA;AAQrB,0GAAA,eAAe,OAAA;AAEhB,uDAK4B;AAJ3B,iHAAA,aAAa,OAAA;AAKd,iEAA6D;AAApD,2HAAA,kBAAkB,OAAA;AAK3B,2EAIsC;AAHrC,uHAAA,SAAS,OAAA;AACT,6HAAA,eAAe,OAAA;AACf,6HAAA,eAAe,OAAA;AAEhB,mDAA+E;AAAtE,6GAAA,WAAW,OAAA;AAAoB,8GAAA,YAAY,OAAA;AACpD,yCAA2F;AAAlF,iHAAA,oBAAoB,OAAA;AAAE,iHAAA,oBAAoB,OAAA;AAAE,6GAAA,gBAAgB,OAAA;AAgBrE,uDAAmD;AAA1C,iHAAA,aAAa,OAAA;AACtB,2DAAuD;AAA9C,qHAAA,eAAe,OAAA;AACxB,qCAAuC;AAA9B,qGAAA,UAAU,OAAA;AA8BnB,mDAQ0B;AAJzB,4HAAA,0BAA0B,OAAA;AAC1B,mHAAA,iBAAiB,OAAA;AACjB,mHAAA,iBAAiB,OAAA;AACjB,2HAAA,yBAAyB,OAAA;AAG1B,iDAQyB;AANxB,uHAAA,sBAAsB,OAAA;AAGtB,uHAAA,sBAAsB,OAAA;AACtB,+GAAA,cAAc,OAAA;AAIf,mDAI0B;AAFzB,mHAAA,iBAAiB,OAAA;AACjB,2HAAA,yBAAyB,OAAA;AAG1B,mDAA6F;AAApF,0GAAA,QAAQ,OAAA;AACjB,2DAAmF;AAA1E,2HAAA,qBAAqB,OAAA;AAC9B,2DAG8B;AAF7B,2HAAA,qBAAqB,OAAA;AAItB,qDAI2B;AAH1B,yHAAA,sBAAsB,OAAA;AACtB,iIAAA,8BAA8B,OAAA;AAC9B,yHAAA,sBAAsB,OAAA;AAGvB,6DAW+B;AAD9B,+GAAA,QAAQ,OAAA;AAGT,6DAAuE;AAA9D,qIAAA,8BAA8B,OAAA;AACvC,6EAAmE;AAA1D,iIAAA,kBAAkB,OAAA;AAE3B,6FAA6F;AAC7F,4IAA4I;AAC5I,mEAIkC;AAHjC,8HAAA,eAAe,OAAwB;AACvC,mIAAA,IAAI,OAA6B;AACjC,sIAAA,uBAAuB,OAAgC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\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\ttype TreeViewAlpha,\n\ttype TreeBranch,\n\ttype TreeBranchEvents,\n\ttype ITreeAlpha,\n\tasTreeViewAlpha,\n} from \"./tree.js\";\nexport {\n\tSchemaFactory,\n\ttype ScopedSchemaName,\n\ttype SchemaFactoryObjectOptions,\n\ttype SchemaStatics,\n} from \"./schemaFactory.js\";\nexport { SchemaFactoryAlpha } from \"./schemaFactoryAlpha.js\";\nexport type {\n\tValidateRecursiveSchema,\n\tFixRecursiveArraySchema,\n} from \"./schemaFactoryRecursive.js\";\nexport {\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n} from \"./schemaCreationUtilities.js\";\nexport { treeNodeApi, type TreeNodeApi, tryGetSchema } from \"./treeNodeApi.js\";\nexport { createFromInsertable, cursorFromInsertable, createFromCursor } from \"./create.js\";\nexport {\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} from \"./jsonSchema.js\";\nexport { getJsonSchema } from \"./getJsonSchema.js\";\nexport { getSimpleSchema } from \"./getSimpleSchema.js\";\nexport { ViewSchema } from \"./view.js\";\nexport type {\n\tUnenforced,\n\tFieldHasDefaultUnsafe,\n\tObjectFromSchemaRecordUnsafe,\n\tTreeObjectNodeUnsafe,\n\tTreeFieldFromImplicitFieldUnsafe,\n\tTreeNodeFromImplicitAllowedTypesUnsafe,\n\tFieldSchemaUnsafe,\n\tInsertableTreeNodeFromImplicitAllowedTypesUnsafe,\n\tTreeArrayNodeUnsafe,\n\tTreeMapNodeUnsafe,\n\tInsertableObjectFromSchemaRecordUnsafe,\n\tInsertableTreeFieldFromImplicitFieldUnsafe,\n\tInsertableTypedNodeUnsafe,\n\tNodeBuilderDataUnsafe,\n\tNodeFromSchemaUnsafe,\n\tReadonlyMapInlined,\n\tTreeNodeSchemaClassUnsafe,\n\tTreeNodeSchemaUnsafe,\n\tAllowedTypesUnsafe,\n\tImplicitAllowedTypesUnsafe,\n\tImplicitFieldSchemaUnsafe,\n\tTreeNodeSchemaNonClassUnsafe,\n\tInsertableTreeNodeFromAllowedTypesUnsafe,\n\tFieldSchemaAlphaUnsafe,\n\tArrayNodeCustomizableSchemaUnsafe,\n\tMapNodeCustomizableSchemaUnsafe,\n} from \"./typesUnsafe.js\";\n\nexport {\n\ttype VerboseTreeNode,\n\ttype ParseOptions,\n\ttype VerboseTree,\n\tapplySchemaToParserOptions,\n\tcursorFromVerbose,\n\tverboseFromCursor,\n\treplaceVerboseTreeHandles,\n} from \"./verboseTree.js\";\n\nexport {\n\ttype EncodeOptions,\n\tcustomFromCursorStored,\n\ttype CustomTreeNode,\n\ttype CustomTreeValue,\n\ttryStoredSchemaAsArray,\n\treplaceHandles,\n\ttype HandleConverter,\n} from \"./customTree.js\";\n\nexport {\n\ttype ConciseTree,\n\tconciseFromCursor,\n\treplaceConciseTreeHandles,\n} from \"./conciseTree.js\";\n\nexport { TreeBeta, type NodeChangedData, type TreeChangeEventsBeta } from \"./treeApiBeta.js\";\nexport { createSimpleTreeIndex, type SimpleTreeIndex } from \"./simpleTreeIndex.js\";\nexport {\n\tcreateIdentifierIndex,\n\ttype IdentifierIndex,\n} from \"./identifierIndex.js\";\n\nexport {\n\textractPersistedSchema,\n\tcomparePersistedSchemaInternal,\n\tcomparePersistedSchema,\n} from \"./storedSchema.js\";\n\nexport {\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} from \"./transactionTypes.js\";\n\nexport { generateSchemaFromSimpleSchema } from \"./schemaFromSimple.js\";\nexport { toSimpleTreeSchema } from \"./viewSchemaToSimpleSchema.js\";\n\n// Exporting the schema (RecursiveObject) to test that recursive types are working correctly.\n// These are `@internal` so they can't be included in the `InternalClassTreeTypes` due to https://github.com/microsoft/rushstack/issues/3639\nexport {\n\tRecursiveObject as test_RecursiveObject,\n\tbase as test_RecursiveObject_base,\n\tRecursiveObjectPojoMode as test_RecursiveObjectPojoMode,\n} from \"./testRecursiveDomain.js\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemaCreationUtilities.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/schemaCreationUtilities.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"schemaCreationUtilities.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/schemaCreationUtilities.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE1E,OAAO,KAAK,EAEX,QAAQ,EACR,QAAQ,EAER,mBAAmB,EACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAWxD;;;;;;;GAOG;AAGH,wBAAgB,eAAe,CAAC,MAAM,SAAS,MAAM,EAAE,KAAK,SAAS,MAAM,GAAG,MAAM,EACnF,OAAO,EAAE,aAAa,CAAC,MAAM,EAAE,KAAK,CAAC,EACrC,IAAI,EAAE,KAAK;oBAW2C,KAAK;kEAkB3D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,wBAAgB,SAAS,CACxB,MAAM,SAAS,MAAM,EACrB,KAAK,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,EAClD,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,KAAK,+CAsBG,MAAM;;;;;;;;EA4BxD;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,wBAAgB,eAAe,CAC9B,MAAM,SAAS,MAAM,EACrB,KAAK,CAAC,OAAO,SAAS,SAAS,MAAM,EAAE,EACtC,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,OAAO,4CAoBO,MAAM;;;;;;;;EA+B9D"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.enumFromStrings = exports.adaptEnum = exports.singletonSchema = void 0;
|
|
8
8
|
const internal_1 = require("@fluidframework/telemetry-utils/internal");
|
|
9
|
-
const
|
|
9
|
+
const internal_2 = require("@fluidframework/core-utils/internal");
|
|
10
10
|
/*
|
|
11
11
|
* This file does two things:
|
|
12
12
|
*
|
|
@@ -93,7 +93,7 @@ function adaptEnum(factory, members) {
|
|
|
93
93
|
const schemaArray = [];
|
|
94
94
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
95
95
|
const factoryOut = (value) => {
|
|
96
|
-
return new out[inverse.get(value) ?? (0,
|
|
96
|
+
return new out[inverse.get(value) ?? (0, internal_2.fail)(0xb31 /* missing enum value */)
|
|
97
97
|
// "extends unknown" is required here to handle when TValue is an union: each member of the union should be processed independently.
|
|
98
98
|
]();
|
|
99
99
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemaCreationUtilities.js","sourceRoot":"","sources":["../../../src/simple-tree/api/schemaCreationUtilities.ts"],"names":[],"mappings":"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","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { fail } from \"../../util/index.js\";\n\nimport type { SchemaFactory, ScopedSchemaName } from \"./schemaFactory.js\";\nimport type { NodeFromSchema } from \"../schemaTypes.js\";\nimport type {\n\tInternalTreeNode,\n\tNodeKind,\n\tTreeNode,\n\tTreeNodeSchema,\n\tTreeNodeSchemaClass,\n} from \"../core/index.js\";\nimport type { UnionToTuple } from \"../../util/index.js\";\n\n/*\n * This file does two things:\n *\n * 1. Provides tools for making schema for cases like enums.\n *\n * 2. Demonstrates the kinds of schema utilities apps can write.\n * Nothing in here needs access to package internal APIs.\n */\n\n/**\n * Create a schema for a node with no state.\n * @remarks\n * This is commonly used in unions when the only information needed is which kind of node the value is.\n * Enums are a common example of this pattern.\n * @see {@link adaptEnum}\n * @alpha\n */\n// Return type is intentionally derived.\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function singletonSchema<TScope extends string, TName extends string | number>(\n\tfactory: SchemaFactory<TScope, TName>,\n\tname: TName,\n) {\n\tclass SingletonSchema extends factory.object(name, {}) {\n\t\tpublic constructor(data?: InternalTreeNode | Record<string, never>) {\n\t\t\tsuper(data ?? {});\n\t\t}\n\t\tpublic get value(): TName {\n\t\t\treturn name;\n\t\t}\n\t}\n\n\ttype SingletonNodeType = TreeNode & { readonly value: TName };\n\n\t// Returning SingletonSchema without a type conversion results in TypeScript generating something like `readonly \"__#124291@#brand\": unknown;`\n\t// for the private brand field of TreeNode.\n\t// This numeric id doesn't seem to be stable over incremental builds, and thus causes diffs in the API extractor reports.\n\t// This is avoided by doing this type conversion.\n\t// The conversion is done via assignment instead of `as` to get stronger type safety.\n\tconst toReturn: TreeNodeSchemaClass<\n\t\tScopedSchemaName<TScope, TName>,\n\t\tNodeKind.Object,\n\t\tSingletonNodeType,\n\t\tRecord<string, never>,\n\t\ttrue,\n\t\tRecord<string, never>,\n\t\tundefined\n\t> = SingletonSchema;\n\n\treturn toReturn;\n}\n\n/**\n * Converts an enum into a collection of schema which can be used in a union.\n * @remarks\n * The string value of the enum is used as the name of the schema: callers must ensure that it is stable and unique.\n * Numeric enums values have the value implicitly converted into a string.\n * Consider making a dedicated schema factory with a nested scope to avoid the enum members colliding with other schema.\n * @example\n * ```typescript\n * const schemaFactory = new SchemaFactory(\"com.myApp\");\n * // An enum for use in the tree. Must have string keys.\n * enum Mode {\n * \ta = \"A\",\n * \tb = \"B\",\n * }\n * // Define the schema for each member of the enum using a nested scope to group them together.\n * const ModeNodes = adaptEnum(new SchemaFactory(`${schemaFactory.scope}.Mode`), Mode);\n * // Defined the types of the nodes which correspond to this the schema.\n * type ModeNodes = TreeNodeFromImplicitAllowedTypes<(typeof ModeNodes.schema)>;\n * // An example schema which has an enum as a child.\n * class Parent extends schemaFactory.object(\"Parent\", {\n * \t// adaptEnum's return value has a \".schema\" property can be use as an `AllowedTypes` array allowing any of the members of the enum.\n * \tmode: ModeNodes.schema,\n * }) {}\n *\n * // Example usage of enum based nodes, showing what type to use and that `.value` can be used to read out the enum value.\n * function getValue(node: ModeNodes): Mode {\n * \treturn node.value;\n * }\n *\n * // Example constructing a tree containing an enum node from an enum value.\n * // The syntax `new ModeNodes.a()` is also supported.\n * function setValue(node: Parent): void {\n * \tnode.mode = ModeNodes(Mode.a);\n * }\n * ```\n * @privateRemarks\n * Maybe provide `SchemaFactory.nested` to ease creating nested scopes?\n * @see {@link enumFromStrings} for a similar function that works on arrays of strings instead of an enum.\n * @alpha\n */\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function adaptEnum<\n\tTScope extends string,\n\tconst TEnum extends Record<string, string | number>,\n>(factory: SchemaFactory<TScope>, members: TEnum) {\n\ttype Values = TEnum[keyof TEnum];\n\tconst values = Object.values(members) as Values[];\n\tconst inverse = new Map(Object.entries(members).map(([key, value]) => [value, key])) as Map<\n\t\tValues,\n\t\tkeyof TEnum\n\t>;\n\n\tif (inverse.size !== values.length) {\n\t\tthrow new UsageError(\"All members of enums must have distinct values.\");\n\t}\n\n\ttype TOut = {\n\t\treadonly [Property in keyof TEnum]: ReturnType<\n\t\t\ttypeof singletonSchema<TScope, TEnum[Property]>\n\t\t>;\n\t};\n\n\ttype SchemaArray = UnionToTuple<TOut[keyof TEnum]>;\n\tconst schemaArray: TreeNodeSchema[] = [];\n\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n\tconst factoryOut = <TValue extends Values>(value: TValue) => {\n\t\treturn new out[\n\t\t\tinverse.get(value) ?? fail(0xb31 /* missing enum value */)\n\t\t\t// \"extends unknown\" is required here to handle when TValue is an union: each member of the union should be processed independently.\n\t\t]() as TValue extends unknown\n\t\t\t? NodeFromSchema<ReturnType<typeof singletonSchema<TScope, TValue>>>\n\t\t\t: never;\n\t};\n\tconst out = factoryOut as typeof factoryOut & TOut & { readonly schema: SchemaArray };\n\tfor (const [key, value] of Object.entries(members)) {\n\t\tconst schema = singletonSchema(factory, value);\n\t\tschemaArray.push(schema);\n\t\tObject.defineProperty(out, key, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\twritable: false,\n\t\t\tvalue: schema,\n\t\t});\n\t}\n\n\tObject.defineProperty(out, \"schema\", {\n\t\tenumerable: true,\n\t\tconfigurable: false,\n\t\twritable: false,\n\t\tvalue: schemaArray,\n\t});\n\n\treturn out;\n}\n\n/**\n * Converts an array of distinct strings into a collection of schema which can be used like an enum style union.\n * @remarks\n * The returned collection is also a function which can be used to convert strings into {@link Unhydrated} nodes in the union.\n * Each node type has a `.value` getter which returns the associated string.\n *\n * The produced nodes use the provided strings as their `name`, and don't store any data beyond that.\n * @example\n * ```typescript\n * const schemaFactory = new SchemaFactory(\"com.myApp\");\n * const Mode = enumFromStrings(schemaFactory, [\"Fun\", \"Cool\"]);\n * type Mode = TreeNodeFromImplicitAllowedTypes<typeof Mode.schema>;\n * const nodeFromString: Mode = Mode(\"Fun\");\n * const nodeFromSchema: Mode = new Mode.Fun();\n *\n * // Schema nodes have a strongly typed `.value` property.\n * const nameFromNode: \"Fun\" | \"Cool\" = nodeFromSchema.value;\n *\n * class Parent extends schemaFactory.object(\"Parent\", { mode: Mode.schema }) {}\n * ```\n * @see {@link adaptEnum} for a similar function that works on enums instead of arrays of strings.\n * @alpha\n */\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function enumFromStrings<\n\tTScope extends string,\n\tconst Members extends readonly string[],\n>(factory: SchemaFactory<TScope>, members: Members) {\n\tconst names = new Set(members);\n\tif (names.size !== members.length) {\n\t\tthrow new UsageError(\"All members of enums must have distinct names\");\n\t}\n\n\ttype MembersUnion = Members[number];\n\n\t// Get all keys of the Members tuple which are numeric strings as union of numbers:\n\ttype Indexes = Extract<keyof Members, `${number}`> extends `${infer N extends number}`\n\t\t? N\n\t\t: never;\n\n\ttype TOut = {\n\t\t[Index in Indexes as Members[Index]]: ReturnType<\n\t\t\ttypeof singletonSchema<TScope, Members[Index] & string>\n\t\t>;\n\t};\n\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n\tconst factoryOut = <TValue extends MembersUnion>(value: TValue) => {\n\t\t// \"extends unknown\" is required here to handle when TValue is an union: each member of the union should be processed independently.\n\t\treturn new recordOut[value]() as TValue extends unknown\n\t\t\t? NodeFromSchema<ReturnType<typeof singletonSchema<TScope, TValue>>>\n\t\t\t: never;\n\t};\n\n\ttype SchemaArray = UnionToTuple<MembersUnion extends unknown ? TOut[MembersUnion] : never>;\n\tconst schemaArray: TreeNodeSchema[] = [];\n\n\tconst out = factoryOut as typeof factoryOut & TOut & { readonly schema: SchemaArray };\n\tconst recordOut = out as Record<MembersUnion, new () => unknown>;\n\tfor (const name of members) {\n\t\tconst schema = singletonSchema(factory, name);\n\t\tschemaArray.push(schema);\n\t\tObject.defineProperty(out, name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\twritable: false,\n\t\t\tvalue: schema,\n\t\t});\n\t}\n\n\tObject.defineProperty(out, \"schema\", {\n\t\tenumerable: true,\n\t\tconfigurable: false,\n\t\twritable: false,\n\t\tvalue: schemaArray,\n\t});\n\n\treturn out;\n}\n\n// TODO: This generates an invalid d.ts file if exported due to a bug https://github.com/microsoft/TypeScript/issues/58688.\n// TODO: replace enumFromStrings above with this simpler implementation when the TypeScript bug is resolved.\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nfunction _enumFromStrings2<TScope extends string, const Members extends readonly string[]>(\n\tfactory: SchemaFactory<TScope>,\n\tmembers: Members,\n) {\n\tconst enumObject: {\n\t\t[key in keyof Members as Members[key] extends string\n\t\t\t? Members[key]\n\t\t\t: string]: Members[key] extends string ? Members[key] : string;\n\t} = Object.create(null);\n\tfor (const name of members) {\n\t\tObject.defineProperty(enumObject, name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\twritable: false,\n\t\t\tvalue: name,\n\t\t});\n\t}\n\n\treturn adaptEnum(factory, enumObject);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"schemaCreationUtilities.js","sourceRoot":"","sources":["../../../src/simple-tree/api/schemaCreationUtilities.ts"],"names":[],"mappings":"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","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { fail } from \"@fluidframework/core-utils/internal\";\n\nimport type { SchemaFactory, ScopedSchemaName } from \"./schemaFactory.js\";\nimport type { NodeFromSchema } from \"../schemaTypes.js\";\nimport type {\n\tInternalTreeNode,\n\tNodeKind,\n\tTreeNode,\n\tTreeNodeSchema,\n\tTreeNodeSchemaClass,\n} from \"../core/index.js\";\nimport type { UnionToTuple } from \"../../util/index.js\";\n\n/*\n * This file does two things:\n *\n * 1. Provides tools for making schema for cases like enums.\n *\n * 2. Demonstrates the kinds of schema utilities apps can write.\n * Nothing in here needs access to package internal APIs.\n */\n\n/**\n * Create a schema for a node with no state.\n * @remarks\n * This is commonly used in unions when the only information needed is which kind of node the value is.\n * Enums are a common example of this pattern.\n * @see {@link adaptEnum}\n * @alpha\n */\n// Return type is intentionally derived.\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function singletonSchema<TScope extends string, TName extends string | number>(\n\tfactory: SchemaFactory<TScope, TName>,\n\tname: TName,\n) {\n\tclass SingletonSchema extends factory.object(name, {}) {\n\t\tpublic constructor(data?: InternalTreeNode | Record<string, never>) {\n\t\t\tsuper(data ?? {});\n\t\t}\n\t\tpublic get value(): TName {\n\t\t\treturn name;\n\t\t}\n\t}\n\n\ttype SingletonNodeType = TreeNode & { readonly value: TName };\n\n\t// Returning SingletonSchema without a type conversion results in TypeScript generating something like `readonly \"__#124291@#brand\": unknown;`\n\t// for the private brand field of TreeNode.\n\t// This numeric id doesn't seem to be stable over incremental builds, and thus causes diffs in the API extractor reports.\n\t// This is avoided by doing this type conversion.\n\t// The conversion is done via assignment instead of `as` to get stronger type safety.\n\tconst toReturn: TreeNodeSchemaClass<\n\t\tScopedSchemaName<TScope, TName>,\n\t\tNodeKind.Object,\n\t\tSingletonNodeType,\n\t\tRecord<string, never>,\n\t\ttrue,\n\t\tRecord<string, never>,\n\t\tundefined\n\t> = SingletonSchema;\n\n\treturn toReturn;\n}\n\n/**\n * Converts an enum into a collection of schema which can be used in a union.\n * @remarks\n * The string value of the enum is used as the name of the schema: callers must ensure that it is stable and unique.\n * Numeric enums values have the value implicitly converted into a string.\n * Consider making a dedicated schema factory with a nested scope to avoid the enum members colliding with other schema.\n * @example\n * ```typescript\n * const schemaFactory = new SchemaFactory(\"com.myApp\");\n * // An enum for use in the tree. Must have string keys.\n * enum Mode {\n * \ta = \"A\",\n * \tb = \"B\",\n * }\n * // Define the schema for each member of the enum using a nested scope to group them together.\n * const ModeNodes = adaptEnum(new SchemaFactory(`${schemaFactory.scope}.Mode`), Mode);\n * // Defined the types of the nodes which correspond to this the schema.\n * type ModeNodes = TreeNodeFromImplicitAllowedTypes<(typeof ModeNodes.schema)>;\n * // An example schema which has an enum as a child.\n * class Parent extends schemaFactory.object(\"Parent\", {\n * \t// adaptEnum's return value has a \".schema\" property can be use as an `AllowedTypes` array allowing any of the members of the enum.\n * \tmode: ModeNodes.schema,\n * }) {}\n *\n * // Example usage of enum based nodes, showing what type to use and that `.value` can be used to read out the enum value.\n * function getValue(node: ModeNodes): Mode {\n * \treturn node.value;\n * }\n *\n * // Example constructing a tree containing an enum node from an enum value.\n * // The syntax `new ModeNodes.a()` is also supported.\n * function setValue(node: Parent): void {\n * \tnode.mode = ModeNodes(Mode.a);\n * }\n * ```\n * @privateRemarks\n * Maybe provide `SchemaFactory.nested` to ease creating nested scopes?\n * @see {@link enumFromStrings} for a similar function that works on arrays of strings instead of an enum.\n * @alpha\n */\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function adaptEnum<\n\tTScope extends string,\n\tconst TEnum extends Record<string, string | number>,\n>(factory: SchemaFactory<TScope>, members: TEnum) {\n\ttype Values = TEnum[keyof TEnum];\n\tconst values = Object.values(members) as Values[];\n\tconst inverse = new Map(Object.entries(members).map(([key, value]) => [value, key])) as Map<\n\t\tValues,\n\t\tkeyof TEnum\n\t>;\n\n\tif (inverse.size !== values.length) {\n\t\tthrow new UsageError(\"All members of enums must have distinct values.\");\n\t}\n\n\ttype TOut = {\n\t\treadonly [Property in keyof TEnum]: ReturnType<\n\t\t\ttypeof singletonSchema<TScope, TEnum[Property]>\n\t\t>;\n\t};\n\n\ttype SchemaArray = UnionToTuple<TOut[keyof TEnum]>;\n\tconst schemaArray: TreeNodeSchema[] = [];\n\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n\tconst factoryOut = <TValue extends Values>(value: TValue) => {\n\t\treturn new out[\n\t\t\tinverse.get(value) ?? fail(0xb31 /* missing enum value */)\n\t\t\t// \"extends unknown\" is required here to handle when TValue is an union: each member of the union should be processed independently.\n\t\t]() as TValue extends unknown\n\t\t\t? NodeFromSchema<ReturnType<typeof singletonSchema<TScope, TValue>>>\n\t\t\t: never;\n\t};\n\tconst out = factoryOut as typeof factoryOut & TOut & { readonly schema: SchemaArray };\n\tfor (const [key, value] of Object.entries(members)) {\n\t\tconst schema = singletonSchema(factory, value);\n\t\tschemaArray.push(schema);\n\t\tObject.defineProperty(out, key, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\twritable: false,\n\t\t\tvalue: schema,\n\t\t});\n\t}\n\n\tObject.defineProperty(out, \"schema\", {\n\t\tenumerable: true,\n\t\tconfigurable: false,\n\t\twritable: false,\n\t\tvalue: schemaArray,\n\t});\n\n\treturn out;\n}\n\n/**\n * Converts an array of distinct strings into a collection of schema which can be used like an enum style union.\n * @remarks\n * The returned collection is also a function which can be used to convert strings into {@link Unhydrated} nodes in the union.\n * Each node type has a `.value` getter which returns the associated string.\n *\n * The produced nodes use the provided strings as their `name`, and don't store any data beyond that.\n * @example\n * ```typescript\n * const schemaFactory = new SchemaFactory(\"com.myApp\");\n * const Mode = enumFromStrings(schemaFactory, [\"Fun\", \"Cool\"]);\n * type Mode = TreeNodeFromImplicitAllowedTypes<typeof Mode.schema>;\n * const nodeFromString: Mode = Mode(\"Fun\");\n * const nodeFromSchema: Mode = new Mode.Fun();\n *\n * // Schema nodes have a strongly typed `.value` property.\n * const nameFromNode: \"Fun\" | \"Cool\" = nodeFromSchema.value;\n *\n * class Parent extends schemaFactory.object(\"Parent\", { mode: Mode.schema }) {}\n * ```\n * @see {@link adaptEnum} for a similar function that works on enums instead of arrays of strings.\n * @alpha\n */\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function enumFromStrings<\n\tTScope extends string,\n\tconst Members extends readonly string[],\n>(factory: SchemaFactory<TScope>, members: Members) {\n\tconst names = new Set(members);\n\tif (names.size !== members.length) {\n\t\tthrow new UsageError(\"All members of enums must have distinct names\");\n\t}\n\n\ttype MembersUnion = Members[number];\n\n\t// Get all keys of the Members tuple which are numeric strings as union of numbers:\n\ttype Indexes = Extract<keyof Members, `${number}`> extends `${infer N extends number}`\n\t\t? N\n\t\t: never;\n\n\ttype TOut = {\n\t\t[Index in Indexes as Members[Index]]: ReturnType<\n\t\t\ttypeof singletonSchema<TScope, Members[Index] & string>\n\t\t>;\n\t};\n\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n\tconst factoryOut = <TValue extends MembersUnion>(value: TValue) => {\n\t\t// \"extends unknown\" is required here to handle when TValue is an union: each member of the union should be processed independently.\n\t\treturn new recordOut[value]() as TValue extends unknown\n\t\t\t? NodeFromSchema<ReturnType<typeof singletonSchema<TScope, TValue>>>\n\t\t\t: never;\n\t};\n\n\ttype SchemaArray = UnionToTuple<MembersUnion extends unknown ? TOut[MembersUnion] : never>;\n\tconst schemaArray: TreeNodeSchema[] = [];\n\n\tconst out = factoryOut as typeof factoryOut & TOut & { readonly schema: SchemaArray };\n\tconst recordOut = out as Record<MembersUnion, new () => unknown>;\n\tfor (const name of members) {\n\t\tconst schema = singletonSchema(factory, name);\n\t\tschemaArray.push(schema);\n\t\tObject.defineProperty(out, name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\twritable: false,\n\t\t\tvalue: schema,\n\t\t});\n\t}\n\n\tObject.defineProperty(out, \"schema\", {\n\t\tenumerable: true,\n\t\tconfigurable: false,\n\t\twritable: false,\n\t\tvalue: schemaArray,\n\t});\n\n\treturn out;\n}\n\n// TODO: This generates an invalid d.ts file if exported due to a bug https://github.com/microsoft/TypeScript/issues/58688.\n// TODO: replace enumFromStrings above with this simpler implementation when the TypeScript bug is resolved.\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nfunction _enumFromStrings2<TScope extends string, const Members extends readonly string[]>(\n\tfactory: SchemaFactory<TScope>,\n\tmembers: Members,\n) {\n\tconst enumObject: {\n\t\t[key in keyof Members as Members[key] extends string\n\t\t\t? Members[key]\n\t\t\t: string]: Members[key] extends string ? Members[key] : string;\n\t} = Object.create(null);\n\tfor (const name of members) {\n\t\tObject.defineProperty(enumObject, name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\twritable: false,\n\t\t\tvalue: name,\n\t\t});\n\t}\n\n\treturn adaptEnum(factory, enumObject);\n}\n"]}
|
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import type { IFluidHandle
|
|
5
|
+
import type { IFluidHandle } from "@fluidframework/core-interfaces";
|
|
6
6
|
import type { TreeValue } from "../../core/index.js";
|
|
7
7
|
import { type RestrictiveStringRecord } from "../../util/index.js";
|
|
8
|
-
import {
|
|
8
|
+
import { stringSchema, type LeafSchema } from "../leafNodeSchema.js";
|
|
9
|
+
import { FieldKind, type FieldSchema, type ImplicitAllowedTypes, type ImplicitFieldSchema, type InsertableTreeNodeFromImplicitAllowedTypes, type FieldProps, type NodeSchemaOptions, type FieldSchemaAlpha } from "../schemaTypes.js";
|
|
9
10
|
import type { NodeKind, WithType, TreeNodeSchema, TreeNodeSchemaClass, TreeNodeSchemaNonClass } from "../core/index.js";
|
|
10
11
|
import { type TreeArrayNode } from "../arrayNode.js";
|
|
11
12
|
import { type InsertableObjectFromSchemaRecord, type TreeObjectNode } from "../objectNode.js";
|
|
12
13
|
import { type MapNodeInsertableData, type TreeMapNode } from "../mapNode.js";
|
|
13
|
-
import type { FieldSchemaUnsafe, InsertableObjectFromSchemaRecordUnsafe, InsertableTreeNodeFromImplicitAllowedTypesUnsafe, TreeArrayNodeUnsafe, TreeMapNodeUnsafe, TreeObjectNodeUnsafe,
|
|
14
|
+
import type { FieldSchemaUnsafe, InsertableObjectFromSchemaRecordUnsafe, InsertableTreeNodeFromImplicitAllowedTypesUnsafe, TreeArrayNodeUnsafe, TreeMapNodeUnsafe, TreeObjectNodeUnsafe, ImplicitAllowedTypesUnsafe, ImplicitFieldSchemaUnsafe, FieldSchemaAlphaUnsafe } from "./typesUnsafe.js";
|
|
14
15
|
/**
|
|
15
16
|
* Gets the leaf domain schema compatible with a given {@link TreeValue}.
|
|
16
17
|
*/
|
|
@@ -57,7 +58,7 @@ export interface SchemaFactoryObjectOptions<TCustomMetadata = unknown> extends N
|
|
|
57
58
|
* ```
|
|
58
59
|
*
|
|
59
60
|
* If an application wants to be particularly careful to preserve all data on a node when editing it, it can use
|
|
60
|
-
* {@link TreeAlpha.
|
|
61
|
+
* {@link TreeAlpha.importVerbose|import}/{@link TreeAlpha.exportVerbose|export} APIs with persistent keys.
|
|
61
62
|
*
|
|
62
63
|
* Note that public API methods which operate on entire nodes (such as `moveTo`, `moveToEnd`, etc. on arrays) do not encounter
|
|
63
64
|
* this problem as SharedTree's implementation stores the entire node in its lower layers. It's only when application code
|
|
@@ -79,7 +80,7 @@ export type ScopedSchemaName<TScope extends string | undefined, TName extends nu
|
|
|
79
80
|
* As a workaround, we have this type as a third place which can be linked.
|
|
80
81
|
* @system @sealed @public
|
|
81
82
|
*/
|
|
82
|
-
export
|
|
83
|
+
export interface SchemaStatics {
|
|
83
84
|
/**
|
|
84
85
|
* {@link TreeNodeSchema} for holding a JavaScript `string`.
|
|
85
86
|
*
|
|
@@ -93,7 +94,7 @@ export declare const schemaStatics: {
|
|
|
93
94
|
* We should be much more clear about what happens if you use problematic values.
|
|
94
95
|
* We should validate and/or normalize them when inserting content.
|
|
95
96
|
*/
|
|
96
|
-
readonly string:
|
|
97
|
+
readonly string: LeafSchema<"string", string>;
|
|
97
98
|
/**
|
|
98
99
|
* {@link TreeNodeSchema} for holding a JavaScript `number`.
|
|
99
100
|
*
|
|
@@ -108,11 +109,11 @@ export declare const schemaStatics: {
|
|
|
108
109
|
* We should be much more clear about what happens if you use problematic values.
|
|
109
110
|
* We should validate and/or normalize them when inserting content.
|
|
110
111
|
*/
|
|
111
|
-
readonly number:
|
|
112
|
+
readonly number: LeafSchema<"number", number>;
|
|
112
113
|
/**
|
|
113
114
|
* {@link TreeNodeSchema} for holding a boolean.
|
|
114
115
|
*/
|
|
115
|
-
readonly boolean:
|
|
116
|
+
readonly boolean: LeafSchema<"boolean", boolean>;
|
|
116
117
|
/**
|
|
117
118
|
* {@link TreeNodeSchema} for JavaScript `null`.
|
|
118
119
|
*
|
|
@@ -121,15 +122,21 @@ export declare const schemaStatics: {
|
|
|
121
122
|
* This {@link TreeNodeSchema} node provides the option to include nulls in trees when desired.
|
|
122
123
|
* Unless directly inter-operating with existing data using null, consider other approaches, like wrapping the value in an optional field, or using a more specifically named empty object node.
|
|
123
124
|
*/
|
|
124
|
-
readonly null:
|
|
125
|
+
readonly null: LeafSchema<"null", null>;
|
|
125
126
|
/**
|
|
126
127
|
* {@link TreeNodeSchema} for holding an {@link @fluidframework/core-interfaces#(IFluidHandle:interface)}.
|
|
127
128
|
*/
|
|
128
|
-
readonly handle:
|
|
129
|
+
readonly handle: LeafSchema<"handle", IFluidHandle>;
|
|
129
130
|
/**
|
|
130
131
|
* {@link AllowedTypes} for holding any of the leaf types.
|
|
131
132
|
*/
|
|
132
|
-
readonly leaves: readonly [
|
|
133
|
+
readonly leaves: readonly [
|
|
134
|
+
SchemaStatics["string"],
|
|
135
|
+
SchemaStatics["number"],
|
|
136
|
+
SchemaStatics["boolean"],
|
|
137
|
+
SchemaStatics["null"],
|
|
138
|
+
SchemaStatics["handle"]
|
|
139
|
+
];
|
|
133
140
|
/**
|
|
134
141
|
* Make a field optional instead of the default, which is required.
|
|
135
142
|
*
|
|
@@ -153,23 +160,57 @@ export declare const schemaStatics: {
|
|
|
153
160
|
* @typeParam TCustomMetadata - Custom metadata properties to associate with the field.
|
|
154
161
|
* See {@link FieldSchemaMetadata.custom}.
|
|
155
162
|
*/
|
|
156
|
-
readonly required: <const
|
|
163
|
+
readonly required: <const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">) => FieldSchema<FieldKind.Required, T, TCustomMetadata>;
|
|
157
164
|
/**
|
|
158
|
-
* {@link
|
|
165
|
+
* {@link SchemaStatics.optional} except tweaked to work better for recursive types.
|
|
159
166
|
* Use with {@link ValidateRecursiveSchema} for improved type safety.
|
|
160
167
|
* @remarks
|
|
161
|
-
* This version of {@link
|
|
168
|
+
* This version of {@link SchemaStatics.optional} has fewer type constraints to work around TypeScript limitations, see {@link Unenforced}.
|
|
162
169
|
* See {@link ValidateRecursiveSchema} for additional information about using recursive schema.
|
|
163
170
|
*/
|
|
164
|
-
readonly optionalRecursive: <const
|
|
171
|
+
readonly optionalRecursive: <const T extends ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">) => FieldSchemaUnsafe<FieldKind.Optional, T, TCustomMetadata>;
|
|
165
172
|
/**
|
|
166
|
-
* {@link
|
|
173
|
+
* {@link SchemaStatics.required} except tweaked to work better for recursive types.
|
|
167
174
|
* Use with {@link ValidateRecursiveSchema} for improved type safety.
|
|
168
175
|
* @remarks
|
|
169
|
-
* This version of {@link
|
|
176
|
+
* This version of {@link SchemaStatics.required} has fewer type constraints to work around TypeScript limitations, see {@link Unenforced}.
|
|
170
177
|
* See {@link ValidateRecursiveSchema} for additional information about using recursive schema.
|
|
171
178
|
*/
|
|
172
|
-
readonly requiredRecursive: <const
|
|
179
|
+
readonly requiredRecursive: <const T extends ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">) => FieldSchemaUnsafe<FieldKind.Required, T, TCustomMetadata>;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Implementation of {@link SchemaStatics}.
|
|
183
|
+
* @remarks
|
|
184
|
+
* Entries can use more specific types than {@link SchemaStatics} requires to be more useful for non-public consumers.
|
|
185
|
+
* Additional non-public members are in {@link schemaStatics}.
|
|
186
|
+
*/
|
|
187
|
+
export declare const schemaStaticsBase: {
|
|
188
|
+
readonly string: LeafSchema<"string", string> & import("../simpleSchema.js").SimpleLeafNodeSchema;
|
|
189
|
+
readonly number: LeafSchema<"number", number> & import("../simpleSchema.js").SimpleLeafNodeSchema;
|
|
190
|
+
readonly boolean: LeafSchema<"boolean", boolean> & import("../simpleSchema.js").SimpleLeafNodeSchema;
|
|
191
|
+
readonly null: LeafSchema<"null", null> & import("../simpleSchema.js").SimpleLeafNodeSchema;
|
|
192
|
+
readonly handle: LeafSchema<"handle", IFluidHandle<unknown>> & import("../simpleSchema.js").SimpleLeafNodeSchema;
|
|
193
|
+
readonly leaves: readonly [LeafSchema<"string", string> & import("../simpleSchema.js").SimpleLeafNodeSchema, LeafSchema<"number", number> & import("../simpleSchema.js").SimpleLeafNodeSchema, LeafSchema<"boolean", boolean> & import("../simpleSchema.js").SimpleLeafNodeSchema, LeafSchema<"null", null> & import("../simpleSchema.js").SimpleLeafNodeSchema, LeafSchema<"handle", IFluidHandle<unknown>> & import("../simpleSchema.js").SimpleLeafNodeSchema];
|
|
194
|
+
readonly optional: <const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">) => FieldSchemaAlpha<FieldKind.Optional, T, TCustomMetadata>;
|
|
195
|
+
readonly required: <const T_1 extends ImplicitAllowedTypes, const TCustomMetadata_1 = unknown>(t: T_1, props?: Omit<FieldProps<TCustomMetadata_1>, "defaultProvider"> | undefined) => FieldSchemaAlpha<FieldKind.Required, T_1, TCustomMetadata_1>;
|
|
196
|
+
readonly optionalRecursive: <const T_2 extends ImplicitAllowedTypesUnsafe, const TCustomMetadata_2 = unknown>(t: T_2, props?: Omit<FieldProps<TCustomMetadata_2>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe<FieldKind.Optional, T_2, TCustomMetadata_2>;
|
|
197
|
+
readonly requiredRecursive: <const T_3 extends ImplicitAllowedTypesUnsafe, const TCustomMetadata_3 = unknown>(t: T_3, props?: Omit<FieldProps<TCustomMetadata_3>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe<FieldKind.Required, T_3, TCustomMetadata_3>;
|
|
198
|
+
};
|
|
199
|
+
/**
|
|
200
|
+
* Unstable extensions to {@link schemaStaticsBase}.
|
|
201
|
+
*/
|
|
202
|
+
export declare const schemaStatics: {
|
|
203
|
+
readonly identifier: <const TCustomMetadata = unknown>(props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">) => FieldSchemaAlpha<FieldKind.Identifier, typeof stringSchema, TCustomMetadata>;
|
|
204
|
+
readonly string: LeafSchema<"string", string> & import("../simpleSchema.js").SimpleLeafNodeSchema;
|
|
205
|
+
readonly number: LeafSchema<"number", number> & import("../simpleSchema.js").SimpleLeafNodeSchema;
|
|
206
|
+
readonly boolean: LeafSchema<"boolean", boolean> & import("../simpleSchema.js").SimpleLeafNodeSchema;
|
|
207
|
+
readonly null: LeafSchema<"null", null> & import("../simpleSchema.js").SimpleLeafNodeSchema;
|
|
208
|
+
readonly handle: LeafSchema<"handle", IFluidHandle<unknown>> & import("../simpleSchema.js").SimpleLeafNodeSchema;
|
|
209
|
+
readonly leaves: readonly [LeafSchema<"string", string> & import("../simpleSchema.js").SimpleLeafNodeSchema, LeafSchema<"number", number> & import("../simpleSchema.js").SimpleLeafNodeSchema, LeafSchema<"boolean", boolean> & import("../simpleSchema.js").SimpleLeafNodeSchema, LeafSchema<"null", null> & import("../simpleSchema.js").SimpleLeafNodeSchema, LeafSchema<"handle", IFluidHandle<unknown>> & import("../simpleSchema.js").SimpleLeafNodeSchema];
|
|
210
|
+
readonly optional: <const T extends ImplicitAllowedTypes, const TCustomMetadata_1 = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata_1>, "defaultProvider"> | undefined) => FieldSchemaAlpha<FieldKind.Optional, T, TCustomMetadata_1>;
|
|
211
|
+
readonly required: <const T_1 extends ImplicitAllowedTypes, const TCustomMetadata_2 = unknown>(t: T_1, props?: Omit<FieldProps<TCustomMetadata_2>, "defaultProvider"> | undefined) => FieldSchemaAlpha<FieldKind.Required, T_1, TCustomMetadata_2>;
|
|
212
|
+
readonly optionalRecursive: <const T_2 extends ImplicitAllowedTypesUnsafe, const TCustomMetadata_3 = unknown>(t: T_2, props?: Omit<FieldProps<TCustomMetadata_3>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe<FieldKind.Optional, T_2, TCustomMetadata_3>;
|
|
213
|
+
readonly requiredRecursive: <const T_3 extends ImplicitAllowedTypesUnsafe, const TCustomMetadata_4 = unknown>(t: T_3, props?: Omit<FieldProps<TCustomMetadata_4>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe<FieldKind.Required, T_3, TCustomMetadata_4>;
|
|
173
214
|
};
|
|
174
215
|
/**
|
|
175
216
|
* Creates various types of {@link TreeNodeSchema|schema} for {@link TreeNode}s.
|
|
@@ -190,6 +231,17 @@ export declare const schemaStatics: {
|
|
|
190
231
|
* On the other hand, two calls to `array(name, allowedTypes)` will always return different {@link TreeNodeSchema} instances
|
|
191
232
|
* and it is an error to use both in the same tree (since their identifiers are not unique).
|
|
192
233
|
*
|
|
234
|
+
* For "customizable" schema (those which can be subclassed to customize them, see details below) some additional rules must be followed:
|
|
235
|
+
*
|
|
236
|
+
* 1. Only a single {@link TreeNodeSchema|schema} can be used from the class hierarchy deriving from the base class produced by this factory.
|
|
237
|
+
* It is legal to subclass the returned class, and even subclass that class,
|
|
238
|
+
* but only a single class from that class hierarchy can ever be instantiated or passed to any API as a {@link TreeNodeSchema|schema}.
|
|
239
|
+
* These base classes can be used with `instanceof`, but not with schema based APIs like `Tree.is`.
|
|
240
|
+
* 2. If overriding the constructor, the constructor must accept the same argument as the base constructor `super` and forward it to `super` unchanged.
|
|
241
|
+
* 3. Properties for fields defined in the schema should not be overridden.
|
|
242
|
+
* 4. Additional static members added to schema should pick relatively unique keys to reduce the risk of colliding with implementation details what are not exposed in the API.
|
|
243
|
+
* 5. If exporting the schema from a package which uses API-Extractor, export the base class and derived class separately to work around [a known limitation](https://github.com/microsoft/rushstack/issues/4429).
|
|
244
|
+
*
|
|
193
245
|
* Note:
|
|
194
246
|
* POJO stands for Plain Old JavaScript Object.
|
|
195
247
|
* This means an object that works like a `{}` style object literal.
|
|
@@ -236,7 +288,8 @@ export declare const schemaStatics: {
|
|
|
236
288
|
*
|
|
237
289
|
* 8. IntelliSense: Shows internal type generation logic: `object & TreeNode & ObjectFromSchemaRecord<{}> & WithType<"test.x">`.
|
|
238
290
|
*
|
|
239
|
-
* 9. Recursion: Unsupported: Generated `.d.ts` files replace recursive references with `any
|
|
291
|
+
* 9. Recursion: Unsupported: [Generated `.d.ts` files replace recursive references with `any`](https://github.com/microsoft/TypeScript/issues/55832),
|
|
292
|
+
* breaking the use of recursive schema across compilation boundaries.
|
|
240
293
|
*
|
|
241
294
|
* Note that while "POJO Emulation" nodes act a lot like POJO objects, they are not true POJO objects:
|
|
242
295
|
*
|
|
@@ -263,7 +316,7 @@ export declare const schemaStatics: {
|
|
|
263
316
|
*
|
|
264
317
|
* @sealed @public
|
|
265
318
|
*/
|
|
266
|
-
export declare class SchemaFactory<out TScope extends string | undefined = string | undefined, TName extends number | string = string> {
|
|
319
|
+
export declare class SchemaFactory<out TScope extends string | undefined = string | undefined, TName extends number | string = string> implements SchemaStatics {
|
|
267
320
|
/**
|
|
268
321
|
* Prefix appended to the identifiers of all {@link TreeNodeSchema} produced by this builder.
|
|
269
322
|
*
|
|
@@ -345,53 +398,53 @@ export declare class SchemaFactory<out TScope extends string | undefined = strin
|
|
|
345
398
|
scope: TScope);
|
|
346
399
|
private scoped;
|
|
347
400
|
/**
|
|
348
|
-
* {@inheritDoc
|
|
401
|
+
* {@inheritDoc SchemaStatics.string}
|
|
349
402
|
*/
|
|
350
|
-
readonly string:
|
|
403
|
+
readonly string: LeafSchema<"string", string>;
|
|
351
404
|
/**
|
|
352
|
-
* {@inheritDoc
|
|
405
|
+
* {@inheritDoc SchemaStatics.number}
|
|
353
406
|
*/
|
|
354
|
-
readonly number:
|
|
407
|
+
readonly number: LeafSchema<"number", number>;
|
|
355
408
|
/**
|
|
356
|
-
* {@inheritDoc
|
|
409
|
+
* {@inheritDoc SchemaStatics.boolean}
|
|
357
410
|
*/
|
|
358
|
-
readonly boolean:
|
|
411
|
+
readonly boolean: LeafSchema<"boolean", boolean>;
|
|
359
412
|
/**
|
|
360
|
-
* {@inheritDoc
|
|
413
|
+
* {@inheritDoc SchemaStatics.null}
|
|
361
414
|
*/
|
|
362
|
-
readonly null:
|
|
415
|
+
readonly null: LeafSchema<"null", null>;
|
|
363
416
|
/**
|
|
364
|
-
* {@inheritDoc
|
|
417
|
+
* {@inheritDoc SchemaStatics.handle}
|
|
365
418
|
*/
|
|
366
|
-
readonly handle:
|
|
419
|
+
readonly handle: LeafSchema<"handle", IFluidHandle<unknown>>;
|
|
367
420
|
/**
|
|
368
|
-
* {@inheritDoc
|
|
421
|
+
* {@inheritDoc SchemaStatics.leaves}
|
|
369
422
|
*/
|
|
370
|
-
readonly leaves: readonly [
|
|
423
|
+
readonly leaves: readonly [LeafSchema<"string", string>, LeafSchema<"number", number>, LeafSchema<"boolean", boolean>, LeafSchema<"null", null>, LeafSchema<"handle", IFluidHandle<unknown>>];
|
|
371
424
|
/**
|
|
372
|
-
* {@inheritDoc
|
|
425
|
+
* {@inheritDoc SchemaStatics.string}
|
|
373
426
|
*/
|
|
374
|
-
static readonly string:
|
|
427
|
+
static readonly string: LeafSchema<"string", string>;
|
|
375
428
|
/**
|
|
376
|
-
* {@inheritDoc
|
|
429
|
+
* {@inheritDoc SchemaStatics.number}
|
|
377
430
|
*/
|
|
378
|
-
static readonly number:
|
|
431
|
+
static readonly number: LeafSchema<"number", number>;
|
|
379
432
|
/**
|
|
380
|
-
* {@inheritDoc
|
|
433
|
+
* {@inheritDoc SchemaStatics.boolean}
|
|
381
434
|
*/
|
|
382
|
-
static readonly boolean:
|
|
435
|
+
static readonly boolean: LeafSchema<"boolean", boolean>;
|
|
383
436
|
/**
|
|
384
|
-
* {@inheritDoc
|
|
437
|
+
* {@inheritDoc SchemaStatics.null}
|
|
385
438
|
*/
|
|
386
|
-
static readonly null:
|
|
439
|
+
static readonly null: LeafSchema<"null", null>;
|
|
387
440
|
/**
|
|
388
|
-
* {@inheritDoc
|
|
441
|
+
* {@inheritDoc SchemaStatics.handle}
|
|
389
442
|
*/
|
|
390
|
-
static readonly handle:
|
|
443
|
+
static readonly handle: LeafSchema<"handle", IFluidHandle<unknown>>;
|
|
391
444
|
/**
|
|
392
|
-
* {@inheritDoc
|
|
445
|
+
* {@inheritDoc SchemaStatics.leaves}
|
|
393
446
|
*/
|
|
394
|
-
static readonly leaves: readonly [
|
|
447
|
+
static readonly leaves: readonly [LeafSchema<"string", string>, LeafSchema<"number", number>, LeafSchema<"boolean", boolean>, LeafSchema<"null", null>, LeafSchema<"handle", IFluidHandle<unknown>>];
|
|
395
448
|
/**
|
|
396
449
|
* Define a {@link TreeNodeSchemaClass} for a {@link TreeObjectNode}.
|
|
397
450
|
*
|
|
@@ -504,37 +557,37 @@ export declare class SchemaFactory<out TScope extends string | undefined = strin
|
|
|
504
557
|
*/
|
|
505
558
|
private namedArray;
|
|
506
559
|
/**
|
|
507
|
-
* {@inheritDoc
|
|
560
|
+
* {@inheritDoc SchemaStatics.optional}
|
|
508
561
|
*/
|
|
509
562
|
readonly optional: <const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchema<FieldKind.Optional, T, TCustomMetadata>;
|
|
510
563
|
/**
|
|
511
|
-
* {@inheritDoc
|
|
564
|
+
* {@inheritDoc SchemaStatics.required}
|
|
512
565
|
*/
|
|
513
566
|
readonly required: <const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchema<FieldKind.Required, T, TCustomMetadata>;
|
|
514
567
|
/**
|
|
515
|
-
* {@inheritDoc
|
|
568
|
+
* {@inheritDoc SchemaStatics.optionalRecursive}
|
|
516
569
|
*/
|
|
517
|
-
readonly optionalRecursive: <const T extends unknown>(t: T, props?: Omit<FieldProps<
|
|
570
|
+
readonly optionalRecursive: <const T extends ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaUnsafe<FieldKind.Optional, T, TCustomMetadata>;
|
|
518
571
|
/**
|
|
519
|
-
* {@inheritDoc
|
|
572
|
+
* {@inheritDoc SchemaStatics.requiredRecursive}
|
|
520
573
|
*/
|
|
521
|
-
readonly requiredRecursive: <const T extends unknown>(t: T, props?: Omit<FieldProps<
|
|
574
|
+
readonly requiredRecursive: <const T extends ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaUnsafe<FieldKind.Required, T, TCustomMetadata>;
|
|
522
575
|
/**
|
|
523
|
-
* {@inheritDoc
|
|
576
|
+
* {@inheritDoc SchemaStatics.optional}
|
|
524
577
|
*/
|
|
525
578
|
static readonly optional: <const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchema<FieldKind.Optional, T, TCustomMetadata>;
|
|
526
579
|
/**
|
|
527
|
-
* {@inheritDoc
|
|
580
|
+
* {@inheritDoc SchemaStatics.required}
|
|
528
581
|
*/
|
|
529
582
|
static readonly required: <const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchema<FieldKind.Required, T, TCustomMetadata>;
|
|
530
583
|
/**
|
|
531
|
-
* {@inheritDoc
|
|
584
|
+
* {@inheritDoc SchemaStatics.optionalRecursive}
|
|
532
585
|
*/
|
|
533
|
-
static readonly optionalRecursive: <const T extends unknown>(t: T, props?: Omit<FieldProps<
|
|
586
|
+
static readonly optionalRecursive: <const T extends ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaUnsafe<FieldKind.Optional, T, TCustomMetadata>;
|
|
534
587
|
/**
|
|
535
|
-
* {@inheritDoc
|
|
588
|
+
* {@inheritDoc SchemaStatics.requiredRecursive}
|
|
536
589
|
*/
|
|
537
|
-
static readonly requiredRecursive: <const T extends unknown>(t: T, props?: Omit<FieldProps<
|
|
590
|
+
static readonly requiredRecursive: <const T extends ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaUnsafe<FieldKind.Required, T, TCustomMetadata>;
|
|
538
591
|
/**
|
|
539
592
|
* A special field which holds a unique identifier for an object node.
|
|
540
593
|
* @remarks
|
|
@@ -567,7 +620,7 @@ export declare class SchemaFactory<out TScope extends string | undefined = strin
|
|
|
567
620
|
* `error TS2589: Type instantiation is excessively deep and possibly infinite.`
|
|
568
621
|
* which otherwise gets reported at sometimes incorrect source locations that vary based on incremental builds.
|
|
569
622
|
*/
|
|
570
|
-
objectRecursive<const Name extends TName, const T extends
|
|
623
|
+
objectRecursive<const Name extends TName, const T extends RestrictiveStringRecord<ImplicitFieldSchemaUnsafe>>(name: Name, t: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>, object & InsertableObjectFromSchemaRecordUnsafe<T>, false, T>;
|
|
571
624
|
/**
|
|
572
625
|
* `SchemaFactory.array` except tweaked to work better for recursive types.
|
|
573
626
|
* Use with {@link ValidateRecursiveSchema} for improved type safety.
|
|
@@ -575,7 +628,7 @@ export declare class SchemaFactory<out TScope extends string | undefined = strin
|
|
|
575
628
|
* This version of `SchemaFactory.array` uses the same workarounds as {@link SchemaFactory.objectRecursive}.
|
|
576
629
|
* See {@link ValidateRecursiveSchema} for additional information about using recursive schema.
|
|
577
630
|
*/
|
|
578
|
-
arrayRecursive<const Name extends TName, const T extends
|
|
631
|
+
arrayRecursive<const Name extends TName, const T extends ImplicitAllowedTypesUnsafe>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Array, TreeArrayNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Array, unknown>, {
|
|
579
632
|
/**
|
|
580
633
|
* Iterator for the iterable of content for this node.
|
|
581
634
|
* @privateRemarks
|
|
@@ -596,7 +649,7 @@ export declare class SchemaFactory<out TScope extends string | undefined = strin
|
|
|
596
649
|
* This version of `SchemaFactory.map` uses the same workarounds as {@link SchemaFactory.objectRecursive}.
|
|
597
650
|
* See {@link ValidateRecursiveSchema} for additional information about using recursive schema.
|
|
598
651
|
*/
|
|
599
|
-
mapRecursive<Name extends TName, const T extends
|
|
652
|
+
mapRecursive<Name extends TName, const T extends ImplicitAllowedTypesUnsafe>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Map, TreeMapNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Map, unknown>, {
|
|
600
653
|
/**
|
|
601
654
|
* Iterator for the iterable of content for this node.
|
|
602
655
|
* @privateRemarks
|
|
@@ -617,12 +670,4 @@ export declare class SchemaFactory<out TScope extends string | undefined = strin
|
|
|
617
670
|
}, false, T, undefined>;
|
|
618
671
|
}
|
|
619
672
|
export declare function structuralName<const T extends string>(collectionName: T, allowedTypes: TreeNodeSchema | readonly TreeNodeSchema[]): `${T}<${string}>`;
|
|
620
|
-
/**
|
|
621
|
-
* Indicates that a schema is the "most derived" version which is allowed to be used, see {@link MostDerivedData}.
|
|
622
|
-
* Calling helps with error messages about invalid schema usage (using more than one type from single schema factor produced type,
|
|
623
|
-
* and thus calling this for one than one subclass).
|
|
624
|
-
* @remarks
|
|
625
|
-
* Helper for invoking {@link TreeNodeValid.markMostDerived} for any {@link TreeNodeSchema} if it needed.
|
|
626
|
-
*/
|
|
627
|
-
export declare function markSchemaMostDerived(schema: TreeNodeSchema): void;
|
|
628
673
|
//# sourceMappingURL=schemaFactory.d.ts.map
|