@fluidframework/tree 2.30.0 → 2.31.1
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 +1632 -1500
- package/api-extractor/api-extractor.current.json +0 -3
- package/api-report/tree.alpha.api.md +233 -88
- 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 +26 -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/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.map +1 -1
- package/dist/core/tree/anchorSet.js +4 -4
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/treeTextFormat.js +2 -2
- package/dist/core/tree/treeTextFormat.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.js +8 -8
- package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js +2 -2
- package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.js +3 -3
- 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/compressedEncode.js +3 -3
- 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/schemaBasedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +3 -4
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- 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.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.js +4 -4
- package/dist/feature-libraries/chunked-forest/uniformChunk.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/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/flex-tree/lazyField.js +3 -3
- 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/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/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.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +4 -4
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.js +1 -1
- package/dist/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.js +1 -1
- 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 +4 -5
- package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -4
- 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/schematizeTree.js +1 -1
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +16 -12
- 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 +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/treeApiAlpha.d.ts +6 -2
- package/dist/shared-tree/treeApiAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeApiAlpha.js +20 -17
- 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 +1 -1
- 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/customTree.js +3 -3
- 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 +3 -3
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +3 -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 +100 -58
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +65 -133
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +31 -23
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js +17 -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 +4 -4
- package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.js +26 -15
- package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
- 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 +1 -1
- package/dist/simple-tree/api/tree.d.ts.map +1 -1
- package/dist/simple-tree/api/tree.js +6 -6
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.js +3 -3
- package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.d.ts +87 -21
- 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.js +4 -4
- 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.js +5 -5
- package/dist/simple-tree/core/unhydratedFlexTree.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 +9 -1
- 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 +10 -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 +47 -6
- package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
- package/dist/simple-tree/schemaTypes.js +40 -4
- package/dist/simple-tree/schemaTypes.js.map +1 -1
- package/dist/simple-tree/{api/simpleSchema.d.ts → simpleSchema.d.ts} +54 -30
- package/dist/simple-tree/simpleSchema.d.ts.map +1 -0
- package/dist/simple-tree/simpleSchema.js.map +1 -0
- package/dist/simple-tree/toMapTree.js +3 -3
- package/dist/simple-tree/toMapTree.js.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +1 -1
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/simple-tree/treeNodeValid.d.ts.map +1 -1
- package/dist/simple-tree/treeNodeValid.js +4 -5
- 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/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 +1 -1
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +2 -3
- package/dist/util/index.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 +26 -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/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.map +1 -1
- package/lib/core/tree/anchorSet.js +2 -2
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/core/tree/treeTextFormat.js +1 -1
- package/lib/core/tree/treeTextFormat.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.js +2 -2
- package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js +2 -2
- package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.js +2 -2
- 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/compressedEncode.js +2 -2
- 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/schemaBasedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +1 -2
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- 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.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js +2 -2
- package/lib/feature-libraries/chunked-forest/uniformChunk.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/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/flex-tree/lazyField.js +2 -2
- 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/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/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.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +2 -2
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js +2 -2
- package/lib/feature-libraries/node-identifier/mockNodeIdentifierManager.js.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js +2 -2
- 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 +1 -2
- package/lib/feature-libraries/treeCursorUtils.js.map +1 -1
- package/lib/index.d.ts +4 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -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/schematizeTree.js +2 -2
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +14 -10
- 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 +2 -2
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/treeApiAlpha.d.ts +6 -2
- package/lib/shared-tree/treeApiAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeApiAlpha.js +10 -7
- 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 +2 -2
- 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/customTree.js +2 -2
- 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 +3 -3
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +1 -0
- 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 +100 -58
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +64 -132
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +31 -23
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js +18 -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 +4 -4
- package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.js +21 -10
- package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
- 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 +1 -1
- package/lib/simple-tree/api/tree.d.ts.map +1 -1
- package/lib/simple-tree/api/tree.js +2 -2
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.js +2 -2
- package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.d.ts +87 -21
- 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.js +2 -2
- 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.js +2 -2
- package/lib/simple-tree/core/unhydratedFlexTree.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 +3 -0
- 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 +10 -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 +47 -6
- package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
- package/lib/simple-tree/schemaTypes.js +37 -3
- package/lib/simple-tree/schemaTypes.js.map +1 -1
- package/lib/simple-tree/{api/simpleSchema.d.ts → simpleSchema.d.ts} +54 -30
- package/lib/simple-tree/simpleSchema.d.ts.map +1 -0
- package/lib/simple-tree/simpleSchema.js.map +1 -0
- package/lib/simple-tree/toMapTree.js +2 -2
- package/lib/simple-tree/toMapTree.js.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +2 -2
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/simple-tree/treeNodeValid.d.ts.map +1 -1
- package/lib/simple-tree/treeNodeValid.js +1 -2
- package/lib/simple-tree/treeNodeValid.js.map +1 -1
- package/lib/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/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 +1 -1
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +1 -1
- package/lib/util/index.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 +22 -25
- package/src/codec/codec.ts +2 -2
- package/src/codec/discriminatedUnions.ts +2 -2
- package/src/core/rebase/utils.ts +1 -1
- package/src/core/schema-stored/schema.ts +6 -2
- package/src/core/tree/anchorSet.ts +1 -2
- package/src/core/tree/treeTextFormat.ts +1 -1
- package/src/feature-libraries/chunked-forest/basicChunk.ts +2 -2
- package/src/feature-libraries/chunked-forest/chunkTree.ts +2 -2
- package/src/feature-libraries/chunked-forest/chunkedForest.ts +1 -2
- package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +1 -1
- package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +2 -2
- package/src/feature-libraries/chunked-forest/codec/nodeShape.ts +2 -2
- package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +1 -2
- package/src/feature-libraries/chunked-forest/emptyChunk.ts +1 -1
- package/src/feature-libraries/chunked-forest/uniformChunk.ts +2 -2
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +1 -1
- package/src/feature-libraries/default-schema/schemaChecker.ts +1 -2
- package/src/feature-libraries/flex-tree/lazyField.ts +2 -2
- package/src/feature-libraries/flex-tree/lazyNode.ts +2 -2
- package/src/feature-libraries/indexing/anchorTreeIndex.ts +2 -2
- 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 +1 -2
- package/src/feature-libraries/node-identifier/mockNodeIdentifierManager.ts +2 -2
- package/src/feature-libraries/object-forest/objectForest.ts +1 -2
- 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 +1 -2
- package/src/index.ts +26 -3
- package/src/jsonDomainSchema.ts +30 -11
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/schematizeTree.ts +2 -2
- package/src/shared-tree/sharedTree.ts +16 -10
- package/src/shared-tree/sharedTreeChangeFamily.ts +1 -2
- package/src/shared-tree/treeApiAlpha.ts +36 -13
- package/src/shared-tree/treeCheckout.ts +2 -8
- 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/customTree.ts +2 -2
- 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 +7 -11
- package/src/simple-tree/api/schemaCreationUtilities.ts +1 -2
- package/src/simple-tree/api/schemaFactory.ts +161 -86
- package/src/simple-tree/api/schemaFactoryAlpha.ts +62 -67
- package/src/simple-tree/api/schemaFactoryRecursive.ts +44 -12
- package/src/simple-tree/api/schemaFromSimple.ts +41 -13
- 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 +3 -3
- package/src/simple-tree/api/treeNodeApi.ts +2 -2
- package/src/simple-tree/api/typesUnsafe.ts +151 -33
- package/src/simple-tree/api/verboseTree.ts +2 -2
- 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 +2 -2
- package/src/simple-tree/index.ts +30 -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 +37 -13
- package/src/simple-tree/objectNodeTypes.ts +21 -16
- package/src/simple-tree/proxies.ts +2 -2
- package/src/simple-tree/schemaTypes.ts +83 -19
- package/src/simple-tree/{api/simpleSchema.ts → simpleSchema.ts} +61 -32
- package/src/simple-tree/toMapTree.ts +2 -2
- package/src/simple-tree/toStoredSchema.ts +2 -2
- package/src/simple-tree/treeNodeValid.ts +1 -2
- package/src/treeFactory.ts +1 -19
- package/src/util/idAllocator.ts +1 -3
- package/src/util/index.ts +0 -1
- package/src/util/typeCheck.ts +7 -0
- package/src/util/utils.ts +0 -3
- 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/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/simple-tree/core/schemaCaching.ts +0 -35
- /package/dist/simple-tree/{api/simpleSchema.js → simpleSchema.js} +0 -0
- /package/lib/simple-tree/{api/simpleSchema.js → simpleSchema.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/simple-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,QAAQ,EACR,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EAGrB,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,SAAS,GACT,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACN,KAAK,KAAK,EACV,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,qBAAqB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,aAAa,EACb,kBAAkB,EAClB,KAAK,0BAA0B,EAC/B,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,SAAS,EACT,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,yBAAyB,EACzB,4BAA4B,EAC5B,WAAW,EACX,KAAK,WAAW,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,KAAK,eAAe,EACpB,QAAQ,EACR,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/simple-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,QAAQ,EACR,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EAGrB,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,SAAS,GACT,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACN,KAAK,KAAK,EACV,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,qBAAqB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,aAAa,EACb,kBAAkB,EAClB,KAAK,0BAA0B,EAC/B,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,SAAS,EACT,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,yBAAyB,EACzB,4BAA4B,EAC5B,WAAW,EACX,KAAK,WAAW,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,KAAK,eAAe,EACpB,QAAQ,EACR,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,kBAAk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,EAAE,MAAM,qBAAqB,CAAC;AACzE,YAAY,EACX,yBAAyB,EACzB,0BAA0B,GAC1B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EACN,KAAK,eAAe,EACpB,KAAK,gCAAgC,EACrC,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,QAAQ,EACR,gCAAgC,GAChC,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,YAAY,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,EACN,mBAAmB,EACnB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,oBAAoB,GACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EACN,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,UAAU,GACV,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC"}
|
package/lib/simple-tree/index.js
CHANGED
|
@@ -7,7 +7,10 @@ export { TreeViewConfiguration, SchemaFactory, SchemaFactoryAlpha, adaptEnum, en
|
|
|
7
7
|
export { isTreeNodeSchemaClass, FieldKind, FieldSchema, normalizeFieldSchema, areFieldSchemaEqual, areImplicitFieldSchemaEqual, normalizeAllowedTypes, evaluateLazySchema, } from "./schemaTypes.js";
|
|
8
8
|
export { getTreeNodeForField, prepareContentForHydration, } from "./proxies.js";
|
|
9
9
|
export { TreeArrayNode, IterableTreeArrayContent, } from "./arrayNode.js";
|
|
10
|
+
export { ArrayNodeSchema, isArrayNodeSchema } from "./arrayNodeTypes.js";
|
|
11
|
+
export { MapNodeSchema, isMapNodeSchema } from "./mapNodeTypes.js";
|
|
10
12
|
export { setField, createUnknownOptionalFieldPolicy, } from "./objectNode.js";
|
|
13
|
+
export { ObjectNodeSchema } from "./objectNodeTypes.js";
|
|
11
14
|
export { mapTreeFromNodeData, } from "./toMapTree.js";
|
|
12
15
|
export { toStoredSchema, getStoredSchema } from "./toStoredSchema.js";
|
|
13
16
|
export { numberSchema, stringSchema, booleanSchema, handleSchema, nullSchema, } from "./leafNodeSchema.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/simple-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,cAAc,EACd,gBAAgB,EAGhB,QAAQ,EAUR,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,SAAS,GACT,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAKN,qBAAqB,EAIrB,aAAa,EACb,kBAAkB,EAKlB,SAAS,EACT,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,yBAAyB,EACzB,4BAA4B,EAC5B,WAAW,EAEX,oBAAoB,EACpB,oBAAoB,EAEpB,QAAQ,EAIR,qBAAqB,EACrB,qBAAqB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/simple-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,cAAc,EACd,gBAAgB,EAGhB,QAAQ,EAUR,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,SAAS,GACT,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAKN,qBAAqB,EAIrB,aAAa,EACb,kBAAkB,EAKlB,SAAS,EACT,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,yBAAyB,EACzB,4BAA4B,EAC5B,WAAW,EAEX,oBAAoB,EACpB,oBAAoB,EAEpB,QAAQ,EAIR,qBAAqB,EACrB,qBAAqB,EAcrB,aAAa,EACb,eAAe,EAKf,sBAAsB,EACtB,sBAAsB,EAEtB,8BAA8B,EAC9B,UAAU,EA6BV,YAAY,EACZ,0BAA0B,EAC1B,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,sBAAsB,EAGtB,sBAAsB,EAYtB,QAAQ,EACR,8BAA8B,EAC9B,yBAAyB,EACzB,cAAc,EACd,yBAAyB,GAGzB,MAAM,gBAAgB,CAAC;AAYxB,OAAO,EAEN,qBAAqB,EAQrB,SAAS,EACT,WAAW,EAOX,oBAAoB,EACpB,mBAAmB,EACnB,2BAA2B,EAM3B,qBAAqB,EAQrB,kBAAkB,GAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,mBAAmB,EACnB,0BAA0B,GAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,EACN,aAAa,EACb,wBAAwB,GAExB,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAKzE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAKN,QAAQ,EACR,gCAAgC,GAChC,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,EACN,mBAAmB,GAInB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EACN,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,UAAU,GACV,MAAM,qBAAqB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttypeNameSymbol,\n\ttypeSchemaSymbol,\n\ttype WithType,\n\ttype TreeNodeSchema,\n\tNodeKind,\n\ttype TreeNodeSchemaClass,\n\ttype TreeNodeSchemaNonClass,\n\ttype TreeNodeSchemaCore,\n\ttype TreeChangeEvents,\n\t// TreeNode is only type exported, which prevents use of the class object for unsupported use-cases like direct sub-classing and instanceof.\n\t// See docs on TreeNode for more details.\n\ttype TreeNode,\n\ttype Unhydrated,\n\ttype InternalTreeNode,\n\tisTreeNode,\n\ttryDisposeTreeNode,\n\tHydratedContext,\n\tSimpleContextSlot,\n\tgetOrCreateInnerNode,\n\tgetKernel,\n} from \"./core/index.js\";\nexport {\n\ttype ITree,\n\ttype TreeView,\n\ttype ViewableTree,\n\ttype TreeViewEvents,\n\tTreeViewConfiguration,\n\ttype ITreeViewConfiguration,\n\ttype SchemaCompatibilityStatus,\n\ttype ITreeConfigurationOptions,\n\tSchemaFactory,\n\tSchemaFactoryAlpha,\n\ttype SchemaFactoryObjectOptions,\n\ttype ScopedSchemaName,\n\ttype ValidateRecursiveSchema,\n\ttype FixRecursiveArraySchema,\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n\ttest_RecursiveObject,\n\ttest_RecursiveObject_base,\n\ttest_RecursiveObjectPojoMode,\n\ttreeNodeApi,\n\ttype TreeNodeApi,\n\tcursorFromInsertable,\n\tcreateFromInsertable,\n\ttype NodeChangedData,\n\tTreeBeta,\n\ttype TreeChangeEventsBeta,\n\ttype SimpleTreeIndex,\n\ttype IdentifierIndex,\n\tcreateSimpleTreeIndex,\n\tcreateIdentifierIndex,\n\ttype JsonSchemaId,\n\ttype JsonSchemaType,\n\ttype JsonObjectNodeSchema,\n\ttype JsonArrayNodeSchema,\n\ttype JsonMapNodeSchema,\n\ttype JsonLeafNodeSchema,\n\ttype JsonSchemaRef,\n\ttype JsonRefPath,\n\ttype JsonNodeSchema,\n\ttype JsonNodeSchemaBase,\n\ttype JsonTreeSchema,\n\ttype JsonFieldSchema,\n\ttype JsonLeafSchemaType,\n\tgetJsonSchema,\n\tgetSimpleSchema,\n\ttype VerboseTreeNode,\n\ttype EncodeOptions,\n\ttype ParseOptions,\n\ttype VerboseTree,\n\textractPersistedSchema,\n\tcomparePersistedSchema,\n\ttype ConciseTree,\n\tcomparePersistedSchemaInternal,\n\tViewSchema,\n\ttype Unenforced,\n\ttype FieldHasDefaultUnsafe,\n\ttype ObjectFromSchemaRecordUnsafe,\n\ttype TreeObjectNodeUnsafe,\n\ttype TreeFieldFromImplicitFieldUnsafe,\n\ttype TreeNodeFromImplicitAllowedTypesUnsafe,\n\ttype FieldSchemaUnsafe,\n\ttype InsertableTreeNodeFromImplicitAllowedTypesUnsafe,\n\ttype TreeArrayNodeUnsafe,\n\ttype TreeMapNodeUnsafe,\n\ttype InsertableObjectFromSchemaRecordUnsafe,\n\ttype InsertableTreeFieldFromImplicitFieldUnsafe,\n\ttype InsertableTypedNodeUnsafe,\n\ttype NodeBuilderDataUnsafe,\n\ttype NodeFromSchemaUnsafe,\n\ttype ReadonlyMapInlined,\n\ttype TreeNodeSchemaClassUnsafe,\n\ttype TreeNodeSchemaUnsafe,\n\ttype AllowedTypesUnsafe,\n\ttype ImplicitAllowedTypesUnsafe,\n\ttype ImplicitFieldSchemaUnsafe,\n\ttype TreeNodeSchemaNonClassUnsafe,\n\ttype InsertableTreeNodeFromAllowedTypesUnsafe,\n\ttype ArrayNodeCustomizableSchemaUnsafe,\n\ttype MapNodeCustomizableSchemaUnsafe,\n\ttype TreeViewAlpha,\n\ttype TreeBranch,\n\ttype TreeBranchEvents,\n\ttryGetSchema,\n\tapplySchemaToParserOptions,\n\tcursorFromVerbose,\n\tverboseFromCursor,\n\tconciseFromCursor,\n\tcreateFromCursor,\n\tasTreeViewAlpha,\n\tcustomFromCursorStored,\n\ttype CustomTreeNode,\n\ttype CustomTreeValue,\n\ttryStoredSchemaAsArray,\n\ttype SchemaStatics,\n\ttype ITreeAlpha,\n\ttype TransactionConstraint,\n\ttype NodeInDocumentConstraint,\n\ttype RunTransactionParams,\n\ttype VoidTransactionCallbackStatus,\n\ttype TransactionCallbackStatus,\n\ttype TransactionResult,\n\ttype TransactionResultExt,\n\ttype TransactionResultSuccess,\n\ttype TransactionResultFailed,\n\trollback,\n\tgenerateSchemaFromSimpleSchema,\n\treplaceConciseTreeHandles,\n\treplaceHandles,\n\treplaceVerboseTreeHandles,\n\ttype HandleConverter,\n\ttype FieldSchemaAlphaUnsafe,\n} from \"./api/index.js\";\nexport type {\n\tSimpleTreeSchema,\n\tSimpleNodeSchema,\n\tSimpleFieldSchema,\n\tSimpleLeafNodeSchema,\n\tSimpleMapNodeSchema,\n\tSimpleArrayNodeSchema,\n\tSimpleObjectNodeSchema,\n\tSimpleNodeSchemaBase,\n\tSimpleObjectFieldSchema,\n} from \"./simpleSchema.js\";\nexport {\n\ttype NodeFromSchema,\n\tisTreeNodeSchemaClass,\n\ttype ImplicitFieldSchema,\n\ttype TreeFieldFromImplicitField,\n\ttype ImplicitAllowedTypes,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype TreeLeafValue,\n\ttype AllowedTypes,\n\tFieldKind,\n\tFieldSchema,\n\ttype FieldSchemaAlpha,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype InsertableTypedNode,\n\ttype NodeBuilderData,\n\ttype DefaultProvider,\n\ttype FieldProps,\n\tnormalizeFieldSchema,\n\tareFieldSchemaEqual,\n\tareImplicitFieldSchemaEqual,\n\ttype ApplyKind,\n\ttype FieldSchemaMetadata,\n\ttype InsertableField,\n\ttype Insertable,\n\ttype UnsafeUnknownSchema,\n\tnormalizeAllowedTypes,\n\ttype ApplyKindInput,\n\ttype InsertableTreeNodeFromAllowedTypes,\n\ttype Input,\n\ttype ReadableField,\n\ttype ReadSchema,\n\ttype NodeSchemaOptions,\n\ttype NodeSchemaMetadata,\n\tevaluateLazySchema,\n} from \"./schemaTypes.js\";\nexport {\n\tgetTreeNodeForField,\n\tprepareContentForHydration,\n} from \"./proxies.js\";\nexport {\n\tTreeArrayNode,\n\tIterableTreeArrayContent,\n\ttype ReadonlyArrayNode,\n} from \"./arrayNode.js\";\nexport type {\n\tArrayNodeCustomizableSchema,\n\tArrayNodePojoEmulationSchema,\n} from \"./arrayNodeTypes.js\";\nexport { ArrayNodeSchema, isArrayNodeSchema } from \"./arrayNodeTypes.js\";\nexport type {\n\tMapNodeCustomizableSchema,\n\tMapNodePojoEmulationSchema,\n} from \"./mapNodeTypes.js\";\nexport { MapNodeSchema, isMapNodeSchema } from \"./mapNodeTypes.js\";\nexport {\n\ttype FieldHasDefault,\n\ttype InsertableObjectFromSchemaRecord,\n\ttype ObjectFromSchemaRecord,\n\ttype TreeObjectNode,\n\tsetField,\n\tcreateUnknownOptionalFieldPolicy,\n} from \"./objectNode.js\";\nexport { ObjectNodeSchema } from \"./objectNodeTypes.js\";\nexport type { TreeMapNode, MapNodeInsertableData } from \"./mapNode.js\";\nexport {\n\tmapTreeFromNodeData,\n\ttype InsertableContent,\n\ttype FactoryContent,\n\ttype FactoryContentObject,\n} from \"./toMapTree.js\";\nexport { toStoredSchema, getStoredSchema } from \"./toStoredSchema.js\";\nexport {\n\tnumberSchema,\n\tstringSchema,\n\tbooleanSchema,\n\thandleSchema,\n\tnullSchema,\n} from \"./leafNodeSchema.js\";\nexport type { LeafSchema } from \"./leafNodeSchema.js\";\nexport type { LazyItem, FlexList, FlexListToUnion, ExtractItemType } from \"./flexList.js\";\n"]}
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
import { type TreeValue, ValueSchema } from "../core/index.js";
|
|
6
6
|
import { type FlexTreeNode } from "../feature-libraries/index.js";
|
|
7
7
|
import { NodeKind, type TreeNodeSchema, type TreeNodeSchemaNonClass } from "./core/index.js";
|
|
8
|
+
import type { NodeSchemaMetadata, TreeLeafValue } from "./schemaTypes.js";
|
|
9
|
+
import type { SimpleLeafNodeSchema } from "./simpleSchema.js";
|
|
8
10
|
/**
|
|
9
11
|
* Instances of this class are schema for leaf nodes.
|
|
10
12
|
* @remarks
|
|
@@ -22,11 +24,26 @@ export declare class LeafNodeSchema<Name extends string, const T extends ValueSc
|
|
|
22
24
|
readonly childTypes: ReadonlySet<TreeNodeSchema>;
|
|
23
25
|
create(data: TreeValue<T> | FlexTreeNode): TreeValue<T>;
|
|
24
26
|
createFromInsertable(data: TreeValue<T>): TreeValue<T>;
|
|
27
|
+
readonly leafKind: ValueSchema;
|
|
28
|
+
readonly metadata: NodeSchemaMetadata;
|
|
25
29
|
constructor(name: Name, t: T);
|
|
26
30
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
/**
|
|
32
|
+
* A {@link TreeNodeSchema} for a {@link TreeLeafValue}.
|
|
33
|
+
* @remarks
|
|
34
|
+
* This is just a more specific alias for a particular {@link TreeNodeSchemaNonClass}.
|
|
35
|
+
* It only exists to make the API (particularly errors, IntelliSense, and generated .d.ts files) more readable.
|
|
36
|
+
*
|
|
37
|
+
* See {@link SchemaFactory} and its various properties for actual leaf schema objects.
|
|
38
|
+
* @privateRemarks
|
|
39
|
+
* This is an interface so its name will show up in things like type errors instead of the fully expanded TreeNodeSchemaNonClass.
|
|
40
|
+
* @system @sealed @public
|
|
41
|
+
*/
|
|
42
|
+
export interface LeafSchema<Name extends string, T extends TreeLeafValue> extends TreeNodeSchemaNonClass<`com.fluidframework.leaf.${Name}`, NodeKind.Leaf, T, T, true> {
|
|
43
|
+
}
|
|
44
|
+
export declare const stringSchema: LeafSchema<"string", string> & SimpleLeafNodeSchema;
|
|
45
|
+
export declare const numberSchema: LeafSchema<"number", number> & SimpleLeafNodeSchema;
|
|
46
|
+
export declare const booleanSchema: LeafSchema<"boolean", boolean> & SimpleLeafNodeSchema;
|
|
47
|
+
export declare const nullSchema: LeafSchema<"null", null> & SimpleLeafNodeSchema;
|
|
48
|
+
export declare const handleSchema: LeafSchema<"handle", import("@fluidframework/core-interfaces").IFluidHandle<unknown>> & SimpleLeafNodeSchema;
|
|
32
49
|
//# sourceMappingURL=leafNodeSchema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leafNodeSchema.d.ts","sourceRoot":"","sources":["../../src/simple-tree/leafNodeSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,KAAK,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EACN,KAAK,YAAY,EAGjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,KAAK,cAAc,EAAE,KAAK,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"leafNodeSchema.d.ts","sourceRoot":"","sources":["../../src/simple-tree/leafNodeSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,KAAK,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EACN,KAAK,YAAY,EAGjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,KAAK,cAAc,EAAE,KAAK,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAC7F,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D;;;;;;;;GAQG;AACH,qBAAa,cAAc,CAAC,IAAI,SAAS,MAAM,EAAE,KAAK,CAAC,CAAC,SAAS,WAAW,CAC3E,YAAW,sBAAsB,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IAElF,SAAgB,UAAU,EAAE,IAAI,CAAC;IACjC,SAAgB,IAAI,iBAAiB;IACrC,SAAgB,IAAI,EAAE,CAAC,CAAC;IACxB,SAAgB,uBAAuB,OAAiB;IACxD,SAAgB,UAAU,EAAE,WAAW,CAAC,cAAc,CAAC,CAAa;IAE7D,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,YAAY,GAAG,SAAS,CAAC,CAAC,CAAC;IASvD,oBAAoB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC;IAI7D,SAAgB,QAAQ,EAAE,WAAW,CAAC;IAEtC,SAAgB,QAAQ,EAAE,kBAAkB,CAAM;gBAE/B,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;CAKnC;AAaD;;;;;;;;;;GAUG;AACH,MAAM,WAAW,UAAU,CAAC,IAAI,SAAS,MAAM,EAAE,CAAC,SAAS,aAAa,CACvE,SAAQ,sBAAsB,CAC7B,2BAA2B,IAAI,EAAE,EACjC,QAAQ,CAAC,IAAI,EACD,CAAC,EACK,CAAC,EACW,IAAI,CAClC;CAAG;AAGL,eAAO,MAAM,YAAY,qDAAyC,CAAC;AACnE,eAAO,MAAM,YAAY,qDAAyC,CAAC;AACnE,eAAO,MAAM,aAAa,uDAA2C,CAAC;AACtE,eAAO,MAAM,UAAU,iDAAqC,CAAC;AAC7D,eAAO,MAAM,YAAY,8GAA8C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leafNodeSchema.js","sourceRoot":"","sources":["../../src/simple-tree/leafNodeSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAE7D,OAAO,EAAkB,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAEN,cAAc,EACd,iBAAiB,GACjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAoD,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"leafNodeSchema.js","sourceRoot":"","sources":["../../src/simple-tree/leafNodeSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,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,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;AACnE,MAAM,CAAC,MAAM,aAAa,GAAG,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;AACtE,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;AAC7D,MAAM,CAAC,MAAM,YAAY,GAAG,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport { type TreeValue, ValueSchema } from \"../core/index.js\";\nimport {\n\ttype FlexTreeNode,\n\tisFlexTreeNode,\n\tvalueSchemaAllows,\n} from \"../feature-libraries/index.js\";\nimport { NodeKind, type TreeNodeSchema, type TreeNodeSchemaNonClass } from \"./core/index.js\";\nimport type { NodeSchemaMetadata, TreeLeafValue } from \"./schemaTypes.js\";\nimport type { SimpleLeafNodeSchema } from \"./simpleSchema.js\";\n\n/**\n * Instances of this class are schema for leaf nodes.\n * @remarks\n * Unlike other schema, leaf schema are class instances instead of classes themselves.\n * This is because the instance type (the tree node type) for leaves are not objects,\n * so those instances can't be instances of a schema based class.\n * @privateRemarks\n * This class refers to the underlying flex tree schema in its constructor, so this class can't be included in the package API.\n */\nexport class LeafNodeSchema<Name extends string, const T extends ValueSchema>\n\timplements TreeNodeSchemaNonClass<Name, NodeKind.Leaf, TreeValue<T>, TreeValue<T>>\n{\n\tpublic readonly identifier: Name;\n\tpublic readonly kind = NodeKind.Leaf;\n\tpublic readonly info: T;\n\tpublic readonly implicitlyConstructable = true as const;\n\tpublic readonly childTypes: ReadonlySet<TreeNodeSchema> = new Set();\n\n\tpublic create(data: TreeValue<T> | FlexTreeNode): TreeValue<T> {\n\t\tif (isFlexTreeNode(data)) {\n\t\t\tconst value = data.value;\n\t\t\tassert(valueSchemaAllows(this.info, value), 0x916 /* invalid value */);\n\t\t\treturn value;\n\t\t}\n\t\treturn data;\n\t}\n\n\tpublic createFromInsertable(data: TreeValue<T>): TreeValue<T> {\n\t\treturn data;\n\t}\n\n\tpublic readonly leafKind: ValueSchema;\n\n\tpublic readonly metadata: NodeSchemaMetadata = {};\n\n\tpublic constructor(name: Name, t: T) {\n\t\tthis.identifier = name;\n\t\tthis.info = t;\n\t\tthis.leafKind = t;\n\t}\n}\n\n/**\n * Wrapper around LeafNodeSchema's constructor that provides the return type that is desired in the package public API.\n */\nfunction makeLeaf<Name extends string, const T extends ValueSchema>(\n\tname: Name,\n\tt: T,\n): LeafSchema<Name, TreeValue<T>> & SimpleLeafNodeSchema {\n\t// Names in this domain follow https://en.wikipedia.org/wiki/Reverse_domain_name_notation\n\treturn new LeafNodeSchema(`com.fluidframework.leaf.${name}`, t);\n}\n\n/**\n * A {@link TreeNodeSchema} for a {@link TreeLeafValue}.\n * @remarks\n * This is just a more specific alias for a particular {@link TreeNodeSchemaNonClass}.\n * It only exists to make the API (particularly errors, IntelliSense, and generated .d.ts files) more readable.\n *\n * See {@link SchemaFactory} and its various properties for actual leaf schema objects.\n * @privateRemarks\n * This is an interface so its name will show up in things like type errors instead of the fully expanded TreeNodeSchemaNonClass.\n * @system @sealed @public\n */\nexport interface LeafSchema<Name extends string, T extends TreeLeafValue>\n\textends TreeNodeSchemaNonClass<\n\t\t`com.fluidframework.leaf.${Name}`,\n\t\tNodeKind.Leaf,\n\t\t/* TNode */ T,\n\t\t/* TInsertable */ T,\n\t\t/* ImplicitlyConstructable */ true\n\t> {}\n\n// Leaf schema shared between all SchemaFactory instances.\nexport const stringSchema = makeLeaf(\"string\", ValueSchema.String);\nexport const numberSchema = makeLeaf(\"number\", ValueSchema.Number);\nexport const booleanSchema = makeLeaf(\"boolean\", ValueSchema.Boolean);\nexport const nullSchema = makeLeaf(\"null\", ValueSchema.Null);\nexport const handleSchema = makeLeaf(\"handle\", ValueSchema.FluidHandle);\n"]}
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { type ImplicitAllowedTypes, type InsertableTreeNodeFromImplicitAllowedTypes, type NodeSchemaMetadata, type TreeNodeFromImplicitAllowedTypes } from "./schemaTypes.js";
|
|
6
|
-
import {
|
|
6
|
+
import { type TreeNode } from "./core/index.js";
|
|
7
7
|
import { type RestrictiveStringRecord } from "../util/index.js";
|
|
8
|
+
import type { MapNodeCustomizableSchema, MapNodePojoEmulationSchema } from "./mapNodeTypes.js";
|
|
8
9
|
/**
|
|
9
10
|
* A map of string keys to tree objects.
|
|
10
11
|
*
|
|
@@ -78,7 +79,7 @@ export interface TreeMapNode<T extends ImplicitAllowedTypes = ImplicitAllowedTyp
|
|
|
78
79
|
* @param base - base schema type to extend.
|
|
79
80
|
* @param useMapPrototype - should this type emulate a ES6 Map object (by faking its prototype with a proxy).
|
|
80
81
|
*/
|
|
81
|
-
export declare function mapSchema<TName extends string, const T extends ImplicitAllowedTypes, const ImplicitlyConstructable extends boolean, const TCustomMetadata = unknown>(identifier: TName, info: T, implicitlyConstructable: ImplicitlyConstructable, useMapPrototype: boolean, metadata?: NodeSchemaMetadata<TCustomMetadata>):
|
|
82
|
+
export declare function mapSchema<TName extends string, const T extends ImplicitAllowedTypes, const ImplicitlyConstructable extends boolean, const TCustomMetadata = unknown>(identifier: TName, info: T, implicitlyConstructable: ImplicitlyConstructable, useMapPrototype: boolean, metadata?: NodeSchemaMetadata<TCustomMetadata>): MapNodeCustomizableSchema<TName, T, ImplicitlyConstructable, TCustomMetadata> & MapNodePojoEmulationSchema<TName, T, ImplicitlyConstructable, TCustomMetadata>;
|
|
82
83
|
/**
|
|
83
84
|
* Content which can be used to construct a Map node, explicitly or implicitly.
|
|
84
85
|
* @system @public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapNode.d.ts","sourceRoot":"","sources":["../../src/simple-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CAAC,CAAC;IAE3E;;;;;;OAMG;IACH,OAAO,CACN,UAAU,EAAE,CACX,KAAK,EAAE,gCAAgC,CAAC,CAAC,CAAC,EAC1C,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,WAAW,CAAC,MAAM,EAAE,gCAAgC,CAAC,CAAC,CAAC,CAAC,KACzD,IAAI,EAGT,OAAO,CAAC,EAAE,GAAG,GACX,IAAI,CAAC;CACR;AAiGD;;;;;GAKG;AAEH,wBAAgB,SAAS,CACxB,KAAK,SAAS,MAAM,EACpB,KAAK,CAAC,CAAC,SAAS,oBAAoB,EACpC,KAAK,CAAC,uBAAuB,SAAS,OAAO,EAC7C,KAAK,CAAC,eAAe,GAAG,OAAO,EAE/B,UAAU,EAAE,KAAK,EACjB,IAAI,EAAE,CAAC,EACP,uBAAuB,EAAE,uBAAuB,EAChD,eAAe,EAAE,OAAO,EACxB,QAAQ,CAAC,EAAE,kBAAkB,CAAC,eAAe,CAAC,kKAqE9C;AAED;;;GAGG;AACH,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,oBAAoB,IAC7D,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,0CAA0C,CAAC,CAAC,CAAC,CAAC,CAAC,GAC1E,uBAAuB,CAAC,0CAA0C,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -96,6 +96,7 @@ CustomMapNodeBase.kind = NodeKind.Map;
|
|
|
96
96
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
97
97
|
export function mapSchema(identifier, info, implicitlyConstructable, useMapPrototype, metadata) {
|
|
98
98
|
const lazyChildTypes = new Lazy(() => normalizeAllowedTypes(info));
|
|
99
|
+
const lazyAllowedTypesIdentifiers = new Lazy(() => new Set([...lazyChildTypes.value].map((type) => type.identifier)));
|
|
99
100
|
let unhydratedContext;
|
|
100
101
|
class Schema extends CustomMapNodeBase {
|
|
101
102
|
static prepareInstance(instance, flexNode) {
|
|
@@ -107,6 +108,9 @@ export function mapSchema(identifier, info, implicitlyConstructable, useMapProto
|
|
|
107
108
|
static buildRawNode(instance, input) {
|
|
108
109
|
return UnhydratedFlexTreeNode.getOrCreate(unhydratedContext, mapTreeFromNodeData(input, this));
|
|
109
110
|
}
|
|
111
|
+
static get allowedTypesIdentifiers() {
|
|
112
|
+
return lazyAllowedTypesIdentifiers.value;
|
|
113
|
+
}
|
|
110
114
|
static oneTimeSetup() {
|
|
111
115
|
const schema = this;
|
|
112
116
|
unhydratedContext = getUnhydratedContext(schema);
|
|
@@ -127,7 +131,7 @@ export function mapSchema(identifier, info, implicitlyConstructable, useMapProto
|
|
|
127
131
|
Schema.identifier = identifier;
|
|
128
132
|
Schema.info = info;
|
|
129
133
|
Schema.implicitlyConstructable = implicitlyConstructable;
|
|
130
|
-
Schema.metadata = metadata;
|
|
134
|
+
Schema.metadata = metadata ?? {};
|
|
131
135
|
const schemaErased = Schema;
|
|
132
136
|
return schemaErased;
|
|
133
137
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapNode.js","sourceRoot":"","sources":["../../src/simple-tree/mapNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAC3D,OAAO,EAIN,kBAAkB,GAClB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,EACN,iBAAiB,EACjB,SAAS,EACT,qBAAqB,GAKrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,SAAS,EAET,QAAQ;AAIR,gDAAgD;AAChD,cAAc,EAEd,gBAAgB,EAEhB,sBAAsB,EACtB,oBAAoB,GAEpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACN,mBAAmB,GAGnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,KAAK,EAAgC,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,aA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AAE,IAAuC,CAAC,CACrF,CAAC;QACH,CAAC;QAIS,MAAM,CAAU,YAAY;YACrC,MAAM,MAAM,GAAG,IAAiC,CAAC;YACjD,iBAAiB,GAAG,oBAAoB,CAAC,MAAM,CAAC,CAAC;YACjD,OAAO,iBAAiB,CAAC;QAC1B,CAAC;QAMM,MAAM,KAAK,UAAU;YAC3B,OAAO,cAAc,CAAC,KAAK,CAAC;QAC7B,CAAC;QAID,gDAAgD;QAChD,IAAW,CAAC,cAAc,CAAC;YAC1B,OAAO,UAAU,CAAC;QACnB,CAAC;QACD,IAAW,CAAC,gBAAgB,CAAC;YAC5B,OAAO,MAAM,CAAC,iBAAiB,EAAE,WAA6C,CAAC;QAChF,CAAC;;IAxByB,wBAAiB,GAAgC,SAAS,CAAC;IAQ9D,iBAAU,GAAG,UAAU,CAAC;IACxB,WAAI,GAAG,IAAI,CAAC;IACZ,8BAAuB,GAC7C,uBAAuB,CAAC;IAIF,eAAQ,GAC9B,QAAQ,CAAC;IAUX,MAAM,YAAY,GASd,MAAM,CAAC;IACX,OAAO,YAAY,CAAC;AACrB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Lazy } from \"@fluidframework/core-utils/internal\";\nimport {\n\ttype FlexTreeNode,\n\ttype FlexTreeOptionalField,\n\ttype OptionalFieldEditBuilder,\n\tgetSchemaAndPolicy,\n} from \"../feature-libraries/index.js\";\nimport { getTreeNodeForField, prepareContentForHydration } from \"./proxies.js\";\nimport {\n\tcreateFieldSchema,\n\tFieldKind,\n\tnormalizeAllowedTypes,\n\ttype ImplicitAllowedTypes,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype NodeSchemaMetadata,\n\ttype TreeNodeFromImplicitAllowedTypes,\n} from \"./schemaTypes.js\";\nimport {\n\tgetKernel,\n\ttype InnerNode,\n\tNodeKind,\n\ttype TreeNodeSchemaBoth,\n\ttype TreeNodeSchema,\n\ttype WithType,\n\t// eslint-disable-next-line import/no-deprecated\n\ttypeNameSymbol,\n\ttype TreeNode,\n\ttypeSchemaSymbol,\n\ttype Context,\n\tUnhydratedFlexTreeNode,\n\tgetOrCreateInnerNode,\n\ttype InternalTreeNode,\n} from \"./core/index.js\";\nimport {\n\tmapTreeFromNodeData,\n\ttype FactoryContent,\n\ttype InsertableContent,\n} from \"./toMapTree.js\";\nimport { brand, count, type RestrictiveStringRecord } from \"../util/index.js\";\nimport { TreeNodeValid, type MostDerivedData } from \"./treeNodeValid.js\";\nimport type { ExclusiveMapTree } from \"../core/index.js\";\nimport { getUnhydratedContext } from \"./createContext.js\";\n\n/**\n * A map of string keys to tree objects.\n *\n * @privateRemarks\n * Add support for `clear` once we have established merge semantics for it.\n *\n * @sealed @public\n */\nexport interface TreeMapNode<T extends ImplicitAllowedTypes = ImplicitAllowedTypes>\n\textends ReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>,\n\t\tTreeNode {\n\t/**\n\t * Adds or updates an entry in the map with a specified `key` and a `value`.\n\t *\n\t * @param key - The key of the element to add to the map.\n\t * @param value - The value of the element to add to the map.\n\t *\n\t * @remarks\n\t * Setting the value at a key to `undefined` is equivalent to calling {@link TreeMapNode.delete} with that key.\n\t */\n\tset(key: string, value: InsertableTreeNodeFromImplicitAllowedTypes<T> | undefined): void;\n\n\t/**\n\t * Removes the specified element from this map by its `key`.\n\t *\n\t * @remarks\n\t * Note: unlike JavaScript's Map API, this method does not return a flag indicating whether or not the value was\n\t * deleted.\n\t *\n\t * @privateRemarks\n\t * Regarding the choice to not return a boolean: Since this data structure is distributed in nature, it isn't\n\t * possible to tell whether or not the item was deleted as a result of this method call. Returning a \"best guess\"\n\t * is more likely to create issues / promote bad usage patterns than offer useful information.\n\t *\n\t * @param key - The key of the element to remove from the map.\n\t */\n\tdelete(key: string): void;\n\n\t/**\n\t * Returns an iterable of keys in the map.\n\t *\n\t * @remarks\n\t * Note: no guarantees are made regarding the order of the keys returned.\n\t * If your usage scenario depends on consistent ordering, you will need to sort these yourself.\n\t */\n\tkeys(): IterableIterator<string>;\n\n\t/**\n\t * Returns an iterable of values in the map.\n\t *\n\t * @remarks\n\t * Note: no guarantees are made regarding the order of the values returned.\n\t * If your usage scenario depends on consistent ordering, you will need to sort these yourself.\n\t */\n\tvalues(): IterableIterator<TreeNodeFromImplicitAllowedTypes<T>>;\n\n\t/**\n\t * Returns an iterable of key, value pairs for every entry in the map.\n\t *\n\t * @remarks\n\t * Note: no guarantees are made regarding the order of the entries returned.\n\t * If your usage scenario depends on consistent ordering, you will need to sort these yourself.\n\t */\n\tentries(): IterableIterator<[string, TreeNodeFromImplicitAllowedTypes<T>]>;\n\n\t/**\n\t * Executes the provided function once per each key/value pair in this map.\n\t *\n\t * @remarks\n\t * Note: no guarantees are made regarding the order in which the function is called with respect to the map's entries.\n\t * If your usage scenario depends on consistent ordering, you will need to account for this.\n\t */\n\tforEach(\n\t\tcallbackfn: (\n\t\t\tvalue: TreeNodeFromImplicitAllowedTypes<T>,\n\t\t\tkey: string,\n\t\t\tmap: ReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>,\n\t\t) => void,\n\t\t// Typing inherited from `ReadonlyMap`.\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tthisArg?: any,\n\t): void;\n}\n\n// TreeMapNode is invariant over schema type, so for this handler to work with all schema, the only possible type for the schema is `any`.\n// This is not ideal, but no alternatives are possible.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst handler: ProxyHandler<TreeMapNode<any>> = {\n\tgetPrototypeOf: () => {\n\t\treturn Map.prototype;\n\t},\n};\n\nabstract class CustomMapNodeBase<const T extends ImplicitAllowedTypes> extends TreeNodeValid<\n\tMapNodeInsertableData<T>\n> {\n\tpublic static readonly kind = NodeKind.Map;\n\n\tpublic constructor(input?: InternalTreeNode | MapNodeInsertableData<T> | undefined) {\n\t\tsuper(input ?? []);\n\t}\n\n\tpublic [Symbol.iterator](): IterableIterator<[string, TreeNodeFromImplicitAllowedTypes<T>]> {\n\t\treturn this.entries();\n\t}\n\n\tprivate get innerNode(): InnerNode {\n\t\treturn getOrCreateInnerNode(this);\n\t}\n\n\tprivate editor(key: string): OptionalFieldEditBuilder<ExclusiveMapTree> {\n\t\tconst field = this.innerNode.getBoxed(brand(key)) as FlexTreeOptionalField;\n\t\treturn field.editor;\n\t}\n\n\tpublic delete(key: string): void {\n\t\tconst field = this.innerNode.getBoxed(brand(key));\n\t\tthis.editor(key).set(undefined, field.length === 0);\n\t}\n\tpublic *entries(): IterableIterator<[string, TreeNodeFromImplicitAllowedTypes<T>]> {\n\t\tconst node = this.innerNode;\n\t\tfor (const key of node.keys()) {\n\t\t\tyield [\n\t\t\t\tkey,\n\t\t\t\tgetTreeNodeForField(node.getBoxed(key)) as TreeNodeFromImplicitAllowedTypes<T>,\n\t\t\t];\n\t\t}\n\t}\n\tpublic get(key: string): TreeNodeFromImplicitAllowedTypes<T> {\n\t\tconst node = this.innerNode;\n\t\tconst field = node.getBoxed(brand(key));\n\t\treturn getTreeNodeForField(field) as TreeNodeFromImplicitAllowedTypes<T>;\n\t}\n\tpublic has(key: string): boolean {\n\t\treturn this.innerNode.tryGetField(brand(key)) !== undefined;\n\t}\n\tpublic keys(): IterableIterator<string> {\n\t\tconst node = this.innerNode;\n\t\treturn node.keys();\n\t}\n\tpublic set(key: string, value: InsertableTreeNodeFromImplicitAllowedTypes<T>): this {\n\t\tconst kernel = getKernel(this);\n\t\tconst node = this.innerNode;\n\t\tconst mapTree = mapTreeFromNodeData(\n\t\t\tvalue as InsertableContent | undefined,\n\t\t\tcreateFieldSchema(FieldKind.Optional, kernel.schema.info as ImplicitAllowedTypes),\n\t\t\tnode.context.isHydrated() ? node.context.nodeKeyManager : undefined,\n\t\t\tgetSchemaAndPolicy(node),\n\t\t);\n\n\t\tconst field = node.getBoxed(brand(key));\n\t\tif (node.context.isHydrated()) {\n\t\t\tprepareContentForHydration(mapTree, node.context.checkout.forest);\n\t\t}\n\n\t\tthis.editor(key).set(mapTree, field.length === 0);\n\t\treturn this;\n\t}\n\tpublic get size(): number {\n\t\treturn count(this.innerNode.keys());\n\t}\n\tpublic *values(): IterableIterator<TreeNodeFromImplicitAllowedTypes<T>> {\n\t\tfor (const [, value] of this.entries()) {\n\t\t\tyield value;\n\t\t}\n\t}\n\tpublic forEach<TThis extends TreeMapNode<T>>(\n\t\tthis: TThis,\n\t\tcallbackFn: (value: TreeNodeFromImplicitAllowedTypes<T>, key: string, map: TThis) => void,\n\t\tthisArg?: unknown,\n\t): void {\n\t\tfor (const field of getOrCreateInnerNode(this).boxedIterator()) {\n\t\t\tconst node = getTreeNodeForField(field) as TreeNodeFromImplicitAllowedTypes<T>;\n\t\t\tcallbackFn.call(thisArg, node, field.key, this);\n\t\t}\n\t}\n\t// TODO: add `clear` once we have established merge semantics for it.\n}\n\n/**\n * Define a {@link TreeNodeSchema} for a {@link (TreeArrayNode:interface)}.\n *\n * @param base - base schema type to extend.\n * @param useMapPrototype - should this type emulate a ES6 Map object (by faking its prototype with a proxy).\n */\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function mapSchema<\n\tTName extends string,\n\tconst T extends ImplicitAllowedTypes,\n\tconst ImplicitlyConstructable extends boolean,\n\tconst TCustomMetadata = unknown,\n>(\n\tidentifier: TName,\n\tinfo: T,\n\timplicitlyConstructable: ImplicitlyConstructable,\n\tuseMapPrototype: boolean,\n\tmetadata?: NodeSchemaMetadata<TCustomMetadata>,\n) {\n\tconst lazyChildTypes = new Lazy(() => normalizeAllowedTypes(info));\n\n\tlet unhydratedContext: Context;\n\n\tclass Schema extends CustomMapNodeBase<T> implements TreeMapNode<T> {\n\t\tpublic static override prepareInstance<T2>(\n\t\t\tthis: typeof TreeNodeValid<T2>,\n\t\t\tinstance: TreeNodeValid<T2>,\n\t\t\tflexNode: FlexTreeNode,\n\t\t): TreeNodeValid<T2> {\n\t\t\tif (useMapPrototype) {\n\t\t\t\treturn new Proxy<Schema>(instance as Schema, handler as ProxyHandler<Schema>);\n\t\t\t}\n\t\t\treturn instance;\n\t\t}\n\n\t\tpublic static override buildRawNode<T2>(\n\t\t\tthis: typeof TreeNodeValid<T2>,\n\t\t\tinstance: TreeNodeValid<T2>,\n\t\t\tinput: T2,\n\t\t): UnhydratedFlexTreeNode {\n\t\t\treturn UnhydratedFlexTreeNode.getOrCreate(\n\t\t\t\tunhydratedContext,\n\t\t\t\tmapTreeFromNodeData(input as FactoryContent, this as unknown as ImplicitAllowedTypes),\n\t\t\t);\n\t\t}\n\n\t\tprotected static override constructorCached: MostDerivedData | undefined = undefined;\n\n\t\tprotected static override oneTimeSetup<T2>(this: typeof TreeNodeValid<T2>): Context {\n\t\t\tconst schema = this as unknown as TreeNodeSchema;\n\t\t\tunhydratedContext = getUnhydratedContext(schema);\n\t\t\treturn unhydratedContext;\n\t\t}\n\n\t\tpublic static readonly identifier = identifier;\n\t\tpublic static readonly info = info;\n\t\tpublic static readonly implicitlyConstructable: ImplicitlyConstructable =\n\t\t\timplicitlyConstructable;\n\t\tpublic static get childTypes(): ReadonlySet<TreeNodeSchema> {\n\t\t\treturn lazyChildTypes.value;\n\t\t}\n\t\tpublic static readonly metadata: NodeSchemaMetadata<TCustomMetadata> | undefined =\n\t\t\tmetadata;\n\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tpublic get [typeNameSymbol](): TName {\n\t\t\treturn identifier;\n\t\t}\n\t\tpublic get [typeSchemaSymbol](): typeof schemaErased {\n\t\t\treturn Schema.constructorCached?.constructor as unknown as typeof schemaErased;\n\t\t}\n\t}\n\tconst schemaErased: TreeNodeSchemaBoth<\n\t\tTName,\n\t\tNodeKind.Map,\n\t\tTreeMapNode<T> & WithType<TName, NodeKind.Map>,\n\t\tMapNodeInsertableData<T>,\n\t\tImplicitlyConstructable,\n\t\tT,\n\t\tundefined,\n\t\tTCustomMetadata\n\t> = Schema;\n\treturn schemaErased;\n}\n\n/**\n * Content which can be used to construct a Map node, explicitly or implicitly.\n * @system @public\n */\nexport type MapNodeInsertableData<T extends ImplicitAllowedTypes> =\n\t| Iterable<readonly [string, InsertableTreeNodeFromImplicitAllowedTypes<T>]>\n\t| RestrictiveStringRecord<InsertableTreeNodeFromImplicitAllowedTypes<T>>;\n"]}
|
|
1
|
+
{"version":3,"file":"mapNode.js","sourceRoot":"","sources":["../../src/simple-tree/mapNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAC3D,OAAO,EAIN,kBAAkB,GAClB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,EACN,iBAAiB,EACjB,SAAS,EACT,qBAAqB,GAKrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,SAAS,EAET,QAAQ;AAER,gDAAgD;AAChD,cAAc,EAEd,gBAAgB,EAEhB,sBAAsB,EACtB,oBAAoB,GAEpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACN,mBAAmB,GAGnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,KAAK,EAAgC,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAwB,MAAM,oBAAoB,CAAC;AAEzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAuF1D,0IAA0I;AAC1I,uDAAuD;AACvD,8DAA8D;AAC9D,MAAM,OAAO,GAAmC;IAC/C,cAAc,EAAE,GAAG,EAAE;QACpB,OAAO,GAAG,CAAC,SAAS,CAAC;IACtB,CAAC;CACD,CAAC;AAEF,MAAe,iBAAwD,SAAQ,aAE9E;IAGA,YAAmB,KAA+D;QACjF,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;IACpB,CAAC;IAEM,CAAC,MAAM,CAAC,QAAQ,CAAC;QACvB,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IAC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OAAO,iBAAiB,CAAC;QAC1B,CAAC;QAMM,MAAM,KAAK,UAAU;YAC3B,OAAO,cAAc,CAAC,KAAK,CAAC;QAC7B,CAAC;QAGD,gDAAgD;QAChD,IAAW,CAAC,cAAc,CAAC;YAC1B,OAAO,UAAU,CAAC;QACnB,CAAC;QACD,IAAW,CAAC,gBAAgB,CAAC;YAC5B,OAAO,MAAM,CAAC,iBAAiB,EAAE,WAA6C,CAAC;QAChF,CAAC;;IAvByB,wBAAiB,GAAgC,SAAS,CAAC;IAQ9D,iBAAU,GAAG,UAAU,CAAC;IACxB,WAAI,GAAG,IAAI,CAAC;IACZ,8BAAuB,GAC7C,uBAAuB,CAAC;IAIF,eAAQ,GAAwC,QAAQ,IAAI,EAAE,CAAC;IAUvF,MAAM,YAAY,GAMgE,MAAM,CAAC;IACzF,OAAO,YAAY,CAAC;AACrB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Lazy } from \"@fluidframework/core-utils/internal\";\nimport {\n\ttype FlexTreeNode,\n\ttype FlexTreeOptionalField,\n\ttype OptionalFieldEditBuilder,\n\tgetSchemaAndPolicy,\n} from \"../feature-libraries/index.js\";\nimport { getTreeNodeForField, prepareContentForHydration } from \"./proxies.js\";\nimport {\n\tcreateFieldSchema,\n\tFieldKind,\n\tnormalizeAllowedTypes,\n\ttype ImplicitAllowedTypes,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype NodeSchemaMetadata,\n\ttype TreeNodeFromImplicitAllowedTypes,\n} from \"./schemaTypes.js\";\nimport {\n\tgetKernel,\n\ttype InnerNode,\n\tNodeKind,\n\ttype TreeNodeSchema,\n\t// eslint-disable-next-line import/no-deprecated\n\ttypeNameSymbol,\n\ttype TreeNode,\n\ttypeSchemaSymbol,\n\ttype Context,\n\tUnhydratedFlexTreeNode,\n\tgetOrCreateInnerNode,\n\ttype InternalTreeNode,\n} from \"./core/index.js\";\nimport {\n\tmapTreeFromNodeData,\n\ttype FactoryContent,\n\ttype InsertableContent,\n} from \"./toMapTree.js\";\nimport { brand, count, type RestrictiveStringRecord } from \"../util/index.js\";\nimport { TreeNodeValid, type MostDerivedData } from \"./treeNodeValid.js\";\nimport type { ExclusiveMapTree } from \"../core/index.js\";\nimport { getUnhydratedContext } from \"./createContext.js\";\nimport type { MapNodeCustomizableSchema, MapNodePojoEmulationSchema } from \"./mapNodeTypes.js\";\n\n/**\n * A map of string keys to tree objects.\n *\n * @privateRemarks\n * Add support for `clear` once we have established merge semantics for it.\n *\n * @sealed @public\n */\nexport interface TreeMapNode<T extends ImplicitAllowedTypes = ImplicitAllowedTypes>\n\textends ReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>,\n\t\tTreeNode {\n\t/**\n\t * Adds or updates an entry in the map with a specified `key` and a `value`.\n\t *\n\t * @param key - The key of the element to add to the map.\n\t * @param value - The value of the element to add to the map.\n\t *\n\t * @remarks\n\t * Setting the value at a key to `undefined` is equivalent to calling {@link TreeMapNode.delete} with that key.\n\t */\n\tset(key: string, value: InsertableTreeNodeFromImplicitAllowedTypes<T> | undefined): void;\n\n\t/**\n\t * Removes the specified element from this map by its `key`.\n\t *\n\t * @remarks\n\t * Note: unlike JavaScript's Map API, this method does not return a flag indicating whether or not the value was\n\t * deleted.\n\t *\n\t * @privateRemarks\n\t * Regarding the choice to not return a boolean: Since this data structure is distributed in nature, it isn't\n\t * possible to tell whether or not the item was deleted as a result of this method call. Returning a \"best guess\"\n\t * is more likely to create issues / promote bad usage patterns than offer useful information.\n\t *\n\t * @param key - The key of the element to remove from the map.\n\t */\n\tdelete(key: string): void;\n\n\t/**\n\t * Returns an iterable of keys in the map.\n\t *\n\t * @remarks\n\t * Note: no guarantees are made regarding the order of the keys returned.\n\t * If your usage scenario depends on consistent ordering, you will need to sort these yourself.\n\t */\n\tkeys(): IterableIterator<string>;\n\n\t/**\n\t * Returns an iterable of values in the map.\n\t *\n\t * @remarks\n\t * Note: no guarantees are made regarding the order of the values returned.\n\t * If your usage scenario depends on consistent ordering, you will need to sort these yourself.\n\t */\n\tvalues(): IterableIterator<TreeNodeFromImplicitAllowedTypes<T>>;\n\n\t/**\n\t * Returns an iterable of key, value pairs for every entry in the map.\n\t *\n\t * @remarks\n\t * Note: no guarantees are made regarding the order of the entries returned.\n\t * If your usage scenario depends on consistent ordering, you will need to sort these yourself.\n\t */\n\tentries(): IterableIterator<[string, TreeNodeFromImplicitAllowedTypes<T>]>;\n\n\t/**\n\t * Executes the provided function once per each key/value pair in this map.\n\t *\n\t * @remarks\n\t * Note: no guarantees are made regarding the order in which the function is called with respect to the map's entries.\n\t * If your usage scenario depends on consistent ordering, you will need to account for this.\n\t */\n\tforEach(\n\t\tcallbackfn: (\n\t\t\tvalue: TreeNodeFromImplicitAllowedTypes<T>,\n\t\t\tkey: string,\n\t\t\tmap: ReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>,\n\t\t) => void,\n\t\t// Typing inherited from `ReadonlyMap`.\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tthisArg?: any,\n\t): void;\n}\n\n// TreeMapNode is invariant over schema type, so for this handler to work with all schema, the only possible type for the schema is `any`.\n// This is not ideal, but no alternatives are possible.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst handler: ProxyHandler<TreeMapNode<any>> = {\n\tgetPrototypeOf: () => {\n\t\treturn Map.prototype;\n\t},\n};\n\nabstract class CustomMapNodeBase<const T extends ImplicitAllowedTypes> extends TreeNodeValid<\n\tMapNodeInsertableData<T>\n> {\n\tpublic static readonly kind = NodeKind.Map;\n\n\tpublic constructor(input?: InternalTreeNode | MapNodeInsertableData<T> | undefined) {\n\t\tsuper(input ?? []);\n\t}\n\n\tpublic [Symbol.iterator](): IterableIterator<[string, TreeNodeFromImplicitAllowedTypes<T>]> {\n\t\treturn this.entries();\n\t}\n\n\tprivate get innerNode(): InnerNode {\n\t\treturn getOrCreateInnerNode(this);\n\t}\n\n\tprivate editor(key: string): OptionalFieldEditBuilder<ExclusiveMapTree> {\n\t\tconst field = this.innerNode.getBoxed(brand(key)) as FlexTreeOptionalField;\n\t\treturn field.editor;\n\t}\n\n\tpublic delete(key: string): void {\n\t\tconst field = this.innerNode.getBoxed(brand(key));\n\t\tthis.editor(key).set(undefined, field.length === 0);\n\t}\n\tpublic *entries(): IterableIterator<[string, TreeNodeFromImplicitAllowedTypes<T>]> {\n\t\tconst node = this.innerNode;\n\t\tfor (const key of node.keys()) {\n\t\t\tyield [\n\t\t\t\tkey,\n\t\t\t\tgetTreeNodeForField(node.getBoxed(key)) as TreeNodeFromImplicitAllowedTypes<T>,\n\t\t\t];\n\t\t}\n\t}\n\tpublic get(key: string): TreeNodeFromImplicitAllowedTypes<T> {\n\t\tconst node = this.innerNode;\n\t\tconst field = node.getBoxed(brand(key));\n\t\treturn getTreeNodeForField(field) as TreeNodeFromImplicitAllowedTypes<T>;\n\t}\n\tpublic has(key: string): boolean {\n\t\treturn this.innerNode.tryGetField(brand(key)) !== undefined;\n\t}\n\tpublic keys(): IterableIterator<string> {\n\t\tconst node = this.innerNode;\n\t\treturn node.keys();\n\t}\n\tpublic set(key: string, value: InsertableTreeNodeFromImplicitAllowedTypes<T>): this {\n\t\tconst kernel = getKernel(this);\n\t\tconst node = this.innerNode;\n\t\tconst mapTree = mapTreeFromNodeData(\n\t\t\tvalue as InsertableContent | undefined,\n\t\t\tcreateFieldSchema(FieldKind.Optional, kernel.schema.info as ImplicitAllowedTypes),\n\t\t\tnode.context.isHydrated() ? node.context.nodeKeyManager : undefined,\n\t\t\tgetSchemaAndPolicy(node),\n\t\t);\n\n\t\tconst field = node.getBoxed(brand(key));\n\t\tif (node.context.isHydrated()) {\n\t\t\tprepareContentForHydration(mapTree, node.context.checkout.forest);\n\t\t}\n\n\t\tthis.editor(key).set(mapTree, field.length === 0);\n\t\treturn this;\n\t}\n\tpublic get size(): number {\n\t\treturn count(this.innerNode.keys());\n\t}\n\tpublic *values(): IterableIterator<TreeNodeFromImplicitAllowedTypes<T>> {\n\t\tfor (const [, value] of this.entries()) {\n\t\t\tyield value;\n\t\t}\n\t}\n\tpublic forEach<TThis extends TreeMapNode<T>>(\n\t\tthis: TThis,\n\t\tcallbackFn: (value: TreeNodeFromImplicitAllowedTypes<T>, key: string, map: TThis) => void,\n\t\tthisArg?: unknown,\n\t): void {\n\t\tfor (const field of getOrCreateInnerNode(this).boxedIterator()) {\n\t\t\tconst node = getTreeNodeForField(field) as TreeNodeFromImplicitAllowedTypes<T>;\n\t\t\tcallbackFn.call(thisArg, node, field.key, this);\n\t\t}\n\t}\n\t// TODO: add `clear` once we have established merge semantics for it.\n}\n\n/**\n * Define a {@link TreeNodeSchema} for a {@link (TreeArrayNode:interface)}.\n *\n * @param base - base schema type to extend.\n * @param useMapPrototype - should this type emulate a ES6 Map object (by faking its prototype with a proxy).\n */\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function mapSchema<\n\tTName extends string,\n\tconst T extends ImplicitAllowedTypes,\n\tconst ImplicitlyConstructable extends boolean,\n\tconst TCustomMetadata = unknown,\n>(\n\tidentifier: TName,\n\tinfo: T,\n\timplicitlyConstructable: ImplicitlyConstructable,\n\tuseMapPrototype: boolean,\n\tmetadata?: NodeSchemaMetadata<TCustomMetadata>,\n) {\n\tconst lazyChildTypes = new Lazy(() => normalizeAllowedTypes(info));\n\tconst lazyAllowedTypesIdentifiers = new Lazy(\n\t\t() => new Set([...lazyChildTypes.value].map((type) => type.identifier)),\n\t);\n\n\tlet unhydratedContext: Context;\n\n\tclass Schema extends CustomMapNodeBase<T> implements TreeMapNode<T> {\n\t\tpublic static override prepareInstance<T2>(\n\t\t\tthis: typeof TreeNodeValid<T2>,\n\t\t\tinstance: TreeNodeValid<T2>,\n\t\t\tflexNode: FlexTreeNode,\n\t\t): TreeNodeValid<T2> {\n\t\t\tif (useMapPrototype) {\n\t\t\t\treturn new Proxy<Schema>(instance as Schema, handler as ProxyHandler<Schema>);\n\t\t\t}\n\t\t\treturn instance;\n\t\t}\n\n\t\tpublic static override buildRawNode<T2>(\n\t\t\tthis: typeof TreeNodeValid<T2>,\n\t\t\tinstance: TreeNodeValid<T2>,\n\t\t\tinput: T2,\n\t\t): UnhydratedFlexTreeNode {\n\t\t\treturn UnhydratedFlexTreeNode.getOrCreate(\n\t\t\t\tunhydratedContext,\n\t\t\t\tmapTreeFromNodeData(input as FactoryContent, this as unknown as ImplicitAllowedTypes),\n\t\t\t);\n\t\t}\n\n\t\tpublic static get allowedTypesIdentifiers(): ReadonlySet<string> {\n\t\t\treturn lazyAllowedTypesIdentifiers.value;\n\t\t}\n\n\t\tprotected static override constructorCached: MostDerivedData | undefined = undefined;\n\n\t\tprotected static override oneTimeSetup<T2>(this: typeof TreeNodeValid<T2>): Context {\n\t\t\tconst schema = this as unknown as TreeNodeSchema;\n\t\t\tunhydratedContext = getUnhydratedContext(schema);\n\t\t\treturn unhydratedContext;\n\t\t}\n\n\t\tpublic static readonly identifier = identifier;\n\t\tpublic static readonly info = info;\n\t\tpublic static readonly implicitlyConstructable: ImplicitlyConstructable =\n\t\t\timplicitlyConstructable;\n\t\tpublic static get childTypes(): ReadonlySet<TreeNodeSchema> {\n\t\t\treturn lazyChildTypes.value;\n\t\t}\n\t\tpublic static readonly metadata: NodeSchemaMetadata<TCustomMetadata> = metadata ?? {};\n\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tpublic get [typeNameSymbol](): TName {\n\t\t\treturn identifier;\n\t\t}\n\t\tpublic get [typeSchemaSymbol](): typeof schemaErased {\n\t\t\treturn Schema.constructorCached?.constructor as unknown as typeof schemaErased;\n\t\t}\n\t}\n\tconst schemaErased: MapNodeCustomizableSchema<\n\t\tTName,\n\t\tT,\n\t\tImplicitlyConstructable,\n\t\tTCustomMetadata\n\t> &\n\t\tMapNodePojoEmulationSchema<TName, T, ImplicitlyConstructable, TCustomMetadata> = Schema;\n\treturn schemaErased;\n}\n\n/**\n * Content which can be used to construct a Map node, explicitly or implicitly.\n * @system @public\n */\nexport type MapNodeInsertableData<T extends ImplicitAllowedTypes> =\n\t| Iterable<readonly [string, InsertableTreeNodeFromImplicitAllowedTypes<T>]>\n\t| RestrictiveStringRecord<InsertableTreeNodeFromImplicitAllowedTypes<T>>;\n"]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import type { MapNodeInsertableData, TreeMapNode } from "./mapNode.js";
|
|
6
|
+
import type { ImplicitAllowedTypes } from "./schemaTypes.js";
|
|
7
|
+
import { NodeKind, type TreeNodeSchemaClass, type TreeNodeSchema, type TreeNodeSchemaNonClass, type WithType } from "./core/index.js";
|
|
8
|
+
import type { SimpleMapNodeSchema } from "./simpleSchema.js";
|
|
9
|
+
/**
|
|
10
|
+
* A schema for customizable {@link (TreeMapNode:interface)}s.
|
|
11
|
+
* @system @sealed @alpha
|
|
12
|
+
*/
|
|
13
|
+
export interface MapNodeCustomizableSchema<out TName extends string = string, in out T extends ImplicitAllowedTypes = ImplicitAllowedTypes, out ImplicitlyConstructable extends boolean = true, out TCustomMetadata = unknown> extends TreeNodeSchemaClass<TName, NodeKind.Map, TreeMapNode<T> & WithType<TName, NodeKind.Map, T>, MapNodeInsertableData<T>, ImplicitlyConstructable, T, undefined, TCustomMetadata>, SimpleMapNodeSchema<TCustomMetadata> {
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A schema for POJO emulation mode {@link (TreeMapNode:interface)}s.
|
|
17
|
+
* @system @sealed @alpha
|
|
18
|
+
*/
|
|
19
|
+
export interface MapNodePojoEmulationSchema<out TName extends string = string, in out T extends ImplicitAllowedTypes = ImplicitAllowedTypes, out ImplicitlyConstructable extends boolean = true, out TCustomMetadata = unknown> extends TreeNodeSchemaNonClass<TName, NodeKind.Map, TreeMapNode<T> & WithType<TName, NodeKind.Map, T>, MapNodeInsertableData<T>, ImplicitlyConstructable, T, undefined, TCustomMetadata>, SimpleMapNodeSchema<TCustomMetadata> {
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A schema for {@link (TreeMapNode:interface)}s.
|
|
23
|
+
* @privateRemarks
|
|
24
|
+
* This could have generic arguments added and forwarded.
|
|
25
|
+
* The expected use-cases for this don't need them however, and if they did want an argument it would probably be the allowed types;
|
|
26
|
+
* perhaps if moving to an order independent way to pass generic arguments, adding support for them here would make sense.
|
|
27
|
+
* @alpha
|
|
28
|
+
*/
|
|
29
|
+
export type MapNodeSchema = MapNodeCustomizableSchema | MapNodePojoEmulationSchema;
|
|
30
|
+
/**
|
|
31
|
+
* @alpha
|
|
32
|
+
*/
|
|
33
|
+
export declare const MapNodeSchema: {
|
|
34
|
+
/**
|
|
35
|
+
* instanceof-based narrowing support for MapNodeSchema in Javascript and TypeScript 5.3 or newer.
|
|
36
|
+
*/
|
|
37
|
+
readonly [Symbol.hasInstance]: (value: TreeNodeSchema) => value is MapNodeSchema;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Narrows a {@link (TreeNodeSchema:interface)} to an {@link (MapNodeSchema:interface)}.
|
|
41
|
+
* @privateRemarks
|
|
42
|
+
* If at some point we want to have internal only APIs for MapNodeSchema (like done for objects),
|
|
43
|
+
* this can include those since its not the public facing API.
|
|
44
|
+
*/
|
|
45
|
+
export declare function isMapNodeSchema(schema: TreeNodeSchema): schema is MapNodeSchema;
|
|
46
|
+
//# sourceMappingURL=mapNodeTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapNodeTypes.d.ts","sourceRoot":"","sources":["../../src/simple-tree/mapNodeTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;A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AG;AAEzC;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG,yBAAyB,GAAG,0BAA0B,CAAC;AAEnF;;GAEG;AACH,eAAO,MAAM,aAAa;IACzB;;OAEG;2CACyB,cAAc;CAGjC,CAAC;AAEX;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,IAAI,aAAa,CAE/E"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { NodeKind, } from "./core/index.js";
|
|
6
|
+
/**
|
|
7
|
+
* @alpha
|
|
8
|
+
*/
|
|
9
|
+
export const MapNodeSchema = {
|
|
10
|
+
/**
|
|
11
|
+
* instanceof-based narrowing support for MapNodeSchema in Javascript and TypeScript 5.3 or newer.
|
|
12
|
+
*/
|
|
13
|
+
[Symbol.hasInstance](value) {
|
|
14
|
+
return isMapNodeSchema(value);
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Narrows a {@link (TreeNodeSchema:interface)} to an {@link (MapNodeSchema:interface)}.
|
|
19
|
+
* @privateRemarks
|
|
20
|
+
* If at some point we want to have internal only APIs for MapNodeSchema (like done for objects),
|
|
21
|
+
* this can include those since its not the public facing API.
|
|
22
|
+
*/
|
|
23
|
+
export function isMapNodeSchema(schema) {
|
|
24
|
+
return schema.kind === NodeKind.Map;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=mapNodeTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapNodeTypes.js","sourceRoot":"","sources":["../../src/simple-tree/mapNodeTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,QAAQ,GAKR,MAAM,iBAAiB,CAAC;AAwDzB;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC5B;;OAEG;IACH,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,KAAqB;QACzC,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;CACQ,CAAC;AAEX;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,MAAsB;IACrD,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC,GAAG,CAAC;AACrC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { MapNodeInsertableData, TreeMapNode } from \"./mapNode.js\";\nimport type { ImplicitAllowedTypes } from \"./schemaTypes.js\";\nimport {\n\tNodeKind,\n\ttype TreeNodeSchemaClass,\n\ttype TreeNodeSchema,\n\ttype TreeNodeSchemaNonClass,\n\ttype WithType,\n} from \"./core/index.js\";\n\nimport type { SimpleMapNodeSchema } from \"./simpleSchema.js\";\n\n/**\n * A schema for customizable {@link (TreeMapNode:interface)}s.\n * @system @sealed @alpha\n */\nexport interface MapNodeCustomizableSchema<\n\tout TName extends string = string,\n\tin out T extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\tout ImplicitlyConstructable extends boolean = true,\n\tout TCustomMetadata = unknown,\n> extends TreeNodeSchemaClass<\n\t\t\tTName,\n\t\t\tNodeKind.Map,\n\t\t\tTreeMapNode<T> & WithType<TName, NodeKind.Map, T>,\n\t\t\tMapNodeInsertableData<T>,\n\t\t\tImplicitlyConstructable,\n\t\t\tT,\n\t\t\tundefined,\n\t\t\tTCustomMetadata\n\t\t>,\n\t\tSimpleMapNodeSchema<TCustomMetadata> {}\n\n/**\n * A schema for POJO emulation mode {@link (TreeMapNode:interface)}s.\n * @system @sealed @alpha\n */\nexport interface MapNodePojoEmulationSchema<\n\tout TName extends string = string,\n\tin out T extends ImplicitAllowedTypes = ImplicitAllowedTypes,\n\tout ImplicitlyConstructable extends boolean = true,\n\tout TCustomMetadata = unknown,\n> extends TreeNodeSchemaNonClass<\n\t\t\tTName,\n\t\t\tNodeKind.Map,\n\t\t\tTreeMapNode<T> & WithType<TName, NodeKind.Map, T>,\n\t\t\tMapNodeInsertableData<T>,\n\t\t\tImplicitlyConstructable,\n\t\t\tT,\n\t\t\tundefined,\n\t\t\tTCustomMetadata\n\t\t>,\n\t\tSimpleMapNodeSchema<TCustomMetadata> {}\n\n/**\n * A schema for {@link (TreeMapNode:interface)}s.\n * @privateRemarks\n * This could have generic arguments added and forwarded.\n * The expected use-cases for this don't need them however, and if they did want an argument it would probably be the allowed types;\n * perhaps if moving to an order independent way to pass generic arguments, adding support for them here would make sense.\n * @alpha\n */\nexport type MapNodeSchema = MapNodeCustomizableSchema | MapNodePojoEmulationSchema;\n\n/**\n * @alpha\n */\nexport const MapNodeSchema = {\n\t/**\n\t * instanceof-based narrowing support for MapNodeSchema in Javascript and TypeScript 5.3 or newer.\n\t */\n\t[Symbol.hasInstance](value: TreeNodeSchema): value is MapNodeSchema {\n\t\treturn isMapNodeSchema(value);\n\t},\n} as const;\n\n/**\n * Narrows a {@link (TreeNodeSchema:interface)} to an {@link (MapNodeSchema:interface)}.\n * @privateRemarks\n * If at some point we want to have internal only APIs for MapNodeSchema (like done for objects),\n * this can include those since its not the public facing API.\n */\nexport function isMapNodeSchema(schema: TreeNodeSchema): schema is MapNodeSchema {\n\treturn schema.kind === NodeKind.Map;\n}\n"]}
|
|
@@ -7,13 +7,13 @@ import { type FlexTreeField } from "../feature-libraries/index.js";
|
|
|
7
7
|
import { type ImplicitFieldSchema, type TreeFieldFromImplicitField, type InsertableTreeFieldFromImplicitField, type FieldSchema, FieldKind, type NodeSchemaMetadata } from "./schemaTypes.js";
|
|
8
8
|
import { NodeKind, type WithType, type TreeNode } from "./core/index.js";
|
|
9
9
|
import { type InsertableContent } from "./toMapTree.js";
|
|
10
|
-
import {
|
|
10
|
+
import type { RestrictiveStringRecord, FlattenKeys } from "../util/index.js";
|
|
11
11
|
import { type ObjectNodeSchema, type ObjectNodeSchemaInternalData } from "./objectNodeTypes.js";
|
|
12
12
|
/**
|
|
13
13
|
* Generates the properties for an ObjectNode from its field schema object.
|
|
14
14
|
* @system @public
|
|
15
15
|
*/
|
|
16
|
-
export type ObjectFromSchemaRecord<T extends RestrictiveStringRecord<ImplicitFieldSchema>> = {
|
|
16
|
+
export type ObjectFromSchemaRecord<T extends RestrictiveStringRecord<ImplicitFieldSchema>> = RestrictiveStringRecord<ImplicitFieldSchema> extends T ? {} : {
|
|
17
17
|
-readonly [Property in keyof T]: Property extends string ? TreeFieldFromImplicitField<T[Property]> : unknown;
|
|
18
18
|
};
|
|
19
19
|
/**
|
|
@@ -58,9 +58,16 @@ export type FieldHasDefault<T extends ImplicitFieldSchema> = T extends FieldSche
|
|
|
58
58
|
* To prevent extraneous properties in literals for the fields of an empty object from compiling, the empty case is special cased to produce `Record<string, never>`.
|
|
59
59
|
* More details at {@link https://mercury.com/blog/creating-an-emptyobject-type-in-typescript}.
|
|
60
60
|
*
|
|
61
|
+
* Additionally when T is exactly `RestrictiveStringRecord<ImplicitFieldSchema>` produce just `never` so that it is assignable to the insertable for any given object type.
|
|
62
|
+
*
|
|
63
|
+
* Separating `{}` from `RestrictiveStringRecord<ImplicitFieldSchema>` is a bit messy since both extend each-other despite them being very different types.
|
|
64
|
+
* A third dummy type `{ arbitraryKey: "arbitraryValue" }` is used to resolve this.
|
|
65
|
+
*
|
|
61
66
|
* @system @public
|
|
62
67
|
*/
|
|
63
|
-
export type InsertableObjectFromSchemaRecord<T extends RestrictiveStringRecord<ImplicitFieldSchema>> =
|
|
68
|
+
export type InsertableObjectFromSchemaRecord<T extends RestrictiveStringRecord<ImplicitFieldSchema>> = RestrictiveStringRecord<ImplicitFieldSchema> extends T ? {
|
|
69
|
+
arbitraryKey: "arbitraryValue";
|
|
70
|
+
} extends T ? Record<string, never> : never : FlattenKeys<{
|
|
64
71
|
readonly [Property in keyof T]?: InsertableTreeFieldFromImplicitField<T[Property & string]>;
|
|
65
72
|
} & {
|
|
66
73
|
readonly [Property in keyof T as FieldHasDefault<T[Property & string]> extends false ? Property : never]: InsertableTreeFieldFromImplicitField<T[Property & string]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectNode.d.ts","sourceRoot":"","sources":["../../src/simple-tree/objectNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAEN,KAAK,aAAa,EAKlB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EACN,KAAK,mBAAmB,EAGxB,KAAK,0BAA0B,EAC/B,KAAK,oCAAoC,EACzC,KAAK,WAAW,EAGhB,SAAS,EACT,KAAK,kBAAkB,
|
|
1
|
+
{"version":3,"file":"objectNode.d.ts","sourceRoot":"","sources":["../../src/simple-tree/objectNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAEN,KAAK,aAAa,EAKlB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EACN,KAAK,mBAAmB,EAGxB,KAAK,0BAA0B,EAC/B,KAAK,oCAAoC,EACzC,KAAK,WAAW,EAGhB,SAAS,EACT,KAAK,kBAAkB,EAGvB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAEN,QAAQ,EACR,KAAK,QAAQ,EAKb,KAAK,QAAQ,EAIb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAuB,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,KAAK,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAEN,KAAK,gBAAgB,EACrB,KAAK,4BAA4B,EACjC,MAAM,sBAAsB,CAAC;AAK9B;;;GAGG;AACH,MAAM,MAAM,sBAAsB,CAAC,CAAC,SAAS,uBAAuB,CAAC,mBA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AAC,CAAC,QAAQ,GAAG,MAAM,CAAC,CAAC;CACrE,CACD,CAAC;AAEJ;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,GAAG,WAAW,CACrC,MAAM,GAAG,MAAM,EACf;IAAE,SAAS,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,WAAW,CAAA;CAAE,CAC5C,CAAC;AA2IF,wBAAgB,QAAQ,CACvB,KAAK,EAAE,aAAa,EACpB,iBAAiB,EAAE,WAAW,EAC9B,KAAK,EAAE,iBAAiB,GAAG,SAAS,GAClC,IAAI,CA4BN;AAQD;;;;;GAKG;AACH,wBAAgB,YAAY,CAC3B,KAAK,SAAS,MAAM,EACpB,KAAK,CAAC,CAAC,SAAS,uBAAuB,CAAC,mBAAmB,CAAC,EAC5D,KAAK,CAAC,uBAAuB,SAAS,OAAO,EAC7C,KAAK,CAAC,eAAe,GAAG,OAAO,EAE/B,UAAU,EAAE,KAAK,EACjB,IAAI,EAAE,CAAC,EACP,uBAAuB,EAAE,uBAAuB,EAChD,0BAA0B,EAAE,OAAO,EACnC,QAAQ,CAAC,EAAE,kBAAkB,CAAC,eAAe,CAAC,GAC5C,gBAAgB,CAAC,KAAK,EAAE,CAAC,EAAE,uBAAuB,EAAE,eAAe,CAAC,GACtE,4BAA4B,CAwJ5B;AA0CD;;;GAGG;AACH,wBAAgB,gCAAgC,CAC/C,MAAM,EAAE,mBAAmB,GACzB,YAAY,CAAC,4BAA4B,CAAC,CAU5C"}
|
|
@@ -2,16 +2,15 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { assert, Lazy } from "@fluidframework/core-utils/internal";
|
|
5
|
+
import { assert, Lazy, fail } from "@fluidframework/core-utils/internal";
|
|
6
6
|
import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
7
7
|
import { FieldKinds, getSchemaAndPolicy, } from "../feature-libraries/index.js";
|
|
8
8
|
import { getTreeNodeForField, prepareContentForHydration } from "./proxies.js";
|
|
9
|
-
import { getStoredKey, getExplicitStoredKey, normalizeFieldSchema, FieldKind, } from "./schemaTypes.js";
|
|
9
|
+
import { getStoredKey, getExplicitStoredKey, normalizeFieldSchema, FieldKind, ObjectFieldSchema, } from "./schemaTypes.js";
|
|
10
10
|
import { NodeKind,
|
|
11
11
|
// eslint-disable-next-line import/no-deprecated
|
|
12
12
|
typeNameSymbol, typeSchemaSymbol, UnhydratedFlexTreeNode, getOrCreateInnerNode, } from "./core/index.js";
|
|
13
13
|
import { mapTreeFromNodeData } from "./toMapTree.js";
|
|
14
|
-
import { fail } from "../util/index.js";
|
|
15
14
|
import { isObjectNodeSchema, } from "./objectNodeTypes.js";
|
|
16
15
|
import { TreeNodeValid } from "./treeNodeValid.js";
|
|
17
16
|
import { getUnhydratedContext } from "./createContext.js";
|
|
@@ -239,7 +238,13 @@ export function objectSchema(identifier, info, implicitlyConstructable, allowUnk
|
|
|
239
238
|
return CustomObjectNode.constructorCached?.constructor;
|
|
240
239
|
}
|
|
241
240
|
}
|
|
242
|
-
CustomObjectNode.fields = new Map(Array.from(flexKeyMap, ([key, value]) => [
|
|
241
|
+
CustomObjectNode.fields = new Map(Array.from(flexKeyMap, ([key, value]) => [
|
|
242
|
+
key,
|
|
243
|
+
new ObjectFieldSchema(value.schema.kind, value.schema.allowedTypes, {
|
|
244
|
+
...value.schema.props,
|
|
245
|
+
key: getStoredKey(key, value.schema),
|
|
246
|
+
}),
|
|
247
|
+
]));
|
|
243
248
|
CustomObjectNode.flexKeyMap = flexKeyMap;
|
|
244
249
|
CustomObjectNode.storedKeyToPropertyKey = new Map(Array.from(flexKeyMap, ([key, value]) => [
|
|
245
250
|
value.storedKey,
|
|
@@ -251,7 +256,7 @@ export function objectSchema(identifier, info, implicitlyConstructable, allowUnk
|
|
|
251
256
|
CustomObjectNode.identifier = identifier;
|
|
252
257
|
CustomObjectNode.info = info;
|
|
253
258
|
CustomObjectNode.implicitlyConstructable = implicitlyConstructable;
|
|
254
|
-
CustomObjectNode.metadata = metadata;
|
|
259
|
+
CustomObjectNode.metadata = metadata ?? {};
|
|
255
260
|
return CustomObjectNode;
|
|
256
261
|
}
|
|
257
262
|
const targetToProxy = new WeakMap();
|