@fluidframework/tree 2.60.0 → 2.61.0-355516

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.
Files changed (126) hide show
  1. package/.mocharc.cjs +2 -3
  2. package/api-report/tree.alpha.api.md +11 -28
  3. package/api-report/tree.beta.api.md +6 -23
  4. package/api-report/tree.legacy.beta.api.md +71 -22
  5. package/api-report/tree.legacy.public.api.md +5 -22
  6. package/api-report/tree.public.api.md +5 -22
  7. package/dist/alpha.d.ts +10 -5
  8. package/dist/beta.d.ts +8 -4
  9. package/dist/core/tree/anchorSet.d.ts +3 -3
  10. package/dist/core/tree/anchorSet.d.ts.map +1 -1
  11. package/dist/core/tree/anchorSet.js.map +1 -1
  12. package/dist/index.d.ts +1 -1
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js.map +1 -1
  15. package/dist/legacy.d.ts +22 -4
  16. package/dist/packageVersion.d.ts +1 -1
  17. package/dist/packageVersion.d.ts.map +1 -1
  18. package/dist/packageVersion.js +1 -1
  19. package/dist/packageVersion.js.map +1 -1
  20. package/dist/public.d.ts +6 -3
  21. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  22. package/dist/shared-tree/treeCheckout.js +1 -0
  23. package/dist/shared-tree/treeCheckout.js.map +1 -1
  24. package/dist/simple-tree/api/index.d.ts +1 -1
  25. package/dist/simple-tree/api/index.d.ts.map +1 -1
  26. package/dist/simple-tree/api/index.js.map +1 -1
  27. package/dist/simple-tree/api/schemaFactory.d.ts +11 -83
  28. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  29. package/dist/simple-tree/api/schemaFactory.js +26 -82
  30. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  31. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +5 -3
  32. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  33. package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  34. package/dist/simple-tree/core/index.d.ts +1 -1
  35. package/dist/simple-tree/core/index.d.ts.map +1 -1
  36. package/dist/simple-tree/core/index.js +2 -1
  37. package/dist/simple-tree/core/index.js.map +1 -1
  38. package/dist/simple-tree/core/treeNodeKernel.d.ts +12 -1
  39. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  40. package/dist/simple-tree/core/treeNodeKernel.js +188 -43
  41. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  42. package/dist/simple-tree/core/unhydratedFlexTree.d.ts +4 -3
  43. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  44. package/dist/simple-tree/core/unhydratedFlexTree.js +22 -6
  45. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  46. package/dist/simple-tree/index.d.ts +2 -2
  47. package/dist/simple-tree/index.d.ts.map +1 -1
  48. package/dist/simple-tree/index.js +3 -2
  49. package/dist/simple-tree/index.js.map +1 -1
  50. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  51. package/dist/simple-tree/node-kinds/array/arrayNode.js +13 -6
  52. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  53. package/dist/tableSchema.d.ts.map +1 -1
  54. package/dist/tableSchema.js +15 -10
  55. package/dist/tableSchema.js.map +1 -1
  56. package/dist/util/breakable.d.ts.map +1 -1
  57. package/dist/util/breakable.js +7 -1
  58. package/dist/util/breakable.js.map +1 -1
  59. package/lib/alpha.d.ts +10 -5
  60. package/lib/beta.d.ts +8 -4
  61. package/lib/core/tree/anchorSet.d.ts +3 -3
  62. package/lib/core/tree/anchorSet.d.ts.map +1 -1
  63. package/lib/core/tree/anchorSet.js.map +1 -1
  64. package/lib/index.d.ts +1 -1
  65. package/lib/index.d.ts.map +1 -1
  66. package/lib/index.js.map +1 -1
  67. package/lib/legacy.d.ts +22 -4
  68. package/lib/packageVersion.d.ts +1 -1
  69. package/lib/packageVersion.d.ts.map +1 -1
  70. package/lib/packageVersion.js +1 -1
  71. package/lib/packageVersion.js.map +1 -1
  72. package/lib/public.d.ts +6 -3
  73. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  74. package/lib/shared-tree/treeCheckout.js +1 -0
  75. package/lib/shared-tree/treeCheckout.js.map +1 -1
  76. package/lib/simple-tree/api/index.d.ts +1 -1
  77. package/lib/simple-tree/api/index.d.ts.map +1 -1
  78. package/lib/simple-tree/api/index.js.map +1 -1
  79. package/lib/simple-tree/api/schemaFactory.d.ts +11 -83
  80. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  81. package/lib/simple-tree/api/schemaFactory.js +25 -81
  82. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  83. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +5 -3
  84. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  85. package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  86. package/lib/simple-tree/core/index.d.ts +1 -1
  87. package/lib/simple-tree/core/index.d.ts.map +1 -1
  88. package/lib/simple-tree/core/index.js +1 -1
  89. package/lib/simple-tree/core/index.js.map +1 -1
  90. package/lib/simple-tree/core/treeNodeKernel.d.ts +12 -1
  91. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  92. package/lib/simple-tree/core/treeNodeKernel.js +187 -43
  93. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  94. package/lib/simple-tree/core/unhydratedFlexTree.d.ts +4 -3
  95. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  96. package/lib/simple-tree/core/unhydratedFlexTree.js +22 -6
  97. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  98. package/lib/simple-tree/index.d.ts +2 -2
  99. package/lib/simple-tree/index.d.ts.map +1 -1
  100. package/lib/simple-tree/index.js +1 -1
  101. package/lib/simple-tree/index.js.map +1 -1
  102. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  103. package/lib/simple-tree/node-kinds/array/arrayNode.js +14 -7
  104. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  105. package/lib/tableSchema.d.ts.map +1 -1
  106. package/lib/tableSchema.js +16 -11
  107. package/lib/tableSchema.js.map +1 -1
  108. package/lib/tsdoc-metadata.json +1 -1
  109. package/lib/util/breakable.d.ts.map +1 -1
  110. package/lib/util/breakable.js +7 -1
  111. package/lib/util/breakable.js.map +1 -1
  112. package/package.json +27 -27
  113. package/src/core/tree/anchorSet.ts +2 -2
  114. package/src/index.ts +1 -0
  115. package/src/packageVersion.ts +1 -1
  116. package/src/shared-tree/treeCheckout.ts +1 -0
  117. package/src/simple-tree/api/index.ts +1 -0
  118. package/src/simple-tree/api/schemaFactory.ts +31 -103
  119. package/src/simple-tree/api/schemaFactoryRecursive.ts +41 -40
  120. package/src/simple-tree/core/index.ts +1 -0
  121. package/src/simple-tree/core/treeNodeKernel.ts +242 -44
  122. package/src/simple-tree/core/unhydratedFlexTree.ts +26 -3
  123. package/src/simple-tree/index.ts +2 -0
  124. package/src/simple-tree/node-kinds/array/arrayNode.ts +19 -11
  125. package/src/tableSchema.ts +15 -9
  126. package/src/util/breakable.ts +9 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/tree",
3
- "version": "2.60.0",
3
+ "version": "2.61.0-355516",
4
4
  "description": "Distributed tree",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -101,17 +101,17 @@
101
101
  "temp-directory": "nyc/.nyc_output"
102
102
  },
103
103
  "dependencies": {
104
- "@fluid-internal/client-utils": "~2.60.0",
105
- "@fluidframework/container-runtime": "~2.60.0",
106
- "@fluidframework/core-interfaces": "~2.60.0",
107
- "@fluidframework/core-utils": "~2.60.0",
108
- "@fluidframework/datastore-definitions": "~2.60.0",
109
- "@fluidframework/driver-definitions": "~2.60.0",
110
- "@fluidframework/id-compressor": "~2.60.0",
111
- "@fluidframework/runtime-definitions": "~2.60.0",
112
- "@fluidframework/runtime-utils": "~2.60.0",
113
- "@fluidframework/shared-object-base": "~2.60.0",
114
- "@fluidframework/telemetry-utils": "~2.60.0",
104
+ "@fluid-internal/client-utils": "2.61.0-355516",
105
+ "@fluidframework/container-runtime": "2.61.0-355516",
106
+ "@fluidframework/core-interfaces": "2.61.0-355516",
107
+ "@fluidframework/core-utils": "2.61.0-355516",
108
+ "@fluidframework/datastore-definitions": "2.61.0-355516",
109
+ "@fluidframework/driver-definitions": "2.61.0-355516",
110
+ "@fluidframework/id-compressor": "2.61.0-355516",
111
+ "@fluidframework/runtime-definitions": "2.61.0-355516",
112
+ "@fluidframework/runtime-utils": "2.61.0-355516",
113
+ "@fluidframework/shared-object-base": "2.61.0-355516",
114
+ "@fluidframework/telemetry-utils": "2.61.0-355516",
115
115
  "@sinclair/typebox": "^0.34.13",
116
116
  "@tylerbu/sorted-btree-es6": "^1.8.0",
117
117
  "@types/ungap__structured-clone": "^1.2.0",
@@ -121,28 +121,28 @@
121
121
  "devDependencies": {
122
122
  "@arethetypeswrong/cli": "^0.17.1",
123
123
  "@biomejs/biome": "~1.9.3",
124
- "@fluid-internal/mocha-test-setup": "~2.60.0",
125
- "@fluid-private/stochastic-test-utils": "~2.60.0",
126
- "@fluid-private/test-dds-utils": "~2.60.0",
127
- "@fluid-private/test-drivers": "~2.60.0",
124
+ "@fluid-internal/mocha-test-setup": "2.61.0-355516",
125
+ "@fluid-private/stochastic-test-utils": "2.61.0-355516",
126
+ "@fluid-private/test-dds-utils": "2.61.0-355516",
127
+ "@fluid-private/test-drivers": "2.61.0-355516",
128
128
  "@fluid-tools/benchmark": "^0.51.0",
129
- "@fluid-tools/build-cli": "^0.57.0",
129
+ "@fluid-tools/build-cli": "^0.58.1",
130
130
  "@fluidframework/build-common": "^2.0.3",
131
- "@fluidframework/build-tools": "^0.57.0",
132
- "@fluidframework/container-definitions": "~2.60.0",
133
- "@fluidframework/container-loader": "~2.60.0",
131
+ "@fluidframework/build-tools": "^0.58.1",
132
+ "@fluidframework/container-definitions": "2.61.0-355516",
133
+ "@fluidframework/container-loader": "2.61.0-355516",
134
134
  "@fluidframework/eslint-config-fluid": "^6.0.0",
135
- "@fluidframework/test-runtime-utils": "~2.60.0",
136
- "@fluidframework/test-utils": "~2.60.0",
137
- "@fluidframework/tree-previous": "npm:@fluidframework/tree@2.53.0",
138
- "@microsoft/api-extractor": "7.52.8",
135
+ "@fluidframework/test-runtime-utils": "2.61.0-355516",
136
+ "@fluidframework/test-utils": "2.61.0-355516",
137
+ "@fluidframework/tree-previous": "npm:@fluidframework/tree@2.60.0",
138
+ "@microsoft/api-extractor": "7.52.11",
139
139
  "@types/diff": "^3.5.1",
140
140
  "@types/easy-table": "^0.0.32",
141
141
  "@types/mocha": "^10.0.10",
142
142
  "@types/node": "^18.19.0",
143
143
  "ajv": "^8.12.0",
144
144
  "ajv-formats": "^3.0.1",
145
- "c8": "^8.0.1",
145
+ "c8": "^10.1.3",
146
146
  "concurrently": "^8.2.1",
147
147
  "copyfiles": "^2.4.1",
148
148
  "cross-env": "^7.0.3",
@@ -177,8 +177,8 @@
177
177
  },
178
178
  "scripts": {
179
179
  "api": "fluid-build . --task api",
180
- "api-extractor:commonjs": "flub generate entrypoints --outDir ./dist",
181
- "api-extractor:esnext": "flub generate entrypoints --outDir ./lib --node10TypeCompat",
180
+ "api-extractor:commonjs": "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./dist",
181
+ "api-extractor:esnext": "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib --node10TypeCompat",
182
182
  "bench": "mocha --timeout 999999 --perfMode --parentProcess --fgrep @Benchmark --fgrep @ExecutionTime --reporter @fluid-tools/benchmark/dist/MochaReporter.js",
183
183
  "bench:profile": "mocha --v8-prof --v8-logfile=profile.log --v8-no-logfile-per-isolate --timeout 999999 --perfMode --fgrep @Benchmark --fgrep @ExecutionTime --reporter @fluid-tools/benchmark/dist/MochaReporter.js && node --prof-process profile.log > profile.txt && rimraf profile.log && echo See results in profile.txt",
184
184
  "build": "fluid-build . --task build",
@@ -6,7 +6,7 @@
6
6
  /* eslint-disable @typescript-eslint/no-non-null-assertion */
7
7
 
8
8
  import { createEmitter } from "@fluid-internal/client-utils";
9
- import type { Listenable } from "@fluidframework/core-interfaces/internal";
9
+ import type { HasListeners, Listenable } from "@fluidframework/core-interfaces/internal";
10
10
  import { assert, fail } from "@fluidframework/core-utils/internal";
11
11
 
12
12
  import {
@@ -210,7 +210,7 @@ export interface AnchorNode extends INormalizedUpPath<AnchorNode> {
210
210
  /**
211
211
  * Events for this anchor node.
212
212
  */
213
- readonly events: Listenable<AnchorEvents>;
213
+ readonly events: Listenable<AnchorEvents> & HasListeners<AnchorEvents>;
214
214
 
215
215
  /**
216
216
  * Allows access to data stored on the Anchor in "slots".
package/src/index.ts CHANGED
@@ -267,6 +267,7 @@ export {
267
267
  type TreeRecordNode,
268
268
  KeyEncodingOptions,
269
269
  type TreeParsingOptions,
270
+ type SchemaFactory_base,
270
271
  } from "./simple-tree/index.js";
271
272
  export {
272
273
  SharedTree,
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/tree";
9
- export const pkgVersion = "2.60.0";
9
+ export const pkgVersion = "2.61.0-355516";
@@ -883,6 +883,7 @@ export class TreeCheckout implements ITreeCheckoutFork {
883
883
  }
884
884
 
885
885
  private revertRevertible(revision: RevisionTag, kind: CommitKind): RevertMetrics {
886
+ this.editLock.checkUnlocked("Reverting a commit");
886
887
  if (this.transaction.isInProgress()) {
887
888
  throw new UsageError("Undo is not yet supported during transactions.");
888
889
  }
@@ -31,6 +31,7 @@ export {
31
31
  type SchemaFactoryObjectOptions,
32
32
  type NodeSchemaOptions,
33
33
  type NodeSchemaOptionsAlpha,
34
+ type SchemaFactory_base,
34
35
  } from "./schemaFactory.js";
35
36
  export { SchemaFactoryBeta } from "./schemaFactoryBeta.js";
36
37
  export { SchemaFactoryAlpha, type SchemaStaticsAlpha } from "./schemaFactoryAlpha.js";
@@ -174,6 +174,33 @@ export type ScopedSchemaName<
174
174
 
175
175
  const schemaStaticsPublic: SchemaStatics = schemaStatics;
176
176
 
177
+ /**
178
+ * Create a class with `Statics` as both static properties and member properties.
179
+ * @privateRemarks
180
+ * An attempt was made to let this take in a base class so it could be used again on SchemaFactoryAlpha.
181
+ * This was unsuccessful, mostly due to issues with trying to manipulate constructor types.
182
+ */
183
+ function classWithStatics<Statics extends object>(
184
+ statics: Statics,
185
+ ): Statics & (new () => Statics) {
186
+ // eslint-disable-next-line @typescript-eslint/no-extraneous-class
187
+ class WithStatics {}
188
+
189
+ Object.assign(WithStatics.prototype, statics);
190
+ Object.assign(WithStatics, statics);
191
+ return WithStatics as Statics & (new () => Statics);
192
+ }
193
+
194
+ /**
195
+ * Base class for SchemaFactory, exposes {@link SchemaStatics} as both static properties and member properties.
196
+ * @remarks
197
+ * Do not use this directly, use {@link SchemaFactory} instead.
198
+ * @privateRemarks
199
+ * Exported only as a workaround for {@link https://github.com/microsoft/TypeScript/issues/59550} and {@link https://github.com/microsoft/rushstack/issues/4429}.
200
+ * @system @public
201
+ */
202
+ export const SchemaFactory_base = classWithStatics(schemaStaticsPublic);
203
+
177
204
  // TODO:
178
205
  // SchemaFactory.array references should link to the correct overloads, however the syntax for this does not seems to work currently for methods unless the they are not qualified with the class.
179
206
  // API-Extractor requires such links to be qualified with the class, so it can't work.
@@ -289,8 +316,7 @@ const schemaStaticsPublic: SchemaStatics = schemaStatics;
289
316
  export class SchemaFactory<
290
317
  out TScope extends string | undefined = string | undefined,
291
318
  TName extends number | string = string,
292
- > implements SchemaStatics
293
- {
319
+ > extends SchemaFactory_base {
294
320
  /**
295
321
  * TODO:
296
322
  * If users of this generate the same name because two different schema with the same identifier were used,
@@ -339,67 +365,9 @@ export class SchemaFactory<
339
365
  * ```
340
366
  */
341
367
  public readonly scope: TScope,
342
- ) {}
343
-
344
- /**
345
- * {@inheritDoc SchemaStatics.string}
346
- */
347
- public readonly string = schemaStaticsPublic.string;
348
-
349
- /**
350
- * {@inheritDoc SchemaStatics.number}
351
- */
352
- public readonly number = schemaStaticsPublic.number;
353
-
354
- /**
355
- * {@inheritDoc SchemaStatics.boolean}
356
- */
357
- public readonly boolean = schemaStaticsPublic.boolean;
358
-
359
- /**
360
- * {@inheritDoc SchemaStatics.null}
361
- */
362
- public readonly null = schemaStaticsPublic.null;
363
-
364
- /**
365
- * {@inheritDoc SchemaStatics.handle}
366
- */
367
- public readonly handle = schemaStaticsPublic.handle;
368
-
369
- /**
370
- * {@inheritDoc SchemaStatics.leaves}
371
- */
372
- public readonly leaves = schemaStaticsPublic.leaves;
373
-
374
- /**
375
- * {@inheritDoc SchemaStatics.string}
376
- */
377
- public static readonly string = schemaStaticsPublic.string;
378
-
379
- /**
380
- * {@inheritDoc SchemaStatics.number}
381
- */
382
- public static readonly number = schemaStaticsPublic.number;
383
-
384
- /**
385
- * {@inheritDoc SchemaStatics.boolean}
386
- */
387
- public static readonly boolean = schemaStaticsPublic.boolean;
388
-
389
- /**
390
- * {@inheritDoc SchemaStatics.null}
391
- */
392
- public static readonly null = schemaStaticsPublic.null;
393
-
394
- /**
395
- * {@inheritDoc SchemaStatics.handle}
396
- */
397
- public static readonly handle = schemaStaticsPublic.handle;
398
-
399
- /**
400
- * {@inheritDoc SchemaStatics.leaves}
401
- */
402
- public static readonly leaves = schemaStaticsPublic.leaves;
368
+ ) {
369
+ super();
370
+ }
403
371
 
404
372
  /**
405
373
  * Define a {@link TreeNodeSchemaClass} for a {@link TreeObjectNode}.
@@ -807,46 +775,6 @@ export class SchemaFactory<
807
775
  >;
808
776
  }
809
777
 
810
- /**
811
- * {@inheritDoc SchemaStatics.optional}
812
- */
813
- public readonly optional = schemaStaticsPublic.optional;
814
-
815
- /**
816
- * {@inheritDoc SchemaStatics.required}
817
- */
818
- public readonly required = schemaStaticsPublic.required;
819
-
820
- /**
821
- * {@inheritDoc SchemaStatics.optionalRecursive}
822
- */
823
- public readonly optionalRecursive = schemaStaticsPublic.optionalRecursive;
824
-
825
- /**
826
- * {@inheritDoc SchemaStatics.requiredRecursive}
827
- */
828
- public readonly requiredRecursive = schemaStaticsPublic.requiredRecursive;
829
-
830
- /**
831
- * {@inheritDoc SchemaStatics.optional}
832
- */
833
- public static readonly optional = schemaStaticsPublic.optional;
834
-
835
- /**
836
- * {@inheritDoc SchemaStatics.required}
837
- */
838
- public static readonly required = schemaStaticsPublic.required;
839
-
840
- /**
841
- * {@inheritDoc SchemaStatics.optionalRecursive}
842
- */
843
- public static readonly optionalRecursive = schemaStaticsPublic.optionalRecursive;
844
-
845
- /**
846
- * {@inheritDoc SchemaStatics.requiredRecursive}
847
- */
848
- public static readonly requiredRecursive = schemaStaticsPublic.requiredRecursive;
849
-
850
778
  /**
851
779
  * A special readonly field which holds an identifier string for an object node.
852
780
  * @remarks
@@ -11,6 +11,7 @@ import type {
11
11
  TreeNode,
12
12
  ImplicitAllowedTypes,
13
13
  InsertableTreeNodeFromImplicitAllowedTypes,
14
+ TreeNodeSchemaClass,
14
15
  } from "../core/index.js";
15
16
  import type { InsertableObjectFromSchemaRecord } from "../node-kinds/index.js";
16
17
  import type { ImplicitFieldSchema } from "../fieldSchema.js";
@@ -136,50 +137,50 @@ import type { ImplicitFieldSchema } from "../fieldSchema.js";
136
137
  * TODO: this currently does not reject `any`, but ideally should.
137
138
  * @public
138
139
  */
139
- export type ValidateRecursiveSchema<
140
- // Recursive types should always be using TreeNodeSchemaClass (not TreeNodeSchemaNonClass) as thats part of the requirements for the type to work across compilation boundaries correctly.
141
- T extends ValidateRecursiveSchemaTemplate<T>,
142
- > = true;
140
+ export type ValidateRecursiveSchema<T extends ValidateRecursiveSchemaTemplate<T>> = true;
143
141
 
144
142
  /**
145
143
  * Validation logic used by {@link ValidateRecursiveSchema}.
144
+ * @privateRemarks
145
+ * Recursive types should always be using TreeNodeSchemaClass (not TreeNodeSchemaNonClass) as that's part of the requirements for the type to work across compilation boundaries correctly.
146
146
  * @system @public
147
147
  */
148
- export type ValidateRecursiveSchemaTemplate<T extends TreeNodeSchema> = TreeNodeSchema<
149
- // Name: This validator places no restrictions on the name other than that it's a string (as required by TreeNodeSchemaClass).
150
- string,
151
- // NodeKind: These are the NodeKinds which currently can be used recursively.
152
- NodeKind.Array | NodeKind.Map | NodeKind.Object | NodeKind.Record,
153
- // TNode: The produced node API. This is pretty minimal validation: more could be added if similar to how TInsertable works below if needed.
154
- TreeNode & WithType<T["identifier"], T["kind"]>,
155
- // TInsertable: What can be passed to the constructor. This should be enough to catch most issues with incorrect schema.
156
- // These match whats defined in the recursive methods on `SchemaFactory` except they do not use `Unenforced`.
157
- {
158
- [NodeKind.Object]: T["info"] extends RestrictiveStringRecord<ImplicitFieldSchema>
159
- ? InsertableObjectFromSchemaRecord<T["info"]>
160
- : unknown;
161
- [NodeKind.Array]: T["info"] extends ImplicitAllowedTypes
162
- ? Iterable<InsertableTreeNodeFromImplicitAllowedTypes<T["info"]>>
163
- : unknown;
164
- [NodeKind.Map]: T["info"] extends ImplicitAllowedTypes
165
- ? Iterable<[string, InsertableTreeNodeFromImplicitAllowedTypes<T["info"]>]>
166
- : unknown;
167
- [NodeKind.Record]: {
168
- readonly [P in string]: InsertableTreeNodeFromImplicitAllowedTypes<T>;
169
- };
170
- [NodeKind.Leaf]: unknown;
171
- }[T["kind"]],
172
- // ImplicitlyConstructable: recursive types are currently not implicitly constructable.
173
- false,
174
- // Info: What's passed to the method to create the schema. Constraining these here should be about as effective as if the actual constraints existed on the actual method itself.
175
- {
176
- [NodeKind.Object]: RestrictiveStringRecord<ImplicitFieldSchema>;
177
- [NodeKind.Array]: ImplicitAllowedTypes;
178
- [NodeKind.Map]: ImplicitAllowedTypes;
179
- [NodeKind.Record]: ImplicitAllowedTypes;
180
- [NodeKind.Leaf]: unknown;
181
- }[T["kind"]]
182
- >;
148
+ export type ValidateRecursiveSchemaTemplate<T extends TreeNodeSchemaClass> =
149
+ TreeNodeSchemaClass<
150
+ // Name: This validator places no restrictions on the name other than that it's a string (as required by TreeNodeSchemaClass).
151
+ string,
152
+ // NodeKind: These are the NodeKinds which currently can be used recursively.
153
+ NodeKind.Array | NodeKind.Map | NodeKind.Object | NodeKind.Record,
154
+ // TNode: The produced node API. This is pretty minimal validation: more could be added if similar to how TInsertable works below if needed.
155
+ TreeNode & WithType<T["identifier"], T["kind"]>,
156
+ // TInsertable: What can be passed to the constructor. This should be enough to catch most issues with incorrect schema.
157
+ // These match whats defined in the recursive methods on `SchemaFactory` except they do not use `Unenforced`.
158
+ {
159
+ [NodeKind.Object]: T["info"] extends RestrictiveStringRecord<ImplicitFieldSchema>
160
+ ? InsertableObjectFromSchemaRecord<T["info"]>
161
+ : unknown;
162
+ [NodeKind.Array]: T["info"] extends ImplicitAllowedTypes
163
+ ? Iterable<InsertableTreeNodeFromImplicitAllowedTypes<T["info"]>>
164
+ : unknown;
165
+ [NodeKind.Map]: T["info"] extends ImplicitAllowedTypes
166
+ ? Iterable<[string, InsertableTreeNodeFromImplicitAllowedTypes<T["info"]>]>
167
+ : unknown;
168
+ [NodeKind.Record]: {
169
+ readonly [P in string]: InsertableTreeNodeFromImplicitAllowedTypes<T>;
170
+ };
171
+ [NodeKind.Leaf]: unknown;
172
+ }[T["kind"]],
173
+ // ImplicitlyConstructable: recursive types are currently not implicitly constructable.
174
+ false,
175
+ // Info: What's passed to the method to create the schema. Constraining these here should be about as effective as if the actual constraints existed on the actual method itself.
176
+ {
177
+ [NodeKind.Object]: RestrictiveStringRecord<ImplicitFieldSchema>;
178
+ [NodeKind.Array]: ImplicitAllowedTypes;
179
+ [NodeKind.Map]: ImplicitAllowedTypes;
180
+ [NodeKind.Record]: ImplicitAllowedTypes;
181
+ [NodeKind.Leaf]: unknown;
182
+ }[T["kind"]]
183
+ >;
183
184
 
184
185
  /**
185
186
  * Workaround for "Type instantiation is excessively deep and possibly infinite.ts" errors.
@@ -236,7 +237,7 @@ export type ValidateRecursiveSchemaTemplate<T extends TreeNodeSchema> = TreeNode
236
237
  * This uses ValidateRecursiveSchemaTemplate since it was found to evaluate enough of the type to work.
237
238
  * @internal
238
239
  */
239
- export type FixRecursiveRecursionLimit<T extends TreeNodeSchema> =
240
+ export type FixRecursiveRecursionLimit<T extends TreeNodeSchemaClass> =
240
241
  T extends ValidateRecursiveSchemaTemplate<T> ? undefined : undefined;
241
242
 
242
243
  /**
@@ -14,6 +14,7 @@ export {
14
14
  treeNodeFromAnchor,
15
15
  getSimpleNodeSchemaFromInnerNode,
16
16
  SimpleContextSlot,
17
+ withBufferedTreeEvents,
17
18
  } from "./treeNodeKernel.js";
18
19
  export { type WithType, typeNameSymbol, typeSchemaSymbol } from "./withType.js";
19
20
  export {