@fluidframework/tree 2.31.1 → 2.33.0-333010
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/settings.json +1 -1
- package/CHANGELOG.md +44 -0
- package/api-extractor/api-extractor.current.json +5 -1
- package/api-report/tree.alpha.api.md +44 -20
- package/dist/alpha.d.ts +6 -2
- package/dist/feature-libraries/flex-tree/context.d.ts +6 -1
- package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/context.js +5 -2
- 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/flex-tree/index.d.ts +1 -1
- package/dist/feature-libraries/flex-tree/index.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/index.js +1 -2
- package/dist/feature-libraries/flex-tree/index.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyEntity.d.ts +6 -15
- package/dist/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyEntity.js +9 -18
- package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.d.ts +3 -3
- package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +14 -14
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts +4 -4
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.js +12 -12
- package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +1 -1
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +1 -2
- package/dist/feature-libraries/index.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/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- 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/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/sharedTree.js +2 -2
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/treeApiAlpha.d.ts +6 -6
- package/dist/shared-tree/treeApiAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeApiAlpha.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts +0 -6
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +0 -17
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/simple-tree/api/conciseTree.d.ts +2 -2
- package/dist/simple-tree/api/conciseTree.d.ts.map +1 -1
- package/dist/simple-tree/api/conciseTree.js.map +1 -1
- package/dist/simple-tree/api/customTree.d.ts +14 -12
- package/dist/simple-tree/api/customTree.d.ts.map +1 -1
- package/dist/simple-tree/api/customTree.js.map +1 -1
- package/dist/simple-tree/api/getJsonSchema.d.ts +21 -7
- package/dist/simple-tree/api/getJsonSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/getJsonSchema.js +8 -16
- package/dist/simple-tree/api/getJsonSchema.js.map +1 -1
- package/dist/simple-tree/api/getSimpleSchema.d.ts +3 -10
- package/dist/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/getSimpleSchema.js +4 -16
- package/dist/simple-tree/api/getSimpleSchema.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +4 -3
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +2 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +17 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js +4 -0
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.d.ts +5 -2
- package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.js +24 -8
- package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts +11 -3
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +40 -28
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +32 -5
- package/dist/simple-tree/api/tree.d.ts.map +1 -1
- package/dist/simple-tree/api/tree.js +17 -1
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/verboseTree.d.ts +4 -28
- package/dist/simple-tree/api/verboseTree.d.ts.map +1 -1
- package/dist/simple-tree/api/verboseTree.js.map +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +7 -3
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.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 +46 -30
- package/dist/simple-tree/core/treeNodeKernel.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 +15 -1
- 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.map +1 -1
- package/dist/simple-tree/objectNode.js +3 -0
- package/dist/simple-tree/objectNode.js.map +1 -1
- package/dist/simple-tree/simpleSchema.d.ts +4 -11
- package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/simpleSchema.js.map +1 -1
- package/dist/tableSchema.d.ts +241 -0
- package/dist/tableSchema.d.ts.map +1 -0
- package/dist/tableSchema.js +238 -0
- package/dist/tableSchema.js.map +1 -0
- package/dist/treeFactory.d.ts +4 -4
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/breakable.d.ts.map +1 -1
- package/dist/util/breakable.js +9 -7
- package/dist/util/breakable.js.map +1 -1
- package/lib/alpha.d.ts +6 -2
- package/lib/feature-libraries/flex-tree/context.d.ts +6 -1
- package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/context.js +6 -3
- 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/flex-tree/index.d.ts +1 -1
- package/lib/feature-libraries/flex-tree/index.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/index.js +1 -1
- package/lib/feature-libraries/flex-tree/index.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyEntity.d.ts +6 -15
- package/lib/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyEntity.js +8 -17
- package/lib/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.d.ts +3 -3
- package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +15 -15
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts +4 -4
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.js +13 -13
- package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +1 -1
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +1 -1
- package/lib/feature-libraries/index.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/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- 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/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/sharedTree.js +2 -2
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/treeApiAlpha.d.ts +6 -6
- package/lib/shared-tree/treeApiAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeApiAlpha.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts +0 -6
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +0 -17
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/simple-tree/api/conciseTree.d.ts +2 -2
- package/lib/simple-tree/api/conciseTree.d.ts.map +1 -1
- package/lib/simple-tree/api/conciseTree.js.map +1 -1
- package/lib/simple-tree/api/customTree.d.ts +14 -12
- package/lib/simple-tree/api/customTree.d.ts.map +1 -1
- package/lib/simple-tree/api/customTree.js.map +1 -1
- package/lib/simple-tree/api/getJsonSchema.d.ts +21 -7
- package/lib/simple-tree/api/getJsonSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/getJsonSchema.js +8 -16
- package/lib/simple-tree/api/getJsonSchema.js.map +1 -1
- package/lib/simple-tree/api/getSimpleSchema.d.ts +3 -10
- package/lib/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/getSimpleSchema.js +4 -16
- package/lib/simple-tree/api/getSimpleSchema.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +4 -3
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +1 -1
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +17 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js +4 -0
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.d.ts +5 -2
- package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.js +24 -8
- package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts +11 -3
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js +41 -29
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +32 -5
- package/lib/simple-tree/api/tree.d.ts.map +1 -1
- package/lib/simple-tree/api/tree.js +16 -1
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/verboseTree.d.ts +4 -28
- package/lib/simple-tree/api/verboseTree.d.ts.map +1 -1
- package/lib/simple-tree/api/verboseTree.js.map +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +7 -3
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.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 +48 -32
- package/lib/simple-tree/core/treeNodeKernel.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 +15 -1
- 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.map +1 -1
- package/lib/simple-tree/objectNode.js +4 -1
- package/lib/simple-tree/objectNode.js.map +1 -1
- package/lib/simple-tree/simpleSchema.d.ts +4 -11
- package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/simpleSchema.js.map +1 -1
- package/lib/tableSchema.d.ts +241 -0
- package/lib/tableSchema.d.ts.map +1 -0
- package/lib/tableSchema.js +235 -0
- package/lib/tableSchema.js.map +1 -0
- package/lib/treeFactory.d.ts +4 -4
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js.map +1 -1
- package/lib/util/breakable.d.ts.map +1 -1
- package/lib/util/breakable.js +9 -7
- package/lib/util/breakable.js.map +1 -1
- package/package.json +23 -22
- package/src/feature-libraries/flex-tree/context.ts +13 -3
- package/src/feature-libraries/flex-tree/flexTreeTypes.ts +8 -0
- package/src/feature-libraries/flex-tree/index.ts +0 -1
- package/src/feature-libraries/flex-tree/lazyEntity.ts +11 -21
- package/src/feature-libraries/flex-tree/lazyField.ts +17 -26
- package/src/feature-libraries/flex-tree/lazyNode.ts +13 -19
- package/src/feature-libraries/index.ts +0 -1
- package/src/feature-libraries/node-identifier/nodeIdentifierManager.ts +39 -38
- package/src/index.ts +6 -2
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/checkoutFlexTreeView.ts +6 -0
- package/src/shared-tree/sharedTree.ts +2 -2
- package/src/shared-tree/treeApiAlpha.ts +17 -15
- package/src/shared-tree-core/sharedTreeCore.ts +0 -23
- package/src/simple-tree/api/conciseTree.ts +4 -4
- package/src/simple-tree/api/customTree.ts +16 -14
- package/src/simple-tree/api/getJsonSchema.ts +25 -16
- package/src/simple-tree/api/getSimpleSchema.ts +4 -18
- package/src/simple-tree/api/index.ts +4 -2
- package/src/simple-tree/api/schemaFactoryAlpha.ts +18 -1
- package/src/simple-tree/api/schemaFromSimple.ts +45 -16
- package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +53 -34
- package/src/simple-tree/api/tree.ts +51 -4
- package/src/simple-tree/api/verboseTree.ts +7 -32
- package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +8 -3
- package/src/simple-tree/core/treeNodeKernel.ts +57 -35
- package/src/simple-tree/core/unhydratedFlexTree.ts +22 -5
- package/src/simple-tree/index.ts +4 -2
- package/src/simple-tree/objectNode.ts +4 -2
- package/src/simple-tree/simpleSchema.ts +4 -12
- package/src/tableSchema.ts +668 -0
- package/src/treeFactory.ts +4 -3
- package/src/util/breakable.ts +9 -6
|
@@ -46,46 +46,47 @@ export interface NodeIdentifierManager {
|
|
|
46
46
|
export function createNodeIdentifierManager(
|
|
47
47
|
idCompressor?: IIdCompressor | undefined,
|
|
48
48
|
): NodeIdentifierManager {
|
|
49
|
-
return
|
|
50
|
-
|
|
51
|
-
assert(
|
|
52
|
-
idCompressor !== undefined,
|
|
53
|
-
0x6e4 /* Runtime IdCompressor must be available to generate local node identifiers */,
|
|
54
|
-
);
|
|
55
|
-
return brand(idCompressor.generateCompressedId());
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
localizeNodeIdentifier: (identifier: StableNodeIdentifier) => {
|
|
59
|
-
assert(
|
|
60
|
-
idCompressor !== undefined,
|
|
61
|
-
0x6e5 /* Runtime IdCompressor must be available to convert node identifiers */,
|
|
62
|
-
);
|
|
63
|
-
return brand(idCompressor.recompress(identifier));
|
|
64
|
-
},
|
|
49
|
+
return new DefaultNodeIdentifierManager(idCompressor);
|
|
50
|
+
}
|
|
65
51
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
52
|
+
class DefaultNodeIdentifierManager implements NodeIdentifierManager {
|
|
53
|
+
public constructor(private readonly idCompressor: IIdCompressor | undefined) {}
|
|
54
|
+
public generateLocalNodeIdentifier(): LocalNodeIdentifier {
|
|
55
|
+
assert(
|
|
56
|
+
this.idCompressor !== undefined,
|
|
57
|
+
0x6e4 /* Runtime IdCompressor must be available to generate local node identifiers */,
|
|
58
|
+
);
|
|
59
|
+
return brand(this.idCompressor.generateCompressedId());
|
|
60
|
+
}
|
|
61
|
+
public localizeNodeIdentifier(identifier: StableNodeIdentifier): LocalNodeIdentifier {
|
|
62
|
+
assert(
|
|
63
|
+
this.idCompressor !== undefined,
|
|
64
|
+
0x6e5 /* Runtime IdCompressor must be available to convert node identifiers */,
|
|
65
|
+
);
|
|
66
|
+
return brand(this.idCompressor.recompress(identifier));
|
|
67
|
+
}
|
|
68
|
+
public stabilizeNodeIdentifier(identifier: LocalNodeIdentifier): StableNodeIdentifier {
|
|
69
|
+
assert(
|
|
70
|
+
this.idCompressor !== undefined,
|
|
71
|
+
0x6e6 /* Runtime IdCompressor must be available to convert node identifiers */,
|
|
72
|
+
);
|
|
73
|
+
return brand(
|
|
74
|
+
// TODO: The assert below is required for type safety but is maybe slow
|
|
75
|
+
assertIsStableId(this.idCompressor.decompress(extractFromOpaque(identifier))),
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
public tryLocalizeNodeIdentifier(identifier: string): LocalNodeIdentifier | undefined {
|
|
79
|
+
assert(
|
|
80
|
+
this.idCompressor !== undefined,
|
|
81
|
+
0x6e9 /* Runtime IdCompressor must be available to convert node identifiers */,
|
|
82
|
+
);
|
|
83
|
+
if (isStableNodeIdentifier(identifier)) {
|
|
84
|
+
const compressedIdentifier = this.idCompressor.tryRecompress(identifier);
|
|
85
|
+
if (compressedIdentifier !== undefined) {
|
|
86
|
+
return brand(compressedIdentifier);
|
|
86
87
|
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
89
90
|
}
|
|
90
91
|
|
|
91
92
|
export function isStableNodeIdentifier(
|
package/src/index.ts
CHANGED
|
@@ -169,9 +169,12 @@ export {
|
|
|
169
169
|
// Beta APIs
|
|
170
170
|
TreeBeta,
|
|
171
171
|
type TreeChangeEventsBeta,
|
|
172
|
+
// Other
|
|
172
173
|
type VerboseTreeNode,
|
|
173
|
-
type
|
|
174
|
-
type
|
|
174
|
+
type TreeEncodingOptions,
|
|
175
|
+
type TreeSchemaEncodingOptions,
|
|
176
|
+
type TreeSchema,
|
|
177
|
+
TreeViewConfigurationAlpha,
|
|
175
178
|
type VerboseTree,
|
|
176
179
|
extractPersistedSchema,
|
|
177
180
|
comparePersistedSchema,
|
|
@@ -291,3 +294,4 @@ export type { MapNodeInsertableData } from "./simple-tree/index.js";
|
|
|
291
294
|
|
|
292
295
|
export { JsonAsTree } from "./jsonDomainSchema.js";
|
|
293
296
|
export { FluidSerializableAsTree } from "./serializableDomainSchema.js";
|
|
297
|
+
export { TableSchema } from "./tableSchema.js";
|
package/src/packageVersion.ts
CHANGED
|
@@ -34,6 +34,8 @@ export class CheckoutFlexTreeView<out TCheckout extends ITreeCheckout = ITreeChe
|
|
|
34
34
|
*/
|
|
35
35
|
public readonly flexTree: FlexTreeField;
|
|
36
36
|
|
|
37
|
+
private disposed = false;
|
|
38
|
+
|
|
37
39
|
public constructor(
|
|
38
40
|
/**
|
|
39
41
|
* Access non-view schema specific aspects of this branch.
|
|
@@ -52,6 +54,9 @@ export class CheckoutFlexTreeView<out TCheckout extends ITreeCheckout = ITreeChe
|
|
|
52
54
|
}
|
|
53
55
|
|
|
54
56
|
public [disposeSymbol](): void {
|
|
57
|
+
assert(!this.disposed, "Double disposed");
|
|
58
|
+
this.disposed = true;
|
|
59
|
+
|
|
55
60
|
for (const anchorNode of this.checkout.forest.anchors) {
|
|
56
61
|
tryDisposeTreeNode(anchorNode);
|
|
57
62
|
}
|
|
@@ -65,6 +70,7 @@ export class CheckoutFlexTreeView<out TCheckout extends ITreeCheckout = ITreeChe
|
|
|
65
70
|
* Any mutations of the new view will not apply to this view until the new view is merged back into this view via `merge()`.
|
|
66
71
|
*/
|
|
67
72
|
public fork(): CheckoutFlexTreeView<ITreeCheckout & ITreeCheckoutFork> {
|
|
73
|
+
assert(!this.disposed, "disposed");
|
|
68
74
|
const branch = this.checkout.branch();
|
|
69
75
|
return new CheckoutFlexTreeView(branch, this.schema, this.nodeKeyManager);
|
|
70
76
|
}
|
|
@@ -250,7 +250,7 @@ export class SharedTree extends SharedObject implements ISharedTree {
|
|
|
250
250
|
local: boolean,
|
|
251
251
|
localOpMetadata: unknown,
|
|
252
252
|
): void {
|
|
253
|
-
|
|
253
|
+
fail(0xb75 /* processCore should not be called on SharedTree */);
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
protected override processMessagesCore(messagesCollection: IRuntimeMessageCollection): void {
|
|
@@ -569,7 +569,7 @@ class SharedTreeKernel extends SharedTreeCore<SharedTreeEditBuilder, SharedTreeC
|
|
|
569
569
|
|
|
570
570
|
export function exportSimpleSchema(storedSchema: TreeStoredSchema): SimpleTreeSchema {
|
|
571
571
|
return {
|
|
572
|
-
|
|
572
|
+
root: exportSimpleFieldSchemaStored(storedSchema.rootFieldSchema),
|
|
573
573
|
definitions: new Map(
|
|
574
574
|
[...storedSchema.nodeSchema].map(([key, schema]) => {
|
|
575
575
|
return [key, exportSimpleNodeSchemaStored(schema)];
|
|
@@ -30,10 +30,9 @@ import {
|
|
|
30
30
|
applySchemaToParserOptions,
|
|
31
31
|
cursorFromVerbose,
|
|
32
32
|
verboseFromCursor,
|
|
33
|
-
type
|
|
33
|
+
type TreeEncodingOptions,
|
|
34
34
|
type VerboseTree,
|
|
35
35
|
toStoredSchema,
|
|
36
|
-
type EncodeOptions,
|
|
37
36
|
extractPersistedSchema,
|
|
38
37
|
TreeViewConfiguration,
|
|
39
38
|
type TreeBranch,
|
|
@@ -129,20 +128,20 @@ export const TreeAlpha: {
|
|
|
129
128
|
importVerbose<const TSchema extends ImplicitFieldSchema>(
|
|
130
129
|
schema: TSchema,
|
|
131
130
|
data: VerboseTree | undefined,
|
|
132
|
-
options?: Partial<
|
|
131
|
+
options?: Partial<TreeEncodingOptions>,
|
|
133
132
|
): Unhydrated<TreeFieldFromImplicitField<TSchema>>;
|
|
134
133
|
|
|
135
134
|
/**
|
|
136
135
|
* Copy a snapshot of the current version of a TreeNode into a {@link ConciseTree}.
|
|
137
136
|
*/
|
|
138
|
-
exportConcise(node: TreeNode | TreeLeafValue, options?:
|
|
137
|
+
exportConcise(node: TreeNode | TreeLeafValue, options?: TreeEncodingOptions): ConciseTree;
|
|
139
138
|
|
|
140
139
|
/**
|
|
141
140
|
* Copy a snapshot of the current version of a TreeNode into a {@link ConciseTree}, allowing undefined.
|
|
142
141
|
*/
|
|
143
142
|
exportConcise(
|
|
144
143
|
node: TreeNode | TreeLeafValue | undefined,
|
|
145
|
-
options?:
|
|
144
|
+
options?: TreeEncodingOptions,
|
|
146
145
|
): ConciseTree | undefined;
|
|
147
146
|
|
|
148
147
|
/**
|
|
@@ -159,7 +158,7 @@ export const TreeAlpha: {
|
|
|
159
158
|
*
|
|
160
159
|
* 3. When easy access to the type is desired.
|
|
161
160
|
*/
|
|
162
|
-
exportVerbose(node: TreeNode | TreeLeafValue, options?:
|
|
161
|
+
exportVerbose(node: TreeNode | TreeLeafValue, options?: TreeEncodingOptions): VerboseTree;
|
|
163
162
|
|
|
164
163
|
/**
|
|
165
164
|
* Export the content of the provided `tree` in a compressed JSON compatible format.
|
|
@@ -167,7 +166,7 @@ export const TreeAlpha: {
|
|
|
167
166
|
* If an `idCompressor` is provided, it will be used to compress identifiers and thus will be needed to decompress the data.
|
|
168
167
|
*
|
|
169
168
|
* Always uses "stored" keys.
|
|
170
|
-
* See {@link
|
|
169
|
+
* See {@link TreeEncodingOptions.useStoredKeys} for details.
|
|
171
170
|
* @privateRemarks
|
|
172
171
|
* TODO: It is currently not clear how to work with the idCompressors correctly in the package API.
|
|
173
172
|
* Better APIs should probably be provided as there is currently no way to associate an un-hydrated tree with an idCompressor,
|
|
@@ -243,9 +242,9 @@ export const TreeAlpha: {
|
|
|
243
242
|
importVerbose<const TSchema extends ImplicitFieldSchema>(
|
|
244
243
|
schema: TSchema,
|
|
245
244
|
data: VerboseTree | undefined,
|
|
246
|
-
options?:
|
|
245
|
+
options?: TreeEncodingOptions,
|
|
247
246
|
): Unhydrated<TreeFieldFromImplicitField<TSchema>> {
|
|
248
|
-
const config:
|
|
247
|
+
const config: TreeEncodingOptions = { ...options };
|
|
249
248
|
// Create a config which is standalone, and thus can be used without having to refer back to the schema.
|
|
250
249
|
const schemalessConfig = applySchemaToParserOptions(schema, config);
|
|
251
250
|
if (data === undefined) {
|
|
@@ -261,8 +260,8 @@ export const TreeAlpha: {
|
|
|
261
260
|
|
|
262
261
|
exportConcise,
|
|
263
262
|
|
|
264
|
-
exportVerbose(node: TreeNode | TreeLeafValue, options?:
|
|
265
|
-
const config:
|
|
263
|
+
exportVerbose(node: TreeNode | TreeLeafValue, options?: TreeEncodingOptions): VerboseTree {
|
|
264
|
+
const config: TreeEncodingOptions = { ...options };
|
|
266
265
|
|
|
267
266
|
const cursor = borrowCursorFromTreeNodeOrValue(node);
|
|
268
267
|
return verboseFromCursor(
|
|
@@ -314,21 +313,24 @@ export const TreeAlpha: {
|
|
|
314
313
|
},
|
|
315
314
|
};
|
|
316
315
|
|
|
317
|
-
function exportConcise(
|
|
316
|
+
function exportConcise(
|
|
317
|
+
node: TreeNode | TreeLeafValue,
|
|
318
|
+
options?: TreeEncodingOptions,
|
|
319
|
+
): ConciseTree;
|
|
318
320
|
|
|
319
321
|
function exportConcise(
|
|
320
322
|
node: TreeNode | TreeLeafValue | undefined,
|
|
321
|
-
options?:
|
|
323
|
+
options?: TreeEncodingOptions,
|
|
322
324
|
): ConciseTree | undefined;
|
|
323
325
|
|
|
324
326
|
function exportConcise(
|
|
325
327
|
node: TreeNode | TreeLeafValue | undefined,
|
|
326
|
-
options?:
|
|
328
|
+
options?: TreeEncodingOptions,
|
|
327
329
|
): ConciseTree | undefined {
|
|
328
330
|
if (node === undefined) {
|
|
329
331
|
return undefined;
|
|
330
332
|
}
|
|
331
|
-
const config:
|
|
333
|
+
const config: TreeEncodingOptions = { ...options };
|
|
332
334
|
|
|
333
335
|
const cursor = borrowCursorFromTreeNodeOrValue(node);
|
|
334
336
|
return conciseFromCursor(
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
7
7
|
import type { IChannelStorageService } from "@fluidframework/datastore-definitions/internal";
|
|
8
8
|
import type { IIdCompressor, SessionId } from "@fluidframework/id-compressor";
|
|
9
|
-
import type { ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
|
|
10
9
|
import type {
|
|
11
10
|
IExperimentalIncrementalSummaryContext,
|
|
12
11
|
IRuntimeMessageCollection,
|
|
@@ -331,28 +330,6 @@ export class SharedTreeCore<TEditor extends ChangeFamilyEditor, TChange>
|
|
|
331
330
|
this.resubmitMachine.onCommitSubmitted(enrichedCommit);
|
|
332
331
|
}
|
|
333
332
|
|
|
334
|
-
/**
|
|
335
|
-
* Process a message from the runtime.
|
|
336
|
-
* @deprecated - Use processMessagesCore to process a bunch of messages together.
|
|
337
|
-
*/
|
|
338
|
-
public processCore(
|
|
339
|
-
message: ISequencedDocumentMessage,
|
|
340
|
-
local: boolean,
|
|
341
|
-
localOpMetadata: unknown,
|
|
342
|
-
): void {
|
|
343
|
-
this.processMessagesCore({
|
|
344
|
-
envelope: message,
|
|
345
|
-
local,
|
|
346
|
-
messagesContent: [
|
|
347
|
-
{
|
|
348
|
-
clientSequenceNumber: message.clientSequenceNumber,
|
|
349
|
-
contents: message.contents,
|
|
350
|
-
localOpMetadata,
|
|
351
|
-
},
|
|
352
|
-
],
|
|
353
|
-
});
|
|
354
|
-
}
|
|
355
|
-
|
|
356
333
|
/**
|
|
357
334
|
* Process a bunch of messages from the runtime. SharedObject will call this method with a bunch of messages.
|
|
358
335
|
*/
|
|
@@ -11,7 +11,7 @@ import type { TreeNodeSchema } from "../core/index.js";
|
|
|
11
11
|
import {
|
|
12
12
|
customFromCursor,
|
|
13
13
|
replaceHandles,
|
|
14
|
-
type
|
|
14
|
+
type TreeEncodingOptions,
|
|
15
15
|
type HandleConverter,
|
|
16
16
|
} from "./customTree.js";
|
|
17
17
|
import { getUnhydratedContext } from "../createContext.js";
|
|
@@ -44,9 +44,9 @@ export type ConciseTree<THandle = IFluidHandle> =
|
|
|
44
44
|
export function conciseFromCursor(
|
|
45
45
|
reader: ITreeCursor,
|
|
46
46
|
rootSchema: ImplicitAllowedTypes,
|
|
47
|
-
options:
|
|
47
|
+
options: TreeEncodingOptions,
|
|
48
48
|
): ConciseTree {
|
|
49
|
-
const config: Required<
|
|
49
|
+
const config: Required<TreeEncodingOptions> = {
|
|
50
50
|
useStoredKeys: false,
|
|
51
51
|
...options,
|
|
52
52
|
};
|
|
@@ -57,7 +57,7 @@ export function conciseFromCursor(
|
|
|
57
57
|
|
|
58
58
|
function conciseFromCursorInner(
|
|
59
59
|
reader: ITreeCursor,
|
|
60
|
-
options: Required<
|
|
60
|
+
options: Required<TreeEncodingOptions>,
|
|
61
61
|
schema: ReadonlyMap<string, TreeNodeSchema>,
|
|
62
62
|
): ConciseTree {
|
|
63
63
|
return customFromCursor(reader, options, schema, conciseFromCursorInner);
|
|
@@ -33,26 +33,20 @@ import { isObjectNodeSchema } from "../objectNodeTypes.js";
|
|
|
33
33
|
import { FieldKinds, valueSchemaAllows } from "../../feature-libraries/index.js";
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
|
-
* Options for how to encode a tree.
|
|
36
|
+
* Options for how to interpret or encode a tree when schema information is available.
|
|
37
37
|
* @alpha
|
|
38
38
|
*/
|
|
39
|
-
export interface
|
|
39
|
+
export interface TreeEncodingOptions {
|
|
40
40
|
/**
|
|
41
|
-
* If true,
|
|
42
|
-
* If false,
|
|
41
|
+
* If true, use the stored keys of object nodes.
|
|
42
|
+
* If false, use the property keys.
|
|
43
|
+
* @remarks
|
|
44
|
+
* Has no effect on {@link NodeKind}s other than {@link NodeKind.Object}.
|
|
43
45
|
* @defaultValue false.
|
|
44
46
|
*/
|
|
45
47
|
readonly useStoredKeys?: boolean;
|
|
46
48
|
}
|
|
47
49
|
|
|
48
|
-
/**
|
|
49
|
-
* Options for how to transcode handles.
|
|
50
|
-
* @remarks
|
|
51
|
-
* Can be applied using {@link replaceHandles}.
|
|
52
|
-
* @alpha
|
|
53
|
-
*/
|
|
54
|
-
export type HandleConverter<TCustom> = (data: IFluidHandle) => TCustom;
|
|
55
|
-
|
|
56
50
|
/**
|
|
57
51
|
* Options for how to interpret a `ConciseTree<TCustom>` without relying on schema.
|
|
58
52
|
*/
|
|
@@ -86,11 +80,11 @@ export type CustomTreeNode<TChild> = TChild[] | { [key: string]: TChild };
|
|
|
86
80
|
*/
|
|
87
81
|
export function customFromCursor<TChild>(
|
|
88
82
|
reader: ITreeCursor,
|
|
89
|
-
options: Required<
|
|
83
|
+
options: Required<TreeEncodingOptions>,
|
|
90
84
|
schema: ReadonlyMap<string, TreeNodeSchema>,
|
|
91
85
|
childHandler: (
|
|
92
86
|
reader: ITreeCursor,
|
|
93
|
-
options: Required<
|
|
87
|
+
options: Required<TreeEncodingOptions>,
|
|
94
88
|
schema: ReadonlyMap<string, TreeNodeSchema>,
|
|
95
89
|
) => TChild,
|
|
96
90
|
): CustomTree<TChild> {
|
|
@@ -203,6 +197,14 @@ export function tryStoredSchemaAsArray(
|
|
|
203
197
|
}
|
|
204
198
|
}
|
|
205
199
|
|
|
200
|
+
/**
|
|
201
|
+
* Options for how to transcode handles.
|
|
202
|
+
* @remarks
|
|
203
|
+
* Can be applied using {@link replaceHandles}.
|
|
204
|
+
* @alpha
|
|
205
|
+
*/
|
|
206
|
+
export type HandleConverter<TCustom> = (data: IFluidHandle) => TCustom;
|
|
207
|
+
|
|
206
208
|
/**
|
|
207
209
|
* Clones tree, replacing any handles.
|
|
208
210
|
* @remarks
|
|
@@ -4,16 +4,25 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { JsonTreeSchema } from "./jsonSchema.js";
|
|
7
|
-
import type {
|
|
7
|
+
import type { ImplicitAllowedTypes } from "../schemaTypes.js";
|
|
8
8
|
import { toJsonSchema } from "./simpleSchemaToJsonSchema.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import type { TreeNodeSchema } from "../core/index.js";
|
|
9
|
+
import type { TreeEncodingOptions } from "./customTree.js";
|
|
10
|
+
import { TreeViewConfigurationAlpha } from "./tree.js";
|
|
12
11
|
|
|
13
12
|
/**
|
|
14
|
-
*
|
|
13
|
+
* Options for how to interpret or encode a tree when schema information is available.
|
|
14
|
+
* @alpha
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
export interface TreeSchemaEncodingOptions extends TreeEncodingOptions {
|
|
17
|
+
/**
|
|
18
|
+
* If true, fields with default providers (like {@link SchemaFactory.identifier}) will be required.
|
|
19
|
+
* If false, they will be optional.
|
|
20
|
+
* @remarks
|
|
21
|
+
* Has no effect on {@link NodeKind}s other than {@link NodeKind.Object}.
|
|
22
|
+
* @defaultValue false.
|
|
23
|
+
*/
|
|
24
|
+
readonly requireFieldsWithDefaults?: boolean;
|
|
25
|
+
}
|
|
17
26
|
|
|
18
27
|
/**
|
|
19
28
|
* Creates a {@link https://json-schema.org/ | JSON Schema} representation of the provided {@link TreeNodeSchema}.
|
|
@@ -63,18 +72,18 @@ const jsonSchemaCache = new WeakMap<TreeNodeSchema, JsonTreeSchema>();
|
|
|
63
72
|
* TODO:
|
|
64
73
|
* This API should allow generating JSON schema for the whole matrix of combinations:
|
|
65
74
|
*
|
|
66
|
-
* 1. VerboseTree and ConciseTree
|
|
67
|
-
* 2. With and without requiring values with defaults (for insertion vs reading)
|
|
68
|
-
* 3. Using stored keys and property keys
|
|
69
|
-
*
|
|
70
|
-
* This current API seems to give ConciseTree with property keys and ignoring default values.
|
|
75
|
+
* 1. VerboseTree and (Done) ConciseTree
|
|
76
|
+
* 2. (Done) With and without requiring values with defaults (for insertion vs reading)
|
|
77
|
+
* 3. (Done) Using stored keys and property keys.
|
|
71
78
|
*
|
|
79
|
+
* This takes in `ImplicitAllowedTypes` since underlying `toJsonSchema` can't handle optional roots.
|
|
72
80
|
*
|
|
73
81
|
* @alpha
|
|
74
82
|
*/
|
|
75
|
-
export function getJsonSchema(
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
});
|
|
83
|
+
export function getJsonSchema(
|
|
84
|
+
schema: ImplicitAllowedTypes,
|
|
85
|
+
options: Required<TreeSchemaEncodingOptions>,
|
|
86
|
+
): JsonTreeSchema {
|
|
87
|
+
const treeSchema = new TreeViewConfigurationAlpha({ schema });
|
|
88
|
+
return toJsonSchema(treeSchema, options);
|
|
80
89
|
}
|
|
@@ -3,39 +3,25 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { getOrCreate } from "../../util/index.js";
|
|
7
|
-
import type { TreeNodeSchema } from "../core/index.js";
|
|
8
6
|
import type { ImplicitFieldSchema } from "../schemaTypes.js";
|
|
9
7
|
import type { SimpleTreeSchema } from "../simpleSchema.js";
|
|
10
8
|
import { toSimpleTreeSchema } from "./viewSchemaToSimpleSchema.js";
|
|
11
9
|
|
|
12
10
|
/**
|
|
13
|
-
*
|
|
14
|
-
*/
|
|
15
|
-
const simpleSchemaCache = new WeakMap<TreeNodeSchema, SimpleTreeSchema>();
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Creates a {@link SimpleTreeSchema} from the provided {@link ImplicitFieldSchema}.
|
|
11
|
+
* Copies data from {@link ImplicitFieldSchema} to create a {@link SimpleTreeSchema} out of new plain JavaScript objects, Sets and Maps.
|
|
19
12
|
*
|
|
20
13
|
* @remarks
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* Caches the result on the input schema for future calls.
|
|
14
|
+
* See also {@link TreeViewConfigurationAlpha} which implements {@link SimpleTreeSchema} as a way to get a `SimpleTreeSchema` without copying the node and field schema and without losing as much type information.
|
|
24
15
|
*
|
|
25
16
|
* @privateRemarks
|
|
26
17
|
* In the future, we may wish to move this to a more discoverable API location.
|
|
27
18
|
* For now, while still an experimental API, it is surfaced as a free function.
|
|
28
19
|
*
|
|
29
|
-
* If the main use for this is the "definitions" map, we should provide a better way to access it (that doesn't type erase the TreeNodeSchema down to SimpleNodeSchema).
|
|
30
|
-
* TODO: Having TreeViewConfiguration implement SimpleTreeSchema directly but with more specific types would be a good way to do this.
|
|
31
|
-
*
|
|
32
20
|
* Note that all TreeNodeSchema get a {@link Context} cached on them as part of one time initialization which contains a map from identifier to all transitively referenced schema.
|
|
33
21
|
* Perhaps exposing access to that would cover this use-case as well.
|
|
34
22
|
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* @internal
|
|
23
|
+
* @alpha
|
|
38
24
|
*/
|
|
39
25
|
export function getSimpleSchema(schema: ImplicitFieldSchema): SimpleTreeSchema {
|
|
40
|
-
return
|
|
26
|
+
return toSimpleTreeSchema(schema, true);
|
|
41
27
|
}
|
|
@@ -9,6 +9,8 @@ export {
|
|
|
9
9
|
type ViewableTree,
|
|
10
10
|
type TreeViewEvents,
|
|
11
11
|
TreeViewConfiguration,
|
|
12
|
+
TreeViewConfigurationAlpha,
|
|
13
|
+
type TreeSchema,
|
|
12
14
|
type ITreeViewConfiguration,
|
|
13
15
|
type SchemaCompatibilityStatus,
|
|
14
16
|
type ITreeConfigurationOptions,
|
|
@@ -51,6 +53,7 @@ export {
|
|
|
51
53
|
type JsonFieldSchema,
|
|
52
54
|
type JsonLeafSchemaType,
|
|
53
55
|
} from "./jsonSchema.js";
|
|
56
|
+
export type { TreeSchemaEncodingOptions } from "./getJsonSchema.js";
|
|
54
57
|
export { getJsonSchema } from "./getJsonSchema.js";
|
|
55
58
|
export { getSimpleSchema } from "./getSimpleSchema.js";
|
|
56
59
|
export { ViewSchema } from "./view.js";
|
|
@@ -85,7 +88,6 @@ export type {
|
|
|
85
88
|
|
|
86
89
|
export {
|
|
87
90
|
type VerboseTreeNode,
|
|
88
|
-
type ParseOptions,
|
|
89
91
|
type VerboseTree,
|
|
90
92
|
applySchemaToParserOptions,
|
|
91
93
|
cursorFromVerbose,
|
|
@@ -94,7 +96,7 @@ export {
|
|
|
94
96
|
} from "./verboseTree.js";
|
|
95
97
|
|
|
96
98
|
export {
|
|
97
|
-
type
|
|
99
|
+
type TreeEncodingOptions,
|
|
98
100
|
customFromCursorStored,
|
|
99
101
|
type CustomTreeNode,
|
|
100
102
|
type CustomTreeValue,
|
|
@@ -69,7 +69,19 @@ export class SchemaFactoryAlpha<
|
|
|
69
69
|
name: Name,
|
|
70
70
|
fields: T,
|
|
71
71
|
options?: SchemaFactoryObjectOptions<TCustomMetadata>,
|
|
72
|
-
): ObjectNodeSchema<ScopedSchemaName<TScope, Name>, T, true, TCustomMetadata> {
|
|
72
|
+
): ObjectNodeSchema<ScopedSchemaName<TScope, Name>, T, true, TCustomMetadata> & {
|
|
73
|
+
/**
|
|
74
|
+
* Typing checking workaround: not for for actual use.
|
|
75
|
+
* @remarks
|
|
76
|
+
* This API collides with {@link TreeNodeSchemaCore.createFromInsertable} to disable a type checking optimization which produces different and undesired results.
|
|
77
|
+
* See {@link https://github.com/microsoft/TypeScript/issues/59049#issuecomment-2773459693} for more details.
|
|
78
|
+
* @privateRemarks
|
|
79
|
+
* The specific issue here is non-empty POJO mode object schema not being assignable to `ObjectNodeSchema`,
|
|
80
|
+
* See the above link and the tests in objectNode.spec.ts which reference it.
|
|
81
|
+
* @system
|
|
82
|
+
*/
|
|
83
|
+
readonly createFromInsertable: unknown;
|
|
84
|
+
} {
|
|
73
85
|
return objectSchema(
|
|
74
86
|
this.scoped2(name),
|
|
75
87
|
fields,
|
|
@@ -136,6 +148,11 @@ export class SchemaFactoryAlpha<
|
|
|
136
148
|
>;
|
|
137
149
|
}
|
|
138
150
|
|
|
151
|
+
/**
|
|
152
|
+
* {@inheritDoc SchemaStatics.optional}
|
|
153
|
+
*/
|
|
154
|
+
public static override readonly leaves = schemaStatics.leaves;
|
|
155
|
+
|
|
139
156
|
/**
|
|
140
157
|
* {@inheritDoc SchemaStatics.optional}
|
|
141
158
|
*/
|