@fluidframework/tree 2.2.0 → 2.3.0-288113
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/api-report/tree.alpha.api.md +39 -3
- package/api-report/tree.beta.api.md +8 -3
- package/api-report/tree.public.api.md +8 -3
- package/dist/beta.d.ts +1 -0
- package/dist/core/tree/anchorSet.d.ts +4 -6
- package/dist/core/tree/anchorSet.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.js +11 -1
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/events/events.d.ts +7 -1
- package/dist/events/events.d.ts.map +1 -1
- package/dist/events/events.js +5 -2
- package/dist/events/events.js.map +1 -1
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts +0 -2
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.js +0 -12
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +4 -95
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js +1 -30
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/dist/feature-libraries/flex-tree/index.d.ts +2 -2
- package/dist/feature-libraries/flex-tree/index.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/index.js +1 -3
- package/dist/feature-libraries/flex-tree/index.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.d.ts +0 -1
- package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +0 -3
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts +3 -10
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.js +2 -87
- 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 +2 -4
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +36 -31
- 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/public.d.ts +1 -0
- package/dist/simple-tree/api/treeNodeApi.d.ts +1 -1
- package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.js +30 -2
- package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
- package/dist/simple-tree/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/arrayNode.js +5 -19
- package/dist/simple-tree/arrayNode.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +1 -1
- package/dist/simple-tree/core/index.d.ts.map +1 -1
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.d.ts +18 -5
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +57 -21
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/types.d.ts +28 -10
- package/dist/simple-tree/core/types.d.ts.map +1 -1
- package/dist/simple-tree/core/types.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.map +1 -1
- package/lib/beta.d.ts +1 -0
- package/lib/core/tree/anchorSet.d.ts +4 -6
- package/lib/core/tree/anchorSet.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.js +11 -1
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/events/events.d.ts +7 -1
- package/lib/events/events.d.ts.map +1 -1
- package/lib/events/events.js +5 -2
- package/lib/events/events.js.map +1 -1
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts +0 -2
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.js +0 -12
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +4 -95
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js +0 -29
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/lib/feature-libraries/flex-tree/index.d.ts +2 -2
- 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/lazyField.d.ts +0 -1
- package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +0 -3
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts +3 -10
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.js +3 -86
- 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/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -0
- 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/public.d.ts +1 -0
- package/lib/simple-tree/api/treeNodeApi.d.ts +1 -1
- package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.js +30 -2
- package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/arrayNode.js +5 -19
- package/lib/simple-tree/arrayNode.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +1 -1
- package/lib/simple-tree/core/index.d.ts.map +1 -1
- package/lib/simple-tree/core/index.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.d.ts +18 -5
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +58 -22
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/types.d.ts +28 -10
- package/lib/simple-tree/core/types.d.ts.map +1 -1
- package/lib/simple-tree/core/types.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.map +1 -1
- package/package.json +22 -32
- package/src/core/tree/anchorSet.ts +20 -9
- package/src/events/events.ts +10 -2
- package/src/feature-libraries/flex-map-tree/mapTreeNode.ts +0 -21
- package/src/feature-libraries/flex-tree/flexTreeTypes.ts +3 -170
- package/src/feature-libraries/flex-tree/index.ts +1 -17
- package/src/feature-libraries/flex-tree/lazyField.ts +0 -6
- package/src/feature-libraries/flex-tree/lazyNode.ts +3 -154
- package/src/feature-libraries/index.ts +0 -14
- package/src/index.ts +8 -0
- package/src/packageVersion.ts +1 -1
- package/src/simple-tree/api/treeNodeApi.ts +37 -5
- package/src/simple-tree/arrayNode.ts +3 -12
- package/src/simple-tree/core/index.ts +1 -0
- package/src/simple-tree/core/treeNodeKernel.ts +88 -29
- package/src/simple-tree/core/types.ts +35 -9
- package/src/simple-tree/index.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAiBN,UAAU,EAGV,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,YAAY,GACZ,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACN,0BAA0B,EAC1B,IAAI,EACJ,mCAAmC,EACnC,iBAAiB,EACjB,0BAA0B,GAC1B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,cAAc,EAAwB,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAM1F,OAAO,EACN,4BAA4B,EAC5B,aAAa,EACb,UAAU,GACV,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEhE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\ttype FlexTreeEntity,\n\ttype FlexTreeTypedField,\n\ttype FlexibleFieldContent,\n\ttype FlexibleNodeContent,\n\ttype FlexTreeLeafNode,\n\ttype FlexTreeMapNode,\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\ttype FlexTreeObjectNode,\n\ttype AssignableFieldKinds,\n\ttype FlexTreeTypedNode,\n\ttype FlexTreeTypedNodeUnion,\n\ttype CheckTypesOverlap,\n\tTreeStatus,\n\ttype FlexTreeUnknownUnboxed,\n\ttype FlexTreeUnboxField,\n\tflexTreeMarker,\n\tFlexTreeEntityKind,\n\tisFlexTreeNode,\n\tflexTreeSlot,\n} from \"./flexTreeTypes.js\";\n\nexport {\n\tvisitBipartiteIterableTree,\n\tSkip,\n\tvisitBipartiteIterableTreeWithState,\n\tvisitIterableTree,\n\tvisitIterableTreeWithState,\n} from \"./navigation.js\";\n\nexport { getTreeContext, type FlexTreeContext, Context, ContextSlot } from \"./context.js\";\n\nexport { type FlexTreeNodeEvents } from \"./treeEvents.js\";\n\nexport type { FlexTreeUnboxNodeUnion } from \"./flexTreeTypes.js\";\n\nexport {\n\tassertFlexTreeEntityNotFreed,\n\tisFreedSymbol,\n\tLazyEntity,\n} from \"./lazyEntity.js\";\n\nexport { getSchemaAndPolicy, indexForAt } from \"./utilities.js\";\n\nexport { treeStatusFromAnchorCache } from \"./utilities.js\";\n"]}
|
|
@@ -30,7 +30,6 @@ export declare abstract class LazyField<out TKind extends FlexFieldKind, TTypes
|
|
|
30
30
|
atIndex(index: number): FlexTreeUnboxNodeUnion<TTypes>;
|
|
31
31
|
boxedAt(index: number): FlexTreeTypedNodeUnion<TTypes> | undefined;
|
|
32
32
|
map<U>(callbackfn: (value: FlexTreeUnboxNodeUnion<TTypes>, index: number) => U): U[];
|
|
33
|
-
mapBoxed<U>(callbackfn: (value: FlexTreeTypedNodeUnion<TTypes>, index: number) => U): U[];
|
|
34
33
|
boxedIterator(): IterableIterator<FlexTreeTypedNodeUnion<TTypes>>;
|
|
35
34
|
[Symbol.iterator](): IterableIterator<FlexTreeUnboxNodeUnion<TTypes>>;
|
|
36
35
|
getFieldPath(): FieldUpPath;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazyField.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/lazyField.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAEN,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,WAAW,EAEhB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EAIzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACN,UA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AAO,IAAI,sBAAsB,CAAC,MAAM,CAAC,GAAG,SAAS,CAE/D;CACD;AAED,qBAAa,kBAAkB,CAAC,MAAM,SAAS,gBAAgB,CAAE,SAAQ,SAAS,CACjF,OAAO,UAAU,CAAC,SAAS,EAC3B,MAAM,CACN;CAAG"}
|
|
@@ -116,9 +116,6 @@ export class LazyField extends LazyEntity {
|
|
|
116
116
|
map(callbackfn) {
|
|
117
117
|
return Array.from(this, callbackfn);
|
|
118
118
|
}
|
|
119
|
-
mapBoxed(callbackfn) {
|
|
120
|
-
return Array.from(this.boxedIterator(), callbackfn);
|
|
121
|
-
}
|
|
122
119
|
boxedIterator() {
|
|
123
120
|
return iterateCursorField(this[cursorSymbol], (cursor) => makeTree(this.context, cursor));
|
|
124
121
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazyField.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/lazyField.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAE7D,OAAO,EASN,YAAY,EACZ,kBAAkB,EAClB,YAAY,GACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EACN,UAAU,GAIV,MAAM,4BAA4B,CAAC;AAKpC,OAAO,EACN,kBAAkB,EASlB,UAAU,EACV,cAAc,EACd,YAAY,GACZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,2BAA2B,GAC3B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAqB,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AACv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ED,MAAM,OAAO,kBAAoD,SAAQ,SAGxE;CAAG;AAaJ,MAAM,WAAW,GAA+B;IAC/C,CAAC,UAAU,CAAC,SAAS,EAAE,kBAAkB,CAAC;IAC1C,CAAC,UAAU,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACxC,CAAC,UAAU,CAAC,QAAQ,EAAE,YAAY,CAAC;IACnC,CAAC,UAAU,CAAC,QAAQ,EAAE,cAAc,CAAC;IACrC,CAAC,UAAU,CAAC,UAAU,EAAE,mBAAmB,CAAC;CAC5C,CAAC;AAEF,MAAM,WAAW,GAAwC,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tCursorLocationType,\n\ttype ExclusiveMapTree,\n\ttype FieldAnchor,\n\ttype FieldKey,\n\ttype FieldUpPath,\n\ttype ITreeCursorSynchronous,\n\ttype ITreeSubscriptionCursor,\n\ttype TreeNavigationResult,\n\tinCursorNode,\n\titerateCursorField,\n\trootFieldKey,\n} from \"../../core/index.js\";\nimport { disposeSymbol, fail, getOrCreate } from \"../../util/index.js\";\nimport {\n\tFieldKinds,\n\ttype OptionalFieldEditBuilder,\n\ttype SequenceFieldEditBuilder,\n\ttype ValueFieldEditBuilder,\n} from \"../default-schema/index.js\";\nimport type { FlexFieldKind } from \"../modular-schema/index.js\";\nimport type { FlexAllowedTypes, FlexFieldSchema } from \"../typed-schema/index.js\";\n\nimport type { Context } from \"./context.js\";\nimport {\n\tFlexTreeEntityKind,\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeTypedNodeUnion,\n\ttype FlexTreeUnboxNodeUnion,\n\tTreeStatus,\n\tflexTreeMarker,\n\tflexTreeSlot,\n} from \"./flexTreeTypes.js\";\nimport {\n\tLazyEntity,\n\tanchorSymbol,\n\tcursorSymbol,\n\tforgetAnchorSymbol,\n\tisFreedSymbol,\n\ttryMoveCursorToAnchorSymbol,\n} from \"./lazyEntity.js\";\nimport { type LazyTreeNode, makeTree } from \"./lazyNode.js\";\nimport { unboxedUnion } from \"./unboxed.js\";\nimport { indexForAt, treeStatusFromAnchorCache } from \"./utilities.js\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { cursorForMapTreeField, cursorForMapTreeNode } from \"../mapTreeCursor.js\";\n\n/**\n * Reuse fields.\n * Since field currently own cursors and register themselves for disposal when the node hit end of life,\n * not reusing them results in memory leaks every time the field is accessed.\n * Since the fields stay alive until the node is end of life reusing them this way is safe.\n *\n * This ins't a perfect solution:\n *\n * - This can cause leaks, like map nodes will keep all accessed field objects around. Since other things cause this same leak already, its not too bad.\n * - This does not cache the root.\n * - Finding the parent anchor to do the caching on has significant cost.\n *\n * Despite these limitations, this cache provides a large performance win in some common cases (over 10x), especially with how simple tree requests far more field objects than necessary currently.\n */\nconst fieldCache: WeakMap<LazyTreeNode, Map<FieldKey, FlexTreeField>> = new WeakMap();\n\nexport function makeField(\n\tcontext: Context,\n\tschema: FlexFieldSchema,\n\tcursor: ITreeSubscriptionCursor,\n): FlexTreeField {\n\tconst fieldAnchor = cursor.buildFieldAnchor();\n\tlet usedAnchor = false;\n\n\tconst makeFlexTreeField = (): FlexTreeField => {\n\t\tusedAnchor = true;\n\t\tconst field = new (kindToClass.get(schema.kind) ?? fail(\"missing field implementation\"))(\n\t\t\tcontext,\n\t\t\tschema,\n\t\t\tcursor,\n\t\t\tfieldAnchor,\n\t\t);\n\t\treturn field;\n\t};\n\n\tif (fieldAnchor.parent === undefined) {\n\t\treturn makeFlexTreeField();\n\t}\n\n\t// For the common case (all but roots), cache field associated with its node's anchor and field key.\n\tconst anchorNode =\n\t\tcontext.checkout.forest.anchors.locate(fieldAnchor.parent) ?? fail(\"missing anchor\");\n\n\t// Since anchor-set could be reused across a flex tree context getting disposed, key off the flex tree node not the anchor.\n\tconst cacheKey = anchorNode.slots.get(flexTreeSlot);\n\n\t// If there is no flex tree parent node, skip caching: this is not expected to be a hot path, but should probably be fixed at some point.\n\tif (cacheKey === undefined) {\n\t\treturn makeFlexTreeField();\n\t}\n\n\tconst innerCache = getOrCreate(\n\t\tfieldCache,\n\t\tcacheKey,\n\t\t() => new Map<FieldKey, FlexTreeField>(),\n\t);\n\tconst result = getOrCreate(innerCache, fieldAnchor.fieldKey, makeFlexTreeField);\n\tif (!usedAnchor) {\n\t\t// The anchor must be disposed to avoid leaking. In the case of a cache hit,\n\t\t// we are not transferring ownership to a new FlexTreeField, so it must be disposed of here to avoid the leak.\n\t\tcontext.checkout.forest.anchors.forget(fieldAnchor.parent);\n\t}\n\treturn result;\n}\n\n/**\n * Base type for fields implementing {@link FlexTreeField} using cursors.\n */\nexport abstract class LazyField<\n\t\tout TKind extends FlexFieldKind,\n\t\tTTypes extends FlexAllowedTypes,\n\t>\n\textends LazyEntity<FlexFieldSchema<TKind, TTypes>, FieldAnchor>\n\timplements FlexTreeField\n{\n\tpublic get [flexTreeMarker](): FlexTreeEntityKind.Field {\n\t\treturn FlexTreeEntityKind.Field;\n\t}\n\tpublic readonly key: FieldKey;\n\n\t/**\n\t * If this field ends its lifetime before the Anchor does, this needs to be invoked to avoid a double free\n\t * if/when the Anchor is destroyed.\n\t */\n\tprivate readonly offAfterDestroy?: () => void;\n\n\tpublic constructor(\n\t\tcontext: Context,\n\t\tschema: FlexFieldSchema<TKind, TTypes>,\n\t\tcursor: ITreeSubscriptionCursor,\n\t\tfieldAnchor: FieldAnchor,\n\t) {\n\t\tsuper(context, schema, cursor, fieldAnchor);\n\t\tassert(cursor.mode === CursorLocationType.Fields, 0x77b /* must be in fields mode */);\n\t\tthis.key = cursor.getFieldKey();\n\t\t// Fields currently live as long as their parent does.\n\t\t// For root fields, this means forever, but other cases can be cleaned up when their parent anchor is deleted.\n\t\tif (fieldAnchor.parent !== undefined) {\n\t\t\tconst anchorNode =\n\t\t\t\tcontext.checkout.forest.anchors.locate(fieldAnchor.parent) ??\n\t\t\t\tfail(\"parent anchor node should always exist since field is under a node\");\n\t\t\tthis.offAfterDestroy = anchorNode.on(\"afterDestroy\", () => {\n\t\t\t\tthis[disposeSymbol]();\n\t\t\t});\n\t\t}\n\t}\n\n\tpublic is<TSchema extends FlexFieldSchema>(\n\t\tschema: TSchema,\n\t): this is FlexTreeTypedField<TSchema> {\n\t\tassert(\n\t\t\tthis.context.schema.policy.fieldKinds.get(schema.kind.identifier) === schema.kind,\n\t\t\t0x77c /* Narrowing must be done to a kind that exists in this context */,\n\t\t);\n\n\t\treturn this.schema.equals(schema);\n\t}\n\n\tpublic get parent(): FlexTreeNode | undefined {\n\t\tif (this[anchorSymbol].parent === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst cursor = this[cursorSymbol];\n\t\tcursor.exitField();\n\t\tconst output = makeTree(this.context, cursor);\n\t\tcursor.enterField(this.key);\n\t\treturn output;\n\t}\n\n\tprotected override [tryMoveCursorToAnchorSymbol](\n\t\tcursor: ITreeSubscriptionCursor,\n\t): TreeNavigationResult {\n\t\treturn this.context.checkout.forest.tryMoveCursorToField(this[anchorSymbol], cursor);\n\t}\n\n\tprotected override [forgetAnchorSymbol](): void {\n\t\tthis.offAfterDestroy?.();\n\t\tif (this[anchorSymbol].parent === undefined) return;\n\t\tthis.context.checkout.forest.anchors.forget(this[anchorSymbol].parent);\n\t}\n\n\tpublic get length(): number {\n\t\treturn this[cursorSymbol].getFieldLength();\n\t}\n\n\tpublic atIndex(index: number): FlexTreeUnboxNodeUnion<TTypes> {\n\t\treturn inCursorNode(this[cursorSymbol], index, (cursor) =>\n\t\t\tunboxedUnion(this.context, this.schema, cursor),\n\t\t);\n\t}\n\n\tpublic boxedAt(index: number): FlexTreeTypedNodeUnion<TTypes> | undefined {\n\t\tconst finalIndex = indexForAt(index, this.length);\n\n\t\tif (finalIndex === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn inCursorNode(this[cursorSymbol], finalIndex, (cursor) =>\n\t\t\tmakeTree(this.context, cursor),\n\t\t) as unknown as FlexTreeTypedNodeUnion<TTypes>;\n\t}\n\n\tpublic map<U>(callbackfn: (value: FlexTreeUnboxNodeUnion<TTypes>, index: number) => U): U[] {\n\t\treturn Array.from(this, callbackfn);\n\t}\n\n\tpublic mapBoxed<U>(\n\t\tcallbackfn: (value: FlexTreeTypedNodeUnion<TTypes>, index: number) => U,\n\t): U[] {\n\t\treturn Array.from(this.boxedIterator(), callbackfn);\n\t}\n\n\tpublic boxedIterator(): IterableIterator<FlexTreeTypedNodeUnion<TTypes>> {\n\t\treturn iterateCursorField(\n\t\t\tthis[cursorSymbol],\n\t\t\t(cursor) => makeTree(this.context, cursor) as unknown as FlexTreeTypedNodeUnion<TTypes>,\n\t\t);\n\t}\n\n\tpublic [Symbol.iterator](): IterableIterator<FlexTreeUnboxNodeUnion<TTypes>> {\n\t\treturn iterateCursorField(this[cursorSymbol], (cursor) =>\n\t\t\tunboxedUnion(this.context, this.schema, cursor),\n\t\t);\n\t}\n\n\tpublic getFieldPath(): FieldUpPath {\n\t\treturn this[cursorSymbol].getFieldPath();\n\t}\n\n\t/**\n\t * Returns the path to this field to use for editing. Throws iff this path is not {@link TreeStatus#InDocument}.\n\t * This path is not valid to hold onto across edits: this must be recalled for each edit.\n\t */\n\tpublic getFieldPathForEditing(): FieldUpPath {\n\t\tif (!this[isFreedSymbol]()) {\n\t\t\tif (\n\t\t\t\t// Only allow editing if we are the root document field...\n\t\t\t\t(this.parent === undefined && this[anchorSymbol].fieldKey === rootFieldKey) ||\n\t\t\t\t// ...or are under a node in the document\n\t\t\t\t(this.parent !== undefined &&\n\t\t\t\t\ttreeStatusFromAnchorCache(this.parent.anchorNode) === TreeStatus.InDocument)\n\t\t\t) {\n\t\t\t\treturn this.getFieldPath();\n\t\t\t}\n\t\t}\n\n\t\tthrow new UsageError(\"Editing only allowed on fields with TreeStatus.InDocument status\");\n\t}\n}\n\nexport class LazySequence<TTypes extends FlexAllowedTypes>\n\textends LazyField<typeof FieldKinds.sequence, TTypes>\n\timplements FlexTreeSequenceField<TTypes>\n{\n\tpublic constructor(\n\t\tcontext: Context,\n\t\tschema: FlexFieldSchema<typeof FieldKinds.sequence, TTypes>,\n\t\tcursor: ITreeSubscriptionCursor,\n\t\tfieldAnchor: FieldAnchor,\n\t) {\n\t\tsuper(context, schema, cursor, fieldAnchor);\n\t}\n\n\tpublic at(index: number): FlexTreeUnboxNodeUnion<TTypes> | undefined {\n\t\tconst finalIndex = indexForAt(index, this.length);\n\n\t\tif (finalIndex === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn inCursorNode(this[cursorSymbol], finalIndex, (cursor) =>\n\t\t\tunboxedUnion(this.context, this.schema, cursor),\n\t\t);\n\t}\n\tpublic get asArray(): readonly FlexTreeUnboxNodeUnion<TTypes>[] {\n\t\treturn this.map((x) => x);\n\t}\n\n\tpublic editor: SequenceFieldEditBuilder<ExclusiveMapTree[]> = {\n\t\tinsert: (index, newContent) => {\n\t\t\tthis.sequenceEditor().insert(index, cursorForMapTreeField(newContent));\n\t\t},\n\t\tremove: (index, count) => {\n\t\t\tthis.sequenceEditor().remove(index, count);\n\t\t},\n\t};\n\n\tprivate sequenceEditor(): SequenceFieldEditBuilder<ITreeCursorSynchronous> {\n\t\tconst fieldPath = this.getFieldPathForEditing();\n\t\treturn this.context.checkout.editor.sequenceField(fieldPath);\n\t}\n}\n\nexport class ReadonlyLazyValueField<TTypes extends FlexAllowedTypes>\n\textends LazyField<typeof FieldKinds.required, TTypes>\n\timplements FlexTreeRequiredField<TTypes>\n{\n\tpublic constructor(\n\t\tcontext: Context,\n\t\tschema: FlexFieldSchema<typeof FieldKinds.required, TTypes>,\n\t\tcursor: ITreeSubscriptionCursor,\n\t\tfieldAnchor: FieldAnchor,\n\t) {\n\t\tsuper(context, schema, cursor, fieldAnchor);\n\t}\n\n\tpublic editor: ValueFieldEditBuilder<ExclusiveMapTree> = {\n\t\tset: (newContent) => {\n\t\t\tassert(false, 0xa0c /* Unexpected set of readonly field */);\n\t\t},\n\t};\n\n\tpublic get content(): FlexTreeUnboxNodeUnion<TTypes> {\n\t\treturn this.atIndex(0);\n\t}\n}\n\nexport class LazyValueField<TTypes extends FlexAllowedTypes>\n\textends ReadonlyLazyValueField<TTypes>\n\timplements FlexTreeRequiredField<TTypes>\n{\n\tpublic constructor(\n\t\tcontext: Context,\n\t\tschema: FlexFieldSchema<typeof FieldKinds.required, TTypes>,\n\t\tcursor: ITreeSubscriptionCursor,\n\t\tfieldAnchor: FieldAnchor,\n\t) {\n\t\tsuper(context, schema, cursor, fieldAnchor);\n\t}\n\n\tpublic override editor: ValueFieldEditBuilder<ExclusiveMapTree> = {\n\t\tset: (newContent) => {\n\t\t\tthis.valueFieldEditor().set(cursorForMapTreeNode(newContent));\n\t\t},\n\t};\n\n\tprivate valueFieldEditor(): ValueFieldEditBuilder<ITreeCursorSynchronous> {\n\t\tconst fieldPath = this.getFieldPathForEditing();\n\t\tconst fieldEditor = this.context.checkout.editor.valueField(fieldPath);\n\t\treturn fieldEditor;\n\t}\n\n\tpublic override get content(): FlexTreeUnboxNodeUnion<TTypes> {\n\t\treturn this.atIndex(0);\n\t}\n}\n\nexport class LazyIdentifierField<TTypes extends FlexAllowedTypes>\n\textends ReadonlyLazyValueField<TTypes>\n\timplements FlexTreeRequiredField<TTypes>\n{\n\tpublic constructor(\n\t\tcontext: Context,\n\t\tschema: FlexFieldSchema<typeof FieldKinds.required, TTypes>,\n\t\tcursor: ITreeSubscriptionCursor,\n\t\tfieldAnchor: FieldAnchor,\n\t) {\n\t\tsuper(context, schema, cursor, fieldAnchor);\n\t}\n}\n\nexport class LazyOptionalField<TTypes extends FlexAllowedTypes>\n\textends LazyField<typeof FieldKinds.optional, TTypes>\n\timplements FlexTreeOptionalField<TTypes>\n{\n\tpublic constructor(\n\t\tcontext: Context,\n\t\tschema: FlexFieldSchema<typeof FieldKinds.optional, TTypes>,\n\t\tcursor: ITreeSubscriptionCursor,\n\t\tfieldAnchor: FieldAnchor,\n\t) {\n\t\tsuper(context, schema, cursor, fieldAnchor);\n\t}\n\n\tpublic editor: OptionalFieldEditBuilder<ExclusiveMapTree> = {\n\t\tset: (newContent, wasEmpty) => {\n\t\t\tthis.optionalEditor().set(\n\t\t\t\tnewContent !== undefined ? cursorForMapTreeNode(newContent) : newContent,\n\t\t\t\twasEmpty,\n\t\t\t);\n\t\t},\n\t};\n\n\tprivate optionalEditor(): OptionalFieldEditBuilder<ITreeCursorSynchronous> {\n\t\tconst fieldPath = this.getFieldPathForEditing();\n\t\tconst fieldEditor = this.context.checkout.editor.optionalField(fieldPath);\n\t\treturn fieldEditor;\n\t}\n\n\tpublic get content(): FlexTreeUnboxNodeUnion<TTypes> | undefined {\n\t\treturn this.length === 0 ? undefined : this.atIndex(0);\n\t}\n}\n\nexport class LazyForbiddenField<TTypes extends FlexAllowedTypes> extends LazyField<\n\ttypeof FieldKinds.forbidden,\n\tTTypes\n> {}\n\ntype Builder = new <TTypes extends FlexAllowedTypes>(\n\tcontext: Context,\n\t// Correct use of these builders requires the builder of the matching type to be used.\n\t// Since this has to be done at runtime anyway, trying to use safer typing than `any` here (such as `never`, which is only slightly safer)\n\t// does not seem worth it (ends up requiring type casts that are just as unsafe).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tschema: FlexFieldSchema<any, TTypes>,\n\tcursor: ITreeSubscriptionCursor,\n\tfieldAnchor: FieldAnchor,\n) => LazyField<FlexFieldKind, TTypes>;\n\nconst builderList: [FlexFieldKind, Builder][] = [\n\t[FieldKinds.forbidden, LazyForbiddenField],\n\t[FieldKinds.optional, LazyOptionalField],\n\t[FieldKinds.sequence, LazySequence],\n\t[FieldKinds.required, LazyValueField],\n\t[FieldKinds.identifier, LazyIdentifierField],\n];\n\nconst kindToClass: ReadonlyMap<FlexFieldKind, Builder> = new Map(builderList);\n"]}
|
|
1
|
+
{"version":3,"file":"lazyField.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/lazyField.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAE7D,OAAO,EASN,YAAY,EACZ,kBAAkB,EAClB,YAAY,GACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EACN,UAAU,GAIV,MAAM,4BAA4B,CAAC;AAKpC,OAAO,EACN,kBAAkB,EASlB,UAAU,EACV,cAAc,EACd,YAAY,GACZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,2BAA2B,GAC3B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAqB,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAElF;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,GAAwD,IAAI,OAAO,EAAE,CAAC;AAEtF,MAAM,UAAU,SAAS,CACxB,OAAgB,EAChB,MAAuB,EACvB,MAA+B;IAE/B,MAAM,WAAW,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;IAC9C,IAAI,UAAU,GAAG,KAAK,CAAC;IAEvB,MAAM,iBAAiB,GAAG,GAAkB,EAAE;QAC7C,UAAU,GAAG,IAAI,CAAC;QAClB,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,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AA+C;YAC3D,GAAG,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,EAAE;gBAC7B,IAAI,CAAC,cAAc,EAAE,CAAC,GAAG,CACxB,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,EACxE,QAAQ,CACR,CAAC;YACH,CAAC;SACD,CAAC;IATF,CAAC;IAWO,cAAc;QACrB,MAAM,SAAS,GAAG,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAChD,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;QAC1E,OAAO,WAAW,CAAC;IACpB,CAAC;IAED,IAAW,OAAO;QACjB,OAAO,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACxD,CAAC;CACD;AAED,MAAM,OAAO,kBAAoD,SAAQ,SAGxE;CAAG;AAaJ,MAAM,WAAW,GAA+B;IAC/C,CAAC,UAAU,CAAC,SAAS,EAAE,kBAAkB,CAAC;IAC1C,CAAC,UAAU,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACxC,CAAC,UAAU,CAAC,QAAQ,EAAE,YAAY,CAAC;IACnC,CAAC,UAAU,CAAC,QAAQ,EAAE,cAAc,CAAC;IACrC,CAAC,UAAU,CAAC,UAAU,EAAE,mBAAmB,CAAC;CAC5C,CAAC;AAEF,MAAM,WAAW,GAAwC,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tCursorLocationType,\n\ttype ExclusiveMapTree,\n\ttype FieldAnchor,\n\ttype FieldKey,\n\ttype FieldUpPath,\n\ttype ITreeCursorSynchronous,\n\ttype ITreeSubscriptionCursor,\n\ttype TreeNavigationResult,\n\tinCursorNode,\n\titerateCursorField,\n\trootFieldKey,\n} from \"../../core/index.js\";\nimport { disposeSymbol, fail, getOrCreate } from \"../../util/index.js\";\nimport {\n\tFieldKinds,\n\ttype OptionalFieldEditBuilder,\n\ttype SequenceFieldEditBuilder,\n\ttype ValueFieldEditBuilder,\n} from \"../default-schema/index.js\";\nimport type { FlexFieldKind } from \"../modular-schema/index.js\";\nimport type { FlexAllowedTypes, FlexFieldSchema } from \"../typed-schema/index.js\";\n\nimport type { Context } from \"./context.js\";\nimport {\n\tFlexTreeEntityKind,\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeTypedNodeUnion,\n\ttype FlexTreeUnboxNodeUnion,\n\tTreeStatus,\n\tflexTreeMarker,\n\tflexTreeSlot,\n} from \"./flexTreeTypes.js\";\nimport {\n\tLazyEntity,\n\tanchorSymbol,\n\tcursorSymbol,\n\tforgetAnchorSymbol,\n\tisFreedSymbol,\n\ttryMoveCursorToAnchorSymbol,\n} from \"./lazyEntity.js\";\nimport { type LazyTreeNode, makeTree } from \"./lazyNode.js\";\nimport { unboxedUnion } from \"./unboxed.js\";\nimport { indexForAt, treeStatusFromAnchorCache } from \"./utilities.js\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { cursorForMapTreeField, cursorForMapTreeNode } from \"../mapTreeCursor.js\";\n\n/**\n * Reuse fields.\n * Since field currently own cursors and register themselves for disposal when the node hit end of life,\n * not reusing them results in memory leaks every time the field is accessed.\n * Since the fields stay alive until the node is end of life reusing them this way is safe.\n *\n * This ins't a perfect solution:\n *\n * - This can cause leaks, like map nodes will keep all accessed field objects around. Since other things cause this same leak already, its not too bad.\n * - This does not cache the root.\n * - Finding the parent anchor to do the caching on has significant cost.\n *\n * Despite these limitations, this cache provides a large performance win in some common cases (over 10x), especially with how simple tree requests far more field objects than necessary currently.\n */\nconst fieldCache: WeakMap<LazyTreeNode, Map<FieldKey, FlexTreeField>> = new WeakMap();\n\nexport function makeField(\n\tcontext: Context,\n\tschema: FlexFieldSchema,\n\tcursor: ITreeSubscriptionCursor,\n): FlexTreeField {\n\tconst fieldAnchor = cursor.buildFieldAnchor();\n\tlet usedAnchor = false;\n\n\tconst makeFlexTreeField = (): FlexTreeField => {\n\t\tusedAnchor = true;\n\t\tconst field = new (kindToClass.get(schema.kind) ?? fail(\"missing field implementation\"))(\n\t\t\tcontext,\n\t\t\tschema,\n\t\t\tcursor,\n\t\t\tfieldAnchor,\n\t\t);\n\t\treturn field;\n\t};\n\n\tif (fieldAnchor.parent === undefined) {\n\t\treturn makeFlexTreeField();\n\t}\n\n\t// For the common case (all but roots), cache field associated with its node's anchor and field key.\n\tconst anchorNode =\n\t\tcontext.checkout.forest.anchors.locate(fieldAnchor.parent) ?? fail(\"missing anchor\");\n\n\t// Since anchor-set could be reused across a flex tree context getting disposed, key off the flex tree node not the anchor.\n\tconst cacheKey = anchorNode.slots.get(flexTreeSlot);\n\n\t// If there is no flex tree parent node, skip caching: this is not expected to be a hot path, but should probably be fixed at some point.\n\tif (cacheKey === undefined) {\n\t\treturn makeFlexTreeField();\n\t}\n\n\tconst innerCache = getOrCreate(\n\t\tfieldCache,\n\t\tcacheKey,\n\t\t() => new Map<FieldKey, FlexTreeField>(),\n\t);\n\tconst result = getOrCreate(innerCache, fieldAnchor.fieldKey, makeFlexTreeField);\n\tif (!usedAnchor) {\n\t\t// The anchor must be disposed to avoid leaking. In the case of a cache hit,\n\t\t// we are not transferring ownership to a new FlexTreeField, so it must be disposed of here to avoid the leak.\n\t\tcontext.checkout.forest.anchors.forget(fieldAnchor.parent);\n\t}\n\treturn result;\n}\n\n/**\n * Base type for fields implementing {@link FlexTreeField} using cursors.\n */\nexport abstract class LazyField<\n\t\tout TKind extends FlexFieldKind,\n\t\tTTypes extends FlexAllowedTypes,\n\t>\n\textends LazyEntity<FlexFieldSchema<TKind, TTypes>, FieldAnchor>\n\timplements FlexTreeField\n{\n\tpublic get [flexTreeMarker](): FlexTreeEntityKind.Field {\n\t\treturn FlexTreeEntityKind.Field;\n\t}\n\tpublic readonly key: FieldKey;\n\n\t/**\n\t * If this field ends its lifetime before the Anchor does, this needs to be invoked to avoid a double free\n\t * if/when the Anchor is destroyed.\n\t */\n\tprivate readonly offAfterDestroy?: () => void;\n\n\tpublic constructor(\n\t\tcontext: Context,\n\t\tschema: FlexFieldSchema<TKind, TTypes>,\n\t\tcursor: ITreeSubscriptionCursor,\n\t\tfieldAnchor: FieldAnchor,\n\t) {\n\t\tsuper(context, schema, cursor, fieldAnchor);\n\t\tassert(cursor.mode === CursorLocationType.Fields, 0x77b /* must be in fields mode */);\n\t\tthis.key = cursor.getFieldKey();\n\t\t// Fields currently live as long as their parent does.\n\t\t// For root fields, this means forever, but other cases can be cleaned up when their parent anchor is deleted.\n\t\tif (fieldAnchor.parent !== undefined) {\n\t\t\tconst anchorNode =\n\t\t\t\tcontext.checkout.forest.anchors.locate(fieldAnchor.parent) ??\n\t\t\t\tfail(\"parent anchor node should always exist since field is under a node\");\n\t\t\tthis.offAfterDestroy = anchorNode.on(\"afterDestroy\", () => {\n\t\t\t\tthis[disposeSymbol]();\n\t\t\t});\n\t\t}\n\t}\n\n\tpublic is<TSchema extends FlexFieldSchema>(\n\t\tschema: TSchema,\n\t): this is FlexTreeTypedField<TSchema> {\n\t\tassert(\n\t\t\tthis.context.schema.policy.fieldKinds.get(schema.kind.identifier) === schema.kind,\n\t\t\t0x77c /* Narrowing must be done to a kind that exists in this context */,\n\t\t);\n\n\t\treturn this.schema.equals(schema);\n\t}\n\n\tpublic get parent(): FlexTreeNode | undefined {\n\t\tif (this[anchorSymbol].parent === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst cursor = this[cursorSymbol];\n\t\tcursor.exitField();\n\t\tconst output = makeTree(this.context, cursor);\n\t\tcursor.enterField(this.key);\n\t\treturn output;\n\t}\n\n\tprotected override [tryMoveCursorToAnchorSymbol](\n\t\tcursor: ITreeSubscriptionCursor,\n\t): TreeNavigationResult {\n\t\treturn this.context.checkout.forest.tryMoveCursorToField(this[anchorSymbol], cursor);\n\t}\n\n\tprotected override [forgetAnchorSymbol](): void {\n\t\tthis.offAfterDestroy?.();\n\t\tif (this[anchorSymbol].parent === undefined) return;\n\t\tthis.context.checkout.forest.anchors.forget(this[anchorSymbol].parent);\n\t}\n\n\tpublic get length(): number {\n\t\treturn this[cursorSymbol].getFieldLength();\n\t}\n\n\tpublic atIndex(index: number): FlexTreeUnboxNodeUnion<TTypes> {\n\t\treturn inCursorNode(this[cursorSymbol], index, (cursor) =>\n\t\t\tunboxedUnion(this.context, this.schema, cursor),\n\t\t);\n\t}\n\n\tpublic boxedAt(index: number): FlexTreeTypedNodeUnion<TTypes> | undefined {\n\t\tconst finalIndex = indexForAt(index, this.length);\n\n\t\tif (finalIndex === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn inCursorNode(this[cursorSymbol], finalIndex, (cursor) =>\n\t\t\tmakeTree(this.context, cursor),\n\t\t) as unknown as FlexTreeTypedNodeUnion<TTypes>;\n\t}\n\n\tpublic map<U>(callbackfn: (value: FlexTreeUnboxNodeUnion<TTypes>, index: number) => U): U[] {\n\t\treturn Array.from(this, callbackfn);\n\t}\n\n\tpublic boxedIterator(): IterableIterator<FlexTreeTypedNodeUnion<TTypes>> {\n\t\treturn iterateCursorField(\n\t\t\tthis[cursorSymbol],\n\t\t\t(cursor) => makeTree(this.context, cursor) as unknown as FlexTreeTypedNodeUnion<TTypes>,\n\t\t);\n\t}\n\n\tpublic [Symbol.iterator](): IterableIterator<FlexTreeUnboxNodeUnion<TTypes>> {\n\t\treturn iterateCursorField(this[cursorSymbol], (cursor) =>\n\t\t\tunboxedUnion(this.context, this.schema, cursor),\n\t\t);\n\t}\n\n\tpublic getFieldPath(): FieldUpPath {\n\t\treturn this[cursorSymbol].getFieldPath();\n\t}\n\n\t/**\n\t * Returns the path to this field to use for editing. Throws iff this path is not {@link TreeStatus#InDocument}.\n\t * This path is not valid to hold onto across edits: this must be recalled for each edit.\n\t */\n\tpublic getFieldPathForEditing(): FieldUpPath {\n\t\tif (!this[isFreedSymbol]()) {\n\t\t\tif (\n\t\t\t\t// Only allow editing if we are the root document field...\n\t\t\t\t(this.parent === undefined && this[anchorSymbol].fieldKey === rootFieldKey) ||\n\t\t\t\t// ...or are under a node in the document\n\t\t\t\t(this.parent !== undefined &&\n\t\t\t\t\ttreeStatusFromAnchorCache(this.parent.anchorNode) === TreeStatus.InDocument)\n\t\t\t) {\n\t\t\t\treturn this.getFieldPath();\n\t\t\t}\n\t\t}\n\n\t\tthrow new UsageError(\"Editing only allowed on fields with TreeStatus.InDocument status\");\n\t}\n}\n\nexport class LazySequence<TTypes extends FlexAllowedTypes>\n\textends LazyField<typeof FieldKinds.sequence, TTypes>\n\timplements FlexTreeSequenceField<TTypes>\n{\n\tpublic constructor(\n\t\tcontext: Context,\n\t\tschema: FlexFieldSchema<typeof FieldKinds.sequence, TTypes>,\n\t\tcursor: ITreeSubscriptionCursor,\n\t\tfieldAnchor: FieldAnchor,\n\t) {\n\t\tsuper(context, schema, cursor, fieldAnchor);\n\t}\n\n\tpublic at(index: number): FlexTreeUnboxNodeUnion<TTypes> | undefined {\n\t\tconst finalIndex = indexForAt(index, this.length);\n\n\t\tif (finalIndex === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn inCursorNode(this[cursorSymbol], finalIndex, (cursor) =>\n\t\t\tunboxedUnion(this.context, this.schema, cursor),\n\t\t);\n\t}\n\tpublic get asArray(): readonly FlexTreeUnboxNodeUnion<TTypes>[] {\n\t\treturn this.map((x) => x);\n\t}\n\n\tpublic editor: SequenceFieldEditBuilder<ExclusiveMapTree[]> = {\n\t\tinsert: (index, newContent) => {\n\t\t\tthis.sequenceEditor().insert(index, cursorForMapTreeField(newContent));\n\t\t},\n\t\tremove: (index, count) => {\n\t\t\tthis.sequenceEditor().remove(index, count);\n\t\t},\n\t};\n\n\tprivate sequenceEditor(): SequenceFieldEditBuilder<ITreeCursorSynchronous> {\n\t\tconst fieldPath = this.getFieldPathForEditing();\n\t\treturn this.context.checkout.editor.sequenceField(fieldPath);\n\t}\n}\n\nexport class ReadonlyLazyValueField<TTypes extends FlexAllowedTypes>\n\textends LazyField<typeof FieldKinds.required, TTypes>\n\timplements FlexTreeRequiredField<TTypes>\n{\n\tpublic constructor(\n\t\tcontext: Context,\n\t\tschema: FlexFieldSchema<typeof FieldKinds.required, TTypes>,\n\t\tcursor: ITreeSubscriptionCursor,\n\t\tfieldAnchor: FieldAnchor,\n\t) {\n\t\tsuper(context, schema, cursor, fieldAnchor);\n\t}\n\n\tpublic editor: ValueFieldEditBuilder<ExclusiveMapTree> = {\n\t\tset: (newContent) => {\n\t\t\tassert(false, 0xa0c /* Unexpected set of readonly field */);\n\t\t},\n\t};\n\n\tpublic get content(): FlexTreeUnboxNodeUnion<TTypes> {\n\t\treturn this.atIndex(0);\n\t}\n}\n\nexport class LazyValueField<TTypes extends FlexAllowedTypes>\n\textends ReadonlyLazyValueField<TTypes>\n\timplements FlexTreeRequiredField<TTypes>\n{\n\tpublic constructor(\n\t\tcontext: Context,\n\t\tschema: FlexFieldSchema<typeof FieldKinds.required, TTypes>,\n\t\tcursor: ITreeSubscriptionCursor,\n\t\tfieldAnchor: FieldAnchor,\n\t) {\n\t\tsuper(context, schema, cursor, fieldAnchor);\n\t}\n\n\tpublic override editor: ValueFieldEditBuilder<ExclusiveMapTree> = {\n\t\tset: (newContent) => {\n\t\t\tthis.valueFieldEditor().set(cursorForMapTreeNode(newContent));\n\t\t},\n\t};\n\n\tprivate valueFieldEditor(): ValueFieldEditBuilder<ITreeCursorSynchronous> {\n\t\tconst fieldPath = this.getFieldPathForEditing();\n\t\tconst fieldEditor = this.context.checkout.editor.valueField(fieldPath);\n\t\treturn fieldEditor;\n\t}\n\n\tpublic override get content(): FlexTreeUnboxNodeUnion<TTypes> {\n\t\treturn this.atIndex(0);\n\t}\n}\n\nexport class LazyIdentifierField<TTypes extends FlexAllowedTypes>\n\textends ReadonlyLazyValueField<TTypes>\n\timplements FlexTreeRequiredField<TTypes>\n{\n\tpublic constructor(\n\t\tcontext: Context,\n\t\tschema: FlexFieldSchema<typeof FieldKinds.required, TTypes>,\n\t\tcursor: ITreeSubscriptionCursor,\n\t\tfieldAnchor: FieldAnchor,\n\t) {\n\t\tsuper(context, schema, cursor, fieldAnchor);\n\t}\n}\n\nexport class LazyOptionalField<TTypes extends FlexAllowedTypes>\n\textends LazyField<typeof FieldKinds.optional, TTypes>\n\timplements FlexTreeOptionalField<TTypes>\n{\n\tpublic constructor(\n\t\tcontext: Context,\n\t\tschema: FlexFieldSchema<typeof FieldKinds.optional, TTypes>,\n\t\tcursor: ITreeSubscriptionCursor,\n\t\tfieldAnchor: FieldAnchor,\n\t) {\n\t\tsuper(context, schema, cursor, fieldAnchor);\n\t}\n\n\tpublic editor: OptionalFieldEditBuilder<ExclusiveMapTree> = {\n\t\tset: (newContent, wasEmpty) => {\n\t\t\tthis.optionalEditor().set(\n\t\t\t\tnewContent !== undefined ? cursorForMapTreeNode(newContent) : newContent,\n\t\t\t\twasEmpty,\n\t\t\t);\n\t\t},\n\t};\n\n\tprivate optionalEditor(): OptionalFieldEditBuilder<ITreeCursorSynchronous> {\n\t\tconst fieldPath = this.getFieldPathForEditing();\n\t\tconst fieldEditor = this.context.checkout.editor.optionalField(fieldPath);\n\t\treturn fieldEditor;\n\t}\n\n\tpublic get content(): FlexTreeUnboxNodeUnion<TTypes> | undefined {\n\t\treturn this.length === 0 ? undefined : this.atIndex(0);\n\t}\n}\n\nexport class LazyForbiddenField<TTypes extends FlexAllowedTypes> extends LazyField<\n\ttypeof FieldKinds.forbidden,\n\tTTypes\n> {}\n\ntype Builder = new <TTypes extends FlexAllowedTypes>(\n\tcontext: Context,\n\t// Correct use of these builders requires the builder of the matching type to be used.\n\t// Since this has to be done at runtime anyway, trying to use safer typing than `any` here (such as `never`, which is only slightly safer)\n\t// does not seem worth it (ends up requiring type casts that are just as unsafe).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tschema: FlexFieldSchema<any, TTypes>,\n\tcursor: ITreeSubscriptionCursor,\n\tfieldAnchor: FieldAnchor,\n) => LazyField<FlexFieldKind, TTypes>;\n\nconst builderList: [FlexFieldKind, Builder][] = [\n\t[FieldKinds.forbidden, LazyForbiddenField],\n\t[FieldKinds.optional, LazyOptionalField],\n\t[FieldKinds.sequence, LazySequence],\n\t[FieldKinds.required, LazyValueField],\n\t[FieldKinds.identifier, LazyIdentifierField],\n];\n\nconst kindToClass: ReadonlyMap<FlexFieldKind, Builder> = new Map(builderList);\n"]}
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { type Anchor, type AnchorNode, type FieldKey, type ITreeSubscriptionCursor, type TreeNavigationResult, type TreeNodeSchemaIdentifier, type TreeValue, type Value } from "../../core/index.js";
|
|
6
|
-
import { type FlexMapNodeSchema, type
|
|
6
|
+
import { type FlexMapNodeSchema, type FlexTreeNodeSchema, type LeafNodeSchema } from "../typed-schema/index.js";
|
|
7
7
|
import type { Context } from "./context.js";
|
|
8
|
-
import { FlexTreeEntityKind, type FlexTreeField, type FlexTreeLeafNode, type FlexTreeMapNode, type FlexTreeNode, type
|
|
8
|
+
import { FlexTreeEntityKind, type FlexTreeField, type FlexTreeLeafNode, type FlexTreeMapNode, type FlexTreeNode, type FlexTreeTypedField, type FlexTreeTypedNode, type FlexTreeUnboxField, flexTreeMarker } from "./flexTreeTypes.js";
|
|
9
9
|
import { LazyEntity, forgetAnchorSymbol, tryMoveCursorToAnchorSymbol } from "./lazyEntity.js";
|
|
10
10
|
/**
|
|
11
11
|
* @param cursor - This does not take ownership of this cursor: Node will fork it as needed.
|
|
@@ -14,7 +14,7 @@ export declare function makeTree(context: Context, cursor: ITreeSubscriptionCurs
|
|
|
14
14
|
/**
|
|
15
15
|
* Lazy implementation of {@link FlexTreeNode}.
|
|
16
16
|
*/
|
|
17
|
-
export declare
|
|
17
|
+
export declare class LazyTreeNode<TSchema extends FlexTreeNodeSchema = FlexTreeNodeSchema> extends LazyEntity<TSchema, Anchor> implements FlexTreeNode {
|
|
18
18
|
#private;
|
|
19
19
|
readonly anchorNode: AnchorNode;
|
|
20
20
|
get [flexTreeMarker](): FlexTreeEntityKind.Node;
|
|
@@ -45,7 +45,6 @@ export declare class LazyMap<TSchema extends FlexMapNodeSchema> extends LazyTree
|
|
|
45
45
|
]>;
|
|
46
46
|
forEach(callbackFn: (value: FlexTreeUnboxField<TSchema["info"], "notEmpty">, key: FieldKey, map: FlexTreeMapNode<TSchema>) => void, thisArg?: unknown): void;
|
|
47
47
|
getBoxed(key: string): FlexTreeTypedField<TSchema["info"]>;
|
|
48
|
-
boxedIterator(): IterableIterator<FlexTreeTypedField<TSchema["info"]>>;
|
|
49
48
|
[Symbol.iterator](): IterableIterator<[
|
|
50
49
|
FieldKey,
|
|
51
50
|
FlexTreeUnboxField<TSchema["info"], "notEmpty">
|
|
@@ -55,10 +54,4 @@ export declare class LazyLeaf<TSchema extends LeafNodeSchema> extends LazyTreeNo
|
|
|
55
54
|
constructor(context: Context, schema: TSchema, cursor: ITreeSubscriptionCursor, anchorNode: AnchorNode, anchor: Anchor);
|
|
56
55
|
get value(): TreeValue<TSchema["info"]>;
|
|
57
56
|
}
|
|
58
|
-
/**
|
|
59
|
-
* {@link reservedObjectNodeFieldPropertyNames} but as a set.
|
|
60
|
-
*/
|
|
61
|
-
export declare const reservedObjectNodeFieldPropertyNameSet: ReadonlySet<string>;
|
|
62
|
-
export declare function propertyNameFromFieldKey<T extends string>(key: T): PropertyNameFromFieldKey<T>;
|
|
63
|
-
export declare function buildLazyObjectNode<TSchema extends FlexObjectNodeSchema>(context: Context, schema: TSchema, cursor: ITreeSubscriptionCursor, anchorNode: AnchorNode, anchor: Anchor): LazyTreeNode<TSchema> & FlexTreeObjectNodeTyped<TSchema>;
|
|
64
57
|
//# sourceMappingURL=lazyNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazyNode.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/lazyNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,KAAK,MAAM,EACX,KAAK,UAAU,EAEf,KAAK,QAAQ,EACb,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,SAAS,EACd,KAAK,KAAK,EAIV,MAAM,qBAAqB,CAAC;AAG7B,OAAO,
|
|
1
|
+
{"version":3,"file":"lazyNode.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/lazyNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,KAAK,MAAM,EACX,KAAK,UAAU,EAEf,KAAK,QAAQ,EACb,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,SAAS,EACd,KAAK,KAAK,EAIV,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAGN,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EAInB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EACN,kBAAkB,EAClB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,cAAc,EAEd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,UAAU,EAGV,kBAAkB,EAClB,2BAA2B,EAC3B,MAAM,iBAAiB,CAAC;AAIzB;;GAEG;AACH,w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AE,UAAU,EACtB,MAAM,EAAE,MAAM;IAKR,IAAI,IAAI,gBAAgB,CAAC,QAAQ,CAAC;IAIlC,MAAM,IAAI,gBAAgB,CAAC,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,CAAC;IAW3E,OAAO,IAAI,gBAAgB,CACjC;QAAC,QAAQ;QAAE,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC;KAAC,CAC3D;IAaM,OAAO,CACb,UAAU,EAAE,CACX,KAAK,EAAE,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,EACtD,GAAG,EAAE,QAAQ,EACb,GAAG,EAAE,eAAe,CAAC,OAAO,CAAC,KACzB,IAAI,EACT,OAAO,CAAC,EAAE,OAAO,GACf,IAAI;IAOS,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAInE,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,gBAAgB,CAC3C;QAAC,QAAQ;QAAE,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC;KAAC,CAC3D;CAGD;AAED,qBAAa,QAAQ,CAAC,OAAO,SAAS,cAAc,CACnD,SAAQ,YAAY,CAAC,OAAO,CAC5B,YAAW,gBAAgB,CAAC,OAAO,CAAC;gBAGnC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,uBAAuB,EAC/B,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM;IAKf,IAAoB,KAAK,IAAI,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAEtD;CACD"}
|
|
@@ -16,10 +16,10 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
16
16
|
var _LazyTreeNode_removeDeleteCallback;
|
|
17
17
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
18
18
|
import { inCursorField, mapCursorFields, rootFieldKey, } from "../../core/index.js";
|
|
19
|
-
import { brand,
|
|
19
|
+
import { brand, disposeSymbol, fail } from "../../util/index.js";
|
|
20
20
|
import { FieldKinds } from "../default-schema/index.js";
|
|
21
21
|
import { Any, FlexFieldSchema, schemaIsLeaf, schemaIsMap, schemaIsObjectNode, } from "../typed-schema/index.js";
|
|
22
|
-
import { FlexTreeEntityKind, flexTreeMarker, flexTreeSlot,
|
|
22
|
+
import { FlexTreeEntityKind, flexTreeMarker, flexTreeSlot, } from "./flexTreeTypes.js";
|
|
23
23
|
import { LazyEntity, anchorSymbol, cursorSymbol, forgetAnchorSymbol, tryMoveCursorToAnchorSymbol, } from "./lazyEntity.js";
|
|
24
24
|
import { makeField } from "./lazyField.js";
|
|
25
25
|
import { unboxedField } from "./unboxed.js";
|
|
@@ -53,7 +53,7 @@ function buildSubclass(context, schema, cursor, anchorNode, anchor) {
|
|
|
53
53
|
return new LazyLeaf(context, schema, cursor, anchorNode, anchor);
|
|
54
54
|
}
|
|
55
55
|
if (schemaIsObjectNode(schema)) {
|
|
56
|
-
return
|
|
56
|
+
return new LazyTreeNode(context, schema, cursor, anchorNode, anchor);
|
|
57
57
|
}
|
|
58
58
|
// TODO: there should be a common fallback that works for cases without a specialized implementation.
|
|
59
59
|
fail("unrecognized node kind");
|
|
@@ -182,9 +182,6 @@ export class LazyMap extends LazyTreeNode {
|
|
|
182
182
|
getBoxed(key) {
|
|
183
183
|
return super.getBoxed(brand(key));
|
|
184
184
|
}
|
|
185
|
-
boxedIterator() {
|
|
186
|
-
return super.boxedIterator();
|
|
187
|
-
}
|
|
188
185
|
[Symbol.iterator]() {
|
|
189
186
|
return this.entries();
|
|
190
187
|
}
|
|
@@ -197,89 +194,9 @@ export class LazyLeaf extends LazyTreeNode {
|
|
|
197
194
|
return super.value;
|
|
198
195
|
}
|
|
199
196
|
}
|
|
200
|
-
/**
|
|
201
|
-
* {@link reservedObjectNodeFieldPropertyNames} but as a set.
|
|
202
|
-
*/
|
|
203
|
-
export const reservedObjectNodeFieldPropertyNameSet = new Set(reservedObjectNodeFieldPropertyNames);
|
|
204
|
-
export function propertyNameFromFieldKey(key) {
|
|
205
|
-
if (reservedObjectNodeFieldPropertyNameSet.has(key)) {
|
|
206
|
-
return `field${capitalize(key)}`;
|
|
207
|
-
}
|
|
208
|
-
for (const prefix of reservedObjectNodeFieldPropertyNamePrefixes) {
|
|
209
|
-
if (key.startsWith(prefix)) {
|
|
210
|
-
const afterPrefix = key.slice(prefix.length);
|
|
211
|
-
if (afterPrefix === capitalize(afterPrefix)) {
|
|
212
|
-
return `field${capitalize(key)}`;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
return key;
|
|
217
|
-
}
|
|
218
|
-
export function buildLazyObjectNode(context, schema, cursor, anchorNode, anchor) {
|
|
219
|
-
const objectNodeClass = getOrCreate(cachedStructClasses, schema, () => buildStructClass(schema));
|
|
220
|
-
return new objectNodeClass(context, cursor, anchorNode, anchor);
|
|
221
|
-
}
|
|
222
|
-
const cachedStructClasses = new WeakMap();
|
|
223
197
|
function getBoxedField(objectNode, key, fieldSchema) {
|
|
224
198
|
return inCursorField(objectNode[cursorSymbol], key, (cursor) => {
|
|
225
199
|
return makeField(objectNode.context, fieldSchema, cursor);
|
|
226
200
|
});
|
|
227
201
|
}
|
|
228
|
-
function buildStructClass(schema) {
|
|
229
|
-
const propertyDescriptorMap = {};
|
|
230
|
-
for (const [key, fieldSchema] of schema.objectNodeFields) {
|
|
231
|
-
const escapedKey = propertyNameFromFieldKey(key);
|
|
232
|
-
let setter;
|
|
233
|
-
switch (fieldSchema.kind) {
|
|
234
|
-
case FieldKinds.optional: {
|
|
235
|
-
setter = function (newContent) {
|
|
236
|
-
const field = getBoxedField(this, key, fieldSchema);
|
|
237
|
-
field.editor.set(newContent, field.length === 0);
|
|
238
|
-
};
|
|
239
|
-
break;
|
|
240
|
-
}
|
|
241
|
-
case FieldKinds.required: {
|
|
242
|
-
setter = function (newContent) {
|
|
243
|
-
const field = getBoxedField(this, key, fieldSchema);
|
|
244
|
-
field.editor.set(newContent);
|
|
245
|
-
};
|
|
246
|
-
break;
|
|
247
|
-
}
|
|
248
|
-
default:
|
|
249
|
-
setter = undefined;
|
|
250
|
-
break;
|
|
251
|
-
}
|
|
252
|
-
// Create getter and setter (when appropriate) for property
|
|
253
|
-
propertyDescriptorMap[escapedKey] = {
|
|
254
|
-
enumerable: true,
|
|
255
|
-
get() {
|
|
256
|
-
return inCursorField(this[cursorSymbol], key, (cursor) => unboxedField(this.context, fieldSchema, cursor));
|
|
257
|
-
},
|
|
258
|
-
set: setter,
|
|
259
|
-
};
|
|
260
|
-
// Create set method for property (when appropriate)
|
|
261
|
-
if (setter !== undefined) {
|
|
262
|
-
propertyDescriptorMap[`set${capitalize(escapedKey)}`] = {
|
|
263
|
-
enumerable: false,
|
|
264
|
-
get() {
|
|
265
|
-
return setter;
|
|
266
|
-
},
|
|
267
|
-
};
|
|
268
|
-
}
|
|
269
|
-
propertyDescriptorMap[`boxed${capitalize(escapedKey)}`] = {
|
|
270
|
-
enumerable: false,
|
|
271
|
-
get() {
|
|
272
|
-
return getBoxedField(this, key, fieldSchema);
|
|
273
|
-
},
|
|
274
|
-
};
|
|
275
|
-
}
|
|
276
|
-
// This must implement `StructTyped<TSchema>`, but TypeScript can't constrain it to do so.
|
|
277
|
-
class CustomStruct extends LazyTreeNode {
|
|
278
|
-
constructor(context, cursor, anchorNode, anchor) {
|
|
279
|
-
super(context, schema, cursor, anchorNode, anchor);
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
Object.defineProperties(CustomStruct.prototype, propertyDescriptorMap);
|
|
283
|
-
return CustomStruct;
|
|
284
|
-
}
|
|
285
202
|
//# sourceMappingURL=lazyNode.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazyNode.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/lazyNode.ts"],"names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AAU,CAAC,EAAE,CAAC,GAAG;YACzD,UAAU,EAAE,KAAK;YACjB,GAAG;gBACF,OAAO,aAAa,CAAC,IAAI,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC;YAC9C,CAAC;SACD,CAAC;IACH,CAAC;IAED,0FAA0F;IAC1F,MAAM,YAAa,SAAQ,YAAqB;QAC/C,YACC,OAAgB,EAChB,MAA+B,EAC/B,UAAsB,EACtB,MAAc;YAEd,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;QACpD,CAAC;KACD;IAED,MAAM,CAAC,gBAAgB,CAAC,YAAY,CAAC,SAAS,EAAE,qBAAqB,CAAC,CAAC;IAEvE,OAAO,YAAY,CAAC;AACrB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype Anchor,\n\ttype AnchorNode,\n\tCursorLocationType,\n\ttype FieldKey,\n\ttype ITreeSubscriptionCursor,\n\ttype TreeNavigationResult,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeValue,\n\ttype Value,\n\tinCursorField,\n\tmapCursorFields,\n\trootFieldKey,\n} from \"../../core/index.js\";\nimport { brand, capitalize, disposeSymbol, fail, getOrCreate } from \"../../util/index.js\";\nimport { FieldKinds } from \"../default-schema/index.js\";\nimport {\n\tAny,\n\ttype FlexAllowedTypes,\n\tFlexFieldSchema,\n\ttype FlexMapNodeSchema,\n\ttype FlexObjectNodeSchema,\n\ttype FlexTreeNodeSchema,\n\ttype LeafNodeSchema,\n\tschemaIsLeaf,\n\tschemaIsMap,\n\tschemaIsObjectNode,\n} from \"../typed-schema/index.js\";\n\nimport type { Context } from \"./context.js\";\nimport {\n\tFlexTreeEntityKind,\n\ttype FlexTreeField,\n\ttype FlexTreeLeafNode,\n\ttype FlexTreeMapNode,\n\ttype FlexTreeNode,\n\ttype FlexTreeObjectNodeTyped,\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeTypedNode,\n\ttype FlexTreeUnboxField,\n\ttype FlexibleNodeContent,\n\ttype PropertyNameFromFieldKey,\n\tflexTreeMarker,\n\tflexTreeSlot,\n\treservedObjectNodeFieldPropertyNamePrefixes,\n\treservedObjectNodeFieldPropertyNames,\n} from \"./flexTreeTypes.js\";\nimport {\n\tLazyEntity,\n\tanchorSymbol,\n\tcursorSymbol,\n\tforgetAnchorSymbol,\n\ttryMoveCursorToAnchorSymbol,\n} from \"./lazyEntity.js\";\nimport { makeField } from \"./lazyField.js\";\nimport { unboxedField } from \"./unboxed.js\";\n\n/**\n * @param cursor - This does not take ownership of this cursor: Node will fork it as needed.\n */\nexport function makeTree(context: Context, cursor: ITreeSubscriptionCursor): LazyTreeNode {\n\tconst anchor = cursor.buildAnchor();\n\tconst anchorNode =\n\t\tcontext.checkout.forest.anchors.locate(anchor) ??\n\t\tfail(\"cursor should point to a node that is not the root of the AnchorSet\");\n\tconst cached = anchorNode.slots.get(flexTreeSlot);\n\tif (cached !== undefined) {\n\t\tcontext.checkout.forest.anchors.forget(anchor);\n\t\tassert(cached.context === context, 0x782 /* contexts must match */);\n\t\tassert(cached instanceof LazyTreeNode, 0x92c /* Expected LazyTreeNode */);\n\t\treturn cached as LazyTreeNode;\n\t}\n\tconst schema = context.schema.nodeSchema.get(cursor.type) ?? fail(\"missing schema\");\n\treturn buildSubclass(context, schema, cursor, anchorNode, anchor);\n}\n\nfunction cleanupTree(anchor: AnchorNode): void {\n\tconst cached = anchor.slots.get(flexTreeSlot) ?? fail(\"tree should only be cleaned up once\");\n\tassert(cached instanceof LazyTreeNode, 0x92d /* Expected LazyTreeNode */);\n\tcached[disposeSymbol]();\n}\n\nfunction buildSubclass(\n\tcontext: Context,\n\tschema: FlexTreeNodeSchema,\n\tcursor: ITreeSubscriptionCursor,\n\tanchorNode: AnchorNode,\n\tanchor: Anchor,\n): LazyTreeNode {\n\tif (schemaIsMap(schema)) {\n\t\treturn new LazyMap(context, schema, cursor, anchorNode, anchor);\n\t}\n\tif (schemaIsLeaf(schema)) {\n\t\treturn new LazyLeaf(context, schema, cursor, anchorNode, anchor);\n\t}\n\tif (schemaIsObjectNode(schema)) {\n\t\treturn buildLazyObjectNode(context, schema, cursor, anchorNode, anchor);\n\t}\n\t// TODO: there should be a common fallback that works for cases without a specialized implementation.\n\tfail(\"unrecognized node kind\");\n}\n\n/**\n * Lazy implementation of {@link FlexTreeNode}.\n */\nexport abstract class LazyTreeNode<TSchema extends FlexTreeNodeSchema = FlexTreeNodeSchema>\n\textends LazyEntity<TSchema, Anchor>\n\timplements FlexTreeNode\n{\n\tpublic get [flexTreeMarker](): FlexTreeEntityKind.Node {\n\t\treturn FlexTreeEntityKind.Node;\n\t}\n\t/**\n\t * Enumerable own property providing a more JS object friendly alternative to \"schema\".\n\t */\n\tpublic readonly type: TreeNodeSchemaIdentifier;\n\n\t// Using JS private here prevents it from showing up as a enumerable own property, or conflicting with struct fields.\n\treadonly #removeDeleteCallback: () => void;\n\n\tpublic constructor(\n\t\tcontext: Context,\n\t\tschema: TSchema,\n\t\tcursor: ITreeSubscriptionCursor,\n\t\tpublic readonly anchorNode: AnchorNode,\n\t\tanchor: Anchor,\n\t) {\n\t\tsuper(context, schema, cursor, anchor);\n\t\tassert(cursor.mode === CursorLocationType.Nodes, 0x783 /* must be in nodes mode */);\n\t\tanchorNode.slots.set(flexTreeSlot, this);\n\t\tthis.#removeDeleteCallback = anchorNode.on(\"afterDestroy\", cleanupTree);\n\n\t\tassert(\n\t\t\tthis.context.schema.nodeSchema.get(this.schema.name) !== undefined,\n\t\t\t0x784 /* There is no explicit schema for this node type. Ensure that the type is correct and the schema for it was added to the TreeStoredSchema */,\n\t\t);\n\n\t\tthis.type = schema.name;\n\t}\n\n\tpublic is<TSchemaInner extends FlexTreeNodeSchema>(\n\t\tschema: TSchemaInner,\n\t): this is FlexTreeTypedNode<TSchemaInner> {\n\t\tassert(\n\t\t\tthis.context.schema.nodeSchema.get(schema.name) === schema,\n\t\t\t0x785 /* Narrowing must be done to a schema that exists in this context */,\n\t\t);\n\t\treturn this.schema === (schema as unknown);\n\t}\n\n\tprotected override [tryMoveCursorToAnchorSymbol](\n\t\tcursor: ITreeSubscriptionCursor,\n\t): TreeNavigationResult {\n\t\treturn this.context.checkout.forest.tryMoveCursorToNode(this[anchorSymbol], cursor);\n\t}\n\n\tprotected override [forgetAnchorSymbol](): void {\n\t\t// This type unconditionally has an anchor, so `forgetAnchor` is always called and cleanup can be done here:\n\t\t// After this point this node will not be usable,\n\t\t// so remove it from the anchor incase a different context (or the same context later) uses this AnchorSet.\n\t\tthis.anchorNode.slots.delete(flexTreeSlot);\n\t\tthis.#removeDeleteCallback();\n\t\tthis.context.checkout.forest.anchors.forget(this[anchorSymbol]);\n\t}\n\n\tpublic get value(): Value {\n\t\treturn this[cursorSymbol].value;\n\t}\n\n\tpublic tryGetField(fieldKey: FieldKey): FlexTreeField | undefined {\n\t\tconst schema = this.schema.getFieldSchema(fieldKey);\n\t\treturn inCursorField(this[cursorSymbol], fieldKey, (cursor) => {\n\t\t\tif (cursor.getFieldLength() === 0) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\treturn makeField(this.context, schema, cursor);\n\t\t});\n\t}\n\n\tpublic getBoxed(key: FieldKey): FlexTreeField {\n\t\treturn getBoxedField(this, key, this.schema.getFieldSchema(key));\n\t}\n\n\tpublic boxedIterator(): IterableIterator<FlexTreeField> {\n\t\treturn mapCursorFields(this[cursorSymbol], (cursor) =>\n\t\t\tmakeField(this.context, this.schema.getFieldSchema(cursor.getFieldKey()), cursor),\n\t\t).values();\n\t}\n\n\tpublic get parentField(): { readonly parent: FlexTreeField; readonly index: number } {\n\t\tconst cursor = this[cursorSymbol];\n\t\tconst index = this.anchorNode.parentIndex;\n\t\tassert(cursor.fieldIndex === index, 0x786 /* mismatched indexes */);\n\t\tconst key = this.anchorNode.parentField;\n\n\t\tcursor.exitNode();\n\t\tassert(key === cursor.getFieldKey(), 0x787 /* mismatched keys */);\n\t\tlet fieldSchema: FlexFieldSchema;\n\n\t\t// Check if the current node is in a detached sequence.\n\t\tif (this.anchorNode.parent === undefined) {\n\t\t\t// Parent field is a detached sequence, and thus needs special handling for its schema.\n\t\t\t// eslint-disable-next-line unicorn/prefer-ternary\n\t\t\tif (key === rootFieldKey) {\n\t\t\t\tfieldSchema = this.context.schema.rootFieldSchema;\n\t\t\t} else {\n\t\t\t\t// All fields (in the flex tree API) have a schema.\n\t\t\t\t// Since currently there is no known schema for detached field other than the special default root:\n\t\t\t\t// give all other detached fields a schema of sequence of any.\n\t\t\t\t// That schema is the only one that is safe since its the only field schema that allows any possible field content.\n\t\t\t\t//\n\t\t\t\t// TODO:\n\t\t\t\t// if any of the following are done this schema will need to be more specific:\n\t\t\t\t// 1. Editing APIs start exposing user created detached sequences.\n\t\t\t\t// 2. Remove (and its inverse) start working on subsequences or fields contents (like everything in a sequence or optional field) and not just single nodes.\n\t\t\t\t// 3. Possibly other unknown cases.\n\t\t\t\t// Additionally this approach makes it possible for a user to take a FlexTree node, get its parent, check its schema, down cast based on that, then edit that detached field (ex: removing the node in it).\n\t\t\t\t// This MIGHT work properly with existing merge resolution logic (it must keep client in sync and be unable to violate schema), but this either needs robust testing or to be explicitly banned (error before s3ending the op).\n\t\t\t\t// Issues like replacing a node in the a removed sequenced then undoing the remove could easily violate schema if not everything works exactly right!\n\t\t\t\tfieldSchema = FlexFieldSchema.create(FieldKinds.sequence, [Any]);\n\t\t\t}\n\t\t} else {\n\t\t\tcursor.exitField();\n\t\t\tconst parentType = cursor.type;\n\t\t\tcursor.enterField(key);\n\t\t\tconst nodeSchema =\n\t\t\t\tthis.context.schema.nodeSchema.get(parentType) ??\n\t\t\t\tfail(\"requested schema that does not exist\");\n\t\t\tfieldSchema = nodeSchema.getFieldSchema(key);\n\t\t}\n\n\t\tconst proxifiedField = makeField(this.context, fieldSchema, cursor);\n\t\tcursor.enterNode(index);\n\n\t\treturn { parent: proxifiedField, index };\n\t}\n}\n\nexport class LazyMap<TSchema extends FlexMapNodeSchema>\n\textends LazyTreeNode<TSchema>\n\timplements FlexTreeMapNode<TSchema>\n{\n\tpublic constructor(\n\t\tcontext: Context,\n\t\tschema: TSchema,\n\t\tcursor: ITreeSubscriptionCursor,\n\t\tanchorNode: AnchorNode,\n\t\tanchor: Anchor,\n\t) {\n\t\tsuper(context, schema, cursor, anchorNode, anchor);\n\t}\n\n\tpublic keys(): IterableIterator<FieldKey> {\n\t\treturn mapCursorFields(this[cursorSymbol], (cursor) => cursor.getFieldKey()).values();\n\t}\n\n\tpublic values(): IterableIterator<FlexTreeUnboxField<TSchema[\"info\"], \"notEmpty\">> {\n\t\treturn mapCursorFields(\n\t\t\tthis[cursorSymbol],\n\t\t\t(cursor) =>\n\t\t\t\tunboxedField(this.context, this.schema.info, cursor) as FlexTreeUnboxField<\n\t\t\t\t\tTSchema[\"info\"],\n\t\t\t\t\t\"notEmpty\"\n\t\t\t\t>,\n\t\t).values();\n\t}\n\n\tpublic entries(): IterableIterator<\n\t\t[FieldKey, FlexTreeUnboxField<TSchema[\"info\"], \"notEmpty\">]\n\t> {\n\t\treturn mapCursorFields(this[cursorSymbol], (cursor) => {\n\t\t\tconst entry: [FieldKey, FlexTreeUnboxField<TSchema[\"info\"], \"notEmpty\">] = [\n\t\t\t\tcursor.getFieldKey(),\n\t\t\t\tunboxedField(this.context, this.schema.info, cursor) as FlexTreeUnboxField<\n\t\t\t\t\tTSchema[\"info\"],\n\t\t\t\t\t\"notEmpty\"\n\t\t\t\t>,\n\t\t\t];\n\t\t\treturn entry;\n\t\t}).values();\n\t}\n\n\tpublic forEach(\n\t\tcallbackFn: (\n\t\t\tvalue: FlexTreeUnboxField<TSchema[\"info\"], \"notEmpty\">,\n\t\t\tkey: FieldKey,\n\t\t\tmap: FlexTreeMapNode<TSchema>,\n\t\t) => void,\n\t\tthisArg?: unknown,\n\t): void {\n\t\tconst fn = thisArg !== undefined ? callbackFn.bind(thisArg) : callbackFn;\n\t\tfor (const [key, value] of this.entries()) {\n\t\t\tfn(value, key, this);\n\t\t}\n\t}\n\n\tpublic override getBoxed(key: string): FlexTreeTypedField<TSchema[\"info\"]> {\n\t\treturn super.getBoxed(brand(key)) as FlexTreeTypedField<TSchema[\"info\"]>;\n\t}\n\n\tpublic override boxedIterator(): IterableIterator<FlexTreeTypedField<TSchema[\"info\"]>> {\n\t\treturn super.boxedIterator() as IterableIterator<FlexTreeTypedField<TSchema[\"info\"]>>;\n\t}\n\n\tpublic [Symbol.iterator](): IterableIterator<\n\t\t[FieldKey, FlexTreeUnboxField<TSchema[\"info\"], \"notEmpty\">]\n\t> {\n\t\treturn this.entries();\n\t}\n}\n\nexport class LazyLeaf<TSchema extends LeafNodeSchema>\n\textends LazyTreeNode<TSchema>\n\timplements FlexTreeLeafNode<TSchema>\n{\n\tpublic constructor(\n\t\tcontext: Context,\n\t\tschema: TSchema,\n\t\tcursor: ITreeSubscriptionCursor,\n\t\tanchorNode: AnchorNode,\n\t\tanchor: Anchor,\n\t) {\n\t\tsuper(context, schema, cursor, anchorNode, anchor);\n\t}\n\n\tpublic override get value(): TreeValue<TSchema[\"info\"]> {\n\t\treturn super.value as TreeValue<TSchema[\"info\"]>;\n\t}\n}\n\n/**\n * {@link reservedObjectNodeFieldPropertyNames} but as a set.\n */\nexport const reservedObjectNodeFieldPropertyNameSet: ReadonlySet<string> = new Set(\n\treservedObjectNodeFieldPropertyNames,\n);\n\nexport function propertyNameFromFieldKey<T extends string>(\n\tkey: T,\n): PropertyNameFromFieldKey<T> {\n\tif (reservedObjectNodeFieldPropertyNameSet.has(key)) {\n\t\treturn `field${capitalize(key)}` as PropertyNameFromFieldKey<T>;\n\t}\n\tfor (const prefix of reservedObjectNodeFieldPropertyNamePrefixes) {\n\t\tif (key.startsWith(prefix)) {\n\t\t\tconst afterPrefix = key.slice(prefix.length);\n\t\t\tif (afterPrefix === capitalize(afterPrefix)) {\n\t\t\t\treturn `field${capitalize(key)}` as PropertyNameFromFieldKey<T>;\n\t\t\t}\n\t\t}\n\t}\n\treturn key as PropertyNameFromFieldKey<T>;\n}\n\nexport function buildLazyObjectNode<TSchema extends FlexObjectNodeSchema>(\n\tcontext: Context,\n\tschema: TSchema,\n\tcursor: ITreeSubscriptionCursor,\n\tanchorNode: AnchorNode,\n\tanchor: Anchor,\n): LazyTreeNode<TSchema> & FlexTreeObjectNodeTyped<TSchema> {\n\tconst objectNodeClass = getOrCreate(cachedStructClasses, schema, () =>\n\t\tbuildStructClass(schema),\n\t);\n\treturn new objectNodeClass(context, cursor, anchorNode, anchor) as LazyTreeNode<TSchema> &\n\t\tFlexTreeObjectNodeTyped<TSchema>;\n}\n\nconst cachedStructClasses = new WeakMap<\n\tFlexObjectNodeSchema,\n\tnew (\n\t\tcontext: Context,\n\t\tcursor: ITreeSubscriptionCursor,\n\t\tanchorNode: AnchorNode,\n\t\tanchor: Anchor,\n\t) => LazyTreeNode<FlexObjectNodeSchema>\n>();\n\nfunction getBoxedField(\n\tobjectNode: LazyTreeNode,\n\tkey: FieldKey,\n\tfieldSchema: FlexFieldSchema,\n): FlexTreeField {\n\treturn inCursorField(objectNode[cursorSymbol], key, (cursor) => {\n\t\treturn makeField(objectNode.context, fieldSchema, cursor);\n\t});\n}\n\nfunction buildStructClass<TSchema extends FlexObjectNodeSchema>(\n\tschema: TSchema,\n): new (\n\tcontext: Context,\n\tcursor: ITreeSubscriptionCursor,\n\tanchorNode: AnchorNode,\n\tanchor: Anchor,\n) => LazyTreeNode<TSchema> {\n\tconst propertyDescriptorMap: PropertyDescriptorMap = {};\n\n\tfor (const [key, fieldSchema] of schema.objectNodeFields) {\n\t\tconst escapedKey = propertyNameFromFieldKey(key);\n\t\tlet setter: ((newContent: FlexibleNodeContent) => void) | undefined;\n\t\tswitch (fieldSchema.kind) {\n\t\t\tcase FieldKinds.optional: {\n\t\t\t\tsetter = function (\n\t\t\t\t\tthis: CustomStruct,\n\t\t\t\t\tnewContent: FlexibleNodeContent | undefined,\n\t\t\t\t): void {\n\t\t\t\t\tconst field = getBoxedField(\n\t\t\t\t\t\tthis,\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tfieldSchema,\n\t\t\t\t\t) as FlexTreeOptionalField<FlexAllowedTypes>;\n\t\t\t\t\tfield.editor.set(newContent, field.length === 0);\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase FieldKinds.required: {\n\t\t\t\tsetter = function (this: CustomStruct, newContent: FlexibleNodeContent): void {\n\t\t\t\t\tconst field = getBoxedField(\n\t\t\t\t\t\tthis,\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tfieldSchema,\n\t\t\t\t\t) as FlexTreeRequiredField<FlexAllowedTypes>;\n\t\t\t\t\tfield.editor.set(newContent);\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\tsetter = undefined;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// Create getter and setter (when appropriate) for property\n\t\tpropertyDescriptorMap[escapedKey] = {\n\t\t\tenumerable: true,\n\t\t\tget(this: CustomStruct): unknown {\n\t\t\t\treturn inCursorField(this[cursorSymbol], key, (cursor) =>\n\t\t\t\t\tunboxedField(this.context, fieldSchema, cursor),\n\t\t\t\t);\n\t\t\t},\n\t\t\tset: setter,\n\t\t};\n\n\t\t// Create set method for property (when appropriate)\n\t\tif (setter !== undefined) {\n\t\t\tpropertyDescriptorMap[`set${capitalize(escapedKey)}`] = {\n\t\t\t\tenumerable: false,\n\t\t\t\tget(this: CustomStruct) {\n\t\t\t\t\treturn setter;\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\tpropertyDescriptorMap[`boxed${capitalize(escapedKey)}`] = {\n\t\t\tenumerable: false,\n\t\t\tget(this: CustomStruct) {\n\t\t\t\treturn getBoxedField(this, key, fieldSchema);\n\t\t\t},\n\t\t};\n\t}\n\n\t// This must implement `StructTyped<TSchema>`, but TypeScript can't constrain it to do so.\n\tclass CustomStruct extends LazyTreeNode<TSchema> {\n\t\tpublic constructor(\n\t\t\tcontext: Context,\n\t\t\tcursor: ITreeSubscriptionCursor,\n\t\t\tanchorNode: AnchorNode,\n\t\t\tanchor: Anchor,\n\t\t) {\n\t\t\tsuper(context, schema, cursor, anchorNode, anchor);\n\t\t}\n\t}\n\n\tObject.defineProperties(CustomStruct.prototype, propertyDescriptorMap);\n\n\treturn CustomStruct;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"lazyNode.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/lazyNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;;;;;;;;;;;;;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAE7D,OAAO,EAUN,aAAa,EACb,eAAe,EACf,YAAY,GACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EACN,GAAG,EACH,eAAe,EAIf,YAAY,EACZ,WAAW,EACX,kBAAkB,GAClB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACN,kBAAkB,EAQlB,cAAc,EACd,YAAY,GACZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,2BAA2B,GAC3B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,OAAgB,EAAE,MAA+B;IACzE,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;IACpC,MAAM,UAAU,GACf,OAA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AAC;IAClD,CAAC;CACD;AAED,SAAS,aAAa,CACrB,UAAwB,EACxB,GAAa,EACb,WAA4B;IAE5B,OAAO,aAAa,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,EAAE;QAC9D,OAAO,SAAS,CAAC,UAAU,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype Anchor,\n\ttype AnchorNode,\n\tCursorLocationType,\n\ttype FieldKey,\n\ttype ITreeSubscriptionCursor,\n\ttype TreeNavigationResult,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeValue,\n\ttype Value,\n\tinCursorField,\n\tmapCursorFields,\n\trootFieldKey,\n} from \"../../core/index.js\";\nimport { brand, disposeSymbol, fail } from \"../../util/index.js\";\nimport { FieldKinds } from \"../default-schema/index.js\";\nimport {\n\tAny,\n\tFlexFieldSchema,\n\ttype FlexMapNodeSchema,\n\ttype FlexTreeNodeSchema,\n\ttype LeafNodeSchema,\n\tschemaIsLeaf,\n\tschemaIsMap,\n\tschemaIsObjectNode,\n} from \"../typed-schema/index.js\";\n\nimport type { Context } from \"./context.js\";\nimport {\n\tFlexTreeEntityKind,\n\ttype FlexTreeField,\n\ttype FlexTreeLeafNode,\n\ttype FlexTreeMapNode,\n\ttype FlexTreeNode,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeTypedNode,\n\ttype FlexTreeUnboxField,\n\tflexTreeMarker,\n\tflexTreeSlot,\n} from \"./flexTreeTypes.js\";\nimport {\n\tLazyEntity,\n\tanchorSymbol,\n\tcursorSymbol,\n\tforgetAnchorSymbol,\n\ttryMoveCursorToAnchorSymbol,\n} from \"./lazyEntity.js\";\nimport { makeField } from \"./lazyField.js\";\nimport { unboxedField } from \"./unboxed.js\";\n\n/**\n * @param cursor - This does not take ownership of this cursor: Node will fork it as needed.\n */\nexport function makeTree(context: Context, cursor: ITreeSubscriptionCursor): LazyTreeNode {\n\tconst anchor = cursor.buildAnchor();\n\tconst anchorNode =\n\t\tcontext.checkout.forest.anchors.locate(anchor) ??\n\t\tfail(\"cursor should point to a node that is not the root of the AnchorSet\");\n\tconst cached = anchorNode.slots.get(flexTreeSlot);\n\tif (cached !== undefined) {\n\t\tcontext.checkout.forest.anchors.forget(anchor);\n\t\tassert(cached.context === context, 0x782 /* contexts must match */);\n\t\tassert(cached instanceof LazyTreeNode, 0x92c /* Expected LazyTreeNode */);\n\t\treturn cached as LazyTreeNode;\n\t}\n\tconst schema = context.schema.nodeSchema.get(cursor.type) ?? fail(\"missing schema\");\n\treturn buildSubclass(context, schema, cursor, anchorNode, anchor);\n}\n\nfunction cleanupTree(anchor: AnchorNode): void {\n\tconst cached = anchor.slots.get(flexTreeSlot) ?? fail(\"tree should only be cleaned up once\");\n\tassert(cached instanceof LazyTreeNode, 0x92d /* Expected LazyTreeNode */);\n\tcached[disposeSymbol]();\n}\n\nfunction buildSubclass(\n\tcontext: Context,\n\tschema: FlexTreeNodeSchema,\n\tcursor: ITreeSubscriptionCursor,\n\tanchorNode: AnchorNode,\n\tanchor: Anchor,\n): LazyTreeNode {\n\tif (schemaIsMap(schema)) {\n\t\treturn new LazyMap(context, schema, cursor, anchorNode, anchor);\n\t}\n\tif (schemaIsLeaf(schema)) {\n\t\treturn new LazyLeaf(context, schema, cursor, anchorNode, anchor);\n\t}\n\tif (schemaIsObjectNode(schema)) {\n\t\treturn new LazyTreeNode(context, schema, cursor, anchorNode, anchor);\n\t}\n\t// TODO: there should be a common fallback that works for cases without a specialized implementation.\n\tfail(\"unrecognized node kind\");\n}\n\n/**\n * Lazy implementation of {@link FlexTreeNode}.\n */\nexport class LazyTreeNode<TSchema extends FlexTreeNodeSchema = FlexTreeNodeSchema>\n\textends LazyEntity<TSchema, Anchor>\n\timplements FlexTreeNode\n{\n\tpublic get [flexTreeMarker](): FlexTreeEntityKind.Node {\n\t\treturn FlexTreeEntityKind.Node;\n\t}\n\t/**\n\t * Enumerable own property providing a more JS object friendly alternative to \"schema\".\n\t */\n\tpublic readonly type: TreeNodeSchemaIdentifier;\n\n\t// Using JS private here prevents it from showing up as a enumerable own property, or conflicting with struct fields.\n\treadonly #removeDeleteCallback: () => void;\n\n\tpublic constructor(\n\t\tcontext: Context,\n\t\tschema: TSchema,\n\t\tcursor: ITreeSubscriptionCursor,\n\t\tpublic readonly anchorNode: AnchorNode,\n\t\tanchor: Anchor,\n\t) {\n\t\tsuper(context, schema, cursor, anchor);\n\t\tassert(cursor.mode === CursorLocationType.Nodes, 0x783 /* must be in nodes mode */);\n\t\tanchorNode.slots.set(flexTreeSlot, this);\n\t\tthis.#removeDeleteCallback = anchorNode.on(\"afterDestroy\", cleanupTree);\n\n\t\tassert(\n\t\t\tthis.context.schema.nodeSchema.get(this.schema.name) !== undefined,\n\t\t\t0x784 /* There is no explicit schema for this node type. Ensure that the type is correct and the schema for it was added to the TreeStoredSchema */,\n\t\t);\n\n\t\tthis.type = schema.name;\n\t}\n\n\tpublic is<TSchemaInner extends FlexTreeNodeSchema>(\n\t\tschema: TSchemaInner,\n\t): this is FlexTreeTypedNode<TSchemaInner> {\n\t\tassert(\n\t\t\tthis.context.schema.nodeSchema.get(schema.name) === schema,\n\t\t\t0x785 /* Narrowing must be done to a schema that exists in this context */,\n\t\t);\n\t\treturn this.schema === (schema as unknown);\n\t}\n\n\tprotected override [tryMoveCursorToAnchorSymbol](\n\t\tcursor: ITreeSubscriptionCursor,\n\t): TreeNavigationResult {\n\t\treturn this.context.checkout.forest.tryMoveCursorToNode(this[anchorSymbol], cursor);\n\t}\n\n\tprotected override [forgetAnchorSymbol](): void {\n\t\t// This type unconditionally has an anchor, so `forgetAnchor` is always called and cleanup can be done here:\n\t\t// After this point this node will not be usable,\n\t\t// so remove it from the anchor incase a different context (or the same context later) uses this AnchorSet.\n\t\tthis.anchorNode.slots.delete(flexTreeSlot);\n\t\tthis.#removeDeleteCallback();\n\t\tthis.context.checkout.forest.anchors.forget(this[anchorSymbol]);\n\t}\n\n\tpublic get value(): Value {\n\t\treturn this[cursorSymbol].value;\n\t}\n\n\tpublic tryGetField(fieldKey: FieldKey): FlexTreeField | undefined {\n\t\tconst schema = this.schema.getFieldSchema(fieldKey);\n\t\treturn inCursorField(this[cursorSymbol], fieldKey, (cursor) => {\n\t\t\tif (cursor.getFieldLength() === 0) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\treturn makeField(this.context, schema, cursor);\n\t\t});\n\t}\n\n\tpublic getBoxed(key: FieldKey): FlexTreeField {\n\t\treturn getBoxedField(this, key, this.schema.getFieldSchema(key));\n\t}\n\n\tpublic boxedIterator(): IterableIterator<FlexTreeField> {\n\t\treturn mapCursorFields(this[cursorSymbol], (cursor) =>\n\t\t\tmakeField(this.context, this.schema.getFieldSchema(cursor.getFieldKey()), cursor),\n\t\t).values();\n\t}\n\n\tpublic get parentField(): { readonly parent: FlexTreeField; readonly index: number } {\n\t\tconst cursor = this[cursorSymbol];\n\t\tconst index = this.anchorNode.parentIndex;\n\t\tassert(cursor.fieldIndex === index, 0x786 /* mismatched indexes */);\n\t\tconst key = this.anchorNode.parentField;\n\n\t\tcursor.exitNode();\n\t\tassert(key === cursor.getFieldKey(), 0x787 /* mismatched keys */);\n\t\tlet fieldSchema: FlexFieldSchema;\n\n\t\t// Check if the current node is in a detached sequence.\n\t\tif (this.anchorNode.parent === undefined) {\n\t\t\t// Parent field is a detached sequence, and thus needs special handling for its schema.\n\t\t\t// eslint-disable-next-line unicorn/prefer-ternary\n\t\t\tif (key === rootFieldKey) {\n\t\t\t\tfieldSchema = this.context.schema.rootFieldSchema;\n\t\t\t} else {\n\t\t\t\t// All fields (in the flex tree API) have a schema.\n\t\t\t\t// Since currently there is no known schema for detached field other than the special default root:\n\t\t\t\t// give all other detached fields a schema of sequence of any.\n\t\t\t\t// That schema is the only one that is safe since its the only field schema that allows any possible field content.\n\t\t\t\t//\n\t\t\t\t// TODO:\n\t\t\t\t// if any of the following are done this schema will need to be more specific:\n\t\t\t\t// 1. Editing APIs start exposing user created detached sequences.\n\t\t\t\t// 2. Remove (and its inverse) start working on subsequences or fields contents (like everything in a sequence or optional field) and not just single nodes.\n\t\t\t\t// 3. Possibly other unknown cases.\n\t\t\t\t// Additionally this approach makes it possible for a user to take a FlexTree node, get its parent, check its schema, down cast based on that, then edit that detached field (ex: removing the node in it).\n\t\t\t\t// This MIGHT work properly with existing merge resolution logic (it must keep client in sync and be unable to violate schema), but this either needs robust testing or to be explicitly banned (error before s3ending the op).\n\t\t\t\t// Issues like replacing a node in the a removed sequenced then undoing the remove could easily violate schema if not everything works exactly right!\n\t\t\t\tfieldSchema = FlexFieldSchema.create(FieldKinds.sequence, [Any]);\n\t\t\t}\n\t\t} else {\n\t\t\tcursor.exitField();\n\t\t\tconst parentType = cursor.type;\n\t\t\tcursor.enterField(key);\n\t\t\tconst nodeSchema =\n\t\t\t\tthis.context.schema.nodeSchema.get(parentType) ??\n\t\t\t\tfail(\"requested schema that does not exist\");\n\t\t\tfieldSchema = nodeSchema.getFieldSchema(key);\n\t\t}\n\n\t\tconst proxifiedField = makeField(this.context, fieldSchema, cursor);\n\t\tcursor.enterNode(index);\n\n\t\treturn { parent: proxifiedField, index };\n\t}\n}\n\nexport class LazyMap<TSchema extends FlexMapNodeSchema>\n\textends LazyTreeNode<TSchema>\n\timplements FlexTreeMapNode<TSchema>\n{\n\tpublic constructor(\n\t\tcontext: Context,\n\t\tschema: TSchema,\n\t\tcursor: ITreeSubscriptionCursor,\n\t\tanchorNode: AnchorNode,\n\t\tanchor: Anchor,\n\t) {\n\t\tsuper(context, schema, cursor, anchorNode, anchor);\n\t}\n\n\tpublic keys(): IterableIterator<FieldKey> {\n\t\treturn mapCursorFields(this[cursorSymbol], (cursor) => cursor.getFieldKey()).values();\n\t}\n\n\tpublic values(): IterableIterator<FlexTreeUnboxField<TSchema[\"info\"], \"notEmpty\">> {\n\t\treturn mapCursorFields(\n\t\t\tthis[cursorSymbol],\n\t\t\t(cursor) =>\n\t\t\t\tunboxedField(this.context, this.schema.info, cursor) as FlexTreeUnboxField<\n\t\t\t\t\tTSchema[\"info\"],\n\t\t\t\t\t\"notEmpty\"\n\t\t\t\t>,\n\t\t).values();\n\t}\n\n\tpublic entries(): IterableIterator<\n\t\t[FieldKey, FlexTreeUnboxField<TSchema[\"info\"], \"notEmpty\">]\n\t> {\n\t\treturn mapCursorFields(this[cursorSymbol], (cursor) => {\n\t\t\tconst entry: [FieldKey, FlexTreeUnboxField<TSchema[\"info\"], \"notEmpty\">] = [\n\t\t\t\tcursor.getFieldKey(),\n\t\t\t\tunboxedField(this.context, this.schema.info, cursor) as FlexTreeUnboxField<\n\t\t\t\t\tTSchema[\"info\"],\n\t\t\t\t\t\"notEmpty\"\n\t\t\t\t>,\n\t\t\t];\n\t\t\treturn entry;\n\t\t}).values();\n\t}\n\n\tpublic forEach(\n\t\tcallbackFn: (\n\t\t\tvalue: FlexTreeUnboxField<TSchema[\"info\"], \"notEmpty\">,\n\t\t\tkey: FieldKey,\n\t\t\tmap: FlexTreeMapNode<TSchema>,\n\t\t) => void,\n\t\tthisArg?: unknown,\n\t): void {\n\t\tconst fn = thisArg !== undefined ? callbackFn.bind(thisArg) : callbackFn;\n\t\tfor (const [key, value] of this.entries()) {\n\t\t\tfn(value, key, this);\n\t\t}\n\t}\n\n\tpublic override getBoxed(key: string): FlexTreeTypedField<TSchema[\"info\"]> {\n\t\treturn super.getBoxed(brand(key)) as FlexTreeTypedField<TSchema[\"info\"]>;\n\t}\n\n\tpublic [Symbol.iterator](): IterableIterator<\n\t\t[FieldKey, FlexTreeUnboxField<TSchema[\"info\"], \"notEmpty\">]\n\t> {\n\t\treturn this.entries();\n\t}\n}\n\nexport class LazyLeaf<TSchema extends LeafNodeSchema>\n\textends LazyTreeNode<TSchema>\n\timplements FlexTreeLeafNode<TSchema>\n{\n\tpublic constructor(\n\t\tcontext: Context,\n\t\tschema: TSchema,\n\t\tcursor: ITreeSubscriptionCursor,\n\t\tanchorNode: AnchorNode,\n\t\tanchor: Anchor,\n\t) {\n\t\tsuper(context, schema, cursor, anchorNode, anchor);\n\t}\n\n\tpublic override get value(): TreeValue<TSchema[\"info\"]> {\n\t\treturn super.value as TreeValue<TSchema[\"info\"]>;\n\t}\n}\n\nfunction getBoxedField(\n\tobjectNode: LazyTreeNode,\n\tkey: FieldKey,\n\tfieldSchema: FlexFieldSchema,\n): FlexTreeField {\n\treturn inCursorField(objectNode[cursorSymbol], key, (cursor) => {\n\t\treturn makeField(objectNode.context, fieldSchema, cursor);\n\t});\n}\n"]}
|
|
@@ -22,7 +22,7 @@ export { mapRootChanges } from "./deltaUtils.js";
|
|
|
22
22
|
export { type TreeChunk, chunkTree, chunkFieldSingle, buildChunkedForest, defaultChunkPolicy, type FieldBatch, type FieldBatchCodec, makeTreeChunker, makeFieldBatchCodec, type FieldBatchEncodingContext, } from "./chunked-forest/index.js";
|
|
23
23
|
export { compareLocalNodeKeys, createNodeKeyManager, isStableNodeKey, type LocalNodeKey, MockNodeKeyManager, type NodeKeyManager, nodeKeyTreeIdentifier, type StableNodeKey, } from "./node-key/index.js";
|
|
24
24
|
export { FieldKinds, type Required, type Optional, type Sequence, type Identifier, type Forbidden, type DefaultChangeset, DefaultChangeFamily, DefaultEditBuilder, type IDefaultEditBuilder, type ValueFieldEditBuilder, type OptionalFieldEditBuilder, type SequenceFieldEditBuilder, defaultSchemaPolicy, fieldKinds, fieldKindConfigurations, intoDelta, relevantRemovedRoots, SchemaValidationErrors, isNodeInSchema, isFieldInSchema, } from "./default-schema/index.js";
|
|
25
|
-
export { type AssignableFieldKinds, type FlexibleFieldContent, type FlexibleNodeContent, type FlexTreeLeafNode, type FlexTreeMapNode, type FlexTreeOptionalField, type FlexTreeRequiredField, type FlexTreeSequenceField, Skip, type FlexTreeObjectNode, type
|
|
25
|
+
export { type AssignableFieldKinds, type FlexibleFieldContent, type FlexibleNodeContent, type FlexTreeLeafNode, type FlexTreeMapNode, type FlexTreeOptionalField, type FlexTreeRequiredField, type FlexTreeSequenceField, Skip, type FlexTreeObjectNode, type FlexTreeContext, type FlexTreeTypedField, type FlexTreeTypedNode, type FlexTreeTypedNodeUnion, type FlexTreeEntity, type FlexTreeField, type FlexTreeNode, getTreeContext, type CheckTypesOverlap, TreeStatus, Context, type FlexTreeNodeEvents, type FlexTreeUnknownUnboxed, isFlexTreeNode, ContextSlot, type FlexTreeUnboxField, flexTreeMarker, FlexTreeEntityKind, assertFlexTreeEntityNotFreed, flexTreeSlot, getSchemaAndPolicy, isFreedSymbol, LazyEntity, treeStatusFromAnchorCache, } from "./flex-tree/index.js";
|
|
26
26
|
export { treeSchemaFromStoredSchema } from "./storedToViewSchema.js";
|
|
27
27
|
export { TreeCompressionStrategy } from "./treeCompressionUtils.js";
|
|
28
28
|
export { valueSchemaAllows } from "./valueUtilities.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,yBAAyB,EACzB,sBAAsB,EACtB,4BAA4B,EAC5B,mBAAmB,EACnB,4BAA4B,EAC5B,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,WAAW,EACX,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,WAAW,EACX,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB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C;AAChC,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EACN,KAAK,SAAS,EACd,SAAS,EACT,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,eAAe,EACf,mBAAmB,EACnB,KAAK,yBAAyB,GAC9B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACN,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,KAAK,YAAY,EACjB,kBAAkB,EAClB,KAAK,cAAc,EACnB,qBAAqB,EACrB,KAAK,aAAa,GAClB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACN,UAAU,EACV,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,mBAAmB,EACnB,UAAU,EACV,uBAAuB,EACvB,SAAS,EACT,oBAAoB,EACpB,sBAAsB,EACtB,cAAc,EACd,eAAe,GACf,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACN,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,IAAI,EACJ,KAAK,kBAAkB,EACvB,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,yBAAyB,EACzB,sBAAsB,EACtB,4BAA4B,EAC5B,mBAAmB,EACnB,4BAA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C;AAEnC,OAAO,EACN,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,IAAI,EACJ,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,cAAc,EACd,KAAK,iBAAiB,EACtB,UAAU,EACV,OAAO,EACP,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,cAAc,EACd,WAAW,EAEX,KAAK,kBAAkB,EACvB,cAAc,EACd,kBAAkB,EAClB,4BAA4B,EAC5B,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,UAAU,EACV,yBAAyB,GACzB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAErE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAEjF,OAAO,EACN,KAAK,YAAY,EACjB,sBAAsB,EACtB,mBAAmB,GACnB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,OAAO,EACN,KAAK,WAAW,EAChB,KAAK,oBAAoB,EACzB,aAAa,EACb,sBAAsB,EACtB,sBAAsB,EACtB,iBAAiB,GACjB,MAAM,0BAA0B,CAAC"}
|
|
@@ -22,7 +22,7 @@ export { mapRootChanges } from "./deltaUtils.js";
|
|
|
22
22
|
export { chunkTree, chunkFieldSingle, buildChunkedForest, defaultChunkPolicy, makeTreeChunker, makeFieldBatchCodec, } from "./chunked-forest/index.js";
|
|
23
23
|
export { compareLocalNodeKeys, createNodeKeyManager, isStableNodeKey, MockNodeKeyManager, nodeKeyTreeIdentifier, } from "./node-key/index.js";
|
|
24
24
|
export { FieldKinds, DefaultChangeFamily, DefaultEditBuilder, defaultSchemaPolicy, fieldKinds, fieldKindConfigurations, intoDelta, relevantRemovedRoots, SchemaValidationErrors, isNodeInSchema, isFieldInSchema, } from "./default-schema/index.js";
|
|
25
|
-
export { Skip, getTreeContext, TreeStatus, Context, isFlexTreeNode, ContextSlot, flexTreeMarker, FlexTreeEntityKind,
|
|
25
|
+
export { Skip, getTreeContext, TreeStatus, Context, isFlexTreeNode, ContextSlot, flexTreeMarker, FlexTreeEntityKind, assertFlexTreeEntityNotFreed, flexTreeSlot, getSchemaAndPolicy, isFreedSymbol, LazyEntity, treeStatusFromAnchorCache, } from "./flex-tree/index.js";
|
|
26
26
|
export { treeSchemaFromStoredSchema } from "./storedToViewSchema.js";
|
|
27
27
|
export { TreeCompressionStrategy } from "./treeCompressionUtils.js";
|
|
28
28
|
export { valueSchemaAllows } from "./valueUtilities.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,yBAAyB,EACzB,sBAAsB,EACtB,4BAA4B,EAC5B,mBAAmB,EACnB,4BAA4B,EAS5B,WAAW,EAOX,WAAW,EAaX,UAAU,EACV,eAAe,EACf,iBAAiB,GACjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAInF,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACN,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,wBA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ACN,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EAEf,kBAAkB,EAElB,qBAAqB,GAErB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACN,UAAU,EAOV,mBAAmB,EACnB,kBAAkB,EAKlB,mBAAmB,EACnB,UAAU,EACV,uBAAuB,EACvB,SAAS,EACT,oBAAoB,EACpB,sBAAsB,EACtB,cAAc,EACd,eAAe,GACf,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EASN,IAAI,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,yBAAyB,EACzB,sBAAsB,EACtB,4BAA4B,EAC5B,mBAAmB,EACnB,4BAA4B,EAS5B,WAAW,EAOX,WAAW,EAaX,UAAU,EACV,eAAe,EACf,iBAAiB,GACjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAInF,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACN,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,wBAAwB,EAAgB,MAAM,+BAA+B,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC9F,OAAO,EACN,mBAAmB,EAEnB,UAAU,EACV,eAAe,EAEf,oBAAoB,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,yBAAyB,EACzB,0BAA0B,EAC1B,sBAAsB,EACtB,2BAA2B,EAC3B,sBAAsB,GACtB,MAAM,qBAAqB,CAAC;AAE7B,sFAAsF;AACtF,OAAO,KAAK,aAAa,MAAM,2BA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kBAAkB,EAClB,aAAa,EACb,UAAU,EACV,yBAAyB,GACzB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAErE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAEjF,OAAO,EAEN,sBAAsB,EACtB,mBAAmB,GACnB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,OAAO,EAGN,aAAa,EACb,sBAAsB,EACtB,sBAAsB,EACtB,iBAAiB,GACjB,MAAM,0BAA0B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tcreateDataBinderBuffering,\n\tcreateDataBinderDirect,\n\tcreateDataBinderInvalidating,\n\tcreateBinderOptions,\n\tcreateFlushableBinderOptions,\n\ttype DataBinder,\n\ttype BinderOptions,\n\ttype Flushable,\n\ttype FlushableBinderOptions,\n\ttype FlushableDataBinder,\n\ttype MatchPolicy,\n\ttype SubtreePolicy,\n\ttype BindSyntaxTree,\n\tindexSymbol,\n\ttype BindPolicy,\n\ttype BindTree,\n\ttype BindTreeDefault,\n\ttype DownPath,\n\ttype BindPath,\n\ttype PathStep,\n\tBindingType,\n\ttype BindingContextType,\n\ttype BindingContext,\n\ttype VisitorBindingContext,\n\ttype RemoveBindingContext,\n\ttype InsertBindingContext,\n\ttype BatchBindingContext,\n\ttype InvalidationBindingContext,\n\ttype OperationBinderEvents,\n\ttype InvalidationBinderEvents,\n\ttype CompareFunction,\n\ttype BinderEventsCompare,\n\ttype AnchorsCompare,\n\ttoDownPath,\n\tcomparePipeline,\n\tcompileSyntaxTree,\n} from \"./editableTreeBinder.js\";\n\nexport { allowsValue, assertAllowedValue, isTreeValue } from \"./valueUtilities.js\";\n\nexport type { FieldGenerator, TreeDataContext } from \"./fieldGenerator.js\";\n\nexport { ForestSummarizer } from \"./forest-summary/index.js\";\nexport {\n\tcursorForMapTreeField,\n\tcursorForMapTreeNode,\n\tmapTreeFromCursor,\n\tmapTreeFieldFromCursor,\n} from \"./mapTreeCursor.js\";\nexport { MemoizedIdRangeAllocator, type IdRange } from \"./memoizedIdRangeAllocator.js\";\nexport { buildForest } from \"./object-forest/index.js\";\nexport { SchemaSummarizer, encodeTreeSchema, makeSchemaCodec } from \"./schema-index/index.js\";\nexport {\n\tstackTreeNodeCursor,\n\ttype CursorAdapter,\n\tprefixPath,\n\tprefixFieldPath,\n\ttype CursorWithNode,\n\tstackTreeFieldCursor,\n} from \"./treeCursorUtils.js\";\nexport {\n\tcursorForJsonableTreeNode,\n\tcursorForJsonableTreeField,\n\tjsonableTreeFromCursor,\n\tjsonableTreeFromFieldCursor,\n\tjsonableTreeFromForest,\n} from \"./treeTextCursor.js\";\n\n// Split this up into separate import and export for compatibility with API-Extractor.\nimport * as SequenceField from \"./sequence-field/index.js\";\nexport { SequenceField };\n\nexport {\n\tisNeverField,\n\tModularEditBuilder,\n\ttype FieldEditDescription as EditDescription,\n\ttype FieldChangeHandler,\n\ttype FieldChangeRebaser,\n\ttype FieldEditor,\n\ttype FieldChangeMap,\n\ttype FieldChange,\n\ttype FieldChangeset,\n\ttype ToDelta,\n\ttype ModularChangeset,\n\tmakeModularChangeCodecFamily,\n\ttype NodeChangeComposer,\n\ttype NodeChangeInverter,\n\ttype NodeChangeRebaser,\n\ttype NodeChangePruner,\n\ttype CrossFieldManager,\n\tCrossFieldTarget,\n\tFlexFieldKind,\n\ttype FullSchemaPolicy,\n\tallowsRepoSuperset,\n\ttype GenericChangeset,\n\tgenericFieldKind,\n\ttype HasFieldChanges,\n\ttype NodeExistsConstraint,\n\tFieldKindWithEditor,\n\tModularChangeFamily,\n\ttype RelevantRemovedRootsFromChild,\n\tEncodedModularChangeset,\n\tupdateRefreshers,\n\ttype NodeId,\n\ttype FieldChangeEncodingContext,\n\ttype FieldKindConfiguration,\n\ttype FieldKindConfigurationEntry,\n\tgetAllowedContentIncompatibilities,\n\tisRepoSuperset,\n} from \"./modular-schema/index.js\";\n\nexport {\n\ttype FlexTreeNodeSchema,\n\ttype FlexAllowedTypes,\n\tFlexFieldSchema,\n\ttype FlexTreeSchema,\n\tAny,\n\ttype SchemaLibraryData,\n\ttype LazyTreeNodeSchema,\n\tViewSchema,\n\ttype SchemaLintConfiguration,\n\tLeafNodeSchema,\n\tFlexMapNodeSchema,\n\tFlexObjectNodeSchema,\n\tschemaIsLeaf,\n\tschemaIsMap,\n\tschemaIsObjectNode,\n\ttype Unenforced,\n\ttype AllowedTypeSet,\n\tmarkEager,\n\ttype FlexMapFieldSchema,\n\ttype SchemaCollection,\n\tTreeNodeSchemaBase,\n\ttype LazyItem,\n\ttype FlexListToUnion,\n\ttype ExtractItemType,\n\tisLazy,\n\ttype NormalizeObjectNodeFields,\n\ttype NormalizeField as NormalizeFieldSchema,\n\ttype FlexObjectNodeFields,\n\tintoStoredSchema,\n\tintoStoredSchemaCollection,\n\ttype NormalizeLazyItem,\n\ttype FlexList,\n} from \"./typed-schema/index.js\";\n\nexport {\n\tSchemaBuilderBase,\n\ttype SchemaLibrary,\n\ttype FlexImplicitFieldSchema,\n\ttype NormalizeField,\n\ttype FlexImplicitAllowedTypes,\n\ttype NormalizeAllowedTypes,\n\ttype SchemaBuilderOptions,\n\tnormalizeAllowedTypes,\n\tnormalizeField,\n} from \"./schemaBuilderBase.js\";\nexport { SchemaBuilderInternal } from \"./schemaBuilder.js\";\n\nexport { mapRootChanges } from \"./deltaUtils.js\";\n\nexport {\n\ttype TreeChunk,\n\tchunkTree,\n\tchunkFieldSingle,\n\tbuildChunkedForest,\n\tdefaultChunkPolicy,\n\ttype FieldBatch,\n\ttype FieldBatchCodec,\n\tmakeTreeChunker,\n\tmakeFieldBatchCodec,\n\ttype FieldBatchEncodingContext,\n} from \"./chunked-forest/index.js\";\n\nexport {\n\tcompareLocalNodeKeys,\n\tcreateNodeKeyManager,\n\tisStableNodeKey,\n\ttype LocalNodeKey,\n\tMockNodeKeyManager,\n\ttype NodeKeyManager,\n\tnodeKeyTreeIdentifier,\n\ttype StableNodeKey,\n} from \"./node-key/index.js\";\n\nexport {\n\tFieldKinds,\n\ttype Required,\n\ttype Optional,\n\ttype Sequence,\n\ttype Identifier,\n\ttype Forbidden,\n\ttype DefaultChangeset,\n\tDefaultChangeFamily,\n\tDefaultEditBuilder,\n\ttype IDefaultEditBuilder,\n\ttype ValueFieldEditBuilder,\n\ttype OptionalFieldEditBuilder,\n\ttype SequenceFieldEditBuilder,\n\tdefaultSchemaPolicy,\n\tfieldKinds,\n\tfieldKindConfigurations,\n\tintoDelta,\n\trelevantRemovedRoots,\n\tSchemaValidationErrors,\n\tisNodeInSchema,\n\tisFieldInSchema,\n} from \"./default-schema/index.js\";\n\nexport {\n\ttype AssignableFieldKinds,\n\ttype FlexibleFieldContent,\n\ttype FlexibleNodeContent,\n\ttype FlexTreeLeafNode,\n\ttype FlexTreeMapNode,\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\tSkip,\n\ttype FlexTreeObjectNode,\n\ttype FlexTreeContext,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeTypedNode,\n\ttype FlexTreeTypedNodeUnion,\n\ttype FlexTreeEntity,\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\tgetTreeContext,\n\ttype CheckTypesOverlap,\n\tTreeStatus,\n\tContext,\n\ttype FlexTreeNodeEvents,\n\ttype FlexTreeUnknownUnboxed,\n\tisFlexTreeNode,\n\tContextSlot,\n\t// Internal\n\ttype FlexTreeUnboxField,\n\tflexTreeMarker,\n\tFlexTreeEntityKind,\n\tassertFlexTreeEntityNotFreed,\n\tflexTreeSlot,\n\tgetSchemaAndPolicy,\n\tisFreedSymbol,\n\tLazyEntity,\n\ttreeStatusFromAnchorCache,\n} from \"./flex-tree/index.js\";\n\nexport { treeSchemaFromStoredSchema } from \"./storedToViewSchema.js\";\n\nexport { TreeCompressionStrategy } from \"./treeCompressionUtils.js\";\n\nexport { valueSchemaAllows } from \"./valueUtilities.js\";\n\nexport { DetachedFieldIndexSummarizer } from \"./detachedFieldIndexSummarizer.js\";\n\nexport {\n\ttype SchemaChange,\n\tmakeSchemaChangeCodecs,\n\tEncodedSchemaChange,\n} from \"./schema-edits/index.js\";\n\nexport { makeMitigatedChangeFamily } from \"./mitigatedChangeFamily.js\";\n\nexport {\n\ttype MapTreeNode,\n\ttype MapTreeSequenceField,\n\tisMapTreeNode,\n\tisMapTreeSequenceField,\n\tgetOrCreateMapTreeNode,\n\ttryGetMapTreeNode,\n} from \"./flex-map-tree/index.js\";\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export { EmptyKey, type FieldKey, type TreeValue, type FieldMapObject, type NodeData, type GenericTreeNode, type JsonableTree, type GenericFieldsNode, type TreeNodeSchemaIdentifier, type TreeFieldStoredSchema, ValueSchema, TreeNodeStoredSchema, type FieldKindIdentifier, type TreeTypeSet, type TreeStoredSchema, type Revertible, CommitKind, RevertibleStatus, type CommitMetadata, type StoredSchemaCollection, type ErasedTreeNodeSchemaDataFormat, ObjectNodeStoredSchema, MapNodeStoredSchema, LeafNodeStoredSchema, } from "./core/index.js";
|
|
6
6
|
export { type Brand } from "./util/index.js";
|
|
7
|
-
export { type Listeners, type IsListener, type Listenable, type Off, } from "./events/index.js";
|
|
7
|
+
export { type Listeners, type IsListener, type Listenable, type Off, createEmitter, EventEmitter, type IEmitter, type HasListeners, type NoListenersCallback, } from "./events/index.js";
|
|
8
8
|
export { type LazyItem, TreeStatus, type Unenforced, TreeCompressionStrategy, } from "./feature-libraries/index.js";
|
|
9
9
|
export { type ISharedTree, type SharedTreeOptions, ForestType, type SharedTreeContentSnapshot, type RevertibleFactory, type SharedTreeFormatOptions, SharedTreeFormatVersion, Tree, type TransactionConstraint, type NodeInDocumentConstraint, type RunTransaction, rollback, } from "./shared-tree/index.js";
|
|
10
|
-
export { TreeArrayNode, type Unhydrated, IterableTreeArrayContent, TreeNode, type ITree, type TreeNodeSchema, TreeViewConfiguration, type ITreeViewConfiguration, type ITreeConfigurationOptions, type TreeView, type TreeViewEvents, SchemaFactory, type ImplicitFieldSchema, type TreeFieldFromImplicitField, type TreeChangeEvents, type NodeFromSchema, type TreeMapNode, type InsertableTreeNodeFromImplicitAllowedTypes, type TreeLeafValue, FieldKind, FieldSchema, type ImplicitAllowedTypes, type InsertableTreeFieldFromImplicitField, type InsertableTypedNode, NodeKind, type TreeObjectNode, type TreeNodeFromImplicitAllowedTypes, type TreeNodeSchemaClass, type SchemaCompatibilityStatus, type FieldProps, type InternalTreeNode, type WithType, type TreeNodeApi, type TreeNodeSchemaCore, type AllowedTypes, type TreeObjectNodeUnsafe, type InsertableTreeNodeFromImplicitAllowedTypesUnsafe, type TreeArrayNodeUnsafe, type TreeMapNodeUnsafe, type InsertableObjectFromSchemaRecordUnsafe, type InsertableTreeFieldFromImplicitFieldUnsafe, type FieldSchemaUnsafe, type typeSchemaSymbol, type ValidateRecursiveSchema, type FixRecursiveArraySchema, adaptEnum, enumFromStrings, singletonSchema, typedObjectValues, type EmptyObject, test_RecursiveObject, test_RecursiveObject_base, test_RecursiveObjectPojoMode, type JsonTreeSchema, type JsonSchemaId, type JsonNodeSchema, type JsonNodeSchemaBase, type JsonLeafNodeSchema, type JsonMapNodeSchema, type JsonArrayNodeSchema, type JsonObjectNodeSchema, type JsonFieldSchema, type JsonSchemaRef, type JsonRefPath, type JsonSchemaType, type JsonLeafSchemaType, getJsonSchema, } from "./simple-tree/index.js";
|
|
10
|
+
export { TreeArrayNode, type Unhydrated, IterableTreeArrayContent, TreeNode, type ITree, type TreeNodeSchema, TreeViewConfiguration, type ITreeViewConfiguration, type ITreeConfigurationOptions, type TreeView, type TreeViewEvents, SchemaFactory, type ImplicitFieldSchema, type TreeFieldFromImplicitField, type TreeChangeEvents, type NodeFromSchema, type TreeMapNode, type InsertableTreeNodeFromImplicitAllowedTypes, type TreeLeafValue, FieldKind, FieldSchema, type ImplicitAllowedTypes, type InsertableTreeFieldFromImplicitField, type InsertableTypedNode, NodeKind, type TreeObjectNode, type TreeNodeFromImplicitAllowedTypes, type TreeNodeSchemaClass, type SchemaCompatibilityStatus, type FieldProps, type InternalTreeNode, type WithType, type NodeChangedData, type TreeNodeApi, type TreeNodeSchemaCore, type AllowedTypes, type TreeObjectNodeUnsafe, type InsertableTreeNodeFromImplicitAllowedTypesUnsafe, type TreeArrayNodeUnsafe, type TreeMapNodeUnsafe, type InsertableObjectFromSchemaRecordUnsafe, type InsertableTreeFieldFromImplicitFieldUnsafe, type FieldSchemaUnsafe, type typeSchemaSymbol, type ValidateRecursiveSchema, type FixRecursiveArraySchema, adaptEnum, enumFromStrings, singletonSchema, typedObjectValues, type EmptyObject, test_RecursiveObject, test_RecursiveObject_base, test_RecursiveObjectPojoMode, type JsonTreeSchema, type JsonSchemaId, type JsonNodeSchema, type JsonNodeSchemaBase, type JsonLeafNodeSchema, type JsonMapNodeSchema, type JsonArrayNodeSchema, type JsonObjectNodeSchema, type JsonFieldSchema, type JsonSchemaRef, type JsonRefPath, type JsonSchemaType, type JsonLeafSchemaType, getJsonSchema, } from "./simple-tree/index.js";
|
|
11
11
|
export { SharedTree, configuredSharedTree } from "./treeFactory.js";
|
|
12
12
|
export type { ICodecOptions, JsonValidator, SchemaValidationFunction } from "./codec/index.js";
|
|
13
13
|
export { noopValidator } from "./codec/index.js";
|