docs: Misc tree cleanups (#23088)
## Description Cleanup a few test and docs things in tree.
This commit is contained in:
Родитель
3fe3fa54bc
Коммит
9485e134a3
|
@ -47,7 +47,7 @@ import { TreeNodeValid, type MostDerivedData } from "./treeNodeValid.js";
|
|||
import { getUnhydratedContext } from "./createContext.js";
|
||||
|
||||
/**
|
||||
* Helper used to produce types for object nodes.
|
||||
* Generates the properties for an ObjectNode from its field schema object.
|
||||
* @system @public
|
||||
*/
|
||||
export type ObjectFromSchemaRecord<T extends RestrictiveStringRecord<ImplicitFieldSchema>> = {
|
||||
|
|
|
@ -58,7 +58,9 @@ export interface ObjectNodeSchemaInternalData {
|
|||
}
|
||||
|
||||
export const ObjectNodeSchema = {
|
||||
// instanceof-based narrowing support for Javascript and TypeScript 5.3 or newer.
|
||||
/**
|
||||
* instanceof-based narrowing support for ObjectNodeSchema in Javascript and TypeScript 5.3 or newer.
|
||||
*/
|
||||
[Symbol.hasInstance](value: TreeNodeSchema): value is ObjectNodeSchema {
|
||||
return isObjectNodeSchema(value);
|
||||
},
|
||||
|
|
|
@ -294,9 +294,9 @@ describe("SharedTreeCore", () => {
|
|||
});
|
||||
|
||||
const sf = new SchemaFactory("0x4a6 repro");
|
||||
const TestNode = sf.objectRecursive("test node", {
|
||||
class TestNode extends sf.objectRecursive("test node", {
|
||||
child: sf.optionalRecursive([() => TestNode, sf.number]),
|
||||
});
|
||||
}) {}
|
||||
|
||||
const tree2 = await factory.load(
|
||||
dataStoreRuntime2,
|
||||
|
|
|
@ -110,7 +110,7 @@ describe("Class based end to end example", () => {
|
|||
});
|
||||
|
||||
// Confirm that the alternative syntax for initialTree from the example above actually works.
|
||||
it("using a mix of insertible content and nodes", () => {
|
||||
it("using a mix of insertable content and nodes", () => {
|
||||
const factory = new TreeFactory({});
|
||||
const theTree = factory.create(
|
||||
new MockFluidDataStoreRuntime({ idCompressor: createIdCompressor() }),
|
||||
|
|
Загрузка…
Ссылка в новой задаче