@fluidframework/tree 2.22.1 → 2.23.0-325054
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/.vscode/extensions.json +1 -0
- package/.vscode/settings.json +1 -0
- package/CHANGELOG.md +47 -0
- package/api-report/tree.alpha.api.md +169 -10
- package/api-report/tree.beta.api.md +101 -9
- package/api-report/tree.legacy.alpha.api.md +101 -9
- package/api-report/tree.legacy.public.api.md +101 -9
- package/api-report/tree.public.api.md +101 -9
- package/dist/alpha.d.ts +20 -0
- package/dist/beta.d.ts +15 -0
- package/dist/codec/codec.js +3 -3
- 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/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +3 -3
- 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 +18 -13
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/treeTextFormat.js +1 -1
- 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 +11 -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.js +3 -3
- package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +2 -2
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +4 -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/schemaBasedEncoding.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncoding.js +3 -3
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncoding.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/emptyChunk.js +14 -14
- 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 +6 -4
- package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/default-schema/schemaChecker.js +1 -1
- package/dist/feature-libraries/default-schema/schemaChecker.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +4 -3
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.js +5 -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.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.js +6 -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 +4 -4
- package/dist/feature-libraries/modular-schema/isNeverTree.js.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 +10 -11
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/node-key/mockNodeKeyManager.js +1 -1
- package/dist/feature-libraries/node-key/mockNodeKeyManager.js.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.js +1 -1
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.js +1 -1
- package/dist/feature-libraries/sequence-field/compose.js.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.js +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js.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 +6 -4
- package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/dist/jsonDomainSchema.d.ts +113 -0
- package/dist/jsonDomainSchema.d.ts.map +1 -0
- package/dist/jsonDomainSchema.js +101 -0
- package/dist/jsonDomainSchema.js.map +1 -0
- package/dist/legacy.d.ts +15 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/public.d.ts +15 -0
- package/dist/serializableDomainSchema.d.ts +108 -0
- package/dist/serializableDomainSchema.d.ts.map +1 -0
- package/dist/serializableDomainSchema.js +90 -0
- package/dist/serializableDomainSchema.js.map +1 -0
- package/dist/shared-tree/index.d.ts +1 -1
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js.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 +37 -20
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +17 -17
- package/dist/shared-tree/sharedTree.js.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.map +1 -1
- package/dist/shared-tree/treeApiAlpha.js +4 -4
- package/dist/shared-tree/treeApiAlpha.js.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/editManager.d.ts +11 -2
- package/dist/shared-tree-core/editManager.d.ts.map +1 -1
- package/dist/shared-tree-core/editManager.js +70 -34
- package/dist/shared-tree-core/editManager.js.map +1 -1
- package/dist/shared-tree-core/resubmitMachine.d.ts +2 -0
- package/dist/shared-tree-core/resubmitMachine.d.ts.map +1 -1
- package/dist/shared-tree-core/resubmitMachine.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts +10 -3
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +42 -7
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/simple-tree/api/component.d.ts +30 -0
- package/dist/simple-tree/api/component.d.ts.map +1 -0
- package/dist/simple-tree/api/component.js +26 -0
- package/dist/simple-tree/api/component.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/index.d.ts +2 -1
- 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.js +1 -1
- package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts +0 -8
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +4 -25
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/dist/simple-tree/api/simpleTreeIndex.js +3 -3
- package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts.map +1 -1
- package/dist/simple-tree/api/tree.js +2 -3
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.js +7 -18
- package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.d.ts +127 -19
- package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.js +17 -0
- package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
- package/dist/simple-tree/api/verboseTree.d.ts.map +1 -1
- package/dist/simple-tree/api/verboseTree.js +5 -4
- package/dist/simple-tree/api/verboseTree.js.map +1 -1
- package/dist/simple-tree/api/view.js +1 -1
- package/dist/simple-tree/api/view.js.map +1 -1
- package/dist/simple-tree/arrayNode.d.ts +1 -1
- package/dist/simple-tree/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/arrayNode.js +2 -2
- package/dist/simple-tree/arrayNode.js.map +1 -1
- package/dist/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
- package/dist/simple-tree/core/getOrCreateNode.js +1 -1
- package/dist/simple-tree/core/getOrCreateNode.js.map +1 -1
- package/dist/simple-tree/core/schemaCaching.js +1 -1
- package/dist/simple-tree/core/schemaCaching.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +6 -6
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js +5 -5
- package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/dist/simple-tree/flexList.d.ts +4 -5
- package/dist/simple-tree/flexList.d.ts.map +1 -1
- package/dist/simple-tree/flexList.js +1 -14
- package/dist/simple-tree/flexList.js.map +1 -1
- package/dist/simple-tree/index.d.ts +4 -4
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +6 -2
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/objectNode.d.ts +25 -2
- package/dist/simple-tree/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/objectNode.js +4 -2
- package/dist/simple-tree/objectNode.js.map +1 -1
- package/dist/simple-tree/proxies.js +1 -1
- package/dist/simple-tree/proxies.js.map +1 -1
- package/dist/simple-tree/schemaTypes.d.ts +211 -9
- package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
- package/dist/simple-tree/schemaTypes.js +83 -2
- package/dist/simple-tree/schemaTypes.js.map +1 -1
- package/dist/simple-tree/toMapTree.js +3 -3
- package/dist/simple-tree/toMapTree.js.map +1 -1
- package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +3 -6
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/simple-tree/treeNodeValid.d.ts +7 -1
- package/dist/simple-tree/treeNodeValid.d.ts.map +1 -1
- package/dist/simple-tree/treeNodeValid.js +18 -7
- package/dist/simple-tree/treeNodeValid.js.map +1 -1
- package/dist/util/idAllocator.js +1 -1
- package/dist/util/idAllocator.js.map +1 -1
- package/dist/util/index.d.ts +2 -2
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +5 -4
- package/dist/util/index.js.map +1 -1
- package/dist/util/nestedMap.d.ts +2 -10
- package/dist/util/nestedMap.d.ts.map +1 -1
- package/dist/util/nestedMap.js +9 -28
- package/dist/util/nestedMap.js.map +1 -1
- package/dist/util/utils.d.ts +23 -6
- package/dist/util/utils.d.ts.map +1 -1
- package/dist/util/utils.js +46 -13
- package/dist/util/utils.js.map +1 -1
- package/lib/alpha.d.ts +20 -0
- package/lib/beta.d.ts +15 -0
- package/lib/codec/codec.js +3 -3
- package/lib/codec/codec.js.map +1 -1
- package/lib/codec/discriminatedUnions.d.ts.map +1 -1
- package/lib/codec/discriminatedUnions.js +1 -1
- package/lib/codec/discriminatedUnions.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +3 -3
- 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 +19 -14
- 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 +11 -8
- 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.js +3 -3
- package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +2 -2
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +4 -3
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.js +2 -2
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncoding.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncoding.js +3 -3
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncoding.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/emptyChunk.js +14 -14
- 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 +6 -4
- package/lib/feature-libraries/chunked-forest/uniformChunk.js.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.js +1 -1
- package/lib/feature-libraries/default-schema/schemaChecker.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +4 -3
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.js +5 -4
- 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 +1 -1
- package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.js +6 -4
- 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 +4 -4
- package/lib/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +4 -4
- 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 +11 -12
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/node-key/mockNodeKeyManager.js +1 -1
- package/lib/feature-libraries/node-key/mockNodeKeyManager.js.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/lib/feature-libraries/schema-index/codec.js +1 -1
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.js +1 -1
- package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
- package/lib/feature-libraries/sequence-field/invert.js +1 -1
- package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
- package/lib/feature-libraries/sequence-field/utils.js +1 -1
- 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 +6 -4
- package/lib/feature-libraries/treeCursorUtils.js.map +1 -1
- package/lib/index.d.ts +4 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/lib/jsonDomainSchema.d.ts +113 -0
- package/lib/jsonDomainSchema.d.ts.map +1 -0
- package/lib/jsonDomainSchema.js +98 -0
- package/lib/jsonDomainSchema.js.map +1 -0
- package/lib/legacy.d.ts +15 -0
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/public.d.ts +15 -0
- package/lib/serializableDomainSchema.d.ts +108 -0
- package/lib/serializableDomainSchema.d.ts.map +1 -0
- package/lib/serializableDomainSchema.js +87 -0
- package/lib/serializableDomainSchema.js.map +1 -0
- package/lib/shared-tree/index.d.ts +1 -1
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/schematizeTree.js +1 -1
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +37 -20
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +18 -18
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/treeApiAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeApiAlpha.js +4 -4
- package/lib/shared-tree/treeApiAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.js +1 -1
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/editManager.d.ts +11 -2
- package/lib/shared-tree-core/editManager.d.ts.map +1 -1
- package/lib/shared-tree-core/editManager.js +70 -34
- package/lib/shared-tree-core/editManager.js.map +1 -1
- package/lib/shared-tree-core/resubmitMachine.d.ts +2 -0
- package/lib/shared-tree-core/resubmitMachine.d.ts.map +1 -1
- package/lib/shared-tree-core/resubmitMachine.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts +10 -3
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +42 -7
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/simple-tree/api/component.d.ts +30 -0
- package/lib/simple-tree/api/component.d.ts.map +1 -0
- package/lib/simple-tree/api/component.js +23 -0
- package/lib/simple-tree/api/component.js.map +1 -0
- package/lib/simple-tree/api/customTree.js +3 -3
- package/lib/simple-tree/api/customTree.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +2 -1
- 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.js +1 -1
- package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts +0 -8
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +2 -22
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/lib/simple-tree/api/simpleTreeIndex.js +3 -3
- package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts.map +1 -1
- package/lib/simple-tree/api/tree.js +3 -4
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.js +9 -20
- package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.d.ts +127 -19
- package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.js +15 -1
- package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
- package/lib/simple-tree/api/verboseTree.d.ts.map +1 -1
- package/lib/simple-tree/api/verboseTree.js +5 -4
- package/lib/simple-tree/api/verboseTree.js.map +1 -1
- package/lib/simple-tree/api/view.js +1 -1
- package/lib/simple-tree/api/view.js.map +1 -1
- package/lib/simple-tree/arrayNode.d.ts +1 -1
- package/lib/simple-tree/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/arrayNode.js +2 -2
- package/lib/simple-tree/arrayNode.js.map +1 -1
- package/lib/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
- package/lib/simple-tree/core/getOrCreateNode.js +1 -1
- package/lib/simple-tree/core/getOrCreateNode.js.map +1 -1
- package/lib/simple-tree/core/schemaCaching.js +1 -1
- package/lib/simple-tree/core/schemaCaching.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +6 -6
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js +5 -5
- package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/lib/simple-tree/flexList.d.ts +4 -5
- package/lib/simple-tree/flexList.d.ts.map +1 -1
- package/lib/simple-tree/flexList.js +0 -12
- package/lib/simple-tree/flexList.js.map +1 -1
- package/lib/simple-tree/index.d.ts +4 -4
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +2 -2
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/objectNode.d.ts +25 -2
- package/lib/simple-tree/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/objectNode.js +4 -2
- package/lib/simple-tree/objectNode.js.map +1 -1
- package/lib/simple-tree/proxies.js +1 -1
- package/lib/simple-tree/proxies.js.map +1 -1
- package/lib/simple-tree/schemaTypes.d.ts +211 -9
- package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
- package/lib/simple-tree/schemaTypes.js +81 -3
- package/lib/simple-tree/schemaTypes.js.map +1 -1
- package/lib/simple-tree/toMapTree.js +3 -3
- package/lib/simple-tree/toMapTree.js.map +1 -1
- package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +5 -8
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/simple-tree/treeNodeValid.d.ts +7 -1
- package/lib/simple-tree/treeNodeValid.d.ts.map +1 -1
- package/lib/simple-tree/treeNodeValid.js +18 -7
- package/lib/simple-tree/treeNodeValid.js.map +1 -1
- package/lib/util/idAllocator.js +1 -1
- package/lib/util/idAllocator.js.map +1 -1
- package/lib/util/index.d.ts +2 -2
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +2 -2
- package/lib/util/index.js.map +1 -1
- package/lib/util/nestedMap.d.ts +2 -10
- package/lib/util/nestedMap.d.ts.map +1 -1
- package/lib/util/nestedMap.js +5 -23
- package/lib/util/nestedMap.js.map +1 -1
- package/lib/util/utils.d.ts +23 -6
- package/lib/util/utils.d.ts.map +1 -1
- package/lib/util/utils.js +42 -11
- package/lib/util/utils.js.map +1 -1
- package/package.json +27 -23
- package/src/codec/codec.ts +3 -3
- package/src/codec/discriminatedUnions.ts +2 -1
- package/src/core/schema-stored/schema.ts +5 -3
- package/src/core/tree/anchorSet.ts +37 -26
- package/src/core/tree/treeTextFormat.ts +1 -1
- package/src/feature-libraries/chunked-forest/basicChunk.ts +11 -8
- package/src/feature-libraries/chunked-forest/chunkTree.ts +2 -2
- package/src/feature-libraries/chunked-forest/chunkedForest.ts +3 -3
- package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +2 -2
- package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +4 -3
- package/src/feature-libraries/chunked-forest/codec/nodeShape.ts +2 -2
- package/src/feature-libraries/chunked-forest/codec/schemaBasedEncoding.ts +4 -3
- package/src/feature-libraries/chunked-forest/emptyChunk.ts +14 -14
- package/src/feature-libraries/chunked-forest/uniformChunk.ts +6 -4
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +1 -1
- package/src/feature-libraries/default-schema/schemaChecker.ts +1 -1
- package/src/feature-libraries/flex-tree/lazyField.ts +6 -8
- package/src/feature-libraries/flex-tree/lazyNode.ts +6 -4
- package/src/feature-libraries/indexing/anchorTreeIndex.ts +2 -1
- package/src/feature-libraries/modular-schema/comparison.ts +7 -5
- package/src/feature-libraries/modular-schema/isNeverTree.ts +6 -4
- package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +4 -4
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +16 -12
- package/src/feature-libraries/node-key/mockNodeKeyManager.ts +1 -1
- package/src/feature-libraries/object-forest/objectForest.ts +1 -1
- package/src/feature-libraries/schema-index/codec.ts +1 -1
- package/src/feature-libraries/sequence-field/compose.ts +1 -1
- package/src/feature-libraries/sequence-field/invert.ts +1 -1
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV1.ts +1 -1
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +1 -1
- package/src/feature-libraries/sequence-field/utils.ts +1 -1
- package/src/feature-libraries/treeCursorUtils.ts +6 -4
- package/src/index.ts +22 -1
- package/src/jsonDomainSchema.ts +129 -0
- package/src/packageVersion.ts +1 -1
- package/src/serializableDomainSchema.ts +121 -0
- package/src/shared-tree/index.ts +0 -1
- package/src/shared-tree/schematizeTree.ts +1 -1
- package/src/shared-tree/sharedTree.ts +31 -41
- package/src/shared-tree/sharedTreeChangeFamily.ts +1 -1
- package/src/shared-tree/treeApiAlpha.ts +12 -4
- package/src/shared-tree/treeCheckout.ts +1 -1
- package/src/shared-tree-core/editManager.ts +85 -47
- package/src/shared-tree-core/resubmitMachine.ts +2 -0
- package/src/shared-tree-core/sharedTreeCore.ts +62 -14
- package/src/simple-tree/api/component.ts +42 -0
- package/src/simple-tree/api/customTree.ts +3 -3
- package/src/simple-tree/api/index.ts +7 -0
- package/src/simple-tree/api/schemaCreationUtilities.ts +1 -1
- package/src/simple-tree/api/schemaFactory.ts +1 -28
- package/src/simple-tree/api/schemaFactoryRecursive.ts +1 -1
- package/src/simple-tree/api/simpleTreeIndex.ts +3 -3
- package/src/simple-tree/api/tree.ts +3 -3
- package/src/simple-tree/api/treeNodeApi.ts +10 -18
- package/src/simple-tree/api/typesUnsafe.ts +193 -18
- package/src/simple-tree/api/verboseTree.ts +8 -4
- package/src/simple-tree/api/view.ts +1 -1
- package/src/simple-tree/arrayNode.ts +2 -2
- package/src/simple-tree/core/getOrCreateNode.ts +2 -1
- package/src/simple-tree/core/schemaCaching.ts +1 -1
- package/src/simple-tree/core/treeNodeKernel.ts +9 -6
- package/src/simple-tree/core/unhydratedFlexTree.ts +7 -5
- package/src/simple-tree/flexList.ts +4 -14
- package/src/simple-tree/index.ts +25 -1
- package/src/simple-tree/objectNode.ts +50 -5
- package/src/simple-tree/proxies.ts +1 -1
- package/src/simple-tree/schemaTypes.ts +322 -23
- package/src/simple-tree/toMapTree.ts +3 -3
- package/src/simple-tree/toStoredSchema.ts +5 -7
- package/src/simple-tree/treeNodeValid.ts +21 -7
- package/src/util/idAllocator.ts +1 -1
- package/src/util/index.ts +3 -2
- package/src/util/nestedMap.ts +9 -33
- package/src/util/utils.ts +52 -12
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import type { ErasedType, IFluidHandle } from "@fluidframework/core-interfaces";
|
|
6
6
|
import type { NodeKeyManager } from "../feature-libraries/index.js";
|
|
7
7
|
import { type MakeNominal, type UnionToIntersection } from "../util/index.js";
|
|
8
|
-
import type
|
|
8
|
+
import { type Unhydrated, type NodeKind, type TreeNodeSchema, type TreeNodeSchemaClass, type TreeNode, type TreeNodeSchemaCore, type TreeNodeSchemaNonClass } from "./core/index.js";
|
|
9
9
|
import type { FieldKey } from "../core/index.js";
|
|
10
10
|
import type { InsertableContent } from "./toMapTree.js";
|
|
11
11
|
import { type FlexListToUnion, type LazyItem } from "./flexList.js";
|
|
@@ -27,6 +27,8 @@ export declare function isTreeNodeSchemaClass<Name extends string, Kind extends
|
|
|
27
27
|
* way to declare and manipulate unordered sets of types in TypeScript.
|
|
28
28
|
*
|
|
29
29
|
* Not intended for direct use outside of package.
|
|
30
|
+
* @privateRemarks
|
|
31
|
+
* Code reading data from this should use `normalizeAllowedTypes` to ensure consistent handling, caching, nice errors etc.
|
|
30
32
|
* @system @public
|
|
31
33
|
*/
|
|
32
34
|
export type AllowedTypes = readonly LazyItem<TreeNodeSchema>[];
|
|
@@ -282,6 +284,21 @@ export declare function areImplicitFieldSchemaEqual(a: ImplicitFieldSchema, b: I
|
|
|
282
284
|
* 3. They have the same exact set of allowed types. The allowed types must be reference equal.
|
|
283
285
|
*/
|
|
284
286
|
export declare function areFieldSchemaEqual(a: FieldSchema, b: FieldSchema): boolean;
|
|
287
|
+
/**
|
|
288
|
+
* Returns the schema referenced by the {@link LazyItem}.
|
|
289
|
+
* @remarks
|
|
290
|
+
* Caches results to handle {@link LazyItem} which compute their resulting schema.
|
|
291
|
+
* @alpha
|
|
292
|
+
*/
|
|
293
|
+
export declare function evaluateLazySchema<T extends TreeNodeSchema>(value: LazyItem<T>): T;
|
|
294
|
+
/**
|
|
295
|
+
* Indicates that a schema is the "most derived" version which is allowed to be used, see {@link MostDerivedData}.
|
|
296
|
+
* Calling helps with error messages about invalid schema usage (using more than one type from single schema factor produced type,
|
|
297
|
+
* and thus calling this for one than one subclass).
|
|
298
|
+
* @remarks
|
|
299
|
+
* Helper for invoking {@link TreeNodeValid.markMostDerived} for any {@link TreeNodeSchema} if it needed.
|
|
300
|
+
*/
|
|
301
|
+
export declare function markSchemaMostDerived(schema: TreeNodeSchema, oneTimeInitialize?: boolean): void;
|
|
285
302
|
/**
|
|
286
303
|
* Types of {@link TreeNode|TreeNodes} or {@link TreeLeafValue|TreeLeafValues} allowed at a location in a tree.
|
|
287
304
|
* @remarks
|
|
@@ -311,6 +328,8 @@ export declare function areFieldSchemaEqual(a: FieldSchema, b: FieldSchema): boo
|
|
|
311
328
|
* class A extends sf.array("example", [() => B]) {}
|
|
312
329
|
* class B extends sf.array("Inner", sf.number) {}
|
|
313
330
|
* ```
|
|
331
|
+
* @privateRemarks
|
|
332
|
+
* Code reading data from this should use `normalizeAllowedTypes` to ensure consistent handling, caching, nice errors etc.
|
|
314
333
|
* @public
|
|
315
334
|
*/
|
|
316
335
|
export type ImplicitAllowedTypes = AllowedTypes | TreeNodeSchema;
|
|
@@ -339,7 +358,16 @@ export type TreeFieldFromImplicitField<TSchema extends ImplicitFieldSchema = Fie
|
|
|
339
358
|
* @typeparam TSchema - Do not specify: default value used as implementation detail.
|
|
340
359
|
* @public
|
|
341
360
|
*/
|
|
342
|
-
export type InsertableTreeFieldFromImplicitField<TSchemaInput extends ImplicitFieldSchema, TSchema =
|
|
361
|
+
export type InsertableTreeFieldFromImplicitField<TSchemaInput extends ImplicitFieldSchema, TSchema = [TSchemaInput] extends [CustomizedSchemaTyping<unknown, CustomTypes>] ? TSchemaInput : SchemaUnionToIntersection<TSchemaInput>> = [TSchema] extends [FieldSchema<infer Kind, infer Types>] ? ApplyKindInput<InsertableTreeNodeFromImplicitAllowedTypes<Types>, Kind, true> : [TSchema] extends [ImplicitAllowedTypes] ? InsertableTreeNodeFromImplicitAllowedTypes<TSchema> : never;
|
|
362
|
+
/**
|
|
363
|
+
* {@link UnionToIntersection} except it does not distribute over {@link CustomizedSchemaTyping}s when the original type is a union.
|
|
364
|
+
* @privateRemarks
|
|
365
|
+
* This is a workaround for TypeScript distributing over intersections over unions when distributing extends over unions.
|
|
366
|
+
* @system @public
|
|
367
|
+
*/
|
|
368
|
+
export type SchemaUnionToIntersection<T> = [T] extends [
|
|
369
|
+
CustomizedSchemaTyping<unknown, CustomTypes>
|
|
370
|
+
] ? T : UnionToIntersection<T>;
|
|
343
371
|
/**
|
|
344
372
|
* {@inheritdoc (UnsafeUnknownSchema:type)}
|
|
345
373
|
* @alpha
|
|
@@ -361,18 +389,174 @@ export declare const UnsafeUnknownSchema: unique symbol;
|
|
|
361
389
|
* Any APIs which use this must produce UsageErrors when out of schema data is encountered, and never produce unrecoverable errors,
|
|
362
390
|
* or silently accept invalid data.
|
|
363
391
|
* This is currently only type exported from the package: the symbol is just used as a way to get a named type.
|
|
392
|
+
*
|
|
393
|
+
* TODO: This takes a very different approach than `customizeSchemaTyping` which applies to allowed types.
|
|
394
|
+
* Maybe generalize that to apply to field schema as well and replace this with it?
|
|
364
395
|
* @alpha
|
|
365
396
|
*/
|
|
366
397
|
export type UnsafeUnknownSchema = typeof UnsafeUnknownSchema;
|
|
398
|
+
/**
|
|
399
|
+
* {@inheritdoc (CustomizedTyping:type)}
|
|
400
|
+
* @system @public
|
|
401
|
+
*/
|
|
402
|
+
export declare const CustomizedTyping: unique symbol;
|
|
403
|
+
/**
|
|
404
|
+
* A type brand used by {@link customizeSchemaTyping}.
|
|
405
|
+
* @system @public
|
|
406
|
+
*/
|
|
407
|
+
export type CustomizedTyping = typeof CustomizedTyping;
|
|
408
|
+
/**
|
|
409
|
+
* Collection of schema aware types.
|
|
410
|
+
* @remarks
|
|
411
|
+
* This type is only used as a type constraint.
|
|
412
|
+
* It's fields are similar to an unordered set of generic type parameters.
|
|
413
|
+
* {@link customizeSchemaTyping} applies this to {@link ImplicitAllowedTypes} via {@link CustomizedSchemaTyping}.
|
|
414
|
+
* @sealed @public
|
|
415
|
+
*/
|
|
416
|
+
export interface CustomTypes {
|
|
417
|
+
/**
|
|
418
|
+
* Type used for inserting values.
|
|
419
|
+
*/
|
|
420
|
+
readonly input: unknown;
|
|
421
|
+
/**
|
|
422
|
+
* Type used for the read+write property on object nodes.
|
|
423
|
+
*
|
|
424
|
+
* Set to never to disable setter.
|
|
425
|
+
* @remarks
|
|
426
|
+
* Due to https://github.com/microsoft/TypeScript/issues/43826 we cannot set the desired setter type.
|
|
427
|
+
* Instead we can only control the types of the read+write property and the type of a readonly property.
|
|
428
|
+
*
|
|
429
|
+
* For recursive types using {@link SchemaFactory.objectRecursive}, support for using `never` to remove setters is limited:
|
|
430
|
+
* When the customized schema is wrapped in an {@link FieldSchema}, the setter will not be fully removed.
|
|
431
|
+
*/
|
|
432
|
+
readonly readWrite: TreeLeafValue | TreeNode;
|
|
433
|
+
/**
|
|
434
|
+
* Type for reading data.
|
|
435
|
+
* @remarks
|
|
436
|
+
* See limitation for read+write properties on ObjectNodes in {@link CustomTypes.readWrite}.
|
|
437
|
+
*/
|
|
438
|
+
readonly output: TreeLeafValue | TreeNode;
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* Type annotation which overrides the default schema derived types with customized ones.
|
|
442
|
+
* @remarks
|
|
443
|
+
* See {@link customizeSchemaTyping} for more information.
|
|
444
|
+
* @system @public
|
|
445
|
+
*/
|
|
446
|
+
export type CustomizedSchemaTyping<TSchema, TCustom extends CustomTypes> = TSchema & {
|
|
447
|
+
[CustomizedTyping]: TCustom;
|
|
448
|
+
};
|
|
449
|
+
/**
|
|
450
|
+
* Default strict policy.
|
|
451
|
+
*
|
|
452
|
+
* @typeparam TSchema - The schema to process
|
|
453
|
+
* @typeparam TInput - Internal: do not specify.
|
|
454
|
+
* @typeparam TOutput - Internal: do not specify.
|
|
455
|
+
* @remarks
|
|
456
|
+
* Handles input types contravariantly so any input which might be invalid is rejected.
|
|
457
|
+
* @sealed @public
|
|
458
|
+
*/
|
|
459
|
+
export interface StrictTypes<TSchema extends ImplicitAllowedTypes, TInput = DefaultInsertableTreeNodeFromImplicitAllowedTypes<TSchema>, TOutput extends TreeNode | TreeLeafValue = DefaultTreeNodeFromImplicitAllowedTypes<TSchema>> {
|
|
460
|
+
input: TInput;
|
|
461
|
+
readWrite: TInput extends never ? never : TOutput;
|
|
462
|
+
output: TOutput;
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* Customizes the types associated with `TSchema`
|
|
466
|
+
* @remarks
|
|
467
|
+
* By default, the types used when constructing, reading and writing tree nodes are derived from the schema.
|
|
468
|
+
* In some cases, it may be desirable to override these types with carefully selected alternatives.
|
|
469
|
+
* This utility allows for that customization.
|
|
470
|
+
* Note that this customization is only used for typing, and does not affect the runtime behavior at all.
|
|
471
|
+
*
|
|
472
|
+
* This can be used for a wide variety of purposes, including (but not limited to):
|
|
473
|
+
*
|
|
474
|
+
* 1. Implementing better typing for a runtime extensible set of types (e.g. a polymorphic collection).
|
|
475
|
+
* This is commonly needed when implementing containers which don't directly reference their child types, and can be done using {@link Customizer.simplified}.
|
|
476
|
+
* 2. Adding type brands to specific values to increase type safety.
|
|
477
|
+
* This can be done using {@link Customizer.simplified}.
|
|
478
|
+
* 3. Adding some (compile time only) constraints to values, like enum style unions.
|
|
479
|
+
* This can be done using {@link Customizer.simplified}.
|
|
480
|
+
* 4. Making fields readonly (for the current client).
|
|
481
|
+
* This can be done using {@link Customizer.custom} with `{ readWrite: never; }`.
|
|
482
|
+
* 5. Opting into more [compleat and less sound](https://en.wikipedia.org/wiki/Soundness#Relation_to_completeness) typing.
|
|
483
|
+
* {@link Customizer.relaxed} is an example of this.
|
|
484
|
+
*
|
|
485
|
+
* For this customization to be used, the resulting schema must be used as `ImplicitAllowedTypes`.
|
|
486
|
+
* For example applying this to a single type, then using that type in an array of allowed types will have no effect:
|
|
487
|
+
* in such a case the customization must instead be applied to the array of allowed types.
|
|
488
|
+
* @privateRemarks
|
|
489
|
+
* Once this API is more stable/final, the examples in tests such as openPolymorphism.spec.ts and schemaFactory.examples.spec.ts
|
|
490
|
+
* should be copied into examples here, or somehow linked.
|
|
491
|
+
* @alpha
|
|
492
|
+
*/
|
|
493
|
+
export declare function customizeSchemaTyping<const TSchema extends ImplicitAllowedTypes>(schema: TSchema): Customizer<TSchema>;
|
|
494
|
+
/**
|
|
495
|
+
* Utility for customizing the types used for data matching a given schema.
|
|
496
|
+
* @sealed @alpha
|
|
497
|
+
*/
|
|
498
|
+
export interface Customizer<TSchema extends ImplicitAllowedTypes> {
|
|
499
|
+
/**
|
|
500
|
+
* The default {@link StrictTypes}, explicitly applied.
|
|
501
|
+
*/
|
|
502
|
+
strict(): CustomizedSchemaTyping<TSchema, StrictTypes<TSchema>>;
|
|
503
|
+
/**
|
|
504
|
+
* Relaxed policy: allows possible invalid edits (which will err at runtime) when schema is not exact.
|
|
505
|
+
* @remarks
|
|
506
|
+
* Handles input types covariantly so any input which might be valid with the schema is allowed
|
|
507
|
+
* instead of the default strict policy of only inputs with all possible schema are allowed.
|
|
508
|
+
*
|
|
509
|
+
* This only modifies the typing shallowly: the typing of children are not effected.
|
|
510
|
+
*/
|
|
511
|
+
relaxed(): CustomizedSchemaTyping<TSchema, {
|
|
512
|
+
input: TreeNodeSchema extends TSchema ? InsertableContent : TSchema extends TreeNodeSchema ? InsertableTypedNode<TSchema> : TSchema extends AllowedTypes ? TSchema[number] extends LazyItem<infer TSchemaInner extends TreeNodeSchema> ? InsertableTypedNode<TSchemaInner, TSchemaInner> : never : never;
|
|
513
|
+
readWrite: TreeNodeFromImplicitAllowedTypes<TSchema>;
|
|
514
|
+
output: TreeNodeFromImplicitAllowedTypes<TSchema>;
|
|
515
|
+
}>;
|
|
516
|
+
/**
|
|
517
|
+
* Replace typing with a single substitute which allowed types must implement.
|
|
518
|
+
* @remarks
|
|
519
|
+
* This is generally type safe for reading the tree, but allows instances of `T` other than those listed in the schema to be assigned,
|
|
520
|
+
* which can be out of schema and err at runtime in the same way {@link Customizer.relaxed} does.
|
|
521
|
+
* Until with {@link Customizer.relaxed}, implicit construction is disabled, meaning all nodes must be explicitly constructed (and thus implement `T`) before being inserted.
|
|
522
|
+
*/
|
|
523
|
+
simplified<T extends TreeNodeFromImplicitAllowedTypes<TSchema>>(): CustomizedSchemaTyping<TSchema, {
|
|
524
|
+
input: T;
|
|
525
|
+
readWrite: T;
|
|
526
|
+
output: T;
|
|
527
|
+
}>;
|
|
528
|
+
/**
|
|
529
|
+
* The same as {@link Customizer} except that more T values are allowed, even ones not known to be implemented by `TSchema`.
|
|
530
|
+
*/
|
|
531
|
+
simplifiedUnrestricted<T extends TreeNode | TreeLeafValue>(): CustomizedSchemaTyping<TSchema, {
|
|
532
|
+
input: T;
|
|
533
|
+
readWrite: T;
|
|
534
|
+
output: T;
|
|
535
|
+
}>;
|
|
536
|
+
/**
|
|
537
|
+
* Fully arbitrary customization.
|
|
538
|
+
* Provided types override existing types.
|
|
539
|
+
*/
|
|
540
|
+
custom<T extends Partial<CustomTypes>>(): CustomizedSchemaTyping<TSchema, {
|
|
541
|
+
[Property in keyof CustomTypes]: Property extends keyof T ? T[Property] extends CustomTypes[Property] ? T[Property] : GetTypes<TSchema>[Property] : GetTypes<TSchema>[Property];
|
|
542
|
+
}>;
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* Fetch types associated with a schema, or use the default if not customized.
|
|
546
|
+
* @system @public
|
|
547
|
+
*/
|
|
548
|
+
export type GetTypes<TSchema extends ImplicitAllowedTypes> = [TSchema] extends [
|
|
549
|
+
CustomizedSchemaTyping<unknown, infer TCustom>
|
|
550
|
+
] ? TCustom : StrictTypes<TSchema>;
|
|
367
551
|
/**
|
|
368
552
|
* Content which could be inserted into a tree.
|
|
369
553
|
*
|
|
370
554
|
* @see {@link Input}
|
|
371
555
|
* @remarks
|
|
372
|
-
*
|
|
556
|
+
* Alias of {@link InsertableTreeNodeFromImplicitAllowedTypes} with a shorter name.
|
|
373
557
|
* @alpha
|
|
374
558
|
*/
|
|
375
|
-
export type Insertable<TSchema extends ImplicitAllowedTypes
|
|
559
|
+
export type Insertable<TSchema extends ImplicitAllowedTypes> = InsertableTreeNodeFromImplicitAllowedTypes<TSchema>;
|
|
376
560
|
/**
|
|
377
561
|
* Content which could be inserted into a field within a tree.
|
|
378
562
|
*
|
|
@@ -425,9 +609,18 @@ export type ApplyKindInput<T, Kind extends FieldKind, DefaultsAreOptional extend
|
|
|
425
609
|
] extends [FieldKind.Required] ? T : [Kind] extends [FieldKind.Optional] ? T | undefined : [Kind] extends [FieldKind.Identifier] ? DefaultsAreOptional extends true ? T | undefined : T : never;
|
|
426
610
|
/**
|
|
427
611
|
* Type of tree node for a field of the given schema.
|
|
612
|
+
*
|
|
613
|
+
* @typeparam TSchema - Schema to process.
|
|
614
|
+
* @remarks
|
|
615
|
+
* Defaults to {@link DefaultTreeNodeFromImplicitAllowedTypes}.
|
|
428
616
|
* @public
|
|
429
617
|
*/
|
|
430
|
-
export type TreeNodeFromImplicitAllowedTypes<TSchema extends ImplicitAllowedTypes = TreeNodeSchema> =
|
|
618
|
+
export type TreeNodeFromImplicitAllowedTypes<TSchema extends ImplicitAllowedTypes = TreeNodeSchema> = GetTypes<TSchema>["output"];
|
|
619
|
+
/**
|
|
620
|
+
* Default type of tree node for a field of the given schema.
|
|
621
|
+
* @system @public
|
|
622
|
+
*/
|
|
623
|
+
export type DefaultTreeNodeFromImplicitAllowedTypes<TSchema extends ImplicitAllowedTypes = TreeNodeSchema> = TSchema extends TreeNodeSchema ? NodeFromSchema<TSchema> : TSchema extends AllowedTypes ? NodeFromSchema<FlexListToUnion<TSchema>> : unknown;
|
|
431
624
|
/**
|
|
432
625
|
* This type exists only to be linked from documentation to provide a single linkable place to document some details of
|
|
433
626
|
* "Input" types and how they handle schema.
|
|
@@ -480,6 +673,15 @@ export type TreeNodeFromImplicitAllowedTypes<TSchema extends ImplicitAllowedType
|
|
|
480
673
|
* @system @public
|
|
481
674
|
*/
|
|
482
675
|
export type Input<T extends never> = T;
|
|
676
|
+
/**
|
|
677
|
+
* Type of content that can be inserted into the tree for a node of the given schema.
|
|
678
|
+
*
|
|
679
|
+
* @typeparam TSchema - Schema to process.
|
|
680
|
+
* @remarks
|
|
681
|
+
* Defaults to {@link DefaultInsertableTreeNodeFromImplicitAllowedTypes}.
|
|
682
|
+
* @public
|
|
683
|
+
*/
|
|
684
|
+
export type InsertableTreeNodeFromImplicitAllowedTypes<TSchema extends ImplicitAllowedTypes> = GetTypes<TSchema>["input"];
|
|
483
685
|
/**
|
|
484
686
|
* Type of content that can be inserted into the tree for a node of the given schema.
|
|
485
687
|
*
|
|
@@ -489,11 +691,9 @@ export type Input<T extends never> = T;
|
|
|
489
691
|
*
|
|
490
692
|
* @privateRemarks
|
|
491
693
|
* This is a bit overly conservative, since cases like `A | [A]` give never and could give `A`.
|
|
492
|
-
* @public
|
|
694
|
+
* @system @public
|
|
493
695
|
*/
|
|
494
|
-
export type
|
|
495
|
-
TSchema
|
|
496
|
-
] extends [TreeNodeSchema] ? InsertableTypedNode<TSchema> : [TSchema] extends [AllowedTypes] ? InsertableTreeNodeFromAllowedTypes<TSchema> : never;
|
|
696
|
+
export type DefaultInsertableTreeNodeFromImplicitAllowedTypes<TSchema extends ImplicitAllowedTypes> = [TSchema] extends [TreeNodeSchema] ? InsertableTypedNode<TSchema> : [TSchema] extends [AllowedTypes] ? InsertableTreeNodeFromAllowedTypes<TSchema> : never;
|
|
497
697
|
/**
|
|
498
698
|
* Type of content that can be inserted into the tree for a node of the given schema.
|
|
499
699
|
*
|
|
@@ -529,6 +729,8 @@ export type NodeFromSchema<T extends TreeNodeSchema> = T extends TreeNodeSchemaC
|
|
|
529
729
|
* One special case this makes is if the result of NodeFromSchema contains TreeNode, this must be an under constrained schema, so the result is set to never.
|
|
530
730
|
* Note that applying UnionToIntersection on the result of NodeFromSchema<T> does not work since it breaks booleans.
|
|
531
731
|
*
|
|
732
|
+
* Some internal code may use second parameter to opt out of contravariant behavior, but this is not a stable API.
|
|
733
|
+
*
|
|
532
734
|
* @public
|
|
533
735
|
*/
|
|
534
736
|
export type InsertableTypedNode<TSchema extends TreeNodeSchema, T = UnionToIntersection<TSchema>> = (T extends TreeNodeSchema<string, NodeKind, TreeNode | TreeLeafValue, never, true> ? NodeBuilderData<T> : never) | (T extends TreeNodeSchema ? Unhydrated<TreeNode extends NodeFromSchema<T> ? never : NodeFromSchema<T>> : never);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":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M,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC;IAE9C;;;;;;;;OAQG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1C"}
|
|
@@ -4,8 +4,11 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { Lazy } from "@fluidframework/core-utils/internal";
|
|
6
6
|
import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
7
|
-
import { brand, isReadonlyArray, compareSets, } from "../util/index.js";
|
|
7
|
+
import { brand, isReadonlyArray, compareSets, getOrCreate, } from "../util/index.js";
|
|
8
|
+
import { inPrototypeChain, } from "./core/index.js";
|
|
8
9
|
import { isLazy } from "./flexList.js";
|
|
10
|
+
import { LeafNodeSchema } from "./leafNodeSchema.js";
|
|
11
|
+
import { TreeNodeValid } from "./treeNodeValid.js";
|
|
9
12
|
/**
|
|
10
13
|
* Returns true if the given schema is a {@link TreeNodeSchemaClass}, or otherwise false if it is a {@link TreeNodeSchemaNonClass}.
|
|
11
14
|
* @internal
|
|
@@ -149,6 +152,8 @@ export function normalizeFieldSchema(schema) {
|
|
|
149
152
|
export function normalizeAllowedTypes(types) {
|
|
150
153
|
const normalized = new Set();
|
|
151
154
|
if (isReadonlyArray(types)) {
|
|
155
|
+
// Types array must not be modified after it is normalized since that would result if the user of the normalized data having wrong (out of date) content.
|
|
156
|
+
Object.freeze(types);
|
|
152
157
|
for (const lazyType of types) {
|
|
153
158
|
normalized.add(evaluateLazySchema(lazyType));
|
|
154
159
|
}
|
|
@@ -216,16 +221,89 @@ function areMetadataEqual(a, b) {
|
|
|
216
221
|
}
|
|
217
222
|
return a?.custom === b?.custom && a?.description === b?.description;
|
|
218
223
|
}
|
|
219
|
-
|
|
220
|
-
|
|
224
|
+
const cachedLazyItem = new WeakMap();
|
|
225
|
+
/**
|
|
226
|
+
* Returns the schema referenced by the {@link LazyItem}.
|
|
227
|
+
* @remarks
|
|
228
|
+
* Caches results to handle {@link LazyItem} which compute their resulting schema.
|
|
229
|
+
* @alpha
|
|
230
|
+
*/
|
|
231
|
+
export function evaluateLazySchema(value) {
|
|
232
|
+
const evaluatedSchema = isLazy(value)
|
|
233
|
+
? getOrCreate(cachedLazyItem, value, value)
|
|
234
|
+
: value;
|
|
221
235
|
if (evaluatedSchema === undefined) {
|
|
222
236
|
throw new UsageError(`Encountered an undefined schema. This could indicate that some referenced schema has not yet been instantiated.`);
|
|
223
237
|
}
|
|
238
|
+
markSchemaMostDerived(evaluatedSchema);
|
|
224
239
|
return evaluatedSchema;
|
|
225
240
|
}
|
|
241
|
+
/**
|
|
242
|
+
* Indicates that a schema is the "most derived" version which is allowed to be used, see {@link MostDerivedData}.
|
|
243
|
+
* Calling helps with error messages about invalid schema usage (using more than one type from single schema factor produced type,
|
|
244
|
+
* and thus calling this for one than one subclass).
|
|
245
|
+
* @remarks
|
|
246
|
+
* Helper for invoking {@link TreeNodeValid.markMostDerived} for any {@link TreeNodeSchema} if it needed.
|
|
247
|
+
*/
|
|
248
|
+
export function markSchemaMostDerived(schema, oneTimeInitialize = false) {
|
|
249
|
+
if (schema instanceof LeafNodeSchema) {
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
if (!inPrototypeChain(schema, TreeNodeValid)) {
|
|
253
|
+
// Use JSON.stringify to quote and escape identifier string.
|
|
254
|
+
throw new UsageError(`Schema for ${JSON.stringify(schema.identifier)} does not extend a SchemaFactory generated class. This is invalid.`);
|
|
255
|
+
}
|
|
256
|
+
const schemaValid = schema;
|
|
257
|
+
if (oneTimeInitialize) {
|
|
258
|
+
schemaValid.oneTimeInitialize();
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
schemaValid.markMostDerived();
|
|
262
|
+
}
|
|
263
|
+
}
|
|
226
264
|
/**
|
|
227
265
|
* {@inheritdoc (UnsafeUnknownSchema:type)}
|
|
228
266
|
* @alpha
|
|
229
267
|
*/
|
|
230
268
|
export const UnsafeUnknownSchema = Symbol("UnsafeUnknownSchema");
|
|
269
|
+
/**
|
|
270
|
+
* {@inheritdoc (CustomizedTyping:type)}
|
|
271
|
+
* @system @public
|
|
272
|
+
*/
|
|
273
|
+
export const CustomizedTyping = Symbol("CustomizedTyping");
|
|
274
|
+
/**
|
|
275
|
+
* Customizes the types associated with `TSchema`
|
|
276
|
+
* @remarks
|
|
277
|
+
* By default, the types used when constructing, reading and writing tree nodes are derived from the schema.
|
|
278
|
+
* In some cases, it may be desirable to override these types with carefully selected alternatives.
|
|
279
|
+
* This utility allows for that customization.
|
|
280
|
+
* Note that this customization is only used for typing, and does not affect the runtime behavior at all.
|
|
281
|
+
*
|
|
282
|
+
* This can be used for a wide variety of purposes, including (but not limited to):
|
|
283
|
+
*
|
|
284
|
+
* 1. Implementing better typing for a runtime extensible set of types (e.g. a polymorphic collection).
|
|
285
|
+
* This is commonly needed when implementing containers which don't directly reference their child types, and can be done using {@link Customizer.simplified}.
|
|
286
|
+
* 2. Adding type brands to specific values to increase type safety.
|
|
287
|
+
* This can be done using {@link Customizer.simplified}.
|
|
288
|
+
* 3. Adding some (compile time only) constraints to values, like enum style unions.
|
|
289
|
+
* This can be done using {@link Customizer.simplified}.
|
|
290
|
+
* 4. Making fields readonly (for the current client).
|
|
291
|
+
* This can be done using {@link Customizer.custom} with `{ readWrite: never; }`.
|
|
292
|
+
* 5. Opting into more [compleat and less sound](https://en.wikipedia.org/wiki/Soundness#Relation_to_completeness) typing.
|
|
293
|
+
* {@link Customizer.relaxed} is an example of this.
|
|
294
|
+
*
|
|
295
|
+
* For this customization to be used, the resulting schema must be used as `ImplicitAllowedTypes`.
|
|
296
|
+
* For example applying this to a single type, then using that type in an array of allowed types will have no effect:
|
|
297
|
+
* in such a case the customization must instead be applied to the array of allowed types.
|
|
298
|
+
* @privateRemarks
|
|
299
|
+
* Once this API is more stable/final, the examples in tests such as openPolymorphism.spec.ts and schemaFactory.examples.spec.ts
|
|
300
|
+
* should be copied into examples here, or somehow linked.
|
|
301
|
+
* @alpha
|
|
302
|
+
*/
|
|
303
|
+
export function customizeSchemaTyping(schema) {
|
|
304
|
+
// This function just does type branding, and duplicating the typing here to avoid any would just make it harder to maintain not easier:
|
|
305
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
306
|
+
const f = () => schema;
|
|
307
|
+
return { strict: f, relaxed: f, simplified: f, simplifiedUnrestricted: f, custom: f };
|
|
308
|
+
}
|
|
231
309
|
//# sourceMappingURL=schemaTypes.js.map
|