@fluidframework/tree 2.32.0 → 2.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +53 -0
- package/api-report/tree.alpha.api.md +169 -192
- package/api-report/tree.beta.api.md +135 -164
- package/api-report/tree.legacy.alpha.api.md +138 -167
- package/api-report/tree.legacy.public.api.md +135 -164
- package/api-report/tree.public.api.md +135 -164
- package/dist/alpha.d.ts +3 -11
- package/dist/beta.d.ts +2 -11
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/schema-stored/index.d.ts +1 -1
- package/dist/core/schema-stored/index.d.ts.map +1 -1
- package/dist/core/schema-stored/index.js +1 -2
- package/dist/core/schema-stored/index.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +4 -11
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +7 -14
- 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 +31 -24
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/deltaUtil.d.ts +1 -4
- package/dist/core/tree/deltaUtil.d.ts.map +1 -1
- package/dist/core/tree/deltaUtil.js +1 -13
- package/dist/core/tree/deltaUtil.js.map +1 -1
- package/dist/core/tree/visitDelta.d.ts +6 -29
- package/dist/core/tree/visitDelta.d.ts.map +1 -1
- package/dist/core/tree/visitDelta.js +11 -50
- package/dist/core/tree/visitDelta.js.map +1 -1
- package/dist/core/tree/visitorUtils.d.ts +12 -9
- package/dist/core/tree/visitorUtils.d.ts.map +1 -1
- package/dist/core/tree/visitorUtils.js +19 -32
- package/dist/core/tree/visitorUtils.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.js +6 -11
- package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.d.ts +41 -5
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.js +43 -26
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/dist/feature-libraries/flex-tree/context.d.ts +5 -0
- package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/context.js +4 -0
- package/dist/feature-libraries/flex-tree/context.js.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +8 -0
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js +8 -0
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
- package/dist/feature-libraries/indexing/anchorTreeIndex.js +15 -22
- package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
- package/dist/feature-libraries/node-identifier/nodeIdentifierManager.d.ts.map +1 -1
- package/dist/feature-libraries/node-identifier/nodeIdentifierManager.js +29 -25
- package/dist/feature-libraries/node-identifier/nodeIdentifierManager.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 -7
- 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 +1 -1
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/internalTypes.d.ts +1 -1
- package/dist/internalTypes.d.ts.map +1 -1
- package/dist/internalTypes.js.map +1 -1
- package/dist/jsonDomainSchema.d.ts +6 -6
- package/dist/jsonDomainSchema.d.ts.map +1 -1
- package/dist/jsonDomainSchema.js.map +1 -1
- package/dist/legacy.d.ts +2 -11
- 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 +2 -11
- package/dist/serializableDomainSchema.d.ts +5 -5
- package/dist/shared-tree/checkoutFlexTreeView.d.ts +1 -0
- package/dist/shared-tree/checkoutFlexTreeView.d.ts.map +1 -1
- package/dist/shared-tree/checkoutFlexTreeView.js +4 -0
- package/dist/shared-tree/checkoutFlexTreeView.js.map +1 -1
- package/dist/shared-tree/index.d.ts +3 -2
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js +2 -2
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +4 -35
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +4 -54
- package/dist/shared-tree/sharedTree.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/schemaFactory.d.ts +28 -28
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +11 -11
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +6 -7
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +24 -5
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.js +14 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/dist/simple-tree/api/testRecursiveDomain.d.ts +10 -10
- package/dist/simple-tree/api/tree.d.ts +1 -14
- package/dist/simple-tree/api/tree.d.ts.map +1 -1
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.d.ts +237 -220
- package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
- package/dist/simple-tree/arrayNode.d.ts +2 -2
- package/dist/simple-tree/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/arrayNode.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.d.ts +9 -2
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +39 -24
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/types.d.ts +14 -4
- package/dist/simple-tree/core/types.d.ts.map +1 -1
- package/dist/simple-tree/core/types.js +14 -4
- package/dist/simple-tree/core/types.js.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts +2 -1
- package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/dist/simple-tree/core/unhydratedFlexTree.js +3 -0
- package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/dist/simple-tree/index.d.ts +1 -1
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +3 -2
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/objectNode.d.ts +9 -2
- package/dist/simple-tree/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/objectNode.js +3 -0
- package/dist/simple-tree/objectNode.js.map +1 -1
- package/dist/simple-tree/schemaTypes.d.ts +10 -5
- package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
- package/dist/simple-tree/schemaTypes.js +5 -2
- package/dist/simple-tree/schemaTypes.js.map +1 -1
- package/dist/tableSchema.d.ts +78 -26
- package/dist/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +53 -24
- package/dist/tableSchema.js.map +1 -1
- package/dist/treeFactory.d.ts +6 -12
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +56 -5
- package/dist/treeFactory.js.map +1 -1
- package/lib/alpha.d.ts +3 -11
- package/lib/beta.d.ts +2 -11
- package/lib/core/index.d.ts +1 -1
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +1 -1
- package/lib/core/index.js.map +1 -1
- package/lib/core/schema-stored/index.d.ts +1 -1
- package/lib/core/schema-stored/index.d.ts.map +1 -1
- package/lib/core/schema-stored/index.js +1 -1
- package/lib/core/schema-stored/index.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +4 -11
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +6 -12
- 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 +31 -24
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/core/tree/deltaUtil.d.ts +1 -4
- package/lib/core/tree/deltaUtil.d.ts.map +1 -1
- package/lib/core/tree/deltaUtil.js +0 -9
- package/lib/core/tree/deltaUtil.js.map +1 -1
- package/lib/core/tree/visitDelta.d.ts +6 -29
- package/lib/core/tree/visitDelta.d.ts.map +1 -1
- package/lib/core/tree/visitDelta.js +12 -51
- package/lib/core/tree/visitDelta.js.map +1 -1
- package/lib/core/tree/visitorUtils.d.ts +12 -9
- package/lib/core/tree/visitorUtils.d.ts.map +1 -1
- package/lib/core/tree/visitorUtils.js +19 -32
- package/lib/core/tree/visitorUtils.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.js +6 -11
- package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.d.ts +41 -5
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.js +43 -26
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/lib/feature-libraries/flex-tree/context.d.ts +5 -0
- package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/context.js +5 -1
- package/lib/feature-libraries/flex-tree/context.js.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +8 -0
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js +8 -0
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
- package/lib/feature-libraries/indexing/anchorTreeIndex.js +15 -22
- package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
- package/lib/feature-libraries/node-identifier/nodeIdentifierManager.d.ts.map +1 -1
- package/lib/feature-libraries/node-identifier/nodeIdentifierManager.js +28 -24
- package/lib/feature-libraries/node-identifier/nodeIdentifierManager.js.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js +1 -7
- 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 -2
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/internalTypes.d.ts +1 -1
- package/lib/internalTypes.d.ts.map +1 -1
- package/lib/internalTypes.js.map +1 -1
- package/lib/jsonDomainSchema.d.ts +6 -6
- package/lib/jsonDomainSchema.d.ts.map +1 -1
- package/lib/jsonDomainSchema.js.map +1 -1
- package/lib/legacy.d.ts +2 -11
- 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 +2 -11
- package/lib/serializableDomainSchema.d.ts +5 -5
- package/lib/shared-tree/checkoutFlexTreeView.d.ts +1 -0
- package/lib/shared-tree/checkoutFlexTreeView.d.ts.map +1 -1
- package/lib/shared-tree/checkoutFlexTreeView.js +4 -0
- package/lib/shared-tree/checkoutFlexTreeView.js.map +1 -1
- package/lib/shared-tree/index.d.ts +3 -2
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js +1 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +4 -35
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +2 -51
- package/lib/shared-tree/sharedTree.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/schemaFactory.d.ts +28 -28
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +11 -11
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +6 -7
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +24 -5
- package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.js +12 -0
- package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/lib/simple-tree/api/testRecursiveDomain.d.ts +10 -10
- package/lib/simple-tree/api/tree.d.ts +1 -14
- package/lib/simple-tree/api/tree.d.ts.map +1 -1
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.d.ts +237 -220
- package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
- package/lib/simple-tree/arrayNode.d.ts +2 -2
- package/lib/simple-tree/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/arrayNode.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.d.ts +9 -2
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +40 -25
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/types.d.ts +14 -4
- package/lib/simple-tree/core/types.d.ts.map +1 -1
- package/lib/simple-tree/core/types.js +14 -4
- package/lib/simple-tree/core/types.js.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts +2 -1
- package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
- package/lib/simple-tree/core/unhydratedFlexTree.js +3 -0
- package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
- package/lib/simple-tree/index.d.ts +1 -1
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +1 -1
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/objectNode.d.ts +9 -2
- package/lib/simple-tree/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/objectNode.js +4 -1
- package/lib/simple-tree/objectNode.js.map +1 -1
- package/lib/simple-tree/schemaTypes.d.ts +10 -5
- package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
- package/lib/simple-tree/schemaTypes.js +5 -2
- package/lib/simple-tree/schemaTypes.js.map +1 -1
- package/lib/tableSchema.d.ts +78 -26
- package/lib/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +53 -24
- package/lib/tableSchema.js.map +1 -1
- package/lib/treeFactory.d.ts +6 -12
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +55 -3
- package/lib/treeFactory.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/package.json +22 -23
- package/src/core/index.ts +0 -2
- package/src/core/schema-stored/index.ts +0 -2
- package/src/core/schema-stored/schema.ts +10 -29
- package/src/core/tree/anchorSet.ts +32 -24
- package/src/core/tree/deltaUtil.ts +1 -13
- package/src/core/tree/visitDelta.ts +24 -81
- package/src/core/tree/visitorUtils.ts +43 -53
- package/src/feature-libraries/chunked-forest/chunkedForest.ts +7 -22
- package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +1 -1
- package/src/feature-libraries/chunked-forest/codec/nodeShape.ts +45 -27
- package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +1 -1
- package/src/feature-libraries/flex-tree/context.ts +11 -1
- package/src/feature-libraries/flex-tree/flexTreeTypes.ts +8 -0
- package/src/feature-libraries/indexing/anchorTreeIndex.ts +17 -28
- package/src/feature-libraries/node-identifier/nodeIdentifierManager.ts +39 -38
- package/src/feature-libraries/object-forest/objectForest.ts +1 -18
- package/src/feature-libraries/schema-index/codec.ts +1 -2
- package/src/index.ts +3 -11
- package/src/internalTypes.ts +0 -19
- package/src/jsonDomainSchema.ts +1 -3
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/checkoutFlexTreeView.ts +6 -0
- package/src/shared-tree/index.ts +8 -3
- package/src/shared-tree/sharedTree.ts +5 -133
- package/src/simple-tree/api/index.ts +2 -22
- package/src/simple-tree/api/schemaFactory.ts +40 -54
- package/src/simple-tree/api/schemaFactoryAlpha.ts +9 -14
- package/src/simple-tree/api/schemaFactoryRecursive.ts +25 -5
- package/src/simple-tree/api/tree.ts +1 -14
- package/src/simple-tree/api/typesUnsafe.ts +359 -341
- package/src/simple-tree/arrayNode.ts +2 -2
- package/src/simple-tree/core/treeNodeKernel.ts +46 -28
- package/src/simple-tree/core/types.ts +14 -4
- package/src/simple-tree/core/unhydratedFlexTree.ts +5 -1
- package/src/simple-tree/index.ts +2 -22
- package/src/simple-tree/objectNode.ts +13 -4
- package/src/simple-tree/schemaTypes.ts +11 -7
- package/src/tableSchema.ts +190 -63
- package/src/treeFactory.ts +151 -8
package/dist/beta.d.ts
CHANGED
|
@@ -20,22 +20,15 @@ export {
|
|
|
20
20
|
FieldProps,
|
|
21
21
|
FieldSchema,
|
|
22
22
|
FieldSchemaMetadata,
|
|
23
|
-
FieldSchemaUnsafe,
|
|
24
23
|
ITree,
|
|
25
24
|
ITreeConfigurationOptions,
|
|
26
25
|
ITreeViewConfiguration,
|
|
27
26
|
ImplicitAllowedTypes,
|
|
28
|
-
ImplicitAllowedTypesUnsafe,
|
|
29
27
|
ImplicitFieldSchema,
|
|
30
|
-
ImplicitFieldSchemaUnsafe,
|
|
31
28
|
Input,
|
|
32
|
-
InsertableObjectFromSchemaRecordUnsafe,
|
|
33
29
|
InsertableTreeFieldFromImplicitField,
|
|
34
|
-
InsertableTreeFieldFromImplicitFieldUnsafe,
|
|
35
30
|
InsertableTreeNodeFromAllowedTypes,
|
|
36
|
-
InsertableTreeNodeFromAllowedTypesUnsafe,
|
|
37
31
|
InsertableTreeNodeFromImplicitAllowedTypes,
|
|
38
|
-
InsertableTreeNodeFromImplicitAllowedTypesUnsafe,
|
|
39
32
|
InsertableTypedNode,
|
|
40
33
|
InternalTreeNode,
|
|
41
34
|
IsListener,
|
|
@@ -51,6 +44,7 @@ export {
|
|
|
51
44
|
NodeKind,
|
|
52
45
|
NodeSchemaMetadata,
|
|
53
46
|
NodeSchemaOptions,
|
|
47
|
+
ObjectFromSchemaRecord,
|
|
54
48
|
Off,
|
|
55
49
|
ReadonlyArrayNode,
|
|
56
50
|
RestrictiveReadonlyRecord,
|
|
@@ -63,25 +57,22 @@ export {
|
|
|
63
57
|
SchemaFactory,
|
|
64
58
|
SchemaStatics,
|
|
65
59
|
SimpleNodeSchemaBase,
|
|
60
|
+
System_Unsafe,
|
|
66
61
|
TransactionConstraint,
|
|
67
62
|
Tree,
|
|
68
63
|
TreeArrayNode,
|
|
69
|
-
TreeArrayNodeUnsafe,
|
|
70
64
|
TreeChangeEvents,
|
|
71
65
|
TreeFieldFromImplicitField,
|
|
72
66
|
TreeLeafValue,
|
|
73
67
|
TreeMapNode,
|
|
74
|
-
TreeMapNodeUnsafe,
|
|
75
68
|
TreeNode,
|
|
76
69
|
TreeNodeApi,
|
|
77
70
|
TreeNodeFromImplicitAllowedTypes,
|
|
78
71
|
TreeNodeSchema,
|
|
79
72
|
TreeNodeSchemaClass,
|
|
80
|
-
TreeNodeSchemaClassUnsafe,
|
|
81
73
|
TreeNodeSchemaCore,
|
|
82
74
|
TreeNodeSchemaNonClass,
|
|
83
75
|
TreeObjectNode,
|
|
84
|
-
TreeObjectNodeUnsafe,
|
|
85
76
|
TreeStatus,
|
|
86
77
|
TreeView,
|
|
87
78
|
TreeViewConfiguration,
|
package/dist/core/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export { EmptyKey, type TreeType, type Value, type TreeValue, AnchorSet, type DetachedField, type UpPath, type NormalizedUpPath, type INormalizedUpPath, type NormalizedFieldUpPath, type Range, type RangeUpPath, type PlaceUpPath, type PlaceIndex, type NodeIndex, type FieldUpPath, type Anchor, type RootField, type ChildCollection, type ChildLocation, type FieldMapObject, type NodeData, type GenericTreeNode, type JsonableTree, EncodedJsonableTree, rootFieldKey, rootField, type ITreeCursor, CursorLocationType, type ITreeCursorSynchronous, castCursorToSynchronous, type GenericFieldsNode, type AnchorLocator, genericTreeKeys, getGenericTreeField, genericTreeDeleteIfEmpty, getDepth, mapCursorField, mapCursorFields, iterateCursorField, type MapTree, detachedFieldAsKey, keyAsDetachedField, visitDelta, createAnnouncedVisitor, combineVisitors, announceDelta, applyDelta, makeDetachedFieldIndex, setGenericTreeField, type DeltaVisitor, type AnnouncedVisitor, SparseNode, getDescendant, compareUpPaths, clonePath, topDownPath, compareFieldUpPaths, forEachNode, forEachNodeInSubtree, forEachField, type PathRootPrefix, deltaForRootInitialization, makeDetachedNodeId, offsetDetachId, emptyDelta, type AnchorSlot, type AnchorNode, anchorSlot, type UpPathDefault, isDetachedUpPath, inCursorField, inCursorNode, type AnchorEvents, type AnchorSetRootEvents, type ProtoNodes, CursorMarker, isCursor, DetachedFieldIndex, type ForestRootId, getDetachedFieldContainingPath, aboveRootPlaceholder, type DeltaRoot, type DeltaMark, type DeltaDetachedNodeId, type DeltaFieldMap, type DeltaDetachedNodeChanges, type DeltaDetachedNodeBuild, type DeltaDetachedNodeDestruction, type DeltaDetachedNodeRename, type DeltaFieldChanges, type ExclusiveMapTree, deepCopyMapTree, type TreeChunk, dummyRoot, cursorChunk, tryGetChunk, type ChunkedCursor, } from "./tree/index.js";
|
|
6
6
|
export { TreeNavigationResult, type IEditableForest, type IForestSubscription, type TreeLocation, type FieldLocation, type ForestLocation, type ITreeSubscriptionCursor, ITreeSubscriptionCursorState, type FieldAnchor, moveToDetachedField, type ForestEvents, } from "./forest/index.js";
|
|
7
|
-
export { type FieldKey, type TreeNodeSchemaIdentifier, type TreeFieldStoredSchema, ValueSchema, TreeNodeStoredSchema, type TreeStoredSchemaSubscription, type MutableTreeStoredSchema, type FieldKindIdentifier, type FieldKindData, type TreeTypeSet, type TreeStoredSchema, TreeStoredSchemaRepository, schemaDataIsEmpty, type SchemaEvents, forbiddenFieldKindIdentifier, identifierFieldKindIdentifier, storedEmptyFieldSchema, type StoredSchemaCollection, schemaFormat, LeafNodeStoredSchema, ObjectNodeStoredSchema, MapNodeStoredSchema,
|
|
7
|
+
export { type FieldKey, type TreeNodeSchemaIdentifier, type TreeFieldStoredSchema, ValueSchema, TreeNodeStoredSchema, type TreeStoredSchemaSubscription, type MutableTreeStoredSchema, type FieldKindIdentifier, type FieldKindData, type TreeTypeSet, type TreeStoredSchema, TreeStoredSchemaRepository, schemaDataIsEmpty, type SchemaEvents, forbiddenFieldKindIdentifier, identifierFieldKindIdentifier, storedEmptyFieldSchema, type StoredSchemaCollection, schemaFormat, LeafNodeStoredSchema, ObjectNodeStoredSchema, MapNodeStoredSchema, decodeFieldSchema, encodeFieldSchema, storedSchemaDecodeDispatcher, type SchemaAndPolicy, Multiplicity, type SchemaPolicy, } from "./schema-stored/index.js";
|
|
8
8
|
export { type ChangeFamily, type ChangeFamilyCodec, type ChangeEncodingContext, type ChangeFamilyEditor, EditBuilder, } from "./change-family/index.js";
|
|
9
9
|
export { areEqualChangeAtomIds, areEqualChangeAtomIdOpts, makeChangeAtomId, asChangeAtomId, type ChangeRebaser, findAncestor, findCommonAncestor, type GraphCommit, CommitKind, type CommitMetadata, type RevisionTag, RevisionTagSchema, RevisionTagCodec, type ChangesetLocalId, type ChangeAtomId, type ChangeAtomIdMap, type TaggedChange, makeAnonChange, tagChange, mapTaggedChange, tagRollbackInverse, SessionIdSchema, mintCommit, rebaseBranch, type BranchRebaseResult, rebaseChange, rebaseChangeOverChanges, type RevisionMetadataSource, revisionMetadataSourceFromInfo, type RevisionInfo, type EncodedRevisionTag, type EncodedChangeAtomId, taggedAtomId, taggedOptAtomId, offsetChangeAtomId, subtractChangeAtomIds, replaceAtomRevisions, replaceChange, type RebaseStats, type RebaseStatsWithDuration, isAncestor, type ChangeAtomIdRangeMap, newChangeAtomIdRangeMap, compareRevisions, } from "./rebase/index.js";
|
|
10
10
|
export { type Adapters, AdaptedViewSchema, type TreeAdapter, AllowedUpdateType, } from "./schema-view/index.js";
|
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,QAAQ,EACR,KAAK,QAAQ,EACb,KAAK,KAAK,EACV,KAAK,SAAS,EACd,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,KAAK,WAAW,EAChB,kBAAkB,EAClB,KAAK,sBAAsB,EAC3B,uBAAuB,EACvB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACxB,QAAQ,EACR,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,KAAK,OAAO,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,UAAU,EACV,sBAAsB,EACtB,eAAe,EACf,aAAa,EACb,UAAU,EACV,sBAAsB,EACtB,mBAAmB,EACnB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,UAAU,EACV,aAAa,EACb,cAAc,EACd,SAAS,EACT,WAAW,EACX,mBAAmB,EACnB,WAAW,EACX,oBAAoB,EACpB,YAAY,EACZ,KAAK,cAAc,EACnB,0BAA0B,EAC1B,kBAAkB,EAClB,cAAc,E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;AAElC,OAAO,EACN,qBAAqB,EACrB,wBAAwB,EACxB,gBAAgB,EAChB,cAAc,EACd,KAAK,aAAa,EAClB,YAAY,EACZ,kBAAkB,EAClB,KAAK,WAAW,EAChB,UAAU,EACV,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,cAAc,EACd,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,UAAU,EACV,YAAY,EACZ,KAAK,kBAAkB,EACvB,YAAY,EACZ,uBAAuB,EACvB,KAAK,sBAAsB,EAC3B,8BAA8B,EAC9B,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,aAAa,EACb,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAC5B,UAAU,EACV,KAAK,oBAAoB,EACzB,uBAAuB,EACvB,gBAAgB,GAChB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACN,KAAK,QAAQ,EACb,iBAAiB,EACjB,KAAK,WAAW,EAChB,iBAAiB,GACjB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACN,KAAK,UAAU,EACf,gBAAgB,EAChB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,eAAe,GACpB,MAAM,iBAAiB,CAAC"}
|
package/dist/core/index.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.TreeNavigationResult = exports.tryGetChunk = exports.cursorChunk = exports.dummyRoot = exports.deepCopyMapTree = exports.aboveRootPlaceholder = exports.getDetachedFieldContainingPath = exports.DetachedFieldIndex = exports.isCursor = exports.CursorMarker = exports.inCursorNode = exports.inCursorField = exports.isDetachedUpPath = exports.anchorSlot = exports.emptyDelta = exports.offsetDetachId = exports.makeDetachedNodeId = exports.deltaForRootInitialization = exports.forEachField = exports.forEachNodeInSubtree = exports.forEachNode = exports.compareFieldUpPaths = exports.topDownPath = exports.clonePath = exports.compareUpPaths = exports.getDescendant = exports.SparseNode = exports.setGenericTreeField = exports.makeDetachedFieldIndex = exports.applyDelta = exports.announceDelta = exports.combineVisitors = exports.createAnnouncedVisitor = exports.visitDelta = exports.keyAsDetachedField = exports.detachedFieldAsKey = exports.iterateCursorField = exports.mapCursorFields = exports.mapCursorField = exports.getDepth = exports.genericTreeDeleteIfEmpty = exports.getGenericTreeField = exports.genericTreeKeys = exports.castCursorToSynchronous = exports.CursorLocationType = exports.rootField = exports.rootFieldKey = exports.EncodedJsonableTree = exports.AnchorSet = exports.EmptyKey = void 0;
|
|
8
|
-
exports.RevertibleStatus = exports.AllowedUpdateType = exports.AdaptedViewSchema = exports.compareRevisions = exports.newChangeAtomIdRangeMap = exports.isAncestor = exports.replaceChange = exports.replaceAtomRevisions = exports.subtractChangeAtomIds = exports.offsetChangeAtomId = exports.taggedOptAtomId = exports.taggedAtomId = exports.revisionMetadataSourceFromInfo = exports.rebaseChangeOverChanges = exports.rebaseChange = exports.rebaseBranch = exports.mintCommit = exports.SessionIdSchema = exports.tagRollbackInverse = exports.mapTaggedChange = exports.tagChange = exports.makeAnonChange = exports.RevisionTagCodec = exports.RevisionTagSchema = exports.CommitKind = exports.findCommonAncestor = exports.findAncestor = exports.asChangeAtomId = exports.makeChangeAtomId = exports.areEqualChangeAtomIdOpts = exports.areEqualChangeAtomIds = exports.EditBuilder = exports.Multiplicity = exports.storedSchemaDecodeDispatcher = exports.encodeFieldSchema = exports.decodeFieldSchema = exports.
|
|
8
|
+
exports.RevertibleStatus = exports.AllowedUpdateType = exports.AdaptedViewSchema = exports.compareRevisions = exports.newChangeAtomIdRangeMap = exports.isAncestor = exports.replaceChange = exports.replaceAtomRevisions = exports.subtractChangeAtomIds = exports.offsetChangeAtomId = exports.taggedOptAtomId = exports.taggedAtomId = exports.revisionMetadataSourceFromInfo = exports.rebaseChangeOverChanges = exports.rebaseChange = exports.rebaseBranch = exports.mintCommit = exports.SessionIdSchema = exports.tagRollbackInverse = exports.mapTaggedChange = exports.tagChange = exports.makeAnonChange = exports.RevisionTagCodec = exports.RevisionTagSchema = exports.CommitKind = exports.findCommonAncestor = exports.findAncestor = exports.asChangeAtomId = exports.makeChangeAtomId = exports.areEqualChangeAtomIdOpts = exports.areEqualChangeAtomIds = exports.EditBuilder = exports.Multiplicity = exports.storedSchemaDecodeDispatcher = exports.encodeFieldSchema = exports.decodeFieldSchema = exports.MapNodeStoredSchema = exports.ObjectNodeStoredSchema = exports.LeafNodeStoredSchema = exports.schemaFormat = exports.storedEmptyFieldSchema = exports.identifierFieldKindIdentifier = exports.forbiddenFieldKindIdentifier = exports.schemaDataIsEmpty = exports.TreeStoredSchemaRepository = exports.TreeNodeStoredSchema = exports.ValueSchema = exports.moveToDetachedField = exports.ITreeSubscriptionCursorState = void 0;
|
|
9
9
|
var index_js_1 = require("./tree/index.js");
|
|
10
10
|
Object.defineProperty(exports, "EmptyKey", { enumerable: true, get: function () { return index_js_1.EmptyKey; } });
|
|
11
11
|
Object.defineProperty(exports, "AnchorSet", { enumerable: true, get: function () { return index_js_1.AnchorSet; } });
|
|
@@ -72,7 +72,6 @@ Object.defineProperty(exports, "schemaFormat", { enumerable: true, get: function
|
|
|
72
72
|
Object.defineProperty(exports, "LeafNodeStoredSchema", { enumerable: true, get: function () { return index_js_3.LeafNodeStoredSchema; } });
|
|
73
73
|
Object.defineProperty(exports, "ObjectNodeStoredSchema", { enumerable: true, get: function () { return index_js_3.ObjectNodeStoredSchema; } });
|
|
74
74
|
Object.defineProperty(exports, "MapNodeStoredSchema", { enumerable: true, get: function () { return index_js_3.MapNodeStoredSchema; } });
|
|
75
|
-
Object.defineProperty(exports, "toTreeNodeSchemaDataFormat", { enumerable: true, get: function () { return index_js_3.toTreeNodeSchemaDataFormat; } });
|
|
76
75
|
Object.defineProperty(exports, "decodeFieldSchema", { enumerable: true, get: function () { return index_js_3.decodeFieldSchema; } });
|
|
77
76
|
Object.defineProperty(exports, "encodeFieldSchema", { enumerable: true, get: function () { return index_js_3.encodeFieldSchema; } });
|
|
78
77
|
Object.defineProperty(exports, "storedSchemaDecodeDispatcher", { enumerable: true, get: function () { return index_js_3.storedSchemaDecodeDispatcher; } });
|
package/dist/core/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,4CAmGyB;AAlGxB,oGAAA,QAAQ,OAAA;AAIR,qGAAA,SAAS,OAAA;AAoBT,+GAAA,mBAAmB,OAAA;AACnB,wGAAA,YAAY,OAAA;AACZ,qGAAA,SAAS,OAAA;AAET,8GAAA,kBAAkB,OAAA;AAElB,mHAAA,uBAAuB,OAAA;AAGvB,2GAAA,eAAe,OAAA;AACf,+GAAA,mBAAmB,OAAA;AACnB,oHAAA,wBAAwB,OAAA;AACxB,oGAAA,QAAQ,OAAA;AACR,0GAAA,cAAc,OAAA;AACd,2GAAA,eAAe,OAAA;AACf,8GAAA,kBAAkB,OAAA;AAElB,8GAAA,kBAAkB,OAAA;AAClB,8GAAA,kBAAkB,OAAA;AAClB,sGAAA,UAAU,OAAA;AACV,kHAAA,sBAAsB,OAAA;AACtB,2GAAA,eAAe,OAAA;AACf,yGAAA,aAAa,OAAA;AACb,sGAAA,UAAU,OAAA;AACV,kHAAA,sBAAsB,OAAA;AACtB,+GAAA,mBAAmB,OAAA;AAGnB,sGAAA,UAAU,OAAA;AACV,yGAAA,aAAa,OAAA;AACb,0GAAA,cAAc,OAAA;AACd,qGAAA,SAAS,OAAA;AACT,uGAAA,WAAW,OAAA;AACX,+GAAA,mBAAmB,OAAA;AACnB,uGAAA,WAAW,OAAA;AACX,gHAAA,oBAAoB,OAAA;AACp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AAA;AAE5B,wGAAA,YAAY,OAAA;AAIb,qDAMkC;AADjC,uGAAA,WAAW,OAAA;AAGZ,8CA6C2B;AA5C1B,iHAAA,qBAAqB,OAAA;AACrB,oHAAA,wBAAwB,OAAA;AACxB,4GAAA,gBAAgB,OAAA;AAChB,0GAAA,cAAc,OAAA;AAEd,wGAAA,YAAY,OAAA;AACZ,8GAAA,kBAAkB,OAAA;AAElB,sGAAA,UAAU,OAAA;AAGV,6GAAA,iBAAiB,OAAA;AACjB,4GAAA,gBAAgB,OAAA;AAKhB,0GAAA,cAAc,OAAA;AACd,qGAAA,SAAS,OAAA;AACT,2GAAA,eAAe,OAAA;AACf,8GAAA,kBAAkB,OAAA;AAClB,2GAAA,eAAe,OAAA;AACf,sGAAA,UAAU,OAAA;AACV,wGAAA,YAAY,OAAA;AAEZ,wGAAA,YAAY,OAAA;AACZ,mHAAA,uBAAuB,OAAA;AAEvB,0HAAA,8BAA8B,OAAA;AAI9B,wGAAA,YAAY,OAAA;AACZ,2GAAA,eAAe,OAAA;AACf,8GAAA,kBAAkB,OAAA;AAClB,iHAAA,qBAAqB,OAAA;AACrB,gHAAA,oBAAoB,OAAA;AACpB,yGAAA,aAAa,OAAA;AAGb,sGAAA,UAAU,OAAA;AAEV,mHAAA,uBAAuB,OAAA;AACvB,4GAAA,gBAAgB,OAAA;AAGjB,mDAKgC;AAH/B,6GAAA,iBAAiB,OAAA;AAEjB,6GAAA,iBAAiB,OAAA;AAGlB,iDAMyB;AAJxB,iHAAA,gBAAgB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tEmptyKey,\n\ttype TreeType,\n\ttype Value,\n\ttype TreeValue,\n\tAnchorSet,\n\ttype DetachedField,\n\ttype UpPath,\n\ttype NormalizedUpPath,\n\ttype INormalizedUpPath,\n\ttype NormalizedFieldUpPath,\n\ttype Range,\n\ttype RangeUpPath,\n\ttype PlaceUpPath,\n\ttype PlaceIndex,\n\ttype NodeIndex,\n\ttype FieldUpPath,\n\ttype Anchor,\n\ttype RootField,\n\ttype ChildCollection,\n\ttype ChildLocation,\n\ttype FieldMapObject,\n\ttype NodeData,\n\ttype GenericTreeNode,\n\ttype JsonableTree,\n\tEncodedJsonableTree,\n\trootFieldKey,\n\trootField,\n\ttype ITreeCursor,\n\tCursorLocationType,\n\ttype ITreeCursorSynchronous,\n\tcastCursorToSynchronous,\n\ttype GenericFieldsNode,\n\ttype AnchorLocator,\n\tgenericTreeKeys,\n\tgetGenericTreeField,\n\tgenericTreeDeleteIfEmpty,\n\tgetDepth,\n\tmapCursorField,\n\tmapCursorFields,\n\titerateCursorField,\n\ttype MapTree,\n\tdetachedFieldAsKey,\n\tkeyAsDetachedField,\n\tvisitDelta,\n\tcreateAnnouncedVisitor,\n\tcombineVisitors,\n\tannounceDelta,\n\tapplyDelta,\n\tmakeDetachedFieldIndex,\n\tsetGenericTreeField,\n\ttype DeltaVisitor,\n\ttype AnnouncedVisitor,\n\tSparseNode,\n\tgetDescendant,\n\tcompareUpPaths,\n\tclonePath,\n\ttopDownPath,\n\tcompareFieldUpPaths,\n\tforEachNode,\n\tforEachNodeInSubtree,\n\tforEachField,\n\ttype PathRootPrefix,\n\tdeltaForRootInitialization,\n\tmakeDetachedNodeId,\n\toffsetDetachId,\n\temptyDelta,\n\ttype AnchorSlot,\n\ttype AnchorNode,\n\tanchorSlot,\n\ttype UpPathDefault,\n\tisDetachedUpPath,\n\tinCursorField,\n\tinCursorNode,\n\ttype AnchorEvents,\n\ttype AnchorSetRootEvents,\n\ttype ProtoNodes,\n\tCursorMarker,\n\tisCursor,\n\tDetachedFieldIndex,\n\ttype ForestRootId,\n\tgetDetachedFieldContainingPath,\n\taboveRootPlaceholder,\n\ttype DeltaRoot,\n\ttype DeltaMark,\n\ttype DeltaDetachedNodeId,\n\ttype DeltaFieldMap,\n\ttype DeltaDetachedNodeChanges,\n\ttype DeltaDetachedNodeBuild,\n\ttype DeltaDetachedNodeDestruction,\n\ttype DeltaDetachedNodeRename,\n\ttype DeltaFieldChanges,\n\ttype ExclusiveMapTree,\n\tdeepCopyMapTree,\n\ttype TreeChunk,\n\tdummyRoot,\n\tcursorChunk,\n\ttryGetChunk,\n\ttype ChunkedCursor,\n} from \"./tree/index.js\";\n\nexport {\n\tTreeNavigationResult,\n\ttype IEditableForest,\n\ttype IForestSubscription,\n\ttype TreeLocation,\n\ttype FieldLocation,\n\ttype ForestLocation,\n\ttype ITreeSubscriptionCursor,\n\tITreeSubscriptionCursorState,\n\ttype FieldAnchor,\n\tmoveToDetachedField,\n\ttype ForestEvents,\n} from \"./forest/index.js\";\n\nexport {\n\ttype FieldKey,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeFieldStoredSchema,\n\tValueSchema,\n\tTreeNodeStoredSchema,\n\ttype TreeStoredSchemaSubscription,\n\ttype MutableTreeStoredSchema,\n\ttype FieldKindIdentifier,\n\ttype FieldKindData,\n\ttype TreeTypeSet,\n\ttype TreeStoredSchema,\n\tTreeStoredSchemaRepository,\n\tschemaDataIsEmpty,\n\ttype SchemaEvents,\n\tforbiddenFieldKindIdentifier,\n\tidentifierFieldKindIdentifier,\n\tstoredEmptyFieldSchema,\n\ttype StoredSchemaCollection,\n\tschemaFormat,\n\tLeafNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tdecodeFieldSchema,\n\tencodeFieldSchema,\n\tstoredSchemaDecodeDispatcher,\n\ttype SchemaAndPolicy,\n\tMultiplicity,\n\ttype SchemaPolicy,\n} from \"./schema-stored/index.js\";\n\nexport {\n\ttype ChangeFamily,\n\ttype ChangeFamilyCodec,\n\ttype ChangeEncodingContext,\n\ttype ChangeFamilyEditor,\n\tEditBuilder,\n} from \"./change-family/index.js\";\n\nexport {\n\tareEqualChangeAtomIds,\n\tareEqualChangeAtomIdOpts,\n\tmakeChangeAtomId,\n\tasChangeAtomId,\n\ttype ChangeRebaser,\n\tfindAncestor,\n\tfindCommonAncestor,\n\ttype GraphCommit,\n\tCommitKind,\n\ttype CommitMetadata,\n\ttype RevisionTag,\n\tRevisionTagSchema,\n\tRevisionTagCodec,\n\ttype ChangesetLocalId,\n\ttype ChangeAtomId,\n\ttype ChangeAtomIdMap,\n\ttype TaggedChange,\n\tmakeAnonChange,\n\ttagChange,\n\tmapTaggedChange,\n\ttagRollbackInverse,\n\tSessionIdSchema,\n\tmintCommit,\n\trebaseBranch,\n\ttype BranchRebaseResult,\n\trebaseChange,\n\trebaseChangeOverChanges,\n\ttype RevisionMetadataSource,\n\trevisionMetadataSourceFromInfo,\n\ttype RevisionInfo,\n\ttype EncodedRevisionTag,\n\ttype EncodedChangeAtomId,\n\ttaggedAtomId,\n\ttaggedOptAtomId,\n\toffsetChangeAtomId,\n\tsubtractChangeAtomIds,\n\treplaceAtomRevisions,\n\treplaceChange,\n\ttype RebaseStats,\n\ttype RebaseStatsWithDuration,\n\tisAncestor,\n\ttype ChangeAtomIdRangeMap,\n\tnewChangeAtomIdRangeMap,\n\tcompareRevisions,\n} from \"./rebase/index.js\";\n\nexport {\n\ttype Adapters,\n\tAdaptedViewSchema,\n\ttype TreeAdapter,\n\tAllowedUpdateType,\n} from \"./schema-view/index.js\";\n\nexport {\n\ttype Revertible,\n\tRevertibleStatus,\n\ttype RevertibleFactory,\n\ttype RevertibleAlphaFactory,\n\ttype RevertibleAlpha,\n} from \"./revertible.js\";\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export { type TreeFieldStoredSchema, ValueSchema, TreeNodeStoredSchema, type TreeTypeSet, type FieldKindData, type TreeStoredSchema, forbiddenFieldKindIdentifier, identifierFieldKindIdentifier, storedEmptyFieldSchema, type StoredSchemaCollection, LeafNodeStoredSchema, ObjectNodeStoredSchema, MapNodeStoredSchema, decodeFieldSchema, encodeFieldSchema, storedSchemaDecodeDispatcher, type
|
|
5
|
+
export { type TreeFieldStoredSchema, ValueSchema, TreeNodeStoredSchema, type TreeTypeSet, type FieldKindData, type TreeStoredSchema, forbiddenFieldKindIdentifier, identifierFieldKindIdentifier, storedEmptyFieldSchema, type StoredSchemaCollection, LeafNodeStoredSchema, ObjectNodeStoredSchema, MapNodeStoredSchema, decodeFieldSchema, encodeFieldSchema, storedSchemaDecodeDispatcher, type SchemaAndPolicy, type SchemaPolicy, } from "./schema.js";
|
|
6
6
|
export { type TreeStoredSchemaSubscription, type MutableTreeStoredSchema, TreeStoredSchemaRepository, schemaDataIsEmpty, type SchemaEvents, } from "./storedSchemaRepository.js";
|
|
7
7
|
export { Multiplicity } from "./multiplicity.js";
|
|
8
8
|
export type { TreeNodeSchemaIdentifier, FieldKey, FieldKindIdentifier } from "./format.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/schema-stored/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,qBAAqB,EAC1B,WAAW,EACX,oBAAoB,EACpB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,4BAA4B,EAC5B,6BAA6B,EAC7B,sBAAsB,EACtB,KAAK,sBAAsB,EAC3B,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,4BAA4B,EAC5B,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/schema-stored/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,qBAAqB,EAC1B,WAAW,EACX,oBAAoB,EACpB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,4BAA4B,EAC5B,6BAA6B,EAC7B,sBAAsB,EACtB,KAAK,sBAAsB,EAC3B,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,4BAA4B,EAC5B,KAAK,eAAe,EACpB,KAAK,YAAY,GACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,KAAK,4BAA4B,EACjC,KAAK,uBAAuB,EAC5B,0BAA0B,EAC1B,iBAAiB,EACjB,KAAK,YAAY,GACjB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,YAAY,EAAE,wBAAwB,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAE3F,OAAO,KAAK,YAAY,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -27,7 +27,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
27
27
|
return result;
|
|
28
28
|
};
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
exports.schemaFormat = exports.Multiplicity = exports.schemaDataIsEmpty = exports.TreeStoredSchemaRepository = exports.
|
|
30
|
+
exports.schemaFormat = exports.Multiplicity = exports.schemaDataIsEmpty = exports.TreeStoredSchemaRepository = exports.storedSchemaDecodeDispatcher = exports.encodeFieldSchema = exports.decodeFieldSchema = exports.MapNodeStoredSchema = exports.ObjectNodeStoredSchema = exports.LeafNodeStoredSchema = exports.storedEmptyFieldSchema = exports.identifierFieldKindIdentifier = exports.forbiddenFieldKindIdentifier = exports.TreeNodeStoredSchema = exports.ValueSchema = void 0;
|
|
31
31
|
var schema_js_1 = require("./schema.js");
|
|
32
32
|
Object.defineProperty(exports, "ValueSchema", { enumerable: true, get: function () { return schema_js_1.ValueSchema; } });
|
|
33
33
|
Object.defineProperty(exports, "TreeNodeStoredSchema", { enumerable: true, get: function () { return schema_js_1.TreeNodeStoredSchema; } });
|
|
@@ -40,7 +40,6 @@ Object.defineProperty(exports, "MapNodeStoredSchema", { enumerable: true, get: f
|
|
|
40
40
|
Object.defineProperty(exports, "decodeFieldSchema", { enumerable: true, get: function () { return schema_js_1.decodeFieldSchema; } });
|
|
41
41
|
Object.defineProperty(exports, "encodeFieldSchema", { enumerable: true, get: function () { return schema_js_1.encodeFieldSchema; } });
|
|
42
42
|
Object.defineProperty(exports, "storedSchemaDecodeDispatcher", { enumerable: true, get: function () { return schema_js_1.storedSchemaDecodeDispatcher; } });
|
|
43
|
-
Object.defineProperty(exports, "toTreeNodeSchemaDataFormat", { enumerable: true, get: function () { return schema_js_1.toTreeNodeSchemaDataFormat; } });
|
|
44
43
|
var storedSchemaRepository_js_1 = require("./storedSchemaRepository.js");
|
|
45
44
|
Object.defineProperty(exports, "TreeStoredSchemaRepository", { enumerable: true, get: function () { return storedSchemaRepository_js_1.TreeStoredSchemaRepository; } });
|
|
46
45
|
Object.defineProperty(exports, "schemaDataIsEmpty", { enumerable: true, get: function () { return storedSchemaRepository_js_1.schemaDataIsEmpty; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/schema-stored/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/schema-stored/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,yCAmBqB;AAjBpB,wGAAA,WAAW,OAAA;AACX,iHAAA,oBAAoB,OAAA;AAIpB,yHAAA,4BAA4B,OAAA;AAC5B,0HAAA,6BAA6B,OAAA;AAC7B,mHAAA,sBAAsB,OAAA;AAEtB,iHAAA,oBAAoB,OAAA;AACpB,mHAAA,sBAAsB,OAAA;AACtB,gHAAA,mBAAmB,OAAA;AACnB,8GAAA,iBAAiB,OAAA;AACjB,8GAAA,iBAAiB,OAAA;AACjB,yHAAA,4BAA4B,OAAA;AAI7B,yEAMqC;AAHpC,uIAAA,0BAA0B,OAAA;AAC1B,8HAAA,iBAAiB,OAAA;AAGlB,qDAAiD;AAAxC,+GAAA,YAAY,OAAA;AAIrB,0DAA4C;AACnC,oCAAY","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype TreeFieldStoredSchema,\n\tValueSchema,\n\tTreeNodeStoredSchema,\n\ttype TreeTypeSet,\n\ttype FieldKindData,\n\ttype TreeStoredSchema,\n\tforbiddenFieldKindIdentifier,\n\tidentifierFieldKindIdentifier,\n\tstoredEmptyFieldSchema,\n\ttype StoredSchemaCollection,\n\tLeafNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tdecodeFieldSchema,\n\tencodeFieldSchema,\n\tstoredSchemaDecodeDispatcher,\n\ttype SchemaAndPolicy,\n\ttype SchemaPolicy,\n} from \"./schema.js\";\nexport {\n\ttype TreeStoredSchemaSubscription,\n\ttype MutableTreeStoredSchema,\n\tTreeStoredSchemaRepository,\n\tschemaDataIsEmpty,\n\ttype SchemaEvents,\n} from \"./storedSchemaRepository.js\";\nexport { Multiplicity } from \"./multiplicity.js\";\n\nexport type { TreeNodeSchemaIdentifier, FieldKey, FieldKindIdentifier } from \"./format.js\";\n\nimport * as schemaFormat from \"./format.js\";\nexport { schemaFormat };\n"]}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import type { ErasedType } from "@fluidframework/core-interfaces";
|
|
6
5
|
import { DiscriminatedUnionDispatcher } from "../../codec/index.js";
|
|
7
6
|
import { type MakeNominal } from "../../util/index.js";
|
|
8
7
|
import { type FieldKey, type FieldKindIdentifier, type FieldSchemaFormat, type TreeNodeSchemaDataFormat, type TreeNodeSchemaIdentifier } from "./format.js";
|
|
@@ -121,12 +120,6 @@ export declare const storedEmptyFieldSchema: TreeFieldStoredSchema;
|
|
|
121
120
|
* Identifier used for the FieldKind for fields of type identifier.
|
|
122
121
|
*/
|
|
123
122
|
export declare const identifierFieldKindIdentifier = "Identifier";
|
|
124
|
-
/**
|
|
125
|
-
* Opaque type erased handle to the encoded representation of the contents of a stored schema.
|
|
126
|
-
*/
|
|
127
|
-
export interface ErasedTreeNodeSchemaDataFormat extends ErasedType<"TreeNodeSchemaDataFormat"> {
|
|
128
|
-
}
|
|
129
|
-
export declare function toTreeNodeSchemaDataFormat(data: ErasedTreeNodeSchemaDataFormat): TreeNodeSchemaDataFormat;
|
|
130
123
|
/**
|
|
131
124
|
*/
|
|
132
125
|
export declare abstract class TreeNodeStoredSchema {
|
|
@@ -137,7 +130,7 @@ export declare abstract class TreeNodeStoredSchema {
|
|
|
137
130
|
* This is uses an opaque type to avoid leaking these types out of the package,
|
|
138
131
|
* and is runtime validated by the codec.
|
|
139
132
|
*/
|
|
140
|
-
abstract encode():
|
|
133
|
+
abstract encode(): TreeNodeSchemaDataFormat;
|
|
141
134
|
/**
|
|
142
135
|
* Returns the schema for the provided field.
|
|
143
136
|
*/
|
|
@@ -156,7 +149,7 @@ export declare class ObjectNodeStoredSchema extends TreeNodeStoredSchema {
|
|
|
156
149
|
* It also interoperates well with mapFields being used as a map with arbitrary data as keys.
|
|
157
150
|
*/
|
|
158
151
|
constructor(objectNodeFields: ReadonlyMap<FieldKey, TreeFieldStoredSchema>);
|
|
159
|
-
encode():
|
|
152
|
+
encode(): TreeNodeSchemaDataFormat;
|
|
160
153
|
getFieldSchema(field: FieldKey): TreeFieldStoredSchema;
|
|
161
154
|
}
|
|
162
155
|
/**
|
|
@@ -172,7 +165,7 @@ export declare class MapNodeStoredSchema extends TreeNodeStoredSchema {
|
|
|
172
165
|
* (that would require infinite children).
|
|
173
166
|
*/
|
|
174
167
|
constructor(mapFields: TreeFieldStoredSchema);
|
|
175
|
-
encode():
|
|
168
|
+
encode(): TreeNodeSchemaDataFormat;
|
|
176
169
|
getFieldSchema(field: FieldKey): TreeFieldStoredSchema;
|
|
177
170
|
}
|
|
178
171
|
/**
|
|
@@ -192,7 +185,7 @@ export declare class LeafNodeStoredSchema extends TreeNodeStoredSchema {
|
|
|
192
185
|
* This is simply one approach that can work for modeling them in the internal schema representation.
|
|
193
186
|
*/
|
|
194
187
|
constructor(leafValue: ValueSchema);
|
|
195
|
-
encode():
|
|
188
|
+
encode(): TreeNodeSchemaDataFormat;
|
|
196
189
|
getFieldSchema(field: FieldKey): TreeFieldStoredSchema;
|
|
197
190
|
}
|
|
198
191
|
export declare const storedSchemaDecodeDispatcher: DiscriminatedUnionDispatcher<TreeNodeSchemaDataFormat, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/core/schema-stored/schema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/core/schema-stored/schema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,KAAK,WAAW,EAAoB,MAAM,qBAAqB,CAAC;AACzE,OAAO,EACN,KAAK,QAAQ,EACb,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EAEtB,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD;;;;;;;;GAQG;AACH,oBAAY,WAAW;IACtB,MAAM,IAAA;IACN,MAAM,IAAA;IACN,OAAO,IAAA;IACP,WAAW,IAAA;IACX,IAAI,IAAA;CACJ;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC,wBAAwB,CAAC,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC7B,QAAQ,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AAE,QAAQ,GAAG,qBAAqB;CAGtE;AAED;GACG;AACH,qBAAa,mBAAoB,SAAQ,oBAAoB;aASzB,SAAS,EAAE,qBAAqB;IARnE;;;;;;;OAOG;gBACgC,SAAS,EAAE,qBAAqB;IAInD,MAAM,IAAI,wBAAwB;IAMlC,cAAc,CAAC,KAAK,EAAE,QAAQ,GAAG,qBAAqB;CAGtE;AAED;GACG;AACH,qBAAa,oBAAqB,SAAQ,oBAAoB;aAa1B,SAAS,EAAE,WAAW;IAZzD;;;;;;;;;;;OAWG;gBACgC,SAAS,EAAE,WAAW;IAIzC,MAAM,IAAI,wBAAwB;IAMlC,cAAc,CAAC,KAAK,EAAE,QAAQ,GAAG,qBAAqB;CAGtE;AAED,eAAO,MAAM,4BAA4B,EAAE,4BAA4B,CACtE,wBAAwB,EACxB;CAAE,EACF,oBAAoB,CAanB,CAAC;AAoBH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,qBAAqB,GAAG,iBAAiB,CAMlF;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,GAAG,qBAAqB,CAOlF;AAED;;;;;;GAMG;AACH,MAAM,WAAW,gBAAiB,SAAQ,sBAAsB;IAC/D;;OAEG;IACH,QAAQ,CAAC,eAAe,EAAE,qBAAqB,CAAC;CAChD;AAED;;;;;;GAMG;AACH,MAAM,WAAW,sBAAsB;IACtC;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,wBAAwB,EAAE,oBAAoB,CAAC,CAAC;CACjF"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.decodeFieldSchema = exports.encodeFieldSchema = exports.storedSchemaDecodeDispatcher = exports.LeafNodeStoredSchema = exports.MapNodeStoredSchema = exports.ObjectNodeStoredSchema = exports.TreeNodeStoredSchema = exports.
|
|
7
|
+
exports.decodeFieldSchema = exports.encodeFieldSchema = exports.storedSchemaDecodeDispatcher = exports.LeafNodeStoredSchema = exports.MapNodeStoredSchema = exports.ObjectNodeStoredSchema = exports.TreeNodeStoredSchema = exports.identifierFieldKindIdentifier = exports.storedEmptyFieldSchema = exports.forbiddenFieldKindIdentifier = exports.ValueSchema = void 0;
|
|
8
8
|
const internal_1 = require("@fluidframework/core-utils/internal");
|
|
9
9
|
const index_js_1 = require("../../codec/index.js");
|
|
10
10
|
const index_js_2 = require("../../util/index.js");
|
|
@@ -49,13 +49,6 @@ exports.storedEmptyFieldSchema = {
|
|
|
49
49
|
* Identifier used for the FieldKind for fields of type identifier.
|
|
50
50
|
*/
|
|
51
51
|
exports.identifierFieldKindIdentifier = "Identifier";
|
|
52
|
-
function toErasedTreeNodeSchemaDataFormat(data) {
|
|
53
|
-
return data;
|
|
54
|
-
}
|
|
55
|
-
function toTreeNodeSchemaDataFormat(data) {
|
|
56
|
-
return data;
|
|
57
|
-
}
|
|
58
|
-
exports.toTreeNodeSchemaDataFormat = toTreeNodeSchemaDataFormat;
|
|
59
52
|
/**
|
|
60
53
|
*/
|
|
61
54
|
class TreeNodeStoredSchema {
|
|
@@ -88,9 +81,9 @@ class ObjectNodeStoredSchema extends TreeNodeStoredSchema {
|
|
|
88
81
|
value: encodeFieldSchema(this.objectNodeFields.get(key) ?? (0, internal_1.fail)(0xae7 /* missing field */)),
|
|
89
82
|
});
|
|
90
83
|
}
|
|
91
|
-
return
|
|
84
|
+
return {
|
|
92
85
|
object: fieldsObject,
|
|
93
|
-
}
|
|
86
|
+
};
|
|
94
87
|
}
|
|
95
88
|
getFieldSchema(field) {
|
|
96
89
|
return this.objectNodeFields.get(field) ?? exports.storedEmptyFieldSchema;
|
|
@@ -113,9 +106,9 @@ class MapNodeStoredSchema extends TreeNodeStoredSchema {
|
|
|
113
106
|
this.mapFields = mapFields;
|
|
114
107
|
}
|
|
115
108
|
encode() {
|
|
116
|
-
return
|
|
109
|
+
return {
|
|
117
110
|
map: encodeFieldSchema(this.mapFields),
|
|
118
|
-
}
|
|
111
|
+
};
|
|
119
112
|
}
|
|
120
113
|
getFieldSchema(field) {
|
|
121
114
|
return this.mapFields;
|
|
@@ -142,9 +135,9 @@ class LeafNodeStoredSchema extends TreeNodeStoredSchema {
|
|
|
142
135
|
this.leafValue = leafValue;
|
|
143
136
|
}
|
|
144
137
|
encode() {
|
|
145
|
-
return
|
|
138
|
+
return {
|
|
146
139
|
leaf: encodeValueSchema(this.leafValue),
|
|
147
|
-
}
|
|
140
|
+
};
|
|
148
141
|
}
|
|
149
142
|
getFieldSchema(field) {
|
|
150
143
|
return exports.storedEmptyFieldSchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/core/schema-stored/schema.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA2D;AAE3D,mDAAoE;AACpE,kDAAyE;AACzE,2CAOqB;AAGrB;;;;;;;;GAQG;AACH,IAAY,WAMX;AAND,WAAY,WAAW;IACtB,iDAAM,CAAA;IACN,iDAAM,CAAA;IACN,mDAAO,CAAA;IACP,2DAAW,CAAA;IACX,6CAAI,CAAA;AACL,CAAC,EANW,WAAW,2BAAX,WAAW,QAMtB;AA0FD;;;;;;;GAOG;AACU,QAAA,4BAA4B,GAAG,WAAW,CAAC;AAExD;;;GAGG;AACU,QAAA,sBAAsB,GAA0B;IAC5D,4CAA4C;IAC5C,IAAI,EAAE,IAAA,gBAAK,EAAC,oCAA4B,CAAC;IACzC,qFAAqF;IACrF,KAAK,EAAE,IAAI,GAAG,EAAE;CAChB,CAAC;AAEF;;GAEG;AACU,QAAA,6BAA6B,GAAG,YAAY,CAAC;AAQ1D,SAAS,gCAAgC,CACxC,IAA8B;IAE9B,OAAO,IAAiD,CAAC;AAC1D,CAAC;AAED,SAAgB,0BAA0B,CACzC,IAAoC;IAEpC,OAAO,IAA2C,CAAC;AACpD,CAAC;AAJD,gEAIC;AAED;GACG;AACH,MAA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C;IACjD,CAAC,WAAW,CAAC,OAAO,EAAE,gCAAoB,CAAC,OAAO,CAAC;IACnD,CAAC,WAAW,CAAC,WAAW,EAAE,gCAAoB,CAAC,WAAW,CAAC;IAC3D,CAAC,WAAW,CAAC,IAAI,EAAE,gCAAoB,CAAC,IAAI,CAAC;CAC7C,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAG,IAAA,oBAAS,EAAC,iBAAiB,CAAC,CAAC;AAEvD,SAAS,iBAAiB,CAAC,QAAqB;IAC/C,OAAO,iBAAiB,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,IAAA,eAAI,EAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;AAC1F,CAAC;AAED,SAAS,iBAAiB,CAAC,QAA8B;IACxD,OAAO,iBAAiB,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,IAAA,eAAI,EAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;AACjF,CAAC;AAED,SAAgB,iBAAiB,CAAC,MAA6B;IAC9D,OAAO;QACN,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,iHAAiH;QACjH,KAAK,EAAE,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE;KAC/B,CAAC;AACH,CAAC;AAND,8CAMC;AAED,SAAgB,iBAAiB,CAAC,MAAyB;IAC1D,MAAM,GAAG,GAA0B;QAClC,kFAAkF;QAClF,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,KAAK,EAAE,IAAI,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC;KAC5B,CAAC;IACF,OAAO,GAAG,CAAC;AACZ,CAAC;AAPD,8CAOC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fail } from \"@fluidframework/core-utils/internal\";\nimport type { ErasedType } from \"@fluidframework/core-interfaces\";\nimport { DiscriminatedUnionDispatcher } from \"../../codec/index.js\";\nimport { type MakeNominal, brand, invertMap } from \"../../util/index.js\";\nimport {\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\ttype FieldSchemaFormat,\n\tPersistedValueSchema,\n\ttype TreeNodeSchemaDataFormat,\n\ttype TreeNodeSchemaIdentifier,\n} from \"./format.js\";\nimport type { Multiplicity } from \"./multiplicity.js\";\n\n/**\n * Schema for what {@link TreeLeafValue} is allowed on a Leaf node.\n * @privateRemarks\n * See also {@link TreeValue}.\n * If further stabilizing this,\n * consider the implications of how this might prevent adding of new leaf types in the future.\n * Maybe add a disclaimer that it might be extended like on {@link NodeKind}?\n * @alpha\n */\nexport enum ValueSchema {\n\tNumber,\n\tString,\n\tBoolean,\n\tFluidHandle,\n\tNull,\n}\n\n/**\n * Set of allowed tree types.\n * Providing multiple values here allows polymorphism, tagged union style.\n *\n * In the future, this could be extended to allow inlining a TreeNodeStoredSchema here\n * (or some similar structural schema system).\n * For structural types which could go here, there are a few interesting options:\n *\n * - Allow replacing the whole set with a structural type for terminal / non-tree data,\n * and use this as a replacement for values on the tree nodes.\n *\n * - Allow expression structural constraints for child trees, for example requiring specific traits\n * (ex: via TreeNodeStoredSchema), instead of by type.\n *\n * There are two ways this could work:\n *\n * - Constrain the child nodes based on their shape:\n * this makes schema safe editing difficult because nodes would incur extra editing constraints to prevent them\n * from going out of schema based on their location in such a field.\n *\n * - Constrain the types allowed based on which types guarantee their data will always meet the constraints.\n *\n * Care would need to be taken to make sure this is sound for the schema updating mechanisms.\n */\nexport type TreeTypeSet = ReadonlySet<TreeNodeSchemaIdentifier>;\n\n/**\n * Declarative portion of a Field Kind.\n *\n * @remarks\n * Enough info about a field kind to know if a given tree is is schema.\n */\nexport interface FieldKindData {\n\treadonly identifier: FieldKindIdentifier;\n\treadonly multiplicity: Multiplicity;\n}\n\n/**\n * Everything needed to define what it means for a tree to be in schema.\n */\nexport interface SchemaAndPolicy {\n\treadonly schema: StoredSchemaCollection;\n\treadonly policy: SchemaPolicy;\n}\n\n/**\n * Extra data needed to interpret schema.\n */\nexport interface SchemaPolicy {\n\t/**\n\t * Policy information about FieldKinds:\n\t * This is typically stored as code, not in documents, and defines how to handle fields based on their kind.\n\t * It is assumed that all users of a document will have exactly the same FieldKind policies,\n\t * though older applications might be missing some,\n\t * and will be unable to process any changes that use those FieldKinds.\n\t */\n\treadonly fieldKinds: ReadonlyMap<FieldKindIdentifier, FieldKindData>;\n\n\t/**\n\t * If true, new content inserted into the tree should be validated against the stored schema.\n\t */\n\treadonly validateSchema: boolean;\n\n\t/**\n\t * Whether to allow a document to be opened when a particular stored schema (identified by `identifier`)\n\t * contains optional fields that are not known to the view schema.\n\t *\n\t * @privateRemarks\n\t * Plumbing this in via `SchemaPolicy` avoids needing to walk the view schema representation repeatedly in places\n\t * that need it (schema validation, view vs stored compatibility checks).\n\t */\n\tallowUnknownOptionalFields(identifier: TreeNodeSchemaIdentifier): boolean;\n}\n\n/**\n * Schema for a field.\n * Object implementing this interface should never be modified.\n */\nexport interface TreeFieldStoredSchema {\n\treadonly kind: FieldKindIdentifier;\n\n\t/**\n\t * The set of allowed child types.\n\t * If not specified, types are unconstrained.\n\t */\n\treadonly types: TreeTypeSet;\n}\n\n/**\n * Identifier used for the FieldKind for fields which must be empty.\n *\n * @remarks\n * This mainly show up in:\n * 1. The root default field for documents.\n * 2. The schema used for out of schema fields (which thus must be empty/not exist) on object and leaf nodes.\n */\nexport const forbiddenFieldKindIdentifier = \"Forbidden\";\n\n/**\n * A schema for empty fields (fields which must always be empty).\n * There are multiple ways this could be encoded, but this is the most explicit.\n */\nexport const storedEmptyFieldSchema: TreeFieldStoredSchema = {\n\t// This kind requires the field to be empty.\n\tkind: brand(forbiddenFieldKindIdentifier),\n\t// This type set also forces the field to be empty not not allowing any types as all.\n\ttypes: new Set(),\n};\n\n/**\n * Identifier used for the FieldKind for fields of type identifier.\n */\nexport const identifierFieldKindIdentifier = \"Identifier\";\n\n/**\n * Opaque type erased handle to the encoded representation of the contents of a stored schema.\n */\nexport interface ErasedTreeNodeSchemaDataFormat\n\textends ErasedType<\"TreeNodeSchemaDataFormat\"> {}\n\nfunction toErasedTreeNodeSchemaDataFormat(\n\tdata: TreeNodeSchemaDataFormat,\n): ErasedTreeNodeSchemaDataFormat {\n\treturn data as unknown as ErasedTreeNodeSchemaDataFormat;\n}\n\nexport function toTreeNodeSchemaDataFormat(\n\tdata: ErasedTreeNodeSchemaDataFormat,\n): TreeNodeSchemaDataFormat {\n\treturn data as unknown as TreeNodeSchemaDataFormat;\n}\n\n/**\n */\nexport abstract class TreeNodeStoredSchema {\n\tprotected _typeCheck!: MakeNominal;\n\n\t/**\n\t * @privateRemarks\n\t * Returns TreeNodeSchemaDataFormat.\n\t * This is uses an opaque type to avoid leaking these types out of the package,\n\t * and is runtime validated by the codec.\n\t */\n\tpublic abstract encode(): ErasedTreeNodeSchemaDataFormat;\n\n\t/**\n\t * Returns the schema for the provided field.\n\t */\n\tpublic abstract getFieldSchema(field: FieldKey): TreeFieldStoredSchema;\n}\n\n/**\n */\nexport class ObjectNodeStoredSchema extends TreeNodeStoredSchema {\n\t/**\n\t * @param objectNodeFields -\n\t * Schema for fields with keys scoped to this TreeNodeStoredSchema.\n\t * This refers to the TreeFieldStoredSchema directly\n\t * (as opposed to just supporting FieldSchemaIdentifier and having a central FieldKey -\\> TreeFieldStoredSchema map).\n\t * This allows us short friendly field keys which can be ergonomically used as field names in code.\n\t * It also interoperates well with mapFields being used as a map with arbitrary data as keys.\n\t */\n\tpublic constructor(\n\t\tpublic readonly objectNodeFields: ReadonlyMap<FieldKey, TreeFieldStoredSchema>,\n\t) {\n\t\tsuper();\n\t}\n\n\tpublic override encode(): ErasedTreeNodeSchemaDataFormat {\n\t\tconst fieldsObject: Record<string, FieldSchemaFormat> = Object.create(null);\n\t\t// Sort fields to ensure output is identical for for equivalent schema (since field order is not considered significant).\n\t\t// This makes comparing schema easier, and ensures chunk reuse for schema summaries isn't needlessly broken.\n\t\tfor (const key of [...this.objectNodeFields.keys()].sort()) {\n\t\t\tObject.defineProperty(fieldsObject, key, {\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true,\n\t\t\t\twritable: true,\n\t\t\t\tvalue: encodeFieldSchema(\n\t\t\t\t\tthis.objectNodeFields.get(key) ?? fail(0xae7 /* missing field */),\n\t\t\t\t),\n\t\t\t});\n\t\t}\n\t\treturn toErasedTreeNodeSchemaDataFormat({\n\t\t\tobject: fieldsObject,\n\t\t});\n\t}\n\n\tpublic override getFieldSchema(field: FieldKey): TreeFieldStoredSchema {\n\t\treturn this.objectNodeFields.get(field) ?? storedEmptyFieldSchema;\n\t}\n}\n\n/**\n */\nexport class MapNodeStoredSchema extends TreeNodeStoredSchema {\n\t/**\n\t * @param mapFields -\n\t * Allows using the fields as a map, with the keys being\n\t * FieldKeys and the values being constrained by this TreeFieldStoredSchema.\n\t * Usually `FieldKind.Value` should NOT be used here\n\t * since no nodes can ever be in schema if you use `FieldKind.Value` here\n\t * (that would require infinite children).\n\t */\n\tpublic constructor(public readonly mapFields: TreeFieldStoredSchema) {\n\t\tsuper();\n\t}\n\n\tpublic override encode(): ErasedTreeNodeSchemaDataFormat {\n\t\treturn toErasedTreeNodeSchemaDataFormat({\n\t\t\tmap: encodeFieldSchema(this.mapFields),\n\t\t});\n\t}\n\n\tpublic override getFieldSchema(field: FieldKey): TreeFieldStoredSchema {\n\t\treturn this.mapFields;\n\t}\n}\n\n/**\n */\nexport class LeafNodeStoredSchema extends TreeNodeStoredSchema {\n\t/**\n\t * @param leafValue -\n\t * There are several approaches for how to store actual data in the tree\n\t * (special node types, special field contents, data on nodes etc.)\n\t * as well as several options about how the data should be modeled at this level\n\t * (byte sequence? javascript type? json?),\n\t * as well as options for how much of this would be exposed in the schema language\n\t * (ex: would all nodes with values be special built-ins, or could any schema add them?)\n\t * A simple easy to do in javascript approach is taken here:\n\t * this is not intended to be a suggestion of what approach to take, or what to expose in the schema language.\n\t * This is simply one approach that can work for modeling them in the internal schema representation.\n\t */\n\tpublic constructor(public readonly leafValue: ValueSchema) {\n\t\tsuper();\n\t}\n\n\tpublic override encode(): ErasedTreeNodeSchemaDataFormat {\n\t\treturn toErasedTreeNodeSchemaDataFormat({\n\t\t\tleaf: encodeValueSchema(this.leafValue),\n\t\t});\n\t}\n\n\tpublic override getFieldSchema(field: FieldKey): TreeFieldStoredSchema {\n\t\treturn storedEmptyFieldSchema;\n\t}\n}\n\nexport const storedSchemaDecodeDispatcher: DiscriminatedUnionDispatcher<\n\tTreeNodeSchemaDataFormat,\n\t[],\n\tTreeNodeStoredSchema\n> = new DiscriminatedUnionDispatcher({\n\tleaf: (data: PersistedValueSchema) => new LeafNodeStoredSchema(decodeValueSchema(data)),\n\tobject: (\n\t\tdata: Record<TreeNodeSchemaIdentifier, FieldSchemaFormat>,\n\t): TreeNodeStoredSchema => {\n\t\tconst map = new Map();\n\t\tfor (const [key, value] of Object.entries(data)) {\n\t\t\tmap.set(key, decodeFieldSchema(value));\n\t\t}\n\t\treturn new ObjectNodeStoredSchema(map);\n\t},\n\tmap: (data: FieldSchemaFormat) => new MapNodeStoredSchema(decodeFieldSchema(data)),\n});\n\nconst valueSchemaEncode = new Map([\n\t[ValueSchema.Number, PersistedValueSchema.Number],\n\t[ValueSchema.String, PersistedValueSchema.String],\n\t[ValueSchema.Boolean, PersistedValueSchema.Boolean],\n\t[ValueSchema.FluidHandle, PersistedValueSchema.FluidHandle],\n\t[ValueSchema.Null, PersistedValueSchema.Null],\n]);\n\nconst valueSchemaDecode = invertMap(valueSchemaEncode);\n\nfunction encodeValueSchema(inMemory: ValueSchema): PersistedValueSchema {\n\treturn valueSchemaEncode.get(inMemory) ?? fail(0xae8 /* missing PersistedValueSchema */);\n}\n\nfunction decodeValueSchema(inMemory: PersistedValueSchema): ValueSchema {\n\treturn valueSchemaDecode.get(inMemory) ?? fail(0xae9 /* missing ValueSchema */);\n}\n\nexport function encodeFieldSchema(schema: TreeFieldStoredSchema): FieldSchemaFormat {\n\treturn {\n\t\tkind: schema.kind,\n\t\t// Types are sorted by identifier to improve stability of persisted data to increase chance of schema blob reuse.\n\t\ttypes: [...schema.types].sort(),\n\t};\n}\n\nexport function decodeFieldSchema(schema: FieldSchemaFormat): TreeFieldStoredSchema {\n\tconst out: TreeFieldStoredSchema = {\n\t\t// TODO: maybe provide actual FieldKind objects here, error on unrecognized kinds.\n\t\tkind: schema.kind,\n\t\ttypes: new Set(schema.types),\n\t};\n\treturn out;\n}\n\n/**\n * Document schema data that can be stored in a document.\n *\n * @remarks\n * Note: the owner of this may modify it over time:\n * thus if needing to hand onto a specific version, make a copy.\n */\nexport interface TreeStoredSchema extends StoredSchemaCollection {\n\t/**\n\t * Schema for the root field which contains the whole tree.\n\t */\n\treadonly rootFieldSchema: TreeFieldStoredSchema;\n}\n\n/**\n * Collection of TreeNodeSchema data that can be stored in a document.\n *\n * @remarks\n * Note: the owner of this may modify it over time:\n * thus if needing to hang onto a specific version, make a copy.\n */\nexport interface StoredSchemaCollection {\n\t/**\n\t * {@inheritdoc StoredSchemaCollection}\n\t */\n\treadonly nodeSchema: ReadonlyMap<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/core/schema-stored/schema.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA2D;AAC3D,mDAAoE;AACpE,kDAAyE;AACzE,2CAOqB;AAGrB;;;;;;;;GAQG;AACH,IAAY,WAMX;AAND,WAAY,WAAW;IACtB,iDAAM,CAAA;IACN,iDAAM,CAAA;IACN,mDAAO,CAAA;IACP,2DAAW,CAAA;IACX,6CAAI,CAAA;AACL,CAAC,EANW,WAAW,2BAAX,WAAW,QAMtB;AA0FD;;;;;;;GAOG;AACU,QAAA,4BAA4B,GAAG,WAAW,CAAC;AAExD;;;GAGG;AACU,QAAA,sBAAsB,GAA0B;IAC5D,4CAA4C;IAC5C,IAAI,EAAE,IAAA,gBAAK,EAAC,oCAA4B,CAAC;IACzC,qFAAqF;IACrF,KAAK,EAAE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AM,EAAE,gCAAoB,CAAC,MAAM,CAAC;IACjD,CAAC,WAAW,CAAC,OAAO,EAAE,gCAAoB,CAAC,OAAO,CAAC;IACnD,CAAC,WAAW,CAAC,WAAW,EAAE,gCAAoB,CAAC,WAAW,CAAC;IAC3D,CAAC,WAAW,CAAC,IAAI,EAAE,gCAAoB,CAAC,IAAI,CAAC;CAC7C,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAG,IAAA,oBAAS,EAAC,iBAAiB,CAAC,CAAC;AAEvD,SAAS,iBAAiB,CAAC,QAAqB;IAC/C,OAAO,iBAAiB,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,IAAA,eAAI,EAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;AAC1F,CAAC;AAED,SAAS,iBAAiB,CAAC,QAA8B;IACxD,OAAO,iBAAiB,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,IAAA,eAAI,EAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;AACjF,CAAC;AAED,SAAgB,iBAAiB,CAAC,MAA6B;IAC9D,OAAO;QACN,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,iHAAiH;QACjH,KAAK,EAAE,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE;KAC/B,CAAC;AACH,CAAC;AAND,8CAMC;AAED,SAAgB,iBAAiB,CAAC,MAAyB;IAC1D,MAAM,GAAG,GAA0B;QAClC,kFAAkF;QAClF,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,KAAK,EAAE,IAAI,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC;KAC5B,CAAC;IACF,OAAO,GAAG,CAAC;AACZ,CAAC;AAPD,8CAOC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fail } from \"@fluidframework/core-utils/internal\";\nimport { DiscriminatedUnionDispatcher } from \"../../codec/index.js\";\nimport { type MakeNominal, brand, invertMap } from \"../../util/index.js\";\nimport {\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\ttype FieldSchemaFormat,\n\tPersistedValueSchema,\n\ttype TreeNodeSchemaDataFormat,\n\ttype TreeNodeSchemaIdentifier,\n} from \"./format.js\";\nimport type { Multiplicity } from \"./multiplicity.js\";\n\n/**\n * Schema for what {@link TreeLeafValue} is allowed on a Leaf node.\n * @privateRemarks\n * See also {@link TreeValue}.\n * If further stabilizing this,\n * consider the implications of how this might prevent adding of new leaf types in the future.\n * Maybe add a disclaimer that it might be extended like on {@link NodeKind}?\n * @alpha\n */\nexport enum ValueSchema {\n\tNumber,\n\tString,\n\tBoolean,\n\tFluidHandle,\n\tNull,\n}\n\n/**\n * Set of allowed tree types.\n * Providing multiple values here allows polymorphism, tagged union style.\n *\n * In the future, this could be extended to allow inlining a TreeNodeStoredSchema here\n * (or some similar structural schema system).\n * For structural types which could go here, there are a few interesting options:\n *\n * - Allow replacing the whole set with a structural type for terminal / non-tree data,\n * and use this as a replacement for values on the tree nodes.\n *\n * - Allow expression structural constraints for child trees, for example requiring specific traits\n * (ex: via TreeNodeStoredSchema), instead of by type.\n *\n * There are two ways this could work:\n *\n * - Constrain the child nodes based on their shape:\n * this makes schema safe editing difficult because nodes would incur extra editing constraints to prevent them\n * from going out of schema based on their location in such a field.\n *\n * - Constrain the types allowed based on which types guarantee their data will always meet the constraints.\n *\n * Care would need to be taken to make sure this is sound for the schema updating mechanisms.\n */\nexport type TreeTypeSet = ReadonlySet<TreeNodeSchemaIdentifier>;\n\n/**\n * Declarative portion of a Field Kind.\n *\n * @remarks\n * Enough info about a field kind to know if a given tree is is schema.\n */\nexport interface FieldKindData {\n\treadonly identifier: FieldKindIdentifier;\n\treadonly multiplicity: Multiplicity;\n}\n\n/**\n * Everything needed to define what it means for a tree to be in schema.\n */\nexport interface SchemaAndPolicy {\n\treadonly schema: StoredSchemaCollection;\n\treadonly policy: SchemaPolicy;\n}\n\n/**\n * Extra data needed to interpret schema.\n */\nexport interface SchemaPolicy {\n\t/**\n\t * Policy information about FieldKinds:\n\t * This is typically stored as code, not in documents, and defines how to handle fields based on their kind.\n\t * It is assumed that all users of a document will have exactly the same FieldKind policies,\n\t * though older applications might be missing some,\n\t * and will be unable to process any changes that use those FieldKinds.\n\t */\n\treadonly fieldKinds: ReadonlyMap<FieldKindIdentifier, FieldKindData>;\n\n\t/**\n\t * If true, new content inserted into the tree should be validated against the stored schema.\n\t */\n\treadonly validateSchema: boolean;\n\n\t/**\n\t * Whether to allow a document to be opened when a particular stored schema (identified by `identifier`)\n\t * contains optional fields that are not known to the view schema.\n\t *\n\t * @privateRemarks\n\t * Plumbing this in via `SchemaPolicy` avoids needing to walk the view schema representation repeatedly in places\n\t * that need it (schema validation, view vs stored compatibility checks).\n\t */\n\tallowUnknownOptionalFields(identifier: TreeNodeSchemaIdentifier): boolean;\n}\n\n/**\n * Schema for a field.\n * Object implementing this interface should never be modified.\n */\nexport interface TreeFieldStoredSchema {\n\treadonly kind: FieldKindIdentifier;\n\n\t/**\n\t * The set of allowed child types.\n\t * If not specified, types are unconstrained.\n\t */\n\treadonly types: TreeTypeSet;\n}\n\n/**\n * Identifier used for the FieldKind for fields which must be empty.\n *\n * @remarks\n * This mainly show up in:\n * 1. The root default field for documents.\n * 2. The schema used for out of schema fields (which thus must be empty/not exist) on object and leaf nodes.\n */\nexport const forbiddenFieldKindIdentifier = \"Forbidden\";\n\n/**\n * A schema for empty fields (fields which must always be empty).\n * There are multiple ways this could be encoded, but this is the most explicit.\n */\nexport const storedEmptyFieldSchema: TreeFieldStoredSchema = {\n\t// This kind requires the field to be empty.\n\tkind: brand(forbiddenFieldKindIdentifier),\n\t// This type set also forces the field to be empty not not allowing any types as all.\n\ttypes: new Set(),\n};\n\n/**\n * Identifier used for the FieldKind for fields of type identifier.\n */\nexport const identifierFieldKindIdentifier = \"Identifier\";\n\n/**\n */\nexport abstract class TreeNodeStoredSchema {\n\tprotected _typeCheck!: MakeNominal;\n\n\t/**\n\t * @privateRemarks\n\t * Returns TreeNodeSchemaDataFormat.\n\t * This is uses an opaque type to avoid leaking these types out of the package,\n\t * and is runtime validated by the codec.\n\t */\n\tpublic abstract encode(): TreeNodeSchemaDataFormat;\n\n\t/**\n\t * Returns the schema for the provided field.\n\t */\n\tpublic abstract getFieldSchema(field: FieldKey): TreeFieldStoredSchema;\n}\n\n/**\n */\nexport class ObjectNodeStoredSchema extends TreeNodeStoredSchema {\n\t/**\n\t * @param objectNodeFields -\n\t * Schema for fields with keys scoped to this TreeNodeStoredSchema.\n\t * This refers to the TreeFieldStoredSchema directly\n\t * (as opposed to just supporting FieldSchemaIdentifier and having a central FieldKey -\\> TreeFieldStoredSchema map).\n\t * This allows us short friendly field keys which can be ergonomically used as field names in code.\n\t * It also interoperates well with mapFields being used as a map with arbitrary data as keys.\n\t */\n\tpublic constructor(\n\t\tpublic readonly objectNodeFields: ReadonlyMap<FieldKey, TreeFieldStoredSchema>,\n\t) {\n\t\tsuper();\n\t}\n\n\tpublic override encode(): TreeNodeSchemaDataFormat {\n\t\tconst fieldsObject: Record<string, FieldSchemaFormat> = Object.create(null);\n\t\t// Sort fields to ensure output is identical for for equivalent schema (since field order is not considered significant).\n\t\t// This makes comparing schema easier, and ensures chunk reuse for schema summaries isn't needlessly broken.\n\t\tfor (const key of [...this.objectNodeFields.keys()].sort()) {\n\t\t\tObject.defineProperty(fieldsObject, key, {\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true,\n\t\t\t\twritable: true,\n\t\t\t\tvalue: encodeFieldSchema(\n\t\t\t\t\tthis.objectNodeFields.get(key) ?? fail(0xae7 /* missing field */),\n\t\t\t\t),\n\t\t\t});\n\t\t}\n\t\treturn {\n\t\t\tobject: fieldsObject,\n\t\t};\n\t}\n\n\tpublic override getFieldSchema(field: FieldKey): TreeFieldStoredSchema {\n\t\treturn this.objectNodeFields.get(field) ?? storedEmptyFieldSchema;\n\t}\n}\n\n/**\n */\nexport class MapNodeStoredSchema extends TreeNodeStoredSchema {\n\t/**\n\t * @param mapFields -\n\t * Allows using the fields as a map, with the keys being\n\t * FieldKeys and the values being constrained by this TreeFieldStoredSchema.\n\t * Usually `FieldKind.Value` should NOT be used here\n\t * since no nodes can ever be in schema if you use `FieldKind.Value` here\n\t * (that would require infinite children).\n\t */\n\tpublic constructor(public readonly mapFields: TreeFieldStoredSchema) {\n\t\tsuper();\n\t}\n\n\tpublic override encode(): TreeNodeSchemaDataFormat {\n\t\treturn {\n\t\t\tmap: encodeFieldSchema(this.mapFields),\n\t\t};\n\t}\n\n\tpublic override getFieldSchema(field: FieldKey): TreeFieldStoredSchema {\n\t\treturn this.mapFields;\n\t}\n}\n\n/**\n */\nexport class LeafNodeStoredSchema extends TreeNodeStoredSchema {\n\t/**\n\t * @param leafValue -\n\t * There are several approaches for how to store actual data in the tree\n\t * (special node types, special field contents, data on nodes etc.)\n\t * as well as several options about how the data should be modeled at this level\n\t * (byte sequence? javascript type? json?),\n\t * as well as options for how much of this would be exposed in the schema language\n\t * (ex: would all nodes with values be special built-ins, or could any schema add them?)\n\t * A simple easy to do in javascript approach is taken here:\n\t * this is not intended to be a suggestion of what approach to take, or what to expose in the schema language.\n\t * This is simply one approach that can work for modeling them in the internal schema representation.\n\t */\n\tpublic constructor(public readonly leafValue: ValueSchema) {\n\t\tsuper();\n\t}\n\n\tpublic override encode(): TreeNodeSchemaDataFormat {\n\t\treturn {\n\t\t\tleaf: encodeValueSchema(this.leafValue),\n\t\t};\n\t}\n\n\tpublic override getFieldSchema(field: FieldKey): TreeFieldStoredSchema {\n\t\treturn storedEmptyFieldSchema;\n\t}\n}\n\nexport const storedSchemaDecodeDispatcher: DiscriminatedUnionDispatcher<\n\tTreeNodeSchemaDataFormat,\n\t[],\n\tTreeNodeStoredSchema\n> = new DiscriminatedUnionDispatcher({\n\tleaf: (data: PersistedValueSchema) => new LeafNodeStoredSchema(decodeValueSchema(data)),\n\tobject: (\n\t\tdata: Record<TreeNodeSchemaIdentifier, FieldSchemaFormat>,\n\t): TreeNodeStoredSchema => {\n\t\tconst map = new Map();\n\t\tfor (const [key, value] of Object.entries(data)) {\n\t\t\tmap.set(key, decodeFieldSchema(value));\n\t\t}\n\t\treturn new ObjectNodeStoredSchema(map);\n\t},\n\tmap: (data: FieldSchemaFormat) => new MapNodeStoredSchema(decodeFieldSchema(data)),\n});\n\nconst valueSchemaEncode = new Map([\n\t[ValueSchema.Number, PersistedValueSchema.Number],\n\t[ValueSchema.String, PersistedValueSchema.String],\n\t[ValueSchema.Boolean, PersistedValueSchema.Boolean],\n\t[ValueSchema.FluidHandle, PersistedValueSchema.FluidHandle],\n\t[ValueSchema.Null, PersistedValueSchema.Null],\n]);\n\nconst valueSchemaDecode = invertMap(valueSchemaEncode);\n\nfunction encodeValueSchema(inMemory: ValueSchema): PersistedValueSchema {\n\treturn valueSchemaEncode.get(inMemory) ?? fail(0xae8 /* missing PersistedValueSchema */);\n}\n\nfunction decodeValueSchema(inMemory: PersistedValueSchema): ValueSchema {\n\treturn valueSchemaDecode.get(inMemory) ?? fail(0xae9 /* missing ValueSchema */);\n}\n\nexport function encodeFieldSchema(schema: TreeFieldStoredSchema): FieldSchemaFormat {\n\treturn {\n\t\tkind: schema.kind,\n\t\t// Types are sorted by identifier to improve stability of persisted data to increase chance of schema blob reuse.\n\t\ttypes: [...schema.types].sort(),\n\t};\n}\n\nexport function decodeFieldSchema(schema: FieldSchemaFormat): TreeFieldStoredSchema {\n\tconst out: TreeFieldStoredSchema = {\n\t\t// TODO: maybe provide actual FieldKind objects here, error on unrecognized kinds.\n\t\tkind: schema.kind,\n\t\ttypes: new Set(schema.types),\n\t};\n\treturn out;\n}\n\n/**\n * Document schema data that can be stored in a document.\n *\n * @remarks\n * Note: the owner of this may modify it over time:\n * thus if needing to hand onto a specific version, make a copy.\n */\nexport interface TreeStoredSchema extends StoredSchemaCollection {\n\t/**\n\t * Schema for the root field which contains the whole tree.\n\t */\n\treadonly rootFieldSchema: TreeFieldStoredSchema;\n}\n\n/**\n * Collection of TreeNodeSchema data that can be stored in a document.\n *\n * @remarks\n * Note: the owner of this may modify it over time:\n * thus if needing to hang onto a specific version, make a copy.\n */\nexport interface StoredSchemaCollection {\n\t/**\n\t * {@inheritdoc StoredSchemaCollection}\n\t */\n\treadonly nodeSchema: ReadonlyMap<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anchorSet.d.ts","sourceRoot":"","sources":["../../../src/core/tree/anchorSet.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAE3E,OAAO,EACN,KAAK,KAAK,EACV,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,MAAM,EACX,oBAAoB,EAKpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,KAAK,KAAK,KAAK,MAAM,YAAY,CAAC;AACzC,OAAO,EAEN,KAAK,iBAAiB,EAItB,KAAK,MAAM,EACX,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAIpD;;;GAGG;AACH,MAAM,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAOrD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B;;;;;;;OAOG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;CAC/C;AAED;;;;GAIG;AACH,MAAM,MAAM,UAAU,CAAC,QAAQ,IAAI,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;AAE7F;;;;;;;;GAQG;AACH,MAAM,WAAW,YAAY;IAC5B;;;;;;;;;;;;OAYG;IACH,YAAY,CAAC,MA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,mBAAmB,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC;IAQ9E;;;;;OAKG;IACH,OAAO,CAAC,MAAM;IAId,IAAW,MAAM,IAAI,QAAQ,GAAG,SAAS,CAWxC;IAEM,MAAM,CAAC,KAAK,SAAI,GAAG,IAAI;IAKvB,SAAS,CAAC,KAAK,SAAI,GAAG,IAAI;IAOjC,SAAS,CAAC,cAAc,IAAI,IAAI;IAIhC;;;OAGG;IACI,gBAAgB,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAG,QAAQ;IAmBxD,eAAe,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS;IAO1E;;;;OAIG;IACI,WAAW,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI;IAczC;;;;OAIG;IACI,eAAe,CAAC,GAAG,EAAE,QAAQ,GAAG,IAAI;IAM3C;;;;;;OAMG;IACH,OAAO,CAAC,eAAe;CASvB"}
|
|
@@ -432,25 +432,32 @@ class AnchorSet {
|
|
|
432
432
|
* Events collected during the visit which get sent as a batch during "free".
|
|
433
433
|
*/
|
|
434
434
|
bufferedEvents: [],
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
435
|
+
/**
|
|
436
|
+
* 'currentDepth' and 'depthThresholdForSubtreeChanged' serve to keep track of when do we need to emit
|
|
437
|
+
* subtreeChangedAfterBatch events.
|
|
438
|
+
* The algorithm works as follows:
|
|
439
|
+
*
|
|
440
|
+
* - Initialize both to 0.
|
|
441
|
+
* - As we walk the tree from the root towards the leaves, when we enter a node increment currentDepth by 1.
|
|
442
|
+
* - When we edit a node, set depthThresholdForSubtreeChanged = currentDepth.
|
|
443
|
+
* Intuitively, depthThresholdForSubtreeChanged means "as you walk the tree towards the root, when you exit a
|
|
444
|
+
* node at this depth you should emit a subtreeChangedAfterBatch event".
|
|
445
|
+
* - When we exit a node, if d === currentDepth then emit a subtreeChangedAfterBatch and decrement d by 1.
|
|
446
|
+
* Then decrement currentDepth unconditionally.
|
|
447
|
+
*
|
|
448
|
+
* Note that the event will be emitted when exiting a node that was edited (depthThresholdForSubtreeChanged will
|
|
449
|
+
* have been set to the current depth when the edit happened), it will be emitted when exiting a node that is the
|
|
450
|
+
* parent of a node that already emitted the event (because both depthThresholdForSubtreeChanged and currentDepth
|
|
451
|
+
* get decremented when exiting a node so they stay in sync), and if we're already emitting the event but start
|
|
452
|
+
* walking the tree back towards the leaves in a path where no edits happen, currentDepth will be increased again
|
|
453
|
+
* as we walk that path, depthThresholdForSubtreeChanged will not, and thus no event will be emitted when walking
|
|
454
|
+
* back up that path, until we get back to the depth where we were already emitting the event, and will continue
|
|
455
|
+
* emitting it on the way to the root.
|
|
456
|
+
*/
|
|
453
457
|
currentDepth: 0,
|
|
458
|
+
/**
|
|
459
|
+
* See {@link visitor.currentDepth}.
|
|
460
|
+
*/
|
|
454
461
|
depthThresholdForSubtreeChanged: 0,
|
|
455
462
|
free() {
|
|
456
463
|
(0, internal_1.assert)(this.anchorSet.activeVisitor !== undefined, 0x768 /* Multiple free calls for same visitor */);
|
|
@@ -571,16 +578,16 @@ class AnchorSet {
|
|
|
571
578
|
},
|
|
572
579
|
exitNode(index) {
|
|
573
580
|
(0, internal_1.assert)(this.parent !== undefined, 0x3ac /* Must have parent node */);
|
|
574
|
-
this.
|
|
575
|
-
|
|
576
|
-
|
|
581
|
+
if (this.depthThresholdForSubtreeChanged === this.currentDepth) {
|
|
582
|
+
this.maybeWithNode((p) => {
|
|
583
|
+
p.events.emit("subtreeChanged", p);
|
|
577
584
|
this.bufferedEvents.push({
|
|
578
585
|
node: p,
|
|
579
586
|
event: "subtreeChangedAfterBatch",
|
|
580
587
|
});
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
}
|
|
588
|
+
});
|
|
589
|
+
this.depthThresholdForSubtreeChanged--;
|
|
590
|
+
}
|
|
584
591
|
const parent = this.parent;
|
|
585
592
|
this.parentField = parent.parentField;
|
|
586
593
|
this.parent = parent.parent;
|