@fluidframework/tree 2.1.0-281041 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/Tree.code-workspace +2 -1
- package/CHANGELOG.md +38 -0
- package/README.md +6 -6
- package/api-report/tree.alpha.api.md +1 -1
- package/api-report/tree.beta.api.md +1 -1
- package/api-report/tree.public.api.md +1 -1
- package/dist/core/forest/editableForest.d.ts.map +1 -1
- package/dist/core/forest/editableForest.js +4 -2
- package/dist/core/forest/editableForest.js.map +1 -1
- package/dist/core/tree/anchorSet.d.ts +1 -0
- package/dist/core/tree/anchorSet.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.js +13 -0
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/detachedFieldIndex.d.ts +48 -11
- package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndex.js +144 -20
- package/dist/core/tree/detachedFieldIndex.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodec.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodec.js +13 -4
- package/dist/core/tree/detachedFieldIndexCodec.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormat.d.ts +1 -1
- package/dist/core/tree/detachedFieldIndexFormat.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormat.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexTypes.d.ts +39 -4
- package/dist/core/tree/detachedFieldIndexTypes.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexTypes.js.map +1 -1
- package/dist/core/tree/index.d.ts +2 -1
- package/dist/core/tree/index.d.ts.map +1 -1
- package/dist/core/tree/index.js.map +1 -1
- package/dist/core/tree/visitDelta.d.ts +3 -1
- package/dist/core/tree/visitDelta.d.ts.map +1 -1
- package/dist/core/tree/visitDelta.js +31 -15
- package/dist/core/tree/visitDelta.js.map +1 -1
- package/dist/core/tree/visitorUtils.d.ts +3 -3
- package/dist/core/tree/visitorUtils.d.ts.map +1 -1
- package/dist/core/tree/visitorUtils.js +4 -4
- package/dist/core/tree/visitorUtils.js.map +1 -1
- package/dist/feature-libraries/editableTreeBinder.js +1 -1
- package/dist/feature-libraries/editableTreeBinder.js.map +1 -1
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts +1 -8
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.js +0 -52
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +1 -13
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js +0 -2
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/dist/feature-libraries/flex-tree/index.d.ts +2 -1
- package/dist/feature-libraries/flex-tree/index.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/index.js +5 -1
- package/dist/feature-libraries/flex-tree/index.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyEntity.d.ts +1 -2
- package/dist/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.d.ts +1 -2
- package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +10 -18
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts +1 -4
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.js +0 -27
- package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.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 +4 -1
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/discrepancies.js +3 -3
- package/dist/feature-libraries/modular-schema/discrepancies.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +14 -17
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.d.ts +3 -2
- package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.js +5 -4
- package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +5 -1
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +8 -1
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.js +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/dist/shared-tree/treeApi.js +1 -1
- package/dist/shared-tree/treeApi.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +10 -1
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +47 -4
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree/treeView.d.ts.map +1 -1
- package/dist/shared-tree/treeView.js +7 -3
- package/dist/shared-tree/treeView.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts +6 -0
- package/dist/shared-tree-core/branch.d.ts.map +1 -1
- package/dist/shared-tree-core/branch.js +2 -0
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts +4 -0
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +6 -0
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/simple-tree/arrayNode.js +1 -1
- package/dist/simple-tree/arrayNode.js.map +1 -1
- package/dist/simple-tree/index.d.ts +3 -3
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +2 -1
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/proxies.d.ts.map +1 -1
- package/dist/simple-tree/proxies.js +7 -21
- package/dist/simple-tree/proxies.js.map +1 -1
- package/dist/simple-tree/proxyBinding.d.ts +4 -0
- package/dist/simple-tree/proxyBinding.d.ts.map +1 -1
- package/dist/simple-tree/proxyBinding.js +23 -1
- package/dist/simple-tree/proxyBinding.js.map +1 -1
- package/dist/simple-tree/tree.d.ts.map +1 -1
- package/dist/simple-tree/tree.js +1 -1
- package/dist/simple-tree/tree.js.map +1 -1
- package/dist/simple-tree/treeNodeApi.d.ts +2 -75
- package/dist/simple-tree/treeNodeApi.d.ts.map +1 -1
- package/dist/simple-tree/treeNodeApi.js +7 -15
- package/dist/simple-tree/treeNodeApi.js.map +1 -1
- package/dist/simple-tree/treeNodeKernel.d.ts +26 -0
- package/dist/simple-tree/treeNodeKernel.d.ts.map +1 -0
- package/dist/simple-tree/treeNodeKernel.js +83 -0
- package/dist/simple-tree/treeNodeKernel.js.map +1 -0
- package/dist/simple-tree/types.d.ts +73 -0
- package/dist/simple-tree/types.d.ts.map +1 -1
- package/dist/simple-tree/types.js +89 -1
- package/dist/simple-tree/types.js.map +1 -1
- package/dist/util/breakable.js +1 -1
- package/dist/util/breakable.js.map +1 -1
- package/dist/util/index.d.ts +1 -1
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js.map +1 -1
- package/lib/core/forest/editableForest.d.ts.map +1 -1
- package/lib/core/forest/editableForest.js +4 -2
- package/lib/core/forest/editableForest.js.map +1 -1
- package/lib/core/tree/anchorSet.d.ts +1 -0
- package/lib/core/tree/anchorSet.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.js +13 -0
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/core/tree/detachedFieldIndex.d.ts +48 -11
- package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndex.js +145 -21
- package/lib/core/tree/detachedFieldIndex.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodec.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodec.js +13 -4
- package/lib/core/tree/detachedFieldIndexCodec.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormat.d.ts +1 -1
- package/lib/core/tree/detachedFieldIndexFormat.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormat.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexTypes.d.ts +39 -4
- package/lib/core/tree/detachedFieldIndexTypes.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexTypes.js.map +1 -1
- package/lib/core/tree/index.d.ts +2 -1
- package/lib/core/tree/index.d.ts.map +1 -1
- package/lib/core/tree/index.js.map +1 -1
- package/lib/core/tree/visitDelta.d.ts +3 -1
- package/lib/core/tree/visitDelta.d.ts.map +1 -1
- package/lib/core/tree/visitDelta.js +31 -15
- package/lib/core/tree/visitDelta.js.map +1 -1
- package/lib/core/tree/visitorUtils.d.ts +3 -3
- package/lib/core/tree/visitorUtils.d.ts.map +1 -1
- package/lib/core/tree/visitorUtils.js +4 -4
- package/lib/core/tree/visitorUtils.js.map +1 -1
- package/lib/feature-libraries/editableTreeBinder.js +1 -1
- package/lib/feature-libraries/editableTreeBinder.js.map +1 -1
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts +1 -8
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.js +2 -54
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +1 -13
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js +0 -2
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/lib/feature-libraries/flex-tree/index.d.ts +2 -1
- package/lib/feature-libraries/flex-tree/index.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/index.js +2 -1
- package/lib/feature-libraries/flex-tree/index.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyEntity.d.ts +1 -2
- package/lib/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.d.ts +1 -2
- package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +12 -20
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts +1 -4
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.js +3 -30
- package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +1 -1
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +1 -1
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/discrepancies.js +3 -3
- package/lib/feature-libraries/modular-schema/discrepancies.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +14 -17
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.d.ts +3 -2
- package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js +5 -4
- package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +5 -1
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +8 -1
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.js +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/lib/shared-tree/treeApi.js +1 -1
- package/lib/shared-tree/treeApi.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +10 -1
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +47 -4
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree/treeView.d.ts.map +1 -1
- package/lib/shared-tree/treeView.js +4 -0
- package/lib/shared-tree/treeView.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts +6 -0
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +2 -0
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts +4 -0
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +6 -0
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/simple-tree/arrayNode.js +2 -2
- package/lib/simple-tree/arrayNode.js.map +1 -1
- package/lib/simple-tree/index.d.ts +3 -3
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +1 -1
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/proxies.d.ts.map +1 -1
- package/lib/simple-tree/proxies.js +7 -21
- package/lib/simple-tree/proxies.js.map +1 -1
- package/lib/simple-tree/proxyBinding.d.ts +4 -0
- package/lib/simple-tree/proxyBinding.d.ts.map +1 -1
- package/lib/simple-tree/proxyBinding.js +19 -0
- package/lib/simple-tree/proxyBinding.js.map +1 -1
- package/lib/simple-tree/tree.d.ts.map +1 -1
- package/lib/simple-tree/tree.js +1 -1
- package/lib/simple-tree/tree.js.map +1 -1
- package/lib/simple-tree/treeNodeApi.d.ts +2 -75
- package/lib/simple-tree/treeNodeApi.d.ts.map +1 -1
- package/lib/simple-tree/treeNodeApi.js +9 -17
- package/lib/simple-tree/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/treeNodeKernel.d.ts +26 -0
- package/lib/simple-tree/treeNodeKernel.d.ts.map +1 -0
- package/lib/simple-tree/treeNodeKernel.js +79 -0
- package/lib/simple-tree/treeNodeKernel.js.map +1 -0
- package/lib/simple-tree/types.d.ts +73 -0
- package/lib/simple-tree/types.d.ts.map +1 -1
- package/lib/simple-tree/types.js +90 -2
- package/lib/simple-tree/types.js.map +1 -1
- package/lib/util/breakable.js +1 -1
- package/lib/util/breakable.js.map +1 -1
- package/lib/util/index.d.ts +1 -1
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js.map +1 -1
- package/package.json +23 -23
- package/src/core/forest/editableForest.ts +10 -2
- package/src/core/tree/anchorSet.ts +14 -0
- package/src/core/tree/detachedFieldIndex.ts +217 -35
- package/src/core/tree/detachedFieldIndexCodec.ts +17 -8
- package/src/core/tree/detachedFieldIndexFormat.ts +1 -1
- package/src/core/tree/detachedFieldIndexTypes.ts +41 -5
- package/src/core/tree/index.ts +2 -1
- package/src/core/tree/visitDelta.ts +57 -16
- package/src/core/tree/visitorUtils.ts +7 -4
- package/src/feature-libraries/editableTreeBinder.ts +1 -1
- package/src/feature-libraries/flex-map-tree/mapTreeNode.ts +1 -65
- package/src/feature-libraries/flex-tree/flexTreeTypes.ts +0 -19
- package/src/feature-libraries/flex-tree/index.ts +7 -1
- package/src/feature-libraries/flex-tree/lazyEntity.ts +0 -3
- package/src/feature-libraries/flex-tree/lazyField.ts +14 -26
- package/src/feature-libraries/flex-tree/lazyNode.ts +1 -42
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +1 -0
- package/src/feature-libraries/index.ts +3 -0
- package/src/feature-libraries/modular-schema/discrepancies.ts +3 -3
- package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +1 -1
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +22 -20
- package/src/feature-libraries/object-forest/objectForest.ts +7 -3
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/sharedTree.ts +8 -1
- package/src/shared-tree/sharedTreeChangeEnricher.ts +1 -1
- package/src/shared-tree/treeApi.ts +1 -1
- package/src/shared-tree/treeCheckout.ts +56 -5
- package/src/shared-tree/treeView.ts +5 -0
- package/src/shared-tree-core/branch.ts +9 -0
- package/src/shared-tree-core/sharedTreeCore.ts +7 -0
- package/src/simple-tree/arrayNode.ts +2 -2
- package/src/simple-tree/index.ts +3 -3
- package/src/simple-tree/proxies.ts +8 -29
- package/src/simple-tree/proxyBinding.ts +23 -0
- package/src/simple-tree/tree.ts +4 -1
- package/src/simple-tree/treeNodeApi.ts +14 -96
- package/src/simple-tree/treeNodeKernel.ts +91 -0
- package/src/simple-tree/types.ts +233 -2
- package/src/util/breakable.ts +1 -1
- package/src/util/index.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file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AG,CAAC,IAAI,IAAI,CAAC,2CAA2C,CAAC,CAAC;IAE9E,IAAI,WAAW,CAAC,IAAI,KAAK,UAAU,CAAC,QAAQ,EAAE,CAAC;QAC9C,OAAO,YAAY,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE;YAC7C,MAAM,EAAE,KAAK;YACb,KAAK,EAAE,CAAC;SACR,CAAqC,CAAC;IACxC,CAAC;IACD,IAAI,WAAW,CAAC,IAAI,KAAK,UAAU,CAAC,QAAQ,EAAE,CAAC;QAC9C,OAAO,CACN,QAAQ,CAAC,MAAM,GAAG,CAAC;YAClB,CAAC,CAAC,YAAY,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;YACrE,CAAC,CAAC,SAAS,CACwB,CAAC;IACvC,CAAC;IAED,OAAO,gBAAgB,CACtB,UAAU,EACV,GAAG,EACH,QAAQ,EACR,WAAW,CACyB,CAAC;AACvC,CAAC;AAED,4CAA4C;AAE5C,MAAM,UAAU,qBAAqB,CAAC,OAAgB;IACrD,OAAO,IAAI,UAAU,CACpB,GACC,OAAO,IAAI,WACZ,4EAA4E,CAC5E,CAAC;AACH,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\";\nimport {\n\ttype AnchorNode,\n\tEmptyKey,\n\ttype FieldKey,\n\ttype FieldUpPath,\n\ttype MapTree,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeValue,\n\ttype Value,\n} from \"../../core/index.js\";\nimport { brand, fail, getOrCreate, mapIterable } from \"../../util/index.js\";\nimport {\n\ttype FlexTreeContext,\n\tFlexTreeEntityKind,\n\ttype FlexTreeField,\n\ttype FlexTreeFieldNode,\n\ttype FlexTreeLeafNode,\n\ttype FlexTreeMapNode,\n\ttype FlexTreeNode,\n\ttype FlexTreeNodeEvents,\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeTypedNode,\n\ttype FlexTreeTypedNodeUnion,\n\ttype FlexTreeUnboxField,\n\ttype FlexTreeUnboxNodeUnion,\n\ttype FlexibleFieldContent,\n\ttype FlexibleNodeSubSequence,\n\tTreeStatus,\n\tflexTreeMarker,\n\tindexForAt,\n} from \"../flex-tree/index.js\";\nimport {\n\ttype FlexAllowedTypes,\n\ttype FlexFieldNodeSchema,\n\tFlexFieldSchema,\n\ttype FlexMapNodeSchema,\n\ttype FlexTreeNodeSchema,\n\ttype LeafNodeSchema,\n\tisLazy,\n\tschemaIsFieldNode,\n\tschemaIsLeaf,\n\tschemaIsMap,\n\tschemaIsObjectNode,\n} from \"../typed-schema/index.js\";\nimport { type FlexImplicitAllowedTypes, normalizeAllowedTypes } from \"../schemaBuilderBase.js\";\nimport type { FlexFieldKind } from \"../modular-schema/index.js\";\nimport { FieldKinds, type SequenceFieldEditBuilder } from \"../default-schema/index.js\";\nimport { ComposableEventEmitter, type Listenable, type Off } from \"../../events/index.js\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\n// #region Nodes\n\n/**\n * A readonly {@link FlexTreeNode} which wraps a {@link MapTree}.\n * @remarks Reading data from the MapTreeNode will read the corresponding data from the {@link MapTree}.\n * Create a `MapTreeNode` by calling {@link getOrCreateMapTreeNode}.\n */\nexport interface MapTreeNode extends FlexTreeNode {\n\treadonly mapTree: MapTree;\n\tforwardEvents(to: Listenable<FlexTreeNodeEvents>): void;\n}\n\n/**\n * Checks if the given {@link FlexTreeNode} is a {@link MapTreeNode}.\n */\nexport function isMapTreeNode(flexNode: FlexTreeNode): flexNode is MapTreeNode {\n\treturn flexNode instanceof EagerMapTreeNode;\n}\n\n/** A node's parent field and its index in that field */\ninterface LocationInField {\n\treadonly parent: MapTreeField<FlexAllowedTypes>;\n\treadonly index: number;\n}\n\n/**\n * Allows events to be forwarded to another event emitter.\n * @remarks TODO: After the eventing library is simplified, find a way to support this pattern elegantly in the library.\n */\nclass ForwardingEventEmitter extends ComposableEventEmitter<FlexTreeNodeEvents> {\n\t// A map from deregistration functions produced by this class to deregistration functions of Listenables that have been forwarded to\n\tprivate readonly forwardedOffs = new Map<Off, Off[]>();\n\n\tpublic override on<K extends keyof FlexTreeNodeEvents>(\n\t\teventName: K,\n\t\tlistener: FlexTreeNodeEvents[K],\n\t): Off {\n\t\tconst off = super.on(eventName, listener);\n\t\t// Return a deregister function which...\n\t\treturn (): void => {\n\t\t\toff(); // ...deregisters the event in this emitter,\n\t\t\t// and also deregisters the event in any Listenable that it gets forwarded to\n\t\t\t(this.forwardedOffs.get(off) ?? []).forEach((f) => f());\n\t\t};\n\t}\n\n\tpublic forwardEvents(to: Listenable<FlexTreeNodeEvents>): void {\n\t\tfor (const [eventName, listeners] of this.listeners) {\n\t\t\tfor (const [off, listener] of listeners) {\n\t\t\t\t// For every one of our listeners, make the same subscription in the Listenable that we're forwarding to,\n\t\t\t\t// and then create a mapping from our deregistration function to theirs, so we can call it later if need be.\n\t\t\t\tgetOrCreate(this.forwardedOffs, off, () => []).push(to.on(eventName, listener));\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * A readonly implementation of {@link FlexTreeNode} which wraps a {@link MapTree}.\n * @remarks Any methods that would mutate the node will fail,\n * as will the querying of data specific to the {@link LazyTreeNode} implementation (e.g. {@link FlexTreeNode.context}).\n * MapTreeNodes are unconditionally cached -\n * when retrieved via {@link getOrCreateNode}, the same {@link MapTree} object will always produce the same `MapTreeNode` object.\n */\nexport class EagerMapTreeNode<TSchema extends FlexTreeNodeSchema> implements MapTreeNode {\n\tpublic readonly [flexTreeMarker] = FlexTreeEntityKind.Node as const;\n\tprivate readonly events = new ForwardingEventEmitter();\n\tpublic forwardEvents(to: Listenable<FlexTreeNodeEvents>): void {\n\t\tthis.events.forwardEvents(to);\n\t}\n\n\t/**\n\t * Create a new MapTreeNode.\n\t * @param location - the parentage of this node, if it is being created underneath an existing node and field, or undefined if not\n\t * @remarks This class (and its subclasses) should not be directly constructed outside of this module.\n\t * Instead, use {@link getOrCreateNode} to create a MapTreeNode from a {@link MapTree}.\n\t * A `MapTreeNode` may never be constructed more than once for the same {@link MapTree} object.\n\t * Instead, it should always be acquired via {@link getOrCreateNode}.\n\t */\n\tpublic constructor(\n\t\tpublic readonly schema: TSchema,\n\t\t/** The underlying {@link MapTree} that this `MapTreeNode` reads its data from */\n\t\tpublic readonly mapTree: MapTree,\n\t\tprivate location: LocationInField | undefined,\n\t) {\n\t\tassert(!nodeCache.has(mapTree), 0x98b /* A node already exists for the given MapTree */);\n\t\tnodeCache.set(mapTree, this);\n\n\t\t// Fully demand the tree to ensure that parent pointers are present and accurate on all nodes.\n\t\t// When a MapTreeNode is constructed, its MapTree may contain nodes (anywhere below) that map (via the `nodeCache`) to pre-existing MapTreeNodes.\n\t\t// Put another way, for a given MapTree, some ancestor MapTreeNode can be created after any number of its descendant MapTreeNodes already exist.\n\t\t// In such a case, the spine of nodes between the descendant and ancestor need to exist in order for the ancestor to be able to walk upwards via the `parentField` property.\n\t\t// This needs to happen for all MapTreeNodes that are descendants of the ancestor MapTreeNode.\n\t\t// Demanding the entire tree is overkill to solve this problem since not all descendant MapTree nodes will have corresponding MapTreeNodes.\n\t\t// However, demanding the full tree also lets us eagerly validate that there are no duplicate MapTrees (i.e. same MapTree object) anywhere in the tree.\n\t\tthis.walkTree();\n\t}\n\n\tpublic get type(): TreeNodeSchemaIdentifier {\n\t\treturn this.schema.name;\n\t}\n\n\t/**\n\t * Set this node's parentage (see {@link FlexTreeNode.parentField}).\n\t * @remarks A node may only be adopted to a new parent one time, and only if it was not constructed with a parent.\n\t */\n\tpublic adopt(parent: MapTreeField<FlexAllowedTypes>, index: number): void {\n\t\tassert(\n\t\t\tthis.location === undefined,\n\t\t\t0x98c /* Node may not be adopted if it already has a parent */,\n\t\t);\n\t\tthis.location = { parent, index };\n\t}\n\n\t/**\n\t * The field this tree is in, and the index within that field.\n\t * @remarks If this node is unparented, this method will return the special {@link rootMapTreeField} as the parent.\n\t */\n\tpublic get parentField(): LocationInField {\n\t\tif (this.location === undefined) {\n\t\t\treturn {\n\t\t\t\tparent: rootMapTreeField,\n\t\t\t\tindex: -1,\n\t\t\t};\n\t\t}\n\n\t\treturn this.location;\n\t}\n\n\tpublic is<TSchemaInner extends FlexTreeNodeSchema>(\n\t\tschema: TSchemaInner,\n\t): this is FlexTreeTypedNode<TSchemaInner> {\n\t\treturn (schema as unknown) === this.schema;\n\t}\n\n\tpublic tryGetField(key: FieldKey): MapTreeField<FlexAllowedTypes> | undefined {\n\t\tconst field = this.mapTree.fields.get(key);\n\t\t// Only return the field if it is not empty, in order to fulfill the contract of `tryGetField`.\n\t\tif (field !== undefined && field.length > 0) {\n\t\t\treturn getOrCreateField(this, key, field, this.schema.getFieldSchema(key));\n\t\t}\n\t}\n\n\tpublic getBoxed(key: string): FlexTreeField {\n\t\tconst fieldKey: FieldKey = brand(key);\n\t\tconst field = this.mapTree.fields.get(fieldKey) ?? [];\n\t\treturn getOrCreateField(this, fieldKey, field, this.schema.getFieldSchema(fieldKey));\n\t}\n\n\tpublic boxedIterator(): IterableIterator<FlexTreeField> {\n\t\treturn mapIterable(this.mapTree.fields.entries(), ([key, field]) =>\n\t\t\tgetOrCreateField(this, key, field, this.schema.getFieldSchema(key)),\n\t\t);\n\t}\n\n\tpublic treeStatus(): TreeStatus {\n\t\treturn TreeStatus.New;\n\t}\n\n\tpublic get value(): Value {\n\t\treturn this.mapTree.value;\n\t}\n\n\tpublic on<K extends keyof FlexTreeNodeEvents>(\n\t\teventName: K,\n\t\tlistener: FlexTreeNodeEvents[K],\n\t): () => void {\n\t\tswitch (eventName) {\n\t\t\tcase \"nodeChanged\":\n\t\t\tcase \"treeChanged\":\n\t\t\t\treturn this.events.on(eventName, listener);\n\t\t\tdefault:\n\t\t\t\tthrow unsupportedUsageError(`Subscribing to ${eventName}`);\n\t\t}\n\t}\n\n\tpublic get context(): FlexTreeContext {\n\t\t// This API is relevant to `LazyTreeNode`s, but not `MapTreeNode`s.\n\t\t// TODO: Refactor the FlexTreeNode interface so that stubbing this out isn't necessary.\n\t\treturn fail(\"MapTreeNode does not implement context\");\n\t}\n\n\tpublic get anchorNode(): AnchorNode {\n\t\t// This API is relevant to `LazyTreeNode`s, but not `MapTreeNode`s.\n\t\t// TODO: Refactor the FlexTreeNode interface so that stubbing this out isn't necessary.\n\t\treturn fail(\"MapTreeNode does not implement anchorNode\");\n\t}\n\n\tprivate walkTree(): void {\n\t\tfor (const [key, mapTrees] of this.mapTree.fields) {\n\t\t\tconst field = getOrCreateField(this, key, mapTrees, this.schema.getFieldSchema(key));\n\t\t\tfor (let index = 0; index < field.length; index++) {\n\t\t\t\tconst child = getOrCreateChild(\n\t\t\t\t\tmapTrees[index],\n\t\t\t\t\tthis.schema.getFieldSchema(key).allowedTypes,\n\t\t\t\t\t{ parent: field, index },\n\t\t\t\t);\n\t\t\t\t// These next asserts detect the case where `getOrCreateChild` gets a cache hit of a different node than the one we're trying to create\n\t\t\t\tassert(child.location !== undefined, 0x98d /* Expected node to have parent */);\n\t\t\t\tassert(\n\t\t\t\t\tchild.location.parent.parent === this,\n\t\t\t\t\t0x98e /* Node may not be multi-parented */,\n\t\t\t\t);\n\t\t\t\tassert(child.location.index === index, 0x98f /* Node may not be multi-parented */);\n\t\t\t\tchild.walkTree();\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * The implementation of a field node created by {@link getOrCreateNode}.\n */\nexport class EagerMapTreeFieldNode<TSchema extends FlexFieldNodeSchema>\n\textends EagerMapTreeNode<TSchema>\n\timplements FlexTreeFieldNode<TSchema>\n{\n\tpublic get content(): FlexTreeUnboxField<TSchema[\"info\"]> {\n\t\tconst field = this.tryGetField(EmptyKey);\n\t\tif (field === undefined) {\n\t\t\treturn undefined as FlexTreeUnboxField<TSchema[\"info\"]>;\n\t\t}\n\t\treturn unboxedField(field, EmptyKey, this.mapTree, this);\n\t}\n\n\tpublic override getBoxed(key: string): FlexTreeTypedField<TSchema[\"info\"]> {\n\t\treturn super.getBoxed(key) as FlexTreeTypedField<TSchema[\"info\"]>;\n\t}\n}\n\n/**\n * The implementation of a map node created by {@link getOrCreateNode}.\n */\nexport class EagerMapTreeMapNode<TSchema extends FlexMapNodeSchema>\n\textends EagerMapTreeNode<TSchema>\n\timplements FlexTreeMapNode<TSchema>\n{\n\tpublic get size(): number {\n\t\treturn this.mapTree.fields.size;\n\t}\n\n\tpublic has(key: string): boolean {\n\t\treturn this.tryGetField(brand(key)) !== undefined;\n\t}\n\n\tpublic get(key: string): FlexTreeUnboxField<TSchema[\"info\"]> {\n\t\tconst field = this.tryGetField(brand(key));\n\t\tif (field === undefined) {\n\t\t\treturn undefined as FlexTreeUnboxField<TSchema[\"info\"]>;\n\t\t}\n\t\treturn unboxedField(field, brand(key), this.mapTree, this);\n\t}\n\n\tpublic keys(): IterableIterator<FieldKey> {\n\t\treturn this.mapTree.fields.keys();\n\t}\n\n\tpublic values(): IterableIterator<FlexTreeUnboxField<TSchema[\"info\"], \"notEmpty\">> {\n\t\treturn mapIterable(\n\t\t\tthis.mapTree.fields.keys(),\n\t\t\t(key) =>\n\t\t\t\tunboxedField(\n\t\t\t\t\tthis.tryGetField(key) ?? fail(\"Unexpected empty map field\"),\n\t\t\t\t\tkey,\n\t\t\t\t\tthis.mapTree,\n\t\t\t\t\tthis,\n\t\t\t\t) as FlexTreeUnboxField<TSchema[\"info\"], \"notEmpty\">,\n\t\t);\n\t}\n\n\tpublic entries(): IterableIterator<\n\t\t[FieldKey, FlexTreeUnboxField<TSchema[\"info\"], \"notEmpty\">]\n\t> {\n\t\treturn mapIterable(this.mapTree.fields.keys(), (key) => [\n\t\t\tkey,\n\t\t\tunboxedField(\n\t\t\t\tthis.tryGetField(key) ?? fail(\"Unexpected empty map field\"),\n\t\t\t\tkey,\n\t\t\t\tthis.mapTree,\n\t\t\t\tthis,\n\t\t\t) as FlexTreeUnboxField<TSchema[\"info\"], \"notEmpty\">,\n\t\t]);\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(key) as FlexTreeTypedField<TSchema[\"info\"]>;\n\t}\n\n\tpublic set(key: string, value: FlexibleFieldContent<TSchema[\"info\"]> | undefined): void {\n\t\t// `MapTreeNode`s cannot be mutated\n\t\tthrow unsupportedUsageError(\"Setting a map entry\");\n\t}\n\n\tpublic delete(key: string): void {\n\t\t// `MapTreeNode`s cannot be mutated\n\t\tthrow unsupportedUsageError(\"Deleting a map entry\");\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\tpublic override boxedIterator(): IterableIterator<FlexTreeTypedField<TSchema[\"info\"]>> {\n\t\treturn super.boxedIterator() as IterableIterator<FlexTreeTypedField<TSchema[\"info\"]>>;\n\t}\n}\n\nclass EagerMapTreeLeafNode<TSchema extends LeafNodeSchema>\n\textends EagerMapTreeNode<TSchema>\n\timplements FlexTreeLeafNode<TSchema>\n{\n\tpublic override get value(): TreeValue<TSchema[\"info\"]> {\n\t\treturn super.value as TreeValue<TSchema[\"info\"]>;\n\t}\n}\n\n// #endregion Nodes\n\n// #region Fields\n\n/**\n * A special singleton that is the implicit parent field of all un-parented {@link EagerMapTreeNode}s.\n * @remarks This exists because {@link EagerMapTreeNode.parentField} must return a field.\n * If a {@link EagerMapTreeNode} is created without a parent, its {@link EagerMapTreeNode.parentField} property will point to this object.\n * However, this field cannot be used in any practical way because it is empty, i.e. it does not actually contain the children that claim to be parented under it.\n * It has the \"empty\" schema and it will always contain zero children if queried.\n */\nexport const rootMapTreeField: MapTreeField<FlexAllowedTypes> = {\n\t[flexTreeMarker]: FlexTreeEntityKind.Field as const,\n\tlength: 0,\n\tkey: EmptyKey,\n\tparent: undefined,\n\tis<TSchema extends FlexFieldSchema>(schema: TSchema) {\n\t\treturn schema === (FlexFieldSchema.empty as FlexFieldSchema);\n\t},\n\tboxedIterator(): IterableIterator<FlexTreeNode> {\n\t\treturn [].values();\n\t},\n\tboxedAt(index: number): FlexTreeNode | undefined {\n\t\treturn undefined;\n\t},\n\tschema: FlexFieldSchema.empty,\n\tget context(): FlexTreeContext {\n\t\treturn fail(\"MapTreeField does not implement context\");\n\t},\n\ttreeStatus(): TreeStatus {\n\t\treturn TreeStatus.New;\n\t},\n\tmapTrees: [],\n};\n\nclass MapTreeField<T extends FlexAllowedTypes> implements FlexTreeField {\n\tpublic [flexTreeMarker] = FlexTreeEntityKind.Field as const;\n\n\tpublic constructor(\n\t\tpublic readonly schema: FlexFieldSchema<FlexFieldKind, T>,\n\t\tpublic readonly key: FieldKey,\n\t\tpublic readonly parent: FlexTreeNode | undefined,\n\t\tpublic readonly mapTrees: readonly MapTree[],\n\t) {\n\t\tassert(\n\t\t\t!fieldCache.has(mapTrees),\n\t\t\t0x990 /* A field already exists for the given MapTrees */,\n\t\t);\n\t\tfieldCache.set(mapTrees, this);\n\n\t\t// When this field is created (which only happens one time, because it is cached), all the children become parented for the first time.\n\t\t// \"Adopt\" each child by updating its parent information to point to this field.\n\t\tfor (let i = 0; i < mapTrees.length; i++) {\n\t\t\tconst mapTreeNodeChild = nodeCache.get(mapTrees[i]);\n\t\t\tif (mapTreeNodeChild !== undefined) {\n\t\t\t\tassert(\n\t\t\t\t\tmapTreeNodeChild.parentField.parent === rootMapTreeField,\n\t\t\t\t\t0x991 /* Node is already parented under a different field */,\n\t\t\t\t);\n\t\t\t\tmapTreeNodeChild.adopt(this, i);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic get length(): number {\n\t\treturn this.mapTrees.length;\n\t}\n\n\tpublic is<TSchemaInner extends FlexFieldSchema>(\n\t\tschema: TSchemaInner,\n\t): this is FlexTreeTypedField<TSchemaInner> {\n\t\treturn this.schema.equals(schema);\n\t}\n\n\tpublic boxedIterator(): IterableIterator<FlexTreeTypedNodeUnion<T>> {\n\t\treturn this.mapTrees\n\t\t\t.map(\n\t\t\t\t(m, index) =>\n\t\t\t\t\tgetOrCreateChild(m, this.schema.allowedTypes, {\n\t\t\t\t\t\tparent: this,\n\t\t\t\t\t\tindex,\n\t\t\t\t\t}) as FlexTreeNode as FlexTreeTypedNodeUnion<T>,\n\t\t\t)\n\t\t\t.values();\n\t}\n\n\tpublic boxedAt(index: number): FlexTreeTypedNodeUnion<T> | undefined {\n\t\tconst i = indexForAt(index, this.length);\n\t\tif (i === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst m = this.mapTrees[i];\n\t\tif (m !== undefined) {\n\t\t\treturn getOrCreateChild(m, this.schema.allowedTypes, {\n\t\t\t\tparent: this,\n\t\t\t\tindex: i,\n\t\t\t}) as FlexTreeNode as FlexTreeTypedNodeUnion<T>;\n\t\t}\n\t}\n\n\tpublic get context(): FlexTreeContext {\n\t\treturn fail(\"MapTreeField does not implement context\");\n\t}\n\n\tpublic treeStatus(): TreeStatus {\n\t\treturn TreeStatus.New;\n\t}\n}\n\nclass MapTreeRequiredField<T extends FlexAllowedTypes>\n\textends MapTreeField<T>\n\timplements FlexTreeRequiredField<T>\n{\n\tpublic get content(): FlexTreeUnboxNodeUnion<T> {\n\t\treturn unboxedUnion(this.schema, this.mapTrees[0], { parent: this, index: 0 });\n\t}\n\tpublic set content(_: FlexTreeUnboxNodeUnion<T>) {\n\t\tthrow unsupportedUsageError(\"Setting an optional field\");\n\t}\n}\n\nclass MapTreeOptionalField<T extends FlexAllowedTypes>\n\textends MapTreeField<T>\n\timplements FlexTreeOptionalField<T>\n{\n\tpublic get content(): FlexTreeUnboxNodeUnion<T> | undefined {\n\t\treturn this.mapTrees.length > 0\n\t\t\t? unboxedUnion(this.schema, this.mapTrees[0], { parent: this, index: 0 })\n\t\t\t: undefined;\n\t}\n\tpublic set content(_: FlexTreeUnboxNodeUnion<T> | undefined) {\n\t\tthrow unsupportedUsageError(\"Setting an optional field\");\n\t}\n}\n\nclass MapTreeSequenceField<T extends FlexAllowedTypes>\n\textends MapTreeField<T>\n\timplements FlexTreeSequenceField<T>\n{\n\tpublic at(index: number): FlexTreeUnboxNodeUnion<T> | undefined {\n\t\tconst i = indexForAt(index, this.length);\n\t\tif (i === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn unboxedUnion(this.schema, this.mapTrees[i], { parent: this, index: i });\n\t}\n\tpublic map<U>(callbackfn: (value: FlexTreeUnboxNodeUnion<T>, index: number) => U): U[] {\n\t\treturn Array.from(this, callbackfn);\n\t}\n\tpublic mapBoxed<U>(callbackfn: (value: FlexTreeTypedNodeUnion<T>, index: number) => U): U[] {\n\t\treturn Array.from(this.boxedIterator(), callbackfn);\n\t}\n\n\tpublic *[Symbol.iterator](): IterableIterator<FlexTreeUnboxNodeUnion<T>> {\n\t\tfor (let i = 0; i < this.mapTrees.length; i++) {\n\t\t\tyield unboxedUnion(this.schema, this.mapTrees[i], { parent: this, index: i });\n\t\t}\n\t}\n\n\tpublic sequenceEditor(): SequenceFieldEditBuilder {\n\t\tthrow unsupportedUsageError(\"Editing a sequence\");\n\t}\n\tpublic insertAt(index: number, value: FlexibleNodeSubSequence<T>): void {\n\t\tthrow unsupportedUsageError(\"Editing a sequence\");\n\t}\n\tpublic insertAtStart(value: FlexibleNodeSubSequence<T>): void {\n\t\tthrow unsupportedUsageError(\"Editing a sequence\");\n\t}\n\tpublic insertAtEnd(value: FlexibleNodeSubSequence<T>): void {\n\t\tthrow unsupportedUsageError(\"Editing a sequence\");\n\t}\n\tpublic removeAt(index: number): void {\n\t\tthrow unsupportedUsageError(\"Editing a sequence\");\n\t}\n\tpublic moveToStart(sourceIndex: unknown, source?: unknown): void {\n\t\tthrow unsupportedUsageError(\"Editing a sequence\");\n\t}\n\tpublic moveToEnd(sourceIndex: unknown, source?: unknown): void {\n\t\tthrow unsupportedUsageError(\"Editing a sequence\");\n\t}\n\tpublic moveToIndex(index: unknown, sourceIndex: unknown, source?: unknown): void {\n\t\tthrow unsupportedUsageError(\"Editing a sequence\");\n\t}\n\tpublic moveRangeToStart(sourceStart: unknown, sourceEnd: unknown, source?: unknown): void {\n\t\tthrow unsupportedUsageError(\"Editing a sequence\");\n\t}\n\tpublic moveRangeToEnd(sourceStart: unknown, sourceEnd: unknown, source?: unknown): void {\n\t\tthrow unsupportedUsageError(\"Editing a sequence\");\n\t}\n\tpublic moveRangeToIndex(\n\t\tindex: unknown,\n\t\tsourceStart: unknown,\n\t\tsourceEnd: unknown,\n\t\tsource?: unknown,\n\t): void {\n\t\tthrow unsupportedUsageError(\"Editing a sequence\");\n\t}\n\tpublic getFieldPath(): FieldUpPath {\n\t\tthrow unsupportedUsageError(\"Editing a sequence\");\n\t}\n}\n\n// #endregion Fields\n\n// #region Caching and unboxing utilities\n\nconst nodeCache = new WeakMap<MapTree, EagerMapTreeNode<FlexTreeNodeSchema>>();\nconst fieldCache = new WeakMap<readonly MapTree[], MapTreeField<FlexAllowedTypes>>();\n\n/**\n * If there exists a {@link EagerMapTreeNode} for the given {@link MapTree}, returns it, otherwise returns `undefined`.\n * @remarks {@link EagerMapTreeNode | MapTreeNodes} are created via {@link getOrCreateNode}.\n */\nexport function tryGetMapTreeNode(mapTree: MapTree): MapTreeNode | undefined {\n\treturn nodeCache.get(mapTree);\n}\n\n/**\n * Create a {@link MapTreeNode} that wraps the given {@link MapTree}, or get the node that already exists for that {@link MapTree} if there is one.\n * @param nodeSchema - the {@link FlexTreeNodeSchema | schema} that the node conforms to\n * @param mapTree - the {@link MapTree} containing the data for this node.\n * @remarks It must conform to the `nodeSchema`.\n */\nexport function getOrCreateMapTreeNode(\n\tnodeSchema: FlexTreeNodeSchema,\n\tmapTree: MapTree,\n): MapTreeNode {\n\treturn getOrCreateNode(nodeSchema, mapTree);\n}\n\n/**\n * Create a {@link EagerMapTreeNode} that wraps the given {@link MapTree}, or get the node that already exists for that {@link MapTree} if there is one.\n * @param nodeSchema - the {@link FlexTreeNodeSchema | schema} that the node conforms to\n * @param mapTree - the {@link MapTree} containing the data for this node.\n * @remarks It must conform to the `nodeSchema`.\n * This function is exported for the purposes of unit testing.\n */\nexport function getOrCreateNode<TSchema extends LeafNodeSchema>(\n\tnodeSchema: TSchema,\n\tmapTree: MapTree,\n): EagerMapTreeLeafNode<TSchema>;\nexport function getOrCreateNode<TSchema extends FlexMapNodeSchema>(\n\tnodeSchema: TSchema,\n\tmapTree: MapTree,\n): EagerMapTreeMapNode<TSchema>;\nexport function getOrCreateNode<TSchema extends FlexFieldNodeSchema>(\n\tnodeSchema: TSchema,\n\tmapTree: MapTree,\n): EagerMapTreeFieldNode<TSchema>;\nexport function getOrCreateNode<TSchema extends FlexTreeNodeSchema>(\n\tnodeSchema: TSchema,\n\tmapTree: MapTree,\n): EagerMapTreeNode<TSchema>;\nexport function getOrCreateNode<TSchema extends FlexTreeNodeSchema>(\n\tnodeSchema: TSchema,\n\tmapTree: MapTree,\n): EagerMapTreeNode<TSchema> {\n\tconst cached = tryGetMapTreeNode(mapTree);\n\tif (cached !== undefined) {\n\t\treturn cached as EagerMapTreeNode<TSchema>;\n\t}\n\treturn createNode(nodeSchema, mapTree, undefined);\n}\n\n/** Helper for creating a `MapTreeNode` given the parent field (e.g. when \"walking down\") */\nfunction getOrCreateChild(\n\tmapTree: MapTree,\n\timplicitAllowedTypes: FlexImplicitAllowedTypes,\n\tparent: LocationInField | undefined,\n): EagerMapTreeNode<FlexTreeNodeSchema> {\n\tconst cached = nodeCache.get(mapTree);\n\tif (cached !== undefined) {\n\t\treturn cached;\n\t}\n\n\tconst allowedTypes = normalizeAllowedTypes(implicitAllowedTypes);\n\tconst nodeSchema =\n\t\tallowedTypes\n\t\t\t.map((t) => (isLazy(t) ? t() : t))\n\t\t\t.find((t): t is FlexTreeNodeSchema => {\n\t\t\t\tassert(t !== \"Any\", 0x993 /* 'Any' type is not supported */);\n\t\t\t\treturn t.name === mapTree.type;\n\t\t\t}) ?? fail(\"Unsupported node schema\");\n\n\treturn createNode(nodeSchema, mapTree, parent);\n}\n\n/** Always constructs a new node, therefore may not be called twice for the same `MapTree`. */\nfunction createNode<TSchema extends LeafNodeSchema>(\n\tnodeSchema: TSchema,\n\tmapTree: MapTree,\n\tparentField: LocationInField | undefined,\n): EagerMapTreeLeafNode<TSchema>;\nfunction createNode<TSchema extends FlexMapNodeSchema>(\n\tnodeSchema: TSchema,\n\tmapTree: MapTree,\n\tparentField: LocationInField | undefined,\n): EagerMapTreeMapNode<TSchema>;\nfunction createNode<TSchema extends FlexFieldNodeSchema>(\n\tnodeSchema: TSchema,\n\tmapTree: MapTree,\n\tparentField: LocationInField | undefined,\n): EagerMapTreeFieldNode<TSchema>;\nfunction createNode<TSchema extends FlexTreeNodeSchema>(\n\tnodeSchema: TSchema,\n\tmapTree: MapTree,\n\tparentField: LocationInField | undefined,\n): EagerMapTreeNode<TSchema>;\nfunction createNode<TSchema extends FlexTreeNodeSchema>(\n\tnodeSchema: TSchema,\n\tmapTree: MapTree,\n\tparentField: LocationInField | undefined,\n): EagerMapTreeNode<TSchema> {\n\tif (schemaIsLeaf(nodeSchema)) {\n\t\treturn new EagerMapTreeLeafNode(nodeSchema, mapTree, parentField);\n\t}\n\tif (schemaIsMap(nodeSchema)) {\n\t\treturn new EagerMapTreeMapNode(nodeSchema, mapTree, parentField);\n\t}\n\tif (schemaIsFieldNode(nodeSchema)) {\n\t\treturn new EagerMapTreeFieldNode(nodeSchema, mapTree, parentField);\n\t}\n\tif (schemaIsObjectNode(nodeSchema)) {\n\t\treturn new EagerMapTreeNode(nodeSchema, mapTree, parentField);\n\t}\n\tassert(false, 0x994 /* Unrecognized node kind */);\n}\n\n/** Creates a field with the given attributes, or returns a cached field if there is one */\nfunction getOrCreateField(\n\tparent: FlexTreeNode,\n\tkey: FieldKey,\n\tmapTrees: readonly MapTree[],\n\tschema: FlexFieldSchema,\n): MapTreeField<FlexFieldSchema[\"allowedTypes\"]> {\n\tconst cached = fieldCache.get(mapTrees);\n\tif (cached !== undefined) {\n\t\treturn cached;\n\t}\n\n\tif (\n\t\tschema.kind.identifier === FieldKinds.required.identifier ||\n\t\tschema.kind.identifier === FieldKinds.identifier.identifier\n\t) {\n\t\treturn new MapTreeRequiredField(schema, key, parent, mapTrees);\n\t}\n\n\tif (schema.kind.identifier === FieldKinds.optional.identifier) {\n\t\treturn new MapTreeOptionalField(schema, key, parent, mapTrees);\n\t}\n\n\tif (schema.kind.identifier === FieldKinds.sequence.identifier) {\n\t\treturn new MapTreeSequenceField(schema, key, parent, mapTrees);\n\t}\n\n\treturn new MapTreeField(schema, key, parent, mapTrees);\n}\n\n/** Unboxes non-polymorphic leaf nodes to their values, if applicable */\nfunction unboxedUnion<TTypes extends FlexAllowedTypes>(\n\tschema: FlexFieldSchema<FlexFieldKind, TTypes>,\n\tmapTree: MapTree,\n\tparent: LocationInField,\n): FlexTreeUnboxNodeUnion<TTypes> {\n\tconst type = schema.monomorphicChildType;\n\tif (type !== undefined) {\n\t\tif (schemaIsLeaf(type)) {\n\t\t\treturn mapTree.value as FlexTreeUnboxNodeUnion<TTypes>;\n\t\t}\n\t\treturn getOrCreateChild(mapTree, type, parent) as FlexTreeUnboxNodeUnion<TTypes>;\n\t}\n\n\treturn getOrCreateChild(\n\t\tmapTree,\n\t\tschema.allowedTypes,\n\t\tparent,\n\t) as FlexTreeUnboxNodeUnion<TTypes>;\n}\n\n/** Unboxes non-polymorphic required and optional fields holding leaf nodes to their values, if applicable */\nfunction unboxedField<TFieldSchema extends FlexFieldSchema>(\n\tfield: MapTreeField<FlexAllowedTypes>,\n\tkey: FieldKey,\n\tmapTree: MapTree,\n\tparentNode: FlexTreeNode,\n): FlexTreeUnboxField<TFieldSchema> {\n\tconst fieldSchema = field.schema;\n\tconst mapTrees =\n\t\tmapTree.fields.get(key) ?? fail(\"Key does not exist in unhydrated map tree\");\n\n\tif (fieldSchema.kind === FieldKinds.required) {\n\t\treturn unboxedUnion(fieldSchema, mapTrees[0], {\n\t\t\tparent: field,\n\t\t\tindex: 0,\n\t\t}) as FlexTreeUnboxField<TFieldSchema>;\n\t}\n\tif (fieldSchema.kind === FieldKinds.optional) {\n\t\treturn (\n\t\t\tmapTrees.length > 0\n\t\t\t\t? unboxedUnion(fieldSchema, mapTrees[0], { parent: field, index: 0 })\n\t\t\t\t: undefined\n\t\t) as FlexTreeUnboxField<TFieldSchema>;\n\t}\n\n\treturn getOrCreateField(\n\t\tparentNode,\n\t\tkey,\n\t\tmapTrees,\n\t\tfieldSchema,\n\t) as FlexTreeUnboxField<TFieldSchema>;\n}\n\n// #endregion Caching and unboxing utilities\n\nexport function unsupportedUsageError(message?: string): Error {\n\treturn new UsageError(\n\t\t`${\n\t\t\tmessage ?? \"Operation\"\n\t\t} is not supported for content that has not yet been inserted into the tree`,\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"mapTreeNode.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-map-tree/mapTreeNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO,EAEN,QAAQ,GAOR,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAEN,kBAAkB,EAgBlB,cAAc,EACd,UAAU,GACV,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAGN,eAAe,EAIf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CAAC;AACH,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\";\nimport {\n\ttype AnchorNode,\n\tEmptyKey,\n\ttype FieldKey,\n\ttype FieldUpPath,\n\ttype MapTree,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeValue,\n\ttype Value,\n} from \"../../core/index.js\";\nimport { brand, fail, mapIterable } from \"../../util/index.js\";\nimport {\n\ttype FlexTreeContext,\n\tFlexTreeEntityKind,\n\ttype FlexTreeField,\n\ttype FlexTreeFieldNode,\n\ttype FlexTreeLeafNode,\n\ttype FlexTreeMapNode,\n\ttype FlexTreeNode,\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeTypedNode,\n\ttype FlexTreeTypedNodeUnion,\n\ttype FlexTreeUnboxField,\n\ttype FlexTreeUnboxNodeUnion,\n\ttype FlexibleFieldContent,\n\ttype FlexibleNodeSubSequence,\n\tflexTreeMarker,\n\tindexForAt,\n} from \"../flex-tree/index.js\";\nimport {\n\ttype FlexAllowedTypes,\n\ttype FlexFieldNodeSchema,\n\tFlexFieldSchema,\n\ttype FlexMapNodeSchema,\n\ttype FlexTreeNodeSchema,\n\ttype LeafNodeSchema,\n\tisLazy,\n\tschemaIsFieldNode,\n\tschemaIsLeaf,\n\tschemaIsMap,\n\tschemaIsObjectNode,\n} from \"../typed-schema/index.js\";\nimport { type FlexImplicitAllowedTypes, normalizeAllowedTypes } from \"../schemaBuilderBase.js\";\nimport type { FlexFieldKind } from \"../modular-schema/index.js\";\nimport { FieldKinds, type SequenceFieldEditBuilder } from \"../default-schema/index.js\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\n// #region Nodes\n\n/**\n * A readonly {@link FlexTreeNode} which wraps a {@link MapTree}.\n * @remarks Reading data from the MapTreeNode will read the corresponding data from the {@link MapTree}.\n * Create a `MapTreeNode` by calling {@link getOrCreateMapTreeNode}.\n */\nexport interface MapTreeNode extends FlexTreeNode {\n\treadonly mapTree: MapTree;\n}\n\n/**\n * Checks if the given {@link FlexTreeNode} is a {@link MapTreeNode}.\n */\nexport function isMapTreeNode(flexNode: FlexTreeNode): flexNode is MapTreeNode {\n\treturn flexNode instanceof EagerMapTreeNode;\n}\n\n/** A node's parent field and its index in that field */\ninterface LocationInField {\n\treadonly parent: MapTreeField<FlexAllowedTypes>;\n\treadonly index: number;\n}\n\n/**\n * A readonly implementation of {@link FlexTreeNode} which wraps a {@link MapTree}.\n * @remarks Any methods that would mutate the node will fail,\n * as will the querying of data specific to the {@link LazyTreeNode} implementation (e.g. {@link FlexTreeNode.context}).\n * MapTreeNodes are unconditionally cached -\n * when retrieved via {@link getOrCreateNode}, the same {@link MapTree} object will always produce the same `MapTreeNode` object.\n */\nexport class EagerMapTreeNode<TSchema extends FlexTreeNodeSchema> implements MapTreeNode {\n\tpublic readonly [flexTreeMarker] = FlexTreeEntityKind.Node as const;\n\n\t/**\n\t * Create a new MapTreeNode.\n\t * @param location - the parentage of this node, if it is being created underneath an existing node and field, or undefined if not\n\t * @remarks This class (and its subclasses) should not be directly constructed outside of this module.\n\t * Instead, use {@link getOrCreateNode} to create a MapTreeNode from a {@link MapTree}.\n\t * A `MapTreeNode` may never be constructed more than once for the same {@link MapTree} object.\n\t * Instead, it should always be acquired via {@link getOrCreateNode}.\n\t */\n\tpublic constructor(\n\t\tpublic readonly schema: TSchema,\n\t\t/** The underlying {@link MapTree} that this `MapTreeNode` reads its data from */\n\t\tpublic readonly mapTree: MapTree,\n\t\tprivate location: LocationInField | undefined,\n\t) {\n\t\tassert(!nodeCache.has(mapTree), 0x98b /* A node already exists for the given MapTree */);\n\t\tnodeCache.set(mapTree, this);\n\n\t\t// Fully demand the tree to ensure that parent pointers are present and accurate on all nodes.\n\t\t// When a MapTreeNode is constructed, its MapTree may contain nodes (anywhere below) that map (via the `nodeCache`) to pre-existing MapTreeNodes.\n\t\t// Put another way, for a given MapTree, some ancestor MapTreeNode can be created after any number of its descendant MapTreeNodes already exist.\n\t\t// In such a case, the spine of nodes between the descendant and ancestor need to exist in order for the ancestor to be able to walk upwards via the `parentField` property.\n\t\t// This needs to happen for all MapTreeNodes that are descendants of the ancestor MapTreeNode.\n\t\t// Demanding the entire tree is overkill to solve this problem since not all descendant MapTree nodes will have corresponding MapTreeNodes.\n\t\t// However, demanding the full tree also lets us eagerly validate that there are no duplicate MapTrees (i.e. same MapTree object) anywhere in the tree.\n\t\tthis.walkTree();\n\t}\n\n\tpublic get type(): TreeNodeSchemaIdentifier {\n\t\treturn this.schema.name;\n\t}\n\n\t/**\n\t * Set this node's parentage (see {@link FlexTreeNode.parentField}).\n\t * @remarks A node may only be adopted to a new parent one time, and only if it was not constructed with a parent.\n\t */\n\tpublic adopt(parent: MapTreeField<FlexAllowedTypes>, index: number): void {\n\t\tassert(\n\t\t\tthis.location === undefined,\n\t\t\t0x98c /* Node may not be adopted if it already has a parent */,\n\t\t);\n\t\tthis.location = { parent, index };\n\t}\n\n\t/**\n\t * The field this tree is in, and the index within that field.\n\t * @remarks If this node is unparented, this method will return the special {@link rootMapTreeField} as the parent.\n\t */\n\tpublic get parentField(): LocationInField {\n\t\tif (this.location === undefined) {\n\t\t\treturn {\n\t\t\t\tparent: rootMapTreeField,\n\t\t\t\tindex: -1,\n\t\t\t};\n\t\t}\n\n\t\treturn this.location;\n\t}\n\n\tpublic is<TSchemaInner extends FlexTreeNodeSchema>(\n\t\tschema: TSchemaInner,\n\t): this is FlexTreeTypedNode<TSchemaInner> {\n\t\treturn (schema as unknown) === this.schema;\n\t}\n\n\tpublic tryGetField(key: FieldKey): MapTreeField<FlexAllowedTypes> | undefined {\n\t\tconst field = this.mapTree.fields.get(key);\n\t\t// Only return the field if it is not empty, in order to fulfill the contract of `tryGetField`.\n\t\tif (field !== undefined && field.length > 0) {\n\t\t\treturn getOrCreateField(this, key, field, this.schema.getFieldSchema(key));\n\t\t}\n\t}\n\n\tpublic getBoxed(key: string): FlexTreeField {\n\t\tconst fieldKey: FieldKey = brand(key);\n\t\tconst field = this.mapTree.fields.get(fieldKey) ?? [];\n\t\treturn getOrCreateField(this, fieldKey, field, this.schema.getFieldSchema(fieldKey));\n\t}\n\n\tpublic boxedIterator(): IterableIterator<FlexTreeField> {\n\t\treturn mapIterable(this.mapTree.fields.entries(), ([key, field]) =>\n\t\t\tgetOrCreateField(this, key, field, this.schema.getFieldSchema(key)),\n\t\t);\n\t}\n\n\tpublic get value(): Value {\n\t\treturn this.mapTree.value;\n\t}\n\n\tpublic get context(): FlexTreeContext {\n\t\t// This API is relevant to `LazyTreeNode`s, but not `MapTreeNode`s.\n\t\t// TODO: Refactor the FlexTreeNode interface so that stubbing this out isn't necessary.\n\t\treturn fail(\"MapTreeNode does not implement context\");\n\t}\n\n\tpublic get anchorNode(): AnchorNode {\n\t\t// This API is relevant to `LazyTreeNode`s, but not `MapTreeNode`s.\n\t\t// TODO: Refactor the FlexTreeNode interface so that stubbing this out isn't necessary.\n\t\treturn fail(\"MapTreeNode does not implement anchorNode\");\n\t}\n\n\tprivate walkTree(): void {\n\t\tfor (const [key, mapTrees] of this.mapTree.fields) {\n\t\t\tconst field = getOrCreateField(this, key, mapTrees, this.schema.getFieldSchema(key));\n\t\t\tfor (let index = 0; index < field.length; index++) {\n\t\t\t\tconst child = getOrCreateChild(\n\t\t\t\t\tmapTrees[index],\n\t\t\t\t\tthis.schema.getFieldSchema(key).allowedTypes,\n\t\t\t\t\t{ parent: field, index },\n\t\t\t\t);\n\t\t\t\t// These next asserts detect the case where `getOrCreateChild` gets a cache hit of a different node than the one we're trying to create\n\t\t\t\tassert(child.location !== undefined, 0x98d /* Expected node to have parent */);\n\t\t\t\tassert(\n\t\t\t\t\tchild.location.parent.parent === this,\n\t\t\t\t\t0x98e /* Node may not be multi-parented */,\n\t\t\t\t);\n\t\t\t\tassert(child.location.index === index, 0x98f /* Node may not be multi-parented */);\n\t\t\t\tchild.walkTree();\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * The implementation of a field node created by {@link getOrCreateNode}.\n */\nexport class EagerMapTreeFieldNode<TSchema extends FlexFieldNodeSchema>\n\textends EagerMapTreeNode<TSchema>\n\timplements FlexTreeFieldNode<TSchema>\n{\n\tpublic get content(): FlexTreeUnboxField<TSchema[\"info\"]> {\n\t\tconst field = this.tryGetField(EmptyKey);\n\t\tif (field === undefined) {\n\t\t\treturn undefined as FlexTreeUnboxField<TSchema[\"info\"]>;\n\t\t}\n\t\treturn unboxedField(field, EmptyKey, this.mapTree, this);\n\t}\n\n\tpublic override getBoxed(key: string): FlexTreeTypedField<TSchema[\"info\"]> {\n\t\treturn super.getBoxed(key) as FlexTreeTypedField<TSchema[\"info\"]>;\n\t}\n}\n\n/**\n * The implementation of a map node created by {@link getOrCreateNode}.\n */\nexport class EagerMapTreeMapNode<TSchema extends FlexMapNodeSchema>\n\textends EagerMapTreeNode<TSchema>\n\timplements FlexTreeMapNode<TSchema>\n{\n\tpublic get size(): number {\n\t\treturn this.mapTree.fields.size;\n\t}\n\n\tpublic has(key: string): boolean {\n\t\treturn this.tryGetField(brand(key)) !== undefined;\n\t}\n\n\tpublic get(key: string): FlexTreeUnboxField<TSchema[\"info\"]> {\n\t\tconst field = this.tryGetField(brand(key));\n\t\tif (field === undefined) {\n\t\t\treturn undefined as FlexTreeUnboxField<TSchema[\"info\"]>;\n\t\t}\n\t\treturn unboxedField(field, brand(key), this.mapTree, this);\n\t}\n\n\tpublic keys(): IterableIterator<FieldKey> {\n\t\treturn this.mapTree.fields.keys();\n\t}\n\n\tpublic values(): IterableIterator<FlexTreeUnboxField<TSchema[\"info\"], \"notEmpty\">> {\n\t\treturn mapIterable(\n\t\t\tthis.mapTree.fields.keys(),\n\t\t\t(key) =>\n\t\t\t\tunboxedField(\n\t\t\t\t\tthis.tryGetField(key) ?? fail(\"Unexpected empty map field\"),\n\t\t\t\t\tkey,\n\t\t\t\t\tthis.mapTree,\n\t\t\t\t\tthis,\n\t\t\t\t) as FlexTreeUnboxField<TSchema[\"info\"], \"notEmpty\">,\n\t\t);\n\t}\n\n\tpublic entries(): IterableIterator<\n\t\t[FieldKey, FlexTreeUnboxField<TSchema[\"info\"], \"notEmpty\">]\n\t> {\n\t\treturn mapIterable(this.mapTree.fields.keys(), (key) => [\n\t\t\tkey,\n\t\t\tunboxedField(\n\t\t\t\tthis.tryGetField(key) ?? fail(\"Unexpected empty map field\"),\n\t\t\t\tkey,\n\t\t\t\tthis.mapTree,\n\t\t\t\tthis,\n\t\t\t) as FlexTreeUnboxField<TSchema[\"info\"], \"notEmpty\">,\n\t\t]);\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(key) as FlexTreeTypedField<TSchema[\"info\"]>;\n\t}\n\n\tpublic set(key: string, value: FlexibleFieldContent<TSchema[\"info\"]> | undefined): void {\n\t\t// `MapTreeNode`s cannot be mutated\n\t\tthrow unsupportedUsageError(\"Setting a map entry\");\n\t}\n\n\tpublic delete(key: string): void {\n\t\t// `MapTreeNode`s cannot be mutated\n\t\tthrow unsupportedUsageError(\"Deleting a map entry\");\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\tpublic override boxedIterator(): IterableIterator<FlexTreeTypedField<TSchema[\"info\"]>> {\n\t\treturn super.boxedIterator() as IterableIterator<FlexTreeTypedField<TSchema[\"info\"]>>;\n\t}\n}\n\nclass EagerMapTreeLeafNode<TSchema extends LeafNodeSchema>\n\textends EagerMapTreeNode<TSchema>\n\timplements FlexTreeLeafNode<TSchema>\n{\n\tpublic override get value(): TreeValue<TSchema[\"info\"]> {\n\t\treturn super.value as TreeValue<TSchema[\"info\"]>;\n\t}\n}\n\n// #endregion Nodes\n\n// #region Fields\n\n/**\n * A special singleton that is the implicit parent field of all un-parented {@link EagerMapTreeNode}s.\n * @remarks This exists because {@link EagerMapTreeNode.parentField} must return a field.\n * If a {@link EagerMapTreeNode} is created without a parent, its {@link EagerMapTreeNode.parentField} property will point to this object.\n * However, this field cannot be used in any practical way because it is empty, i.e. it does not actually contain the children that claim to be parented under it.\n * It has the \"empty\" schema and it will always contain zero children if queried.\n */\nexport const rootMapTreeField: MapTreeField<FlexAllowedTypes> = {\n\t[flexTreeMarker]: FlexTreeEntityKind.Field as const,\n\tlength: 0,\n\tkey: EmptyKey,\n\tparent: undefined,\n\tis<TSchema extends FlexFieldSchema>(schema: TSchema) {\n\t\treturn schema === (FlexFieldSchema.empty as FlexFieldSchema);\n\t},\n\tboxedIterator(): IterableIterator<FlexTreeNode> {\n\t\treturn [].values();\n\t},\n\tboxedAt(index: number): FlexTreeNode | undefined {\n\t\treturn undefined;\n\t},\n\tschema: FlexFieldSchema.empty,\n\tget context(): FlexTreeContext {\n\t\treturn fail(\"MapTreeField does not implement context\");\n\t},\n\tmapTrees: [],\n};\n\nclass MapTreeField<T extends FlexAllowedTypes> implements FlexTreeField {\n\tpublic [flexTreeMarker] = FlexTreeEntityKind.Field as const;\n\n\tpublic constructor(\n\t\tpublic readonly schema: FlexFieldSchema<FlexFieldKind, T>,\n\t\tpublic readonly key: FieldKey,\n\t\tpublic readonly parent: FlexTreeNode | undefined,\n\t\tpublic readonly mapTrees: readonly MapTree[],\n\t) {\n\t\tassert(\n\t\t\t!fieldCache.has(mapTrees),\n\t\t\t0x990 /* A field already exists for the given MapTrees */,\n\t\t);\n\t\tfieldCache.set(mapTrees, this);\n\n\t\t// When this field is created (which only happens one time, because it is cached), all the children become parented for the first time.\n\t\t// \"Adopt\" each child by updating its parent information to point to this field.\n\t\tfor (let i = 0; i < mapTrees.length; i++) {\n\t\t\tconst mapTreeNodeChild = nodeCache.get(mapTrees[i]);\n\t\t\tif (mapTreeNodeChild !== undefined) {\n\t\t\t\tassert(\n\t\t\t\t\tmapTreeNodeChild.parentField.parent === rootMapTreeField,\n\t\t\t\t\t0x991 /* Node is already parented under a different field */,\n\t\t\t\t);\n\t\t\t\tmapTreeNodeChild.adopt(this, i);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic get length(): number {\n\t\treturn this.mapTrees.length;\n\t}\n\n\tpublic is<TSchemaInner extends FlexFieldSchema>(\n\t\tschema: TSchemaInner,\n\t): this is FlexTreeTypedField<TSchemaInner> {\n\t\treturn this.schema.equals(schema);\n\t}\n\n\tpublic boxedIterator(): IterableIterator<FlexTreeTypedNodeUnion<T>> {\n\t\treturn this.mapTrees\n\t\t\t.map(\n\t\t\t\t(m, index) =>\n\t\t\t\t\tgetOrCreateChild(m, this.schema.allowedTypes, {\n\t\t\t\t\t\tparent: this,\n\t\t\t\t\t\tindex,\n\t\t\t\t\t}) as FlexTreeNode as FlexTreeTypedNodeUnion<T>,\n\t\t\t)\n\t\t\t.values();\n\t}\n\n\tpublic boxedAt(index: number): FlexTreeTypedNodeUnion<T> | undefined {\n\t\tconst i = indexForAt(index, this.length);\n\t\tif (i === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst m = this.mapTrees[i];\n\t\tif (m !== undefined) {\n\t\t\treturn getOrCreateChild(m, this.schema.allowedTypes, {\n\t\t\t\tparent: this,\n\t\t\t\tindex: i,\n\t\t\t}) as FlexTreeNode as FlexTreeTypedNodeUnion<T>;\n\t\t}\n\t}\n\n\tpublic get context(): FlexTreeContext {\n\t\treturn fail(\"MapTreeField does not implement context\");\n\t}\n}\n\nclass MapTreeRequiredField<T extends FlexAllowedTypes>\n\textends MapTreeField<T>\n\timplements FlexTreeRequiredField<T>\n{\n\tpublic get content(): FlexTreeUnboxNodeUnion<T> {\n\t\treturn unboxedUnion(this.schema, this.mapTrees[0], { parent: this, index: 0 });\n\t}\n\tpublic set content(_: FlexTreeUnboxNodeUnion<T>) {\n\t\tthrow unsupportedUsageError(\"Setting an optional field\");\n\t}\n}\n\nclass MapTreeOptionalField<T extends FlexAllowedTypes>\n\textends MapTreeField<T>\n\timplements FlexTreeOptionalField<T>\n{\n\tpublic get content(): FlexTreeUnboxNodeUnion<T> | undefined {\n\t\treturn this.mapTrees.length > 0\n\t\t\t? unboxedUnion(this.schema, this.mapTrees[0], { parent: this, index: 0 })\n\t\t\t: undefined;\n\t}\n\tpublic set content(_: FlexTreeUnboxNodeUnion<T> | undefined) {\n\t\tthrow unsupportedUsageError(\"Setting an optional field\");\n\t}\n}\n\nclass MapTreeSequenceField<T extends FlexAllowedTypes>\n\textends MapTreeField<T>\n\timplements FlexTreeSequenceField<T>\n{\n\tpublic at(index: number): FlexTreeUnboxNodeUnion<T> | undefined {\n\t\tconst i = indexForAt(index, this.length);\n\t\tif (i === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn unboxedUnion(this.schema, this.mapTrees[i], { parent: this, index: i });\n\t}\n\tpublic map<U>(callbackfn: (value: FlexTreeUnboxNodeUnion<T>, index: number) => U): U[] {\n\t\treturn Array.from(this, callbackfn);\n\t}\n\tpublic mapBoxed<U>(callbackfn: (value: FlexTreeTypedNodeUnion<T>, index: number) => U): U[] {\n\t\treturn Array.from(this.boxedIterator(), callbackfn);\n\t}\n\n\tpublic *[Symbol.iterator](): IterableIterator<FlexTreeUnboxNodeUnion<T>> {\n\t\tfor (let i = 0; i < this.mapTrees.length; i++) {\n\t\t\tyield unboxedUnion(this.schema, this.mapTrees[i], { parent: this, index: i });\n\t\t}\n\t}\n\n\tpublic sequenceEditor(): SequenceFieldEditBuilder {\n\t\tthrow unsupportedUsageError(\"Editing a sequence\");\n\t}\n\tpublic insertAt(index: number, value: FlexibleNodeSubSequence<T>): void {\n\t\tthrow unsupportedUsageError(\"Editing a sequence\");\n\t}\n\tpublic insertAtStart(value: FlexibleNodeSubSequence<T>): void {\n\t\tthrow unsupportedUsageError(\"Editing a sequence\");\n\t}\n\tpublic insertAtEnd(value: FlexibleNodeSubSequence<T>): void {\n\t\tthrow unsupportedUsageError(\"Editing a sequence\");\n\t}\n\tpublic removeAt(index: number): void {\n\t\tthrow unsupportedUsageError(\"Editing a sequence\");\n\t}\n\tpublic moveToStart(sourceIndex: unknown, source?: unknown): void {\n\t\tthrow unsupportedUsageError(\"Editing a sequence\");\n\t}\n\tpublic moveToEnd(sourceIndex: unknown, source?: unknown): void {\n\t\tthrow unsupportedUsageError(\"Editing a sequence\");\n\t}\n\tpublic moveToIndex(index: unknown, sourceIndex: unknown, source?: unknown): void {\n\t\tthrow unsupportedUsageError(\"Editing a sequence\");\n\t}\n\tpublic moveRangeToStart(sourceStart: unknown, sourceEnd: unknown, source?: unknown): void {\n\t\tthrow unsupportedUsageError(\"Editing a sequence\");\n\t}\n\tpublic moveRangeToEnd(sourceStart: unknown, sourceEnd: unknown, source?: unknown): void {\n\t\tthrow unsupportedUsageError(\"Editing a sequence\");\n\t}\n\tpublic moveRangeToIndex(\n\t\tindex: unknown,\n\t\tsourceStart: unknown,\n\t\tsourceEnd: unknown,\n\t\tsource?: unknown,\n\t): void {\n\t\tthrow unsupportedUsageError(\"Editing a sequence\");\n\t}\n\tpublic getFieldPath(): FieldUpPath {\n\t\tthrow unsupportedUsageError(\"Editing a sequence\");\n\t}\n}\n\n// #endregion Fields\n\n// #region Caching and unboxing utilities\n\nconst nodeCache = new WeakMap<MapTree, EagerMapTreeNode<FlexTreeNodeSchema>>();\nconst fieldCache = new WeakMap<readonly MapTree[], MapTreeField<FlexAllowedTypes>>();\n\n/**\n * If there exists a {@link EagerMapTreeNode} for the given {@link MapTree}, returns it, otherwise returns `undefined`.\n * @remarks {@link EagerMapTreeNode | MapTreeNodes} are created via {@link getOrCreateNode}.\n */\nexport function tryGetMapTreeNode(mapTree: MapTree): MapTreeNode | undefined {\n\treturn nodeCache.get(mapTree);\n}\n\n/**\n * Create a {@link MapTreeNode} that wraps the given {@link MapTree}, or get the node that already exists for that {@link MapTree} if there is one.\n * @param nodeSchema - the {@link FlexTreeNodeSchema | schema} that the node conforms to\n * @param mapTree - the {@link MapTree} containing the data for this node.\n * @remarks It must conform to the `nodeSchema`.\n */\nexport function getOrCreateMapTreeNode(\n\tnodeSchema: FlexTreeNodeSchema,\n\tmapTree: MapTree,\n): MapTreeNode {\n\treturn getOrCreateNode(nodeSchema, mapTree);\n}\n\n/**\n * Create a {@link EagerMapTreeNode} that wraps the given {@link MapTree}, or get the node that already exists for that {@link MapTree} if there is one.\n * @param nodeSchema - the {@link FlexTreeNodeSchema | schema} that the node conforms to\n * @param mapTree - the {@link MapTree} containing the data for this node.\n * @remarks It must conform to the `nodeSchema`.\n * This function is exported for the purposes of unit testing.\n */\nexport function getOrCreateNode<TSchema extends LeafNodeSchema>(\n\tnodeSchema: TSchema,\n\tmapTree: MapTree,\n): EagerMapTreeLeafNode<TSchema>;\nexport function getOrCreateNode<TSchema extends FlexMapNodeSchema>(\n\tnodeSchema: TSchema,\n\tmapTree: MapTree,\n): EagerMapTreeMapNode<TSchema>;\nexport function getOrCreateNode<TSchema extends FlexFieldNodeSchema>(\n\tnodeSchema: TSchema,\n\tmapTree: MapTree,\n): EagerMapTreeFieldNode<TSchema>;\nexport function getOrCreateNode<TSchema extends FlexTreeNodeSchema>(\n\tnodeSchema: TSchema,\n\tmapTree: MapTree,\n): EagerMapTreeNode<TSchema>;\nexport function getOrCreateNode<TSchema extends FlexTreeNodeSchema>(\n\tnodeSchema: TSchema,\n\tmapTree: MapTree,\n): EagerMapTreeNode<TSchema> {\n\tconst cached = tryGetMapTreeNode(mapTree);\n\tif (cached !== undefined) {\n\t\treturn cached as EagerMapTreeNode<TSchema>;\n\t}\n\treturn createNode(nodeSchema, mapTree, undefined);\n}\n\n/** Helper for creating a `MapTreeNode` given the parent field (e.g. when \"walking down\") */\nfunction getOrCreateChild(\n\tmapTree: MapTree,\n\timplicitAllowedTypes: FlexImplicitAllowedTypes,\n\tparent: LocationInField | undefined,\n): EagerMapTreeNode<FlexTreeNodeSchema> {\n\tconst cached = nodeCache.get(mapTree);\n\tif (cached !== undefined) {\n\t\treturn cached;\n\t}\n\n\tconst allowedTypes = normalizeAllowedTypes(implicitAllowedTypes);\n\tconst nodeSchema =\n\t\tallowedTypes\n\t\t\t.map((t) => (isLazy(t) ? t() : t))\n\t\t\t.find((t): t is FlexTreeNodeSchema => {\n\t\t\t\tassert(t !== \"Any\", 0x993 /* 'Any' type is not supported */);\n\t\t\t\treturn t.name === mapTree.type;\n\t\t\t}) ?? fail(\"Unsupported node schema\");\n\n\treturn createNode(nodeSchema, mapTree, parent);\n}\n\n/** Always constructs a new node, therefore may not be called twice for the same `MapTree`. */\nfunction createNode<TSchema extends LeafNodeSchema>(\n\tnodeSchema: TSchema,\n\tmapTree: MapTree,\n\tparentField: LocationInField | undefined,\n): EagerMapTreeLeafNode<TSchema>;\nfunction createNode<TSchema extends FlexMapNodeSchema>(\n\tnodeSchema: TSchema,\n\tmapTree: MapTree,\n\tparentField: LocationInField | undefined,\n): EagerMapTreeMapNode<TSchema>;\nfunction createNode<TSchema extends FlexFieldNodeSchema>(\n\tnodeSchema: TSchema,\n\tmapTree: MapTree,\n\tparentField: LocationInField | undefined,\n): EagerMapTreeFieldNode<TSchema>;\nfunction createNode<TSchema extends FlexTreeNodeSchema>(\n\tnodeSchema: TSchema,\n\tmapTree: MapTree,\n\tparentField: LocationInField | undefined,\n): EagerMapTreeNode<TSchema>;\nfunction createNode<TSchema extends FlexTreeNodeSchema>(\n\tnodeSchema: TSchema,\n\tmapTree: MapTree,\n\tparentField: LocationInField | undefined,\n): EagerMapTreeNode<TSchema> {\n\tif (schemaIsLeaf(nodeSchema)) {\n\t\treturn new EagerMapTreeLeafNode(nodeSchema, mapTree, parentField);\n\t}\n\tif (schemaIsMap(nodeSchema)) {\n\t\treturn new EagerMapTreeMapNode(nodeSchema, mapTree, parentField);\n\t}\n\tif (schemaIsFieldNode(nodeSchema)) {\n\t\treturn new EagerMapTreeFieldNode(nodeSchema, mapTree, parentField);\n\t}\n\tif (schemaIsObjectNode(nodeSchema)) {\n\t\treturn new EagerMapTreeNode(nodeSchema, mapTree, parentField);\n\t}\n\tassert(false, 0x994 /* Unrecognized node kind */);\n}\n\n/** Creates a field with the given attributes, or returns a cached field if there is one */\nfunction getOrCreateField(\n\tparent: FlexTreeNode,\n\tkey: FieldKey,\n\tmapTrees: readonly MapTree[],\n\tschema: FlexFieldSchema,\n): MapTreeField<FlexFieldSchema[\"allowedTypes\"]> {\n\tconst cached = fieldCache.get(mapTrees);\n\tif (cached !== undefined) {\n\t\treturn cached;\n\t}\n\n\tif (\n\t\tschema.kind.identifier === FieldKinds.required.identifier ||\n\t\tschema.kind.identifier === FieldKinds.identifier.identifier\n\t) {\n\t\treturn new MapTreeRequiredField(schema, key, parent, mapTrees);\n\t}\n\n\tif (schema.kind.identifier === FieldKinds.optional.identifier) {\n\t\treturn new MapTreeOptionalField(schema, key, parent, mapTrees);\n\t}\n\n\tif (schema.kind.identifier === FieldKinds.sequence.identifier) {\n\t\treturn new MapTreeSequenceField(schema, key, parent, mapTrees);\n\t}\n\n\treturn new MapTreeField(schema, key, parent, mapTrees);\n}\n\n/** Unboxes non-polymorphic leaf nodes to their values, if applicable */\nfunction unboxedUnion<TTypes extends FlexAllowedTypes>(\n\tschema: FlexFieldSchema<FlexFieldKind, TTypes>,\n\tmapTree: MapTree,\n\tparent: LocationInField,\n): FlexTreeUnboxNodeUnion<TTypes> {\n\tconst type = schema.monomorphicChildType;\n\tif (type !== undefined) {\n\t\tif (schemaIsLeaf(type)) {\n\t\t\treturn mapTree.value as FlexTreeUnboxNodeUnion<TTypes>;\n\t\t}\n\t\treturn getOrCreateChild(mapTree, type, parent) as FlexTreeUnboxNodeUnion<TTypes>;\n\t}\n\n\treturn getOrCreateChild(\n\t\tmapTree,\n\t\tschema.allowedTypes,\n\t\tparent,\n\t) as FlexTreeUnboxNodeUnion<TTypes>;\n}\n\n/** Unboxes non-polymorphic required and optional fields holding leaf nodes to their values, if applicable */\nfunction unboxedField<TFieldSchema extends FlexFieldSchema>(\n\tfield: MapTreeField<FlexAllowedTypes>,\n\tkey: FieldKey,\n\tmapTree: MapTree,\n\tparentNode: FlexTreeNode,\n): FlexTreeUnboxField<TFieldSchema> {\n\tconst fieldSchema = field.schema;\n\tconst mapTrees =\n\t\tmapTree.fields.get(key) ?? fail(\"Key does not exist in unhydrated map tree\");\n\n\tif (fieldSchema.kind === FieldKinds.required) {\n\t\treturn unboxedUnion(fieldSchema, mapTrees[0], {\n\t\t\tparent: field,\n\t\t\tindex: 0,\n\t\t}) as FlexTreeUnboxField<TFieldSchema>;\n\t}\n\tif (fieldSchema.kind === FieldKinds.optional) {\n\t\treturn (\n\t\t\tmapTrees.length > 0\n\t\t\t\t? unboxedUnion(fieldSchema, mapTrees[0], { parent: field, index: 0 })\n\t\t\t\t: undefined\n\t\t) as FlexTreeUnboxField<TFieldSchema>;\n\t}\n\n\treturn getOrCreateField(\n\t\tparentNode,\n\t\tkey,\n\t\tmapTrees,\n\t\tfieldSchema,\n\t) as FlexTreeUnboxField<TFieldSchema>;\n}\n\n// #endregion Caching and unboxing utilities\n\nexport function unsupportedUsageError(message?: string): Error {\n\treturn new UsageError(\n\t\t`${\n\t\t\tmessage ?? \"Operation\"\n\t\t} is not supported for content that has not yet been inserted into the tree`,\n\t);\n}\n"]}
|
|
@@ -9,7 +9,6 @@ import type { FlexFieldKind } from "../modular-schema/index.js";
|
|
|
9
9
|
import type { AllowedTypesToFlexInsertableTree, InsertableFlexField } from "../schema-aware/index.js";
|
|
10
10
|
import type { Any, FlexAllowedTypes, FlexFieldNodeSchema, FlexFieldSchema, FlexList, FlexListToUnion, FlexMapNodeSchema, FlexObjectNodeFields, FlexObjectNodeSchema, FlexTreeNodeSchema, LazyItem, LeafNodeSchema } from "../typed-schema/index.js";
|
|
11
11
|
import type { FlexTreeContext } from "./context.js";
|
|
12
|
-
import type { FlexTreeNodeEvents } from "./treeEvents.js";
|
|
13
12
|
/**
|
|
14
13
|
* An anchor slot which records the {@link FlexTreeNode} associated with that anchor, if there is one.
|
|
15
14
|
* @remarks This always points to a "real" {@link FlexTreeNode} (i.e. a `LazyTreeNode`), never to a "raw" node.
|
|
@@ -60,13 +59,6 @@ export interface FlexTreeEntity<out TSchema = unknown> {
|
|
|
60
59
|
* A common context of a "forest" of FlexTrees.
|
|
61
60
|
*/
|
|
62
61
|
readonly context: FlexTreeContext;
|
|
63
|
-
/**
|
|
64
|
-
* Gets the {@link TreeStatus} of this tree.
|
|
65
|
-
*
|
|
66
|
-
* @remarks
|
|
67
|
-
* For non-root fields, this is the status of the parent node, since fields do not have a separate lifetime.
|
|
68
|
-
*/
|
|
69
|
-
treeStatus(): TreeStatus;
|
|
70
62
|
/**
|
|
71
63
|
* Iterate through all nodes/fields in this field/node.
|
|
72
64
|
*
|
|
@@ -121,10 +113,6 @@ export interface FlexTreeNode extends FlexTreeEntity<FlexTreeNodeSchema> {
|
|
|
121
113
|
* Value stored on this node.
|
|
122
114
|
*/
|
|
123
115
|
readonly value?: TreeValue;
|
|
124
|
-
/**
|
|
125
|
-
* {@inheritDoc ISubscribable#on}
|
|
126
|
-
*/
|
|
127
|
-
on<K extends keyof FlexTreeNodeEvents>(eventName: K, listener: FlexTreeNodeEvents[K]): () => void;
|
|
128
116
|
/**
|
|
129
117
|
* Gets a field of this node, if it is not empty.
|
|
130
118
|
*/
|
|
@@ -457,7 +445,7 @@ export type FlexTreeObjectNodeFieldsInner<TFields extends FlexObjectNodeFields>
|
|
|
457
445
|
* Reserved object node field property names to avoid collisions with the rest of the object node API.
|
|
458
446
|
* @internal
|
|
459
447
|
*/
|
|
460
|
-
export declare const reservedObjectNodeFieldPropertyNames: readonly ["anchorNode", "constructor", "context", "is", "
|
|
448
|
+
export declare const reservedObjectNodeFieldPropertyNames: readonly ["anchorNode", "constructor", "context", "is", "parentField", "schema", "tryGetField", "type", "value", "boxedIterator", "iterator", "getBoxed"];
|
|
461
449
|
/**
|
|
462
450
|
* Reserved object node field property names prefixes.
|
|
463
451
|
* These are reserved to avoid collisions with properties derived from field other field names.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flexTreeTypes.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/flexTreeTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,SAAS,EAEd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACvF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EACX,gCAAgC,EAChC,mBAAmB,EACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EACX,GAAG,EACH,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,QAAQ,EACR,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,QAAQ,EACR,cAAc,EACd,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,YAAY,wDAA6B,CAAC;AAEvD;;;GAGG;AACH,eAAO,MA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Q;IACR,YAAY;IACZ,aAAa;IACb,MAAM;IACN,OAAO;IACP,eAAe;IACf,UAAU;IACV,UAAU;CACD,CAAC;AAEX;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,2CAA2C,GAAG;IAC1D,KAAK;IACL,OAAO;IACP,OAAO;IACP,OAAO;CACE,CAAC;AAggBX,aAAa","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\ttype AnchorNode,\n\ttype FieldKey,\n\ttype FieldUpPath,\n\ttype ITreeCursorSynchronous,\n\ttype TreeValue,\n\tanchorSlot,\n} from \"../../core/index.js\";\nimport type { Assume, FlattenKeys } from \"../../util/index.js\";\nimport type { FieldKinds, SequenceFieldEditBuilder } from \"../default-schema/index.js\";\nimport type { FlexFieldKind } from \"../modular-schema/index.js\";\nimport type {\n\tAllowedTypesToFlexInsertableTree,\n\tInsertableFlexField,\n} from \"../schema-aware/index.js\";\nimport type {\n\tAny,\n\tFlexAllowedTypes,\n\tFlexFieldNodeSchema,\n\tFlexFieldSchema,\n\tFlexList,\n\tFlexListToUnion,\n\tFlexMapNodeSchema,\n\tFlexObjectNodeFields,\n\tFlexObjectNodeSchema,\n\tFlexTreeNodeSchema,\n\tLazyItem,\n\tLeafNodeSchema,\n} from \"../typed-schema/index.js\";\n\nimport type { FlexTreeContext } from \"./context.js\";\nimport type { FlexTreeNodeEvents } from \"./treeEvents.js\";\n\n/**\n * An anchor slot which records the {@link FlexTreeNode} associated with that anchor, if there is one.\n * @remarks This always points to a \"real\" {@link FlexTreeNode} (i.e. a `LazyTreeNode`), never to a \"raw\" node.\n */\nexport const flexTreeSlot = anchorSlot<FlexTreeNode>();\n\n/**\n * Indicates that an object is a flex tree.\n * @internal\n */\nexport const flexTreeMarker = Symbol(\"flexTreeMarker\");\n\nexport function isFlexTreeEntity(t: unknown): t is FlexTreeEntity {\n\treturn typeof t === \"object\" && t !== null && flexTreeMarker in t;\n}\n\nexport function isFlexTreeNode(t: unknown): t is FlexTreeNode {\n\treturn isFlexTreeEntity(t) && t[flexTreeMarker] === FlexTreeEntityKind.Node;\n}\n\n/**\n * @internal\n */\nexport enum FlexTreeEntityKind {\n\tNode,\n\tField,\n}\n\n/**\n * Part of a tree.\n * Iterates over children.\n *\n * @privateRemarks\n * This exists mainly as a place to share common members between nodes and fields.\n * It is not expected to be useful or common to write code which handles this type directly.\n * If this assumption turns out to be false, and generically processing `UntypedEntity`s is useful,\n * then this interface should probably be extended with some down casting functionality (like `is`).\n *\n * TODO:\n * Design and document iterator invalidation rules and ordering rules.\n * Providing a custom iterator type with place anchor semantics would be a good approach.\n *\n * @internal\n */\nexport interface FlexTreeEntity<out TSchema = unknown> {\n\t/**\n\t * Indicates that an object is a specific kind of flex tree FlexTreeEntity.\n\t * This makes it possible to both down cast FlexTreeEntities safely as well as validate if an object is or is not a FlexTreeEntity.\n\t */\n\treadonly [flexTreeMarker]: FlexTreeEntityKind;\n\n\t/**\n\t * Schema for this entity.\n\t * If well-formed, it must follow this schema.\n\t */\n\treadonly schema: TSchema;\n\n\t/**\n\t * A common context of a \"forest\" of FlexTrees.\n\t */\n\treadonly context: FlexTreeContext;\n\n\t/**\n\t * Gets the {@link TreeStatus} of this tree.\n\t *\n\t * @remarks\n\t * For non-root fields, this is the status of the parent node, since fields do not have a separate lifetime.\n\t */\n\ttreeStatus(): TreeStatus;\n\n\t/**\n\t * Iterate through all nodes/fields in this field/node.\n\t *\n\t * @remarks\n\t * No mutations to the current view of the shared tree are permitted during iteration.\n\t */\n\tboxedIterator(): IterableIterator<FlexTreeEntity>;\n}\n\n/**\n * Status of the tree that a particular node belongs to.\n * @public\n */\nexport enum TreeStatus {\n\t/**\n\t * Is parented under the root field.\n\t */\n\tInDocument = 0,\n\n\t/**\n\t * Is not parented under the root field, but can be added back to the original document tree.\n\t */\n\tRemoved = 1,\n\n\t/**\n\t * Is removed and cannot be added back to the original document tree.\n\t */\n\tDeleted = 2,\n\n\t/**\n\t * Is created but has not yet been inserted into the tree.\n\t */\n\tNew = 3,\n}\n\n/**\n * Generic tree node API.\n *\n * Nodes are (shallowly) immutable and have a logical identity, a type and either a value or fields under string keys.\n *\n * This \"logical identity\" is exposed as the object identity: if a node is moved within a document,\n * the same {@link FlexTreeNode} instance will be used in the new location.\n * Similarly, edits applied to a node's sub-tree concurrently with the move of the node will still be applied to its subtree in its new location.\n *\n *\n * @remarks\n * Down-casting (via {@link FlexTreeNode#is}) is required to access Schema-Aware APIs, including editing.\n * All content in the tree is accessible without down-casting, but if the schema is known,\n * the schema aware API may be more ergonomic.\n * All editing is actually done via {@link FlexTreeField}s: the nodes are immutable other than that they contain mutable fields.\n *\n * @internal\n */\nexport interface FlexTreeNode extends FlexTreeEntity<FlexTreeNodeSchema> {\n\treadonly [flexTreeMarker]: FlexTreeEntityKind.Node;\n\n\t/**\n\t * Value stored on this node.\n\t */\n\treadonly value?: TreeValue;\n\n\t/**\n\t * {@inheritDoc ISubscribable#on}\n\t */\n\ton<K extends keyof FlexTreeNodeEvents>(\n\t\teventName: K,\n\t\tlistener: FlexTreeNodeEvents[K],\n\t): () => void;\n\n\t/**\n\t * Gets a field of this node, if it is not empty.\n\t */\n\ttryGetField(key: FieldKey): undefined | FlexTreeField;\n\n\t/**\n\t * Get the field for `key`.\n\t * @param key - which entry to look up.\n\t *\n\t * @remarks\n\t * All fields implicitly exist, so `getBoxed` can be called with any key and will always return a field.\n\t * Even if the field is empty, it will still be returned, and can be edited to insert content if allowed by the field kind.\n\t * See {@link FlexTreeNode.tryGetField} for a variant that does not allocate afield in the empty case.\n\t */\n\tgetBoxed(key: FieldKey): FlexTreeField;\n\n\t/**\n\t * The field this tree is in, and the index within that field.\n\t */\n\treadonly parentField: { readonly parent: FlexTreeField; readonly index: number };\n\n\t/**\n\t * Type guard for narrowing / down-casting to a specific schema.\n\t */\n\tis<TSchema extends FlexTreeNodeSchema>(schema: TSchema): this is FlexTreeTypedNode<TSchema>;\n\n\tboxedIterator(): IterableIterator<FlexTreeField>;\n\n\t/**\n\t * The anchor node associated with this node\n\t *\n\t * @remarks\n\t * The ref count keeping this alive is owned by the FlexTreeNode:\n\t * if holding onto this anchor for longer than the FlexTreeNode might be alive,\n\t * a separate Anchor (and thus ref count) must be allocated to keep it alive.\n\t */\n\treadonly anchorNode: AnchorNode;\n}\n\n/**\n * A collaboratively editable collection of nodes within a {@link FlexTreeEntity}.\n *\n * Fields are inherently part of their parent, and thus cannot be moved.\n * Instead their content can be moved, deleted or created.\n *\n * Editing operations are only valid on trees with the {@link TreeStatus#InDocument} `TreeStatus`.\n *\n * @remarks\n * Fields are used wherever an editable collection of nodes is required.\n * This is required in two places:\n * 1. To hold the children of non-leaf {@link FlexTreeNode}s.\n * 2. As the root of a {@link FlexTreeEntity}.\n *\n * Down-casting (via {@link FlexTreeField.is}) is required to access Schema-Aware APIs, including editing.\n * All content in the tree is accessible without down-casting, but if the schema is known,\n * the schema aware API may be more ergonomic.\n *\n * @internal\n */\nexport interface FlexTreeField extends FlexTreeEntity<FlexFieldSchema> {\n\treadonly [flexTreeMarker]: FlexTreeEntityKind.Field;\n\n\t/**\n\t * The number of nodes in this field\n\t */\n\treadonly length: number;\n\n\t/**\n\t * The `FieldKey` this field is under.\n\t * Defines what part of its parent this field makes up.\n\t */\n\treadonly key: FieldKey;\n\n\t/**\n\t * The node which has this field on it under `fieldKey`.\n\t * `undefined` iff this field is a detached field.\n\t */\n\treadonly parent?: FlexTreeNode;\n\n\t/**\n\t * Type guard for narrowing / down-casting to a specific schema.\n\t */\n\tis<TSchema extends FlexFieldSchema>(schema: TSchema): this is FlexTreeTypedField<TSchema>;\n\n\tboxedIterator(): IterableIterator<FlexTreeNode>;\n\n\t/**\n\t * Gets a node of this field by its index without unboxing.\n\t * @param index - Zero-based index of the item to retrieve. Negative values are interpreted from the end of the sequence.\n\t *\n\t * @returns The element in the sequence matching the given index. Always returns undefined if index \\< -sequence.length\n\t * or index \\>= sequence.length.\n\t *\n\t * @remarks\n\t * Semantics match {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at | Array.at}.\n\t */\n\tboxedAt(index: number): FlexTreeNode | undefined;\n}\n\n// #region Node Kinds\n\n/**\n * A {@link FlexTreeNode} that behaves like a `Map<string, Field>` for a specific `Field` type.\n *\n * @remarks\n * Unlike TypeScript Map type, {@link FlexTreeMapNode.get} always provides a reference to any field looked up, even if it has never been set.\n *\n * This means that, for example, a `MapNode` of {@link FlexTreeSequenceField} fields will return an empty sequence when a previously unused key is looked up,\n * and that sequence can be used to insert new items into the field.\n * Additionally empty fields (those containing no nodes) are not distinguished from fields which do not exist.\n * This differs from JavaScript Maps which have a subtle distinction between storing undefined as a value in the map and deleting an entry from the map.\n *\n * @internal\n */\nexport interface FlexTreeMapNode<in out TSchema extends FlexMapNodeSchema>\n\textends FlexTreeNode {\n\treadonly schema: TSchema;\n\n\t/**\n\t * The number of elements in the map.\n\t *\n\t * @remarks\n\t * All fields under a map implicitly exist, but `size` will count only the fields which contain one or more nodes.\n\t */\n\treadonly size: number;\n\n\t/**\n\t * Checks whether a value exists for the given key.\n\t * @param key - Which map entry to look up.\n\t *\n\t * @remarks\n\t * All fields under a map implicitly exist, but `has` will only return true if there are one or more nodes present in the given field.\n\t */\n\thas(key: string): boolean;\n\n\t/**\n\t * Get the value associated with `key`.\n\t * @param key - which map entry to look up.\n\t */\n\tget(key: string): FlexTreeUnboxField<TSchema[\"info\"]>;\n\n\t/**\n\t * Get the field for `key`.\n\t * @param key - which map entry to look up.\n\t *\n\t * @remarks\n\t * All fields under a map implicitly exist, so `get` can be called with any key and will always return a field.\n\t * Even if the field is empty, it will still be returned, and can be edited to insert content into the map.\n\t */\n\tgetBoxed(key: string): FlexTreeTypedField<TSchema[\"info\"]>;\n\n\t/**\n\t * Returns an iterable of keys in the map.\n\t *\n\t * @remarks\n\t * All fields under a map implicitly exist, but `keys` will yield only the keys of fields which contain one or more nodes.\n\t *\n\t * No guarantees are made regarding the order of the keys returned.\n\t */\n\tkeys(): IterableIterator<FieldKey>;\n\n\t/**\n\t * Returns an iterable of values in the map.\n\t *\n\t * @remarks\n\t * All fields under a map implicitly exist, but `values` will yield only the fields containing one or more nodes.\n\t *\n\t * No guarantees are made regarding the order of the values returned.\n\t */\n\tvalues(): IterableIterator<FlexTreeUnboxField<TSchema[\"info\"], \"notEmpty\">>;\n\n\t/**\n\t * Returns an iterable of key, value pairs for every entry in the map.\n\t *\n\t * @remarks\n\t * All fields under a map implicitly exist, but `entries` will yield only the entries whose fields contain one or more nodes.\n\t *\n\t * This iteration provided by `entries()` is equivalent to that provided by direct iteration of the {@link FlexTreeMapNode} (a.k.a. `[Symbol.Iterator]()`).\n\t *\n\t * No guarantees are made regarding the order of the entries returned.\n\t */\n\tentries(): IterableIterator<[FieldKey, FlexTreeUnboxField<TSchema[\"info\"], \"notEmpty\">]>;\n\n\t/**\n\t * Executes a provided function once per each key/value pair in the map.\n\t * @param callbackFn - The function to run for each map entry\n\t * @param thisArg - If present, `callbackFn` will be bound to `thisArg`\n\t *\n\t * @privateRemarks\n\t * TODO: This should run over fields in insertion order if we want to match the javascript foreach spec.\n\t */\n\tforEach(\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\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tthisArg?: any,\n\t): void;\n\n\t/**\n\t * Adds or updates an entry in the map with a specified `key` and a `value`.\n\t *\n\t * @param key - The key of the element to add to the map.\n\t * @param value - The value of the element to add to the map.\n\t */\n\tset(key: string, value: FlexibleFieldContent<TSchema[\"info\"]>): void;\n\n\t/**\n\t * Removes the specified element from this map by its `key`.\n\t *\n\t * @remarks\n\t * Note: unlike JavaScript's Map API, this method does not return a flag indicating whether or not the value was\n\t * deleted.\n\t *\n\t * @privateRemarks\n\t * Regarding the choice to not return a boolean: Since this data structure is distributed in nature, it isn't\n\t * possible to tell whether or not the item was deleted as a result of this method call. Returning a \"best guess\"\n\t * is more likely to create issues / promote bad usage patterns than offer useful information.\n\t *\n\t * @param key - The key of the element to remove from the map.\n\t */\n\tdelete(key: string): void;\n\n\t/**\n\t * Iterate through all fields in the map.\n\t *\n\t * @remarks\n\t * No mutations to the current view of the shared tree are permitted during iteration.\n\t * To iterate over the unboxed values of the map, use `Symbol.Iterator()`.\n\t */\n\tboxedIterator(): IterableIterator<FlexTreeTypedField<TSchema[\"info\"]>>;\n\n\t[Symbol.iterator](): IterableIterator<\n\t\t[FieldKey, FlexTreeUnboxField<TSchema[\"info\"], \"notEmpty\">]\n\t>;\n}\n\n/**\n * A {@link FlexTreeNode} that wraps a single {@link FlexTreeField} (which is placed under the {@link EmptyKey}).\n *\n * @remarks\n * A FieldNode is mostly identical to a struct node with a single field using the {@link EmptyKey}, but provides access to it via a field named \"content\".\n *\n * There are several use-cases where it makes sense to use a field node.\n * Here are a few:\n * - When it's necessary to differentiate between an empty sequence, and no sequence.\n * One case where this is needed is encoding Json.\n * - When polymorphism over {@link FlexFieldSchema} (and not just a union of {@link FlexAllowedTypes}) is required.\n * For example when encoding a schema for a type like\n * `Foo[] | Bar[]`, `Foo | Foo[]` or `Optional<Foo> | Optional<Bar>` (Where `Optional` is the Optional field kind, not TypeScript's `Optional`).\n * Since this schema system only allows `|` of {@link FlexTreeNodeSchema} (and only when declaring a {@link FlexFieldSchema}), see {@link SchemaBuilderBase.field},\n * these aggregate types are most simply expressed by creating fieldNodes for the terms like `Foo[]`, and `Optional<Foo>`.\n * Note that these are distinct from types like `(Foo | Bar)[]` and `Optional<Foo | Bar>` which can be expressed as single fields without extra nodes.\n * - When a distinct merge identity is desired for a field.\n * For example, if the application wants to be able to have an optional node or a sequence which it can pass around, edit and observe changes to,\n * in some cases (like when the content is moved to a different parent) this can be more flexible if a field node is introduced\n * to create a separate logical entity (node) which wraps the field.\n * This can even be useful with value fields to wrap terminal nodes if a stable merge\n * - When a field (such as a {@link FlexTreeSequenceField}) is desired in a location where {@link FlexTreeNode}s are required\n * (like the member of a union or the child of another {@link FlexTreeField}).\n * This can is typically just a different perspective on one of the above cases.\n * For example:\n * `Sequence<Foo> | Sequence<Bar>` or `OptionalField<Sequence<Foo>>` can't be expressed as simple fields\n * (unlike `Sequence<Foo | Bar>` or `OptionalField<Foo>` which can be done as simple fields).\n * Instead {@link FlexTreeFieldNode}s can be use to achieve something similar, more like:\n * `FieldNode<Sequence<Foo>> | FieldNode<Sequence<Bar>>` or `OptionalField<FieldNode<Sequence<Foo>>>`.\n *\n * @privateRemarks\n * FieldNodes do not unbox to their content, so in schema aware APIs which do unboxing, the FieldNode will NOT be skipped over.\n * This is a change from the old behavior to simplify unboxing and prevent cases where arbitrary deep chains of field nodes could unbox omitting information about the tree depth.\n * @internal\n */\nexport interface FlexTreeFieldNode<in out TSchema extends FlexFieldNodeSchema>\n\textends FlexTreeNode {\n\treadonly schema: TSchema;\n\n\t/**\n\t * The content this field node wraps.\n\t */\n\treadonly content: FlexTreeUnboxField<TSchema[\"info\"]>;\n}\n\n/**\n * A {@link FlexTreeNode} that behaves like an \"object\" or \"struct\", providing properties to access its fields.\n *\n * ObjectNodes consist of a finite collection of fields, each with their own (distinct) key and {@link FlexFieldSchema}.\n *\n * @remarks\n * ObjectNodes require complex typing, and have been split into two parts for implementation purposes.\n * See {@link FlexTreeObjectNodeTyped} for the schema aware extensions to this that provide access to the fields.\n *\n * These \"Objects\" resemble \"Structs\" from a wide variety of programming languages\n * (Including Algol 68, C, Go, Rust, C# etc.).\n * ObjectNodes also somewhat resemble JavaScript objects: this analogy is less precise (objects don't have a fixed schema for example),\n * but for consistency with other systems in the JavaScript ecosystem (like JSON) is \"ObjectNodes\" nodes are named \"Objects\".\n *\n * Another common name for this abstraction is [record](https://en.wikipedia.org/wiki/Record_(computer_science)).\n * The name \"Record\" is avoided (in favor of Object) here because it has less precise connotations for most TypeScript developers.\n * For example, TypeScript has a built in `Record` type, but it requires all of the fields to have the same type,\n * putting its semantics half way between this library's \"Object\" schema and {@link FlexTreeMapNode}.\n *\n * @internal\n */\nexport interface FlexTreeObjectNode extends FlexTreeNode {\n\treadonly schema: FlexObjectNodeSchema;\n}\n\n/**\n * Leaf holding a value.\n *\n * @remarks\n * Leaves are immutable and have no children.\n * Leaf unboxes its content, so in schema aware APIs which do unboxing, the Leaf itself will be skipped over and its value will be returned directly.\n * @internal\n */\nexport interface FlexTreeLeafNode<in out TSchema extends LeafNodeSchema> extends FlexTreeNode {\n\treadonly schema: TSchema;\n\n\t/**\n\t * Value stored on this node.\n\t */\n\treadonly value: TreeValue<TSchema[\"info\"]>;\n}\n\n/**\n * An {@link FlexTreeObjectNode} with schema aware accessors for its fields.\n *\n * @privateRemarks\n *\n * The corresponding implementation logic for this lives in `LazyTree.ts` under `buildStructClass`.\n * If you change the signature here, you will need to update that logic to match.\n *\n * @internal\n */\nexport type FlexTreeObjectNodeTyped<TSchema extends FlexObjectNodeSchema> =\n\tFlexObjectNodeSchema extends TSchema\n\t\t? FlexTreeObjectNode\n\t\t: FlexTreeObjectNode & FlexTreeObjectNodeFields<TSchema[\"info\"]>;\n\n/**\n * Properties to access an object node's fields. See {@link FlexTreeObjectNodeTyped}.\n *\n * @privateRemarks\n * TODO: Support custom field keys.\n * @internal\n */\nexport type FlexTreeObjectNodeFields<TFields extends FlexObjectNodeFields> =\n\tFlexTreeObjectNodeFieldsInner<\n\t\tFlattenKeys<\n\t\t\t{\n\t\t\t\t// When the key does not need to be escaped, map it from the input TFields in a way that doesn't break navigate to declaration\n\t\t\t\t[key in keyof TFields as key extends PropertyNameFromFieldKey<key & string>\n\t\t\t\t\t? key\n\t\t\t\t\t: never]: TFields[key];\n\t\t\t} & {\n\t\t\t\t[key in keyof TFields as key extends PropertyNameFromFieldKey<key & string>\n\t\t\t\t\t? never\n\t\t\t\t\t: PropertyNameFromFieldKey<key & string>]: TFields[key];\n\t\t\t}\n\t\t>\n\t>;\n\n/**\n * Properties to access an object node's fields. See {@link FlexTreeObjectNodeTyped}.\n *\n * @privateRemarks\n * TODO: Do we keep assignment operator + \"setFoo\" methods, or just use methods?\n * Inconsistency in the API experience could confusing for consumers.\n *\n * @internal\n */\nexport type FlexTreeObjectNodeFieldsInner<TFields extends FlexObjectNodeFields> = FlattenKeys<\n\t{\n\t\t// boxed fields (TODO: maybe remove these when same as non-boxed version?)\n\t\treadonly [key in keyof TFields as `boxed${Capitalize<key & string>}`]: FlexTreeTypedField<\n\t\t\tTFields[key]\n\t\t>;\n\t} & {\n\t\t// Add getter only (make property readonly) when the field is **not** of a kind that has a logical set operation.\n\t\t// If we could map to getters and setters separately, we would preferably do that, but we can't.\n\t\t// See https://github.com/microsoft/TypeScript/issues/43826 for more details on this limitation.\n\t\treadonly [key in keyof TFields as TFields[key][\"kind\"] extends AssignableFieldKinds\n\t\t\t? never\n\t\t\t: key]: FlexTreeUnboxField<TFields[key]>;\n\t} & {\n\t\t// Add setter (make property writable) when the field is of a kind that has a logical set operation.\n\t\t// If we could map to getters and setters separately, we would preferably do that, but we can't.\n\t\t// See https://github.com/microsoft/TypeScript/issues/43826 for more details on this limitation.\n\t\t-readonly [key in keyof TFields as TFields[key][\"kind\"] extends AssignableFieldKinds\n\t\t\t? key\n\t\t\t: never]: FlexTreeUnboxField<TFields[key]>;\n\t} & {\n\t\t// Setter method (when the field is of a kind that has a logical set operation).\n\t\treadonly [key in keyof TFields as TFields[key][\"kind\"] extends AssignableFieldKinds\n\t\t\t? `set${Capitalize<key & string>}`\n\t\t\t: never]: (content: FlexibleFieldContent<TFields[key]>) => void;\n\t}\n>;\n\n/**\n * Reserved object node field property names to avoid collisions with the rest of the object node API.\n * @internal\n */\nexport const reservedObjectNodeFieldPropertyNames = [\n\t\"anchorNode\",\n\t\"constructor\",\n\t\"context\",\n\t\"is\",\n\t\"on\",\n\t\"parentField\",\n\t\"schema\",\n\t\"treeStatus\",\n\t\"tryGetField\",\n\t\"type\",\n\t\"value\",\n\t\"boxedIterator\",\n\t\"iterator\",\n\t\"getBoxed\",\n] as const;\n\n/**\n * Reserved object node field property names prefixes.\n * These are reserved to avoid collisions with properties derived from field other field names.\n *\n * Field names starting with these must be followed by a lowercase letter, or be escaped.\n * @internal\n */\nexport const reservedObjectNodeFieldPropertyNamePrefixes = [\n\t\"set\",\n\t\"boxed\",\n\t\"field\",\n\t\"Field\",\n] as const;\n\n/**\n * {@link reservedObjectNodeFieldPropertyNamePrefixes} as a type union.\n * @internal\n */\nexport type ReservedObjectNodeFieldPropertyNames =\n\t(typeof reservedObjectNodeFieldPropertyNames)[number];\n\n/**\n * {@link reservedObjectNodeFieldPropertyNamePrefixes} as a type union.\n * @internal\n */\nexport type ReservedObjectNodeFieldPropertyNamePrefixes =\n\t(typeof reservedObjectNodeFieldPropertyNamePrefixes)[number];\n\n/**\n * Convert an object node's field key into an escaped string usable as a property name.\n *\n * @privateRemarks\n * TODO:\n * Collisions are still possible.\n * For example fields named \"foo\" and \"Foo\" would both produce a setter \"setFoo\".\n * Consider naming schemes to avoid this, ensure that there is a good workaround for these cases.\n * Another approach would be to support custom field names (separate from keys),\n * and do the escaping (if needed) when creating the flex tree schema (both when manually creating them and when doing so automatically):\n * this would enable better intellisense for escaped fields, as well as allow the feature of custom field property names.\n *\n * @internal\n */\nexport type PropertyNameFromFieldKey<T extends string> =\n\tT extends ReservedObjectNodeFieldPropertyNames\n\t\t? `field${Capitalize<T>}`\n\t\t: T extends `${ReservedObjectNodeFieldPropertyNamePrefixes}${Capitalize<string>}`\n\t\t\t? `field${Capitalize<T>}`\n\t\t\t: T;\n\n/**\n * Field kinds that allow value assignment.\n *\n * @internal\n */\nexport type AssignableFieldKinds = typeof FieldKinds.optional | typeof FieldKinds.required;\n\n// #endregion\n\n// #region Field Kinds\n\n/**\n * Strongly typed tree literals for inserting as the content of a field.\n *\n * If a cursor is provided, it must be in Fields mode.\n * @internal\n */\nexport type FlexibleFieldContent<TSchema extends FlexFieldSchema> =\n\t| InsertableFlexField<TSchema>\n\t| ITreeCursorSynchronous;\n\n/**\n * Strongly typed tree literals for inserting as a node.\n *\n * If a cursor is provided, it must be in Nodes mode.\n * @internal\n */\nexport type FlexibleNodeContent<TTypes extends FlexAllowedTypes> =\n\t| AllowedTypesToFlexInsertableTree<TTypes>\n\t| ITreeCursorSynchronous;\n\n/**\n * Strongly typed tree literals for inserting a subsequence of nodes.\n *\n * Used to insert a batch of 0 or more nodes into some location in a {@link FlexTreeSequenceField}.\n *\n * If a cursor is provided, it must be in Fields mode.\n * @internal\n */\nexport type FlexibleNodeSubSequence<TTypes extends FlexAllowedTypes> =\n\t| Iterable<AllowedTypesToFlexInsertableTree<TTypes>>\n\t| ITreeCursorSynchronous;\n\n/**\n * Type to ensures two types overlap in at least one way.\n * It evaluates to the input type if this is true, and never otherwise.\n * Examples:\n * CheckTypesOverlap\\<number | boolean, number | object\\> = number | boolean\n * CheckTypesOverlap\\<number | boolean, string | object\\> = never\n * @internal\n */\nexport type CheckTypesOverlap<T, TCheck> = [Extract<T, TCheck> extends never ? never : T][0];\n\n/**\n * {@link FlexTreeField} that stores a sequence of children.\n *\n * Sequence fields can contain an ordered sequence any number of {@link FlexTreeNode}s which must be of the {@link FlexAllowedTypes} from the {@link FlexFieldSchema}).\n *\n * @remarks\n * Allows for concurrent editing based on index, adjusting the locations of indexes as needed so they apply to the same logical place in the sequence when rebased and merged.\n *\n * Edits to sequence fields are anchored relative to their surroundings, so concurrent edits can result in the indexes of nodes and edits getting shifted.\n * To hold onto locations in sequence across an edit, use anchors.\n *\n * @privateRemarks\n * TODO:\n * Add anchor API that can actually hold onto locations in a sequence.\n * Currently only nodes can be held onto with anchors, and this does not replicate the behavior implemented for editing.\n * @internal\n */\nexport interface FlexTreeSequenceField<in out TTypes extends FlexAllowedTypes>\n\textends FlexTreeField {\n\t/**\n\t * Gets a node of this field by its index with unboxing.\n\t * @param index - Zero-based index of the item to retrieve. Negative values are interpreted from the end of the sequence.\n\t *\n\t * @returns The element in the sequence matching the given index. Always returns undefined if index \\< -sequence.length\n\t * or index \\>= array.length.\n\t *\n\t * @remarks\n\t * Semantics match {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at | Array.at}.\n\t */\n\tat(index: number): FlexTreeUnboxNodeUnion<TTypes> | undefined;\n\n\t/**\n\t * {@inheritdoc FlexTreeField.boxedAt}\n\t */\n\tboxedAt(index: number): FlexTreeTypedNodeUnion<TTypes> | undefined;\n\n\t/**\n\t * Calls the provided callback function on each child of this sequence, and returns an array that contains the results.\n\t * @param callbackfn - A function that accepts the child and its index.\n\t */\n\tmap<U>(callbackfn: (value: FlexTreeUnboxNodeUnion<TTypes>, index: number) => U): U[];\n\n\t/**\n\t * Calls the provided callback function on each child of this sequence, and returns an array that contains the results.\n\t * @param callbackfn - A function that accepts the child and its index.\n\t */\n\tmapBoxed<U>(callbackfn: (value: FlexTreeTypedNodeUnion<TTypes>, index: number) => U): U[];\n\n\treadonly length: number;\n\n\t/**\n\t * Get an editor for this sequence.\n\t */\n\tsequenceEditor(): SequenceFieldEditBuilder;\n\n\t/*\n\t * TODO:\n\t * Remove these editing methods and replace their use with use of `sequenceEditor`.\n\t * These editing methods replicate the API exposed by simple-tree, but using flex-tree types.\n\t * As these methods just re-abstract the lower level SequenceFieldEditBuilder API, they add little value.\n\t * Migrating the logic implementing them to simple-tree (and having it just use `sequenceEditor` directly)\n\t * avoids duplicating the API surface (and documentation), as well as makes it simpler to implement the desired user facing validation and errors\n\t * since simple-tree becomes responsible for all the validation and can produce usage errors in terms of the public package API.\n\t */\n\t// #region Editing Methods\n\n\t/**\n\t * Inserts new item(s) at a specified location.\n\t * @param index - The index at which to insert `value`.\n\t * @param value - The content to insert.\n\t * @throws Throws if `index` is not in the range [0, `list.length`).\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tinsertAt(index: number, value: FlexibleNodeSubSequence<TTypes>): void;\n\n\t/**\n\t * Inserts new item(s) at the start of the sequence.\n\t * @param value - The content to insert.\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tinsertAtStart(value: FlexibleNodeSubSequence<TTypes>): void;\n\n\t/**\n\t * Inserts new item(s) at the end of the sequence.\n\t * @param value - The content to insert.\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tinsertAtEnd(value: FlexibleNodeSubSequence<TTypes>): void;\n\n\t/**\n\t * Removes the item at the specified location.\n\t * @param index - The index at which to remove the item.\n\t * @throws Throws if `index` is not in the range [0, `list.length`).\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tremoveAt(index: number): void;\n\n\t/**\n\t * Moves the specified item to the start of the sequence.\n\t * @param sourceIndex - The index of the item to move.\n\t * @throws Throws if `sourceIndex` is not in the range [0, `list.length`).\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveToStart(sourceIndex: number): void;\n\n\t/**\n\t * Moves the specified item to the start of the sequence.\n\t * @param sourceIndex - The index of the item to move.\n\t * @param source - The source sequence to move the item out of.\n\t * @throws Throws if `sourceIndex` is not in the range [0, `list.length`).\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveToStart(sourceIndex: number, source: FlexTreeSequenceField<FlexAllowedTypes>): void;\n\n\t/**\n\t * Moves the specified item to the end of the sequence.\n\t * @param sourceIndex - The index of the item to move.\n\t * @throws Throws if `sourceIndex` is not in the range [0, `list.length`).\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveToEnd(sourceIndex: number): void;\n\n\t/**\n\t * Moves the specified item to the end of the sequence.\n\t * @param sourceIndex - The index of the item to move.\n\t * @param source - The source sequence to move the item out of.\n\t * @throws Throws if `sourceIndex` is not in the range [0, `list.length`).\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveToEnd(sourceIndex: number, source: FlexTreeSequenceField<FlexAllowedTypes>): void;\n\n\t/**\n\t * Moves the specified item to the desired location in the sequence.\n\t * @param index - The index to move the item to.\n\t * This is based on the state of the sequence before moving the source item.\n\t * @param sourceIndex - The index of the item to move.\n\t * @throws Throws if any of the input indices are not in the range [0, `list.length`).\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveToIndex(index: number, sourceIndex: number): void;\n\n\t/**\n\t * Moves the specified item to the desired location in the sequence.\n\t * @param index - The index to move the item to.\n\t * @param sourceIndex - The index of the item to move.\n\t * @param source - The source sequence to move the item out of.\n\t * @throws Throws if any of the input indices are not in the range [0, `list.length`).\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveToIndex(\n\t\tindex: number,\n\t\tsourceIndex: number,\n\t\tsource: FlexTreeSequenceField<FlexAllowedTypes>,\n\t): void;\n\n\t/**\n\t * Moves the specified items to the start of the sequence.\n\t * @param sourceStart - The starting index of the range to move (inclusive).\n\t * @param sourceEnd - The ending index of the range to move (exclusive)\n\t * @throws Throws if either of the input indices are not in the range [0, `list.length`) or if `sourceStart` is greater than `sourceEnd`.\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveRangeToStart(sourceStart: number, sourceEnd: number): void;\n\n\t/**\n\t * Moves the specified items to the start of the sequence.\n\t * @param sourceStart - The starting index of the range to move (inclusive).\n\t * @param sourceEnd - The ending index of the range to move (exclusive)\n\t * @param source - The source sequence to move items out of.\n\t * @throws Throws if the types of any of the items being moved are not allowed in the destination sequence,\n\t * if either of the input indices are not in the range [0, `list.length`) or if `sourceStart` is greater than `sourceEnd`.\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveRangeToStart(\n\t\tsourceStart: number,\n\t\tsourceEnd: number,\n\t\tsource: FlexTreeSequenceField<FlexAllowedTypes>,\n\t): void;\n\n\t/**\n\t * Moves the specified items to the end of the sequence.\n\t * @param sourceStart - The starting index of the range to move (inclusive).\n\t * @param sourceEnd - The ending index of the range to move (exclusive)\n\t * @throws Throws if either of the input indices are not in the range [0, `list.length`) or if `sourceStart` is greater than `sourceEnd`.\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveRangeToEnd(sourceStart: number, sourceEnd: number): void;\n\n\t/**\n\t * Moves the specified items to the end of the sequence.\n\t * @param sourceStart - The starting index of the range to move (inclusive).\n\t * @param sourceEnd - The ending index of the range to move (exclusive)\n\t * @param source - The source sequence to move items out of.\n\t * @throws Throws if the types of any of the items being moved are not allowed in the destination sequence,\n\t * if either of the input indices are not in the range [0, `list.length`) or if `sourceStart` is greater than `sourceEnd`.\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveRangeToEnd(\n\t\tsourceStart: number,\n\t\tsourceEnd: number,\n\t\tsource: FlexTreeSequenceField<FlexAllowedTypes>,\n\t): void;\n\n\t/**\n\t * Moves the specified items to the desired location within the sequence.\n\t * @param index - The index to move the items to.\n\t * This is based on the state of the sequence before moving the source items.\n\t * @param sourceStart - The starting index of the range to move (inclusive).\n\t * @param sourceEnd - The ending index of the range to move (exclusive)\n\t * @throws Throws if any of the input indices are not in the range [0, `list.length`) or if `sourceStart` is greater than `sourceEnd`.\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveRangeToIndex(index: number, sourceStart: number, sourceEnd: number): void;\n\n\t/**\n\t * Moves the specified items to the desired location within the sequence.\n\t * @param index - The index to move the items to.\n\t * @param sourceStart - The starting index of the range to move (inclusive).\n\t * @param sourceEnd - The ending index of the range to move (exclusive)\n\t * @param source - The source sequence to move items out of.\n\t * @throws Throws if the types of any of the items being moved are not allowed in the destination sequence,\n\t * if any of the input indices are not in the range [0, `list.length`) or if `sourceStart` is greater than `sourceEnd`.\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveRangeToIndex(\n\t\tindex: number,\n\t\tsourceStart: number,\n\t\tsourceEnd: number,\n\t\t// FlexTreeSequenceField is invariant over its schema so any is required here.\n\t\t// This use of any can be removed by migrating off this deprecated API and deleting it.\n\t\t// If kept, this function should be fixed by making it generic and constraining it to fields which are safe to move content from.\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tsource: FlexTreeSequenceField<any>,\n\t): void;\n\n\t// #endregion\n\n\tboxedIterator(): IterableIterator<FlexTreeTypedNodeUnion<TTypes>>;\n\n\t/**\n\t * Gets the FieldUpPath of a field.\n\t */\n\tgetFieldPath(): FieldUpPath;\n\n\t[Symbol.iterator](): IterableIterator<FlexTreeUnboxNodeUnion<TTypes>>;\n}\n\n/**\n * Field that stores exactly one child.\n *\n * @remarks\n * Unboxes its content, so in schema aware APIs which do unboxing, the RequiredField itself will be skipped over and its content will be returned directly.\n * @internal\n */\nexport interface FlexTreeRequiredField<in out TTypes extends FlexAllowedTypes>\n\textends FlexTreeField {\n\tget content(): FlexTreeUnboxNodeUnion<TTypes>;\n\tset content(content: FlexibleNodeContent<TTypes>);\n}\n\n/**\n * Field that stores zero or one child.\n *\n * @remarks\n * Unboxes its content, so in schema aware APIs which do unboxing, the OptionalField itself will be skipped over and its content will be returned directly.\n *\n * @privateRemarks\n * TODO: Document merge semitics\n * TODO: Allow Optional fields to be used with last write wins OR first write wins merge resolution.\n * TODO:\n * Better centralize the documentation about what kinds of merge semantics are available for field kinds.\n * Maybe link editor?\n * @internal\n */\nexport interface FlexTreeOptionalField<in out TTypes extends FlexAllowedTypes>\n\textends FlexTreeField {\n\tget content(): FlexTreeUnboxNodeUnion<TTypes> | undefined;\n\tset content(newContent: FlexibleNodeContent<TTypes> | undefined);\n}\n\n// #endregion\n\n// #region Typed\n\n/**\n * Schema aware specialization of {@link FlexTreeField}.\n * @internal\n */\nexport type FlexTreeTypedField<TSchema extends FlexFieldSchema> = FlexTreeTypedFieldInner<\n\tTSchema[\"kind\"],\n\tTSchema[\"allowedTypes\"]\n>;\n\n/**\n * Helper for implementing {@link FlexTreeTypedField}.\n * @internal\n */\nexport type FlexTreeTypedFieldInner<\n\tKind extends FlexFieldKind,\n\tTypes extends FlexAllowedTypes,\n> = Kind extends typeof FieldKinds.sequence\n\t? FlexTreeSequenceField<Types>\n\t: Kind extends typeof FieldKinds.required\n\t\t? FlexTreeRequiredField<Types>\n\t\t: Kind extends typeof FieldKinds.optional\n\t\t\t? FlexTreeOptionalField<Types>\n\t\t\t: FlexTreeField;\n\n/**\n * Schema aware specialization of {@link FlexTreeNode} for a given {@link FlexAllowedTypes}.\n * @internal\n */\nexport type FlexTreeTypedNodeUnion<T extends FlexAllowedTypes> =\n\tT extends FlexList<FlexTreeNodeSchema>\n\t\t? FlexTreeTypedNode<Assume<FlexListToUnion<T>, FlexTreeNodeSchema>>\n\t\t: FlexTreeNode;\n\n/**\n * Schema aware specialization of {@link FlexTreeNode} for a given {@link FlexTreeNodeSchema}.\n * @internal\n */\nexport type FlexTreeTypedNode<TSchema extends FlexTreeNodeSchema> =\n\tTSchema extends LeafNodeSchema\n\t\t? FlexTreeLeafNode<TSchema>\n\t\t: TSchema extends FlexMapNodeSchema\n\t\t\t? FlexTreeMapNode<TSchema>\n\t\t\t: TSchema extends FlexFieldNodeSchema\n\t\t\t\t? FlexTreeFieldNode<TSchema>\n\t\t\t\t: TSchema extends FlexObjectNodeSchema\n\t\t\t\t\t? FlexTreeObjectNodeTyped<TSchema>\n\t\t\t\t\t: FlexTreeNode;\n\n// #endregion\n\n// #region Unbox\n\n/**\n * Schema aware unboxed field.\n * @remarks\n * Unboxes fields to their content if appropriate for the kind.\n * Recursively unboxes that content (then its content etc.) as well if the node union does unboxing.\n * @internal\n */\nexport type FlexTreeUnboxField<\n\tTSchema extends FlexFieldSchema,\n\t// If \"notEmpty\", then optional fields will unbox to their content (not their content | undefined)\n\tEmptiness extends \"maybeEmpty\" | \"notEmpty\" = \"maybeEmpty\",\n> = FlexTreeUnboxFieldInner<TSchema[\"kind\"], TSchema[\"allowedTypes\"], Emptiness>;\n\n/**\n * Helper for implementing FlexTreeUnboxField.\n * @internal\n */\nexport type FlexTreeUnboxFieldInner<\n\tKind extends FlexFieldKind,\n\tTTypes extends FlexAllowedTypes,\n\tEmptiness extends \"maybeEmpty\" | \"notEmpty\",\n> = Kind extends typeof FieldKinds.sequence\n\t? FlexTreeSequenceField<TTypes>\n\t: Kind extends typeof FieldKinds.required\n\t\t? FlexTreeUnboxNodeUnion<TTypes>\n\t\t: Kind extends typeof FieldKinds.optional\n\t\t\t? FlexTreeUnboxNodeUnion<TTypes> | (Emptiness extends \"notEmpty\" ? never : undefined)\n\t\t\t: // TODO: forbidden\n\t\t\t\tunknown;\n\n/**\n * Schema aware unboxed union of tree types.\n * @remarks\n * Unboxes when not polymorphic.\n * Recursively unboxes that content as well if the node kind does unboxing.\n * @internal\n */\nexport type FlexTreeUnboxNodeUnion<TTypes extends FlexAllowedTypes> = TTypes extends readonly [\n\tLazyItem<infer InnerType>,\n]\n\t? InnerType extends FlexTreeNodeSchema\n\t\t? FlexTreeUnboxNode<InnerType>\n\t\t: InnerType extends Any\n\t\t\t? FlexTreeNode\n\t\t\t: // This case should not occur. If the result ever ends up unknown, look at places like this to debug.\n\t\t\t\tunknown\n\t: boolean extends IsArrayOfOne<TTypes>\n\t\t? FlexTreeUnknownUnboxed // Unknown if this will unbox. This should mainly happen when TTypes is AllowedTypes.\n\t\t: FlexTreeTypedNodeUnion<TTypes>; // Known to not be a single type, so known not to unbox.\n\n/**\n * `true` if T is known to be an array of one item.\n * `false` if T is known not to be an array of one item.\n * `boolean` if it is unknown if T is an array of one item or not.\n * @internal\n */\nexport type IsArrayOfOne<T extends readonly unknown[]> = T[\"length\"] extends 1\n\t? true\n\t: 1 extends T[\"length\"]\n\t\t? boolean\n\t\t: false;\n\n/**\n * Schema aware unboxed tree type.\n * @remarks\n * Unboxes if the node kind does unboxing.\n * Recursively unboxes that content as well if it does unboxing.\n * @internal\n */\nexport type FlexTreeUnboxNode<TSchema extends FlexTreeNodeSchema> =\n\tTSchema extends LeafNodeSchema\n\t\t? TreeValue<TSchema[\"info\"]>\n\t\t: TSchema extends FlexMapNodeSchema\n\t\t\t? FlexTreeMapNode<TSchema>\n\t\t\t: TSchema extends FlexFieldNodeSchema\n\t\t\t\t? FlexTreeFieldNode<TSchema>\n\t\t\t\t: TSchema extends FlexObjectNodeSchema\n\t\t\t\t\t? FlexTreeObjectNodeTyped<TSchema>\n\t\t\t\t\t: FlexTreeUnknownUnboxed;\n\n/**\n * Unboxed tree type for unknown schema cases.\n * @internal\n */\nexport type FlexTreeUnknownUnboxed = TreeValue | FlexTreeNode;\n\n// #endregion\n"]}
|
|
1
|
+
{"version":3,"file":"flexTreeTypes.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/flexTreeTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAMN,UAAU,GACV,MAAM,qBAAqB,CAAC;AAyB7B;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,EAAgB,CAAC;AAEvD;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAEvD,MAAM,UAAU,gBAAgB,CAAC,CAAU;IAC1C,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,cAAc,IAAI,CAAC,CAAC;AACnE,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,CAAU;IACxC,OAAO,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,cAAc,CAAC,KAAK,kBAAkB,CAAC,IAAI,CAAC;AAC7E,CAAC;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC7B,2DAAI,CAAA;IACJ,6DAAK,CAAA;AACN,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AA6CD;;;GAGG;AACH,MAAM,CAAN,IAAY,UAoBX;AApBD,WAAY,UAAU;IACrB;;OAEG;IACH,uDAAc,CAAA;IAEd;;OAEG;IACH,iDAAW,CAAA;IAEX;;OAEG;IACH,iDAAW,CAAA;IAEX;;OAEG;IACH,yCAAO,CAAA;AACR,CAAC,EApBW,UAAU,KAAV,UAAU,QAoBrB;AA6aD;;;GAGG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAAG;IACnD,YAAY;IACZ,aAAa;IACb,SAAS;IACT,IAAI;IACJ,aAAa;IACb,QAAQ;IACR,aAAa;IACb,MAAM;IACN,OAAO;IACP,eAAe;IACf,UAAU;IACV,UAAU;CACD,CAAC;AAEX;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,2CAA2C,GAAG;IAC1D,KAAK;IACL,OAAO;IACP,OAAO;IACP,OAAO;CACE,CAAC;AAggBX,aAAa","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\ttype AnchorNode,\n\ttype FieldKey,\n\ttype FieldUpPath,\n\ttype ITreeCursorSynchronous,\n\ttype TreeValue,\n\tanchorSlot,\n} from \"../../core/index.js\";\nimport type { Assume, FlattenKeys } from \"../../util/index.js\";\nimport type { FieldKinds, SequenceFieldEditBuilder } from \"../default-schema/index.js\";\nimport type { FlexFieldKind } from \"../modular-schema/index.js\";\nimport type {\n\tAllowedTypesToFlexInsertableTree,\n\tInsertableFlexField,\n} from \"../schema-aware/index.js\";\nimport type {\n\tAny,\n\tFlexAllowedTypes,\n\tFlexFieldNodeSchema,\n\tFlexFieldSchema,\n\tFlexList,\n\tFlexListToUnion,\n\tFlexMapNodeSchema,\n\tFlexObjectNodeFields,\n\tFlexObjectNodeSchema,\n\tFlexTreeNodeSchema,\n\tLazyItem,\n\tLeafNodeSchema,\n} from \"../typed-schema/index.js\";\n\nimport type { FlexTreeContext } from \"./context.js\";\n\n/**\n * An anchor slot which records the {@link FlexTreeNode} associated with that anchor, if there is one.\n * @remarks This always points to a \"real\" {@link FlexTreeNode} (i.e. a `LazyTreeNode`), never to a \"raw\" node.\n */\nexport const flexTreeSlot = anchorSlot<FlexTreeNode>();\n\n/**\n * Indicates that an object is a flex tree.\n * @internal\n */\nexport const flexTreeMarker = Symbol(\"flexTreeMarker\");\n\nexport function isFlexTreeEntity(t: unknown): t is FlexTreeEntity {\n\treturn typeof t === \"object\" && t !== null && flexTreeMarker in t;\n}\n\nexport function isFlexTreeNode(t: unknown): t is FlexTreeNode {\n\treturn isFlexTreeEntity(t) && t[flexTreeMarker] === FlexTreeEntityKind.Node;\n}\n\n/**\n * @internal\n */\nexport enum FlexTreeEntityKind {\n\tNode,\n\tField,\n}\n\n/**\n * Part of a tree.\n * Iterates over children.\n *\n * @privateRemarks\n * This exists mainly as a place to share common members between nodes and fields.\n * It is not expected to be useful or common to write code which handles this type directly.\n * If this assumption turns out to be false, and generically processing `UntypedEntity`s is useful,\n * then this interface should probably be extended with some down casting functionality (like `is`).\n *\n * TODO:\n * Design and document iterator invalidation rules and ordering rules.\n * Providing a custom iterator type with place anchor semantics would be a good approach.\n *\n * @internal\n */\nexport interface FlexTreeEntity<out TSchema = unknown> {\n\t/**\n\t * Indicates that an object is a specific kind of flex tree FlexTreeEntity.\n\t * This makes it possible to both down cast FlexTreeEntities safely as well as validate if an object is or is not a FlexTreeEntity.\n\t */\n\treadonly [flexTreeMarker]: FlexTreeEntityKind;\n\n\t/**\n\t * Schema for this entity.\n\t * If well-formed, it must follow this schema.\n\t */\n\treadonly schema: TSchema;\n\n\t/**\n\t * A common context of a \"forest\" of FlexTrees.\n\t */\n\treadonly context: FlexTreeContext;\n\n\t/**\n\t * Iterate through all nodes/fields in this field/node.\n\t *\n\t * @remarks\n\t * No mutations to the current view of the shared tree are permitted during iteration.\n\t */\n\tboxedIterator(): IterableIterator<FlexTreeEntity>;\n}\n\n/**\n * Status of the tree that a particular node belongs to.\n * @public\n */\nexport enum TreeStatus {\n\t/**\n\t * Is parented under the root field.\n\t */\n\tInDocument = 0,\n\n\t/**\n\t * Is not parented under the root field, but can be added back to the original document tree.\n\t */\n\tRemoved = 1,\n\n\t/**\n\t * Is removed and cannot be added back to the original document tree.\n\t */\n\tDeleted = 2,\n\n\t/**\n\t * Is created but has not yet been inserted into the tree.\n\t */\n\tNew = 3,\n}\n\n/**\n * Generic tree node API.\n *\n * Nodes are (shallowly) immutable and have a logical identity, a type and either a value or fields under string keys.\n *\n * This \"logical identity\" is exposed as the object identity: if a node is moved within a document,\n * the same {@link FlexTreeNode} instance will be used in the new location.\n * Similarly, edits applied to a node's sub-tree concurrently with the move of the node will still be applied to its subtree in its new location.\n *\n *\n * @remarks\n * Down-casting (via {@link FlexTreeNode#is}) is required to access Schema-Aware APIs, including editing.\n * All content in the tree is accessible without down-casting, but if the schema is known,\n * the schema aware API may be more ergonomic.\n * All editing is actually done via {@link FlexTreeField}s: the nodes are immutable other than that they contain mutable fields.\n *\n * @internal\n */\nexport interface FlexTreeNode extends FlexTreeEntity<FlexTreeNodeSchema> {\n\treadonly [flexTreeMarker]: FlexTreeEntityKind.Node;\n\n\t/**\n\t * Value stored on this node.\n\t */\n\treadonly value?: TreeValue;\n\n\t/**\n\t * Gets a field of this node, if it is not empty.\n\t */\n\ttryGetField(key: FieldKey): undefined | FlexTreeField;\n\n\t/**\n\t * Get the field for `key`.\n\t * @param key - which entry to look up.\n\t *\n\t * @remarks\n\t * All fields implicitly exist, so `getBoxed` can be called with any key and will always return a field.\n\t * Even if the field is empty, it will still be returned, and can be edited to insert content if allowed by the field kind.\n\t * See {@link FlexTreeNode.tryGetField} for a variant that does not allocate afield in the empty case.\n\t */\n\tgetBoxed(key: FieldKey): FlexTreeField;\n\n\t/**\n\t * The field this tree is in, and the index within that field.\n\t */\n\treadonly parentField: { readonly parent: FlexTreeField; readonly index: number };\n\n\t/**\n\t * Type guard for narrowing / down-casting to a specific schema.\n\t */\n\tis<TSchema extends FlexTreeNodeSchema>(schema: TSchema): this is FlexTreeTypedNode<TSchema>;\n\n\tboxedIterator(): IterableIterator<FlexTreeField>;\n\n\t/**\n\t * The anchor node associated with this node\n\t *\n\t * @remarks\n\t * The ref count keeping this alive is owned by the FlexTreeNode:\n\t * if holding onto this anchor for longer than the FlexTreeNode might be alive,\n\t * a separate Anchor (and thus ref count) must be allocated to keep it alive.\n\t */\n\treadonly anchorNode: AnchorNode;\n}\n\n/**\n * A collaboratively editable collection of nodes within a {@link FlexTreeEntity}.\n *\n * Fields are inherently part of their parent, and thus cannot be moved.\n * Instead their content can be moved, deleted or created.\n *\n * Editing operations are only valid on trees with the {@link TreeStatus#InDocument} `TreeStatus`.\n *\n * @remarks\n * Fields are used wherever an editable collection of nodes is required.\n * This is required in two places:\n * 1. To hold the children of non-leaf {@link FlexTreeNode}s.\n * 2. As the root of a {@link FlexTreeEntity}.\n *\n * Down-casting (via {@link FlexTreeField.is}) is required to access Schema-Aware APIs, including editing.\n * All content in the tree is accessible without down-casting, but if the schema is known,\n * the schema aware API may be more ergonomic.\n *\n * @internal\n */\nexport interface FlexTreeField extends FlexTreeEntity<FlexFieldSchema> {\n\treadonly [flexTreeMarker]: FlexTreeEntityKind.Field;\n\n\t/**\n\t * The number of nodes in this field\n\t */\n\treadonly length: number;\n\n\t/**\n\t * The `FieldKey` this field is under.\n\t * Defines what part of its parent this field makes up.\n\t */\n\treadonly key: FieldKey;\n\n\t/**\n\t * The node which has this field on it under `fieldKey`.\n\t * `undefined` iff this field is a detached field.\n\t */\n\treadonly parent?: FlexTreeNode;\n\n\t/**\n\t * Type guard for narrowing / down-casting to a specific schema.\n\t */\n\tis<TSchema extends FlexFieldSchema>(schema: TSchema): this is FlexTreeTypedField<TSchema>;\n\n\tboxedIterator(): IterableIterator<FlexTreeNode>;\n\n\t/**\n\t * Gets a node of this field by its index without unboxing.\n\t * @param index - Zero-based index of the item to retrieve. Negative values are interpreted from the end of the sequence.\n\t *\n\t * @returns The element in the sequence matching the given index. Always returns undefined if index \\< -sequence.length\n\t * or index \\>= sequence.length.\n\t *\n\t * @remarks\n\t * Semantics match {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at | Array.at}.\n\t */\n\tboxedAt(index: number): FlexTreeNode | undefined;\n}\n\n// #region Node Kinds\n\n/**\n * A {@link FlexTreeNode} that behaves like a `Map<string, Field>` for a specific `Field` type.\n *\n * @remarks\n * Unlike TypeScript Map type, {@link FlexTreeMapNode.get} always provides a reference to any field looked up, even if it has never been set.\n *\n * This means that, for example, a `MapNode` of {@link FlexTreeSequenceField} fields will return an empty sequence when a previously unused key is looked up,\n * and that sequence can be used to insert new items into the field.\n * Additionally empty fields (those containing no nodes) are not distinguished from fields which do not exist.\n * This differs from JavaScript Maps which have a subtle distinction between storing undefined as a value in the map and deleting an entry from the map.\n *\n * @internal\n */\nexport interface FlexTreeMapNode<in out TSchema extends FlexMapNodeSchema>\n\textends FlexTreeNode {\n\treadonly schema: TSchema;\n\n\t/**\n\t * The number of elements in the map.\n\t *\n\t * @remarks\n\t * All fields under a map implicitly exist, but `size` will count only the fields which contain one or more nodes.\n\t */\n\treadonly size: number;\n\n\t/**\n\t * Checks whether a value exists for the given key.\n\t * @param key - Which map entry to look up.\n\t *\n\t * @remarks\n\t * All fields under a map implicitly exist, but `has` will only return true if there are one or more nodes present in the given field.\n\t */\n\thas(key: string): boolean;\n\n\t/**\n\t * Get the value associated with `key`.\n\t * @param key - which map entry to look up.\n\t */\n\tget(key: string): FlexTreeUnboxField<TSchema[\"info\"]>;\n\n\t/**\n\t * Get the field for `key`.\n\t * @param key - which map entry to look up.\n\t *\n\t * @remarks\n\t * All fields under a map implicitly exist, so `get` can be called with any key and will always return a field.\n\t * Even if the field is empty, it will still be returned, and can be edited to insert content into the map.\n\t */\n\tgetBoxed(key: string): FlexTreeTypedField<TSchema[\"info\"]>;\n\n\t/**\n\t * Returns an iterable of keys in the map.\n\t *\n\t * @remarks\n\t * All fields under a map implicitly exist, but `keys` will yield only the keys of fields which contain one or more nodes.\n\t *\n\t * No guarantees are made regarding the order of the keys returned.\n\t */\n\tkeys(): IterableIterator<FieldKey>;\n\n\t/**\n\t * Returns an iterable of values in the map.\n\t *\n\t * @remarks\n\t * All fields under a map implicitly exist, but `values` will yield only the fields containing one or more nodes.\n\t *\n\t * No guarantees are made regarding the order of the values returned.\n\t */\n\tvalues(): IterableIterator<FlexTreeUnboxField<TSchema[\"info\"], \"notEmpty\">>;\n\n\t/**\n\t * Returns an iterable of key, value pairs for every entry in the map.\n\t *\n\t * @remarks\n\t * All fields under a map implicitly exist, but `entries` will yield only the entries whose fields contain one or more nodes.\n\t *\n\t * This iteration provided by `entries()` is equivalent to that provided by direct iteration of the {@link FlexTreeMapNode} (a.k.a. `[Symbol.Iterator]()`).\n\t *\n\t * No guarantees are made regarding the order of the entries returned.\n\t */\n\tentries(): IterableIterator<[FieldKey, FlexTreeUnboxField<TSchema[\"info\"], \"notEmpty\">]>;\n\n\t/**\n\t * Executes a provided function once per each key/value pair in the map.\n\t * @param callbackFn - The function to run for each map entry\n\t * @param thisArg - If present, `callbackFn` will be bound to `thisArg`\n\t *\n\t * @privateRemarks\n\t * TODO: This should run over fields in insertion order if we want to match the javascript foreach spec.\n\t */\n\tforEach(\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\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tthisArg?: any,\n\t): void;\n\n\t/**\n\t * Adds or updates an entry in the map with a specified `key` and a `value`.\n\t *\n\t * @param key - The key of the element to add to the map.\n\t * @param value - The value of the element to add to the map.\n\t */\n\tset(key: string, value: FlexibleFieldContent<TSchema[\"info\"]>): void;\n\n\t/**\n\t * Removes the specified element from this map by its `key`.\n\t *\n\t * @remarks\n\t * Note: unlike JavaScript's Map API, this method does not return a flag indicating whether or not the value was\n\t * deleted.\n\t *\n\t * @privateRemarks\n\t * Regarding the choice to not return a boolean: Since this data structure is distributed in nature, it isn't\n\t * possible to tell whether or not the item was deleted as a result of this method call. Returning a \"best guess\"\n\t * is more likely to create issues / promote bad usage patterns than offer useful information.\n\t *\n\t * @param key - The key of the element to remove from the map.\n\t */\n\tdelete(key: string): void;\n\n\t/**\n\t * Iterate through all fields in the map.\n\t *\n\t * @remarks\n\t * No mutations to the current view of the shared tree are permitted during iteration.\n\t * To iterate over the unboxed values of the map, use `Symbol.Iterator()`.\n\t */\n\tboxedIterator(): IterableIterator<FlexTreeTypedField<TSchema[\"info\"]>>;\n\n\t[Symbol.iterator](): IterableIterator<\n\t\t[FieldKey, FlexTreeUnboxField<TSchema[\"info\"], \"notEmpty\">]\n\t>;\n}\n\n/**\n * A {@link FlexTreeNode} that wraps a single {@link FlexTreeField} (which is placed under the {@link EmptyKey}).\n *\n * @remarks\n * A FieldNode is mostly identical to a struct node with a single field using the {@link EmptyKey}, but provides access to it via a field named \"content\".\n *\n * There are several use-cases where it makes sense to use a field node.\n * Here are a few:\n * - When it's necessary to differentiate between an empty sequence, and no sequence.\n * One case where this is needed is encoding Json.\n * - When polymorphism over {@link FlexFieldSchema} (and not just a union of {@link FlexAllowedTypes}) is required.\n * For example when encoding a schema for a type like\n * `Foo[] | Bar[]`, `Foo | Foo[]` or `Optional<Foo> | Optional<Bar>` (Where `Optional` is the Optional field kind, not TypeScript's `Optional`).\n * Since this schema system only allows `|` of {@link FlexTreeNodeSchema} (and only when declaring a {@link FlexFieldSchema}), see {@link SchemaBuilderBase.field},\n * these aggregate types are most simply expressed by creating fieldNodes for the terms like `Foo[]`, and `Optional<Foo>`.\n * Note that these are distinct from types like `(Foo | Bar)[]` and `Optional<Foo | Bar>` which can be expressed as single fields without extra nodes.\n * - When a distinct merge identity is desired for a field.\n * For example, if the application wants to be able to have an optional node or a sequence which it can pass around, edit and observe changes to,\n * in some cases (like when the content is moved to a different parent) this can be more flexible if a field node is introduced\n * to create a separate logical entity (node) which wraps the field.\n * This can even be useful with value fields to wrap terminal nodes if a stable merge\n * - When a field (such as a {@link FlexTreeSequenceField}) is desired in a location where {@link FlexTreeNode}s are required\n * (like the member of a union or the child of another {@link FlexTreeField}).\n * This can is typically just a different perspective on one of the above cases.\n * For example:\n * `Sequence<Foo> | Sequence<Bar>` or `OptionalField<Sequence<Foo>>` can't be expressed as simple fields\n * (unlike `Sequence<Foo | Bar>` or `OptionalField<Foo>` which can be done as simple fields).\n * Instead {@link FlexTreeFieldNode}s can be use to achieve something similar, more like:\n * `FieldNode<Sequence<Foo>> | FieldNode<Sequence<Bar>>` or `OptionalField<FieldNode<Sequence<Foo>>>`.\n *\n * @privateRemarks\n * FieldNodes do not unbox to their content, so in schema aware APIs which do unboxing, the FieldNode will NOT be skipped over.\n * This is a change from the old behavior to simplify unboxing and prevent cases where arbitrary deep chains of field nodes could unbox omitting information about the tree depth.\n * @internal\n */\nexport interface FlexTreeFieldNode<in out TSchema extends FlexFieldNodeSchema>\n\textends FlexTreeNode {\n\treadonly schema: TSchema;\n\n\t/**\n\t * The content this field node wraps.\n\t */\n\treadonly content: FlexTreeUnboxField<TSchema[\"info\"]>;\n}\n\n/**\n * A {@link FlexTreeNode} that behaves like an \"object\" or \"struct\", providing properties to access its fields.\n *\n * ObjectNodes consist of a finite collection of fields, each with their own (distinct) key and {@link FlexFieldSchema}.\n *\n * @remarks\n * ObjectNodes require complex typing, and have been split into two parts for implementation purposes.\n * See {@link FlexTreeObjectNodeTyped} for the schema aware extensions to this that provide access to the fields.\n *\n * These \"Objects\" resemble \"Structs\" from a wide variety of programming languages\n * (Including Algol 68, C, Go, Rust, C# etc.).\n * ObjectNodes also somewhat resemble JavaScript objects: this analogy is less precise (objects don't have a fixed schema for example),\n * but for consistency with other systems in the JavaScript ecosystem (like JSON) is \"ObjectNodes\" nodes are named \"Objects\".\n *\n * Another common name for this abstraction is [record](https://en.wikipedia.org/wiki/Record_(computer_science)).\n * The name \"Record\" is avoided (in favor of Object) here because it has less precise connotations for most TypeScript developers.\n * For example, TypeScript has a built in `Record` type, but it requires all of the fields to have the same type,\n * putting its semantics half way between this library's \"Object\" schema and {@link FlexTreeMapNode}.\n *\n * @internal\n */\nexport interface FlexTreeObjectNode extends FlexTreeNode {\n\treadonly schema: FlexObjectNodeSchema;\n}\n\n/**\n * Leaf holding a value.\n *\n * @remarks\n * Leaves are immutable and have no children.\n * Leaf unboxes its content, so in schema aware APIs which do unboxing, the Leaf itself will be skipped over and its value will be returned directly.\n * @internal\n */\nexport interface FlexTreeLeafNode<in out TSchema extends LeafNodeSchema> extends FlexTreeNode {\n\treadonly schema: TSchema;\n\n\t/**\n\t * Value stored on this node.\n\t */\n\treadonly value: TreeValue<TSchema[\"info\"]>;\n}\n\n/**\n * An {@link FlexTreeObjectNode} with schema aware accessors for its fields.\n *\n * @privateRemarks\n *\n * The corresponding implementation logic for this lives in `LazyTree.ts` under `buildStructClass`.\n * If you change the signature here, you will need to update that logic to match.\n *\n * @internal\n */\nexport type FlexTreeObjectNodeTyped<TSchema extends FlexObjectNodeSchema> =\n\tFlexObjectNodeSchema extends TSchema\n\t\t? FlexTreeObjectNode\n\t\t: FlexTreeObjectNode & FlexTreeObjectNodeFields<TSchema[\"info\"]>;\n\n/**\n * Properties to access an object node's fields. See {@link FlexTreeObjectNodeTyped}.\n *\n * @privateRemarks\n * TODO: Support custom field keys.\n * @internal\n */\nexport type FlexTreeObjectNodeFields<TFields extends FlexObjectNodeFields> =\n\tFlexTreeObjectNodeFieldsInner<\n\t\tFlattenKeys<\n\t\t\t{\n\t\t\t\t// When the key does not need to be escaped, map it from the input TFields in a way that doesn't break navigate to declaration\n\t\t\t\t[key in keyof TFields as key extends PropertyNameFromFieldKey<key & string>\n\t\t\t\t\t? key\n\t\t\t\t\t: never]: TFields[key];\n\t\t\t} & {\n\t\t\t\t[key in keyof TFields as key extends PropertyNameFromFieldKey<key & string>\n\t\t\t\t\t? never\n\t\t\t\t\t: PropertyNameFromFieldKey<key & string>]: TFields[key];\n\t\t\t}\n\t\t>\n\t>;\n\n/**\n * Properties to access an object node's fields. See {@link FlexTreeObjectNodeTyped}.\n *\n * @privateRemarks\n * TODO: Do we keep assignment operator + \"setFoo\" methods, or just use methods?\n * Inconsistency in the API experience could confusing for consumers.\n *\n * @internal\n */\nexport type FlexTreeObjectNodeFieldsInner<TFields extends FlexObjectNodeFields> = FlattenKeys<\n\t{\n\t\t// boxed fields (TODO: maybe remove these when same as non-boxed version?)\n\t\treadonly [key in keyof TFields as `boxed${Capitalize<key & string>}`]: FlexTreeTypedField<\n\t\t\tTFields[key]\n\t\t>;\n\t} & {\n\t\t// Add getter only (make property readonly) when the field is **not** of a kind that has a logical set operation.\n\t\t// If we could map to getters and setters separately, we would preferably do that, but we can't.\n\t\t// See https://github.com/microsoft/TypeScript/issues/43826 for more details on this limitation.\n\t\treadonly [key in keyof TFields as TFields[key][\"kind\"] extends AssignableFieldKinds\n\t\t\t? never\n\t\t\t: key]: FlexTreeUnboxField<TFields[key]>;\n\t} & {\n\t\t// Add setter (make property writable) when the field is of a kind that has a logical set operation.\n\t\t// If we could map to getters and setters separately, we would preferably do that, but we can't.\n\t\t// See https://github.com/microsoft/TypeScript/issues/43826 for more details on this limitation.\n\t\t-readonly [key in keyof TFields as TFields[key][\"kind\"] extends AssignableFieldKinds\n\t\t\t? key\n\t\t\t: never]: FlexTreeUnboxField<TFields[key]>;\n\t} & {\n\t\t// Setter method (when the field is of a kind that has a logical set operation).\n\t\treadonly [key in keyof TFields as TFields[key][\"kind\"] extends AssignableFieldKinds\n\t\t\t? `set${Capitalize<key & string>}`\n\t\t\t: never]: (content: FlexibleFieldContent<TFields[key]>) => void;\n\t}\n>;\n\n/**\n * Reserved object node field property names to avoid collisions with the rest of the object node API.\n * @internal\n */\nexport const reservedObjectNodeFieldPropertyNames = [\n\t\"anchorNode\",\n\t\"constructor\",\n\t\"context\",\n\t\"is\",\n\t\"parentField\",\n\t\"schema\",\n\t\"tryGetField\",\n\t\"type\",\n\t\"value\",\n\t\"boxedIterator\",\n\t\"iterator\",\n\t\"getBoxed\",\n] as const;\n\n/**\n * Reserved object node field property names prefixes.\n * These are reserved to avoid collisions with properties derived from field other field names.\n *\n * Field names starting with these must be followed by a lowercase letter, or be escaped.\n * @internal\n */\nexport const reservedObjectNodeFieldPropertyNamePrefixes = [\n\t\"set\",\n\t\"boxed\",\n\t\"field\",\n\t\"Field\",\n] as const;\n\n/**\n * {@link reservedObjectNodeFieldPropertyNamePrefixes} as a type union.\n * @internal\n */\nexport type ReservedObjectNodeFieldPropertyNames =\n\t(typeof reservedObjectNodeFieldPropertyNames)[number];\n\n/**\n * {@link reservedObjectNodeFieldPropertyNamePrefixes} as a type union.\n * @internal\n */\nexport type ReservedObjectNodeFieldPropertyNamePrefixes =\n\t(typeof reservedObjectNodeFieldPropertyNamePrefixes)[number];\n\n/**\n * Convert an object node's field key into an escaped string usable as a property name.\n *\n * @privateRemarks\n * TODO:\n * Collisions are still possible.\n * For example fields named \"foo\" and \"Foo\" would both produce a setter \"setFoo\".\n * Consider naming schemes to avoid this, ensure that there is a good workaround for these cases.\n * Another approach would be to support custom field names (separate from keys),\n * and do the escaping (if needed) when creating the flex tree schema (both when manually creating them and when doing so automatically):\n * this would enable better intellisense for escaped fields, as well as allow the feature of custom field property names.\n *\n * @internal\n */\nexport type PropertyNameFromFieldKey<T extends string> =\n\tT extends ReservedObjectNodeFieldPropertyNames\n\t\t? `field${Capitalize<T>}`\n\t\t: T extends `${ReservedObjectNodeFieldPropertyNamePrefixes}${Capitalize<string>}`\n\t\t\t? `field${Capitalize<T>}`\n\t\t\t: T;\n\n/**\n * Field kinds that allow value assignment.\n *\n * @internal\n */\nexport type AssignableFieldKinds = typeof FieldKinds.optional | typeof FieldKinds.required;\n\n// #endregion\n\n// #region Field Kinds\n\n/**\n * Strongly typed tree literals for inserting as the content of a field.\n *\n * If a cursor is provided, it must be in Fields mode.\n * @internal\n */\nexport type FlexibleFieldContent<TSchema extends FlexFieldSchema> =\n\t| InsertableFlexField<TSchema>\n\t| ITreeCursorSynchronous;\n\n/**\n * Strongly typed tree literals for inserting as a node.\n *\n * If a cursor is provided, it must be in Nodes mode.\n * @internal\n */\nexport type FlexibleNodeContent<TTypes extends FlexAllowedTypes> =\n\t| AllowedTypesToFlexInsertableTree<TTypes>\n\t| ITreeCursorSynchronous;\n\n/**\n * Strongly typed tree literals for inserting a subsequence of nodes.\n *\n * Used to insert a batch of 0 or more nodes into some location in a {@link FlexTreeSequenceField}.\n *\n * If a cursor is provided, it must be in Fields mode.\n * @internal\n */\nexport type FlexibleNodeSubSequence<TTypes extends FlexAllowedTypes> =\n\t| Iterable<AllowedTypesToFlexInsertableTree<TTypes>>\n\t| ITreeCursorSynchronous;\n\n/**\n * Type to ensures two types overlap in at least one way.\n * It evaluates to the input type if this is true, and never otherwise.\n * Examples:\n * CheckTypesOverlap\\<number | boolean, number | object\\> = number | boolean\n * CheckTypesOverlap\\<number | boolean, string | object\\> = never\n * @internal\n */\nexport type CheckTypesOverlap<T, TCheck> = [Extract<T, TCheck> extends never ? never : T][0];\n\n/**\n * {@link FlexTreeField} that stores a sequence of children.\n *\n * Sequence fields can contain an ordered sequence any number of {@link FlexTreeNode}s which must be of the {@link FlexAllowedTypes} from the {@link FlexFieldSchema}).\n *\n * @remarks\n * Allows for concurrent editing based on index, adjusting the locations of indexes as needed so they apply to the same logical place in the sequence when rebased and merged.\n *\n * Edits to sequence fields are anchored relative to their surroundings, so concurrent edits can result in the indexes of nodes and edits getting shifted.\n * To hold onto locations in sequence across an edit, use anchors.\n *\n * @privateRemarks\n * TODO:\n * Add anchor API that can actually hold onto locations in a sequence.\n * Currently only nodes can be held onto with anchors, and this does not replicate the behavior implemented for editing.\n * @internal\n */\nexport interface FlexTreeSequenceField<in out TTypes extends FlexAllowedTypes>\n\textends FlexTreeField {\n\t/**\n\t * Gets a node of this field by its index with unboxing.\n\t * @param index - Zero-based index of the item to retrieve. Negative values are interpreted from the end of the sequence.\n\t *\n\t * @returns The element in the sequence matching the given index. Always returns undefined if index \\< -sequence.length\n\t * or index \\>= array.length.\n\t *\n\t * @remarks\n\t * Semantics match {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at | Array.at}.\n\t */\n\tat(index: number): FlexTreeUnboxNodeUnion<TTypes> | undefined;\n\n\t/**\n\t * {@inheritdoc FlexTreeField.boxedAt}\n\t */\n\tboxedAt(index: number): FlexTreeTypedNodeUnion<TTypes> | undefined;\n\n\t/**\n\t * Calls the provided callback function on each child of this sequence, and returns an array that contains the results.\n\t * @param callbackfn - A function that accepts the child and its index.\n\t */\n\tmap<U>(callbackfn: (value: FlexTreeUnboxNodeUnion<TTypes>, index: number) => U): U[];\n\n\t/**\n\t * Calls the provided callback function on each child of this sequence, and returns an array that contains the results.\n\t * @param callbackfn - A function that accepts the child and its index.\n\t */\n\tmapBoxed<U>(callbackfn: (value: FlexTreeTypedNodeUnion<TTypes>, index: number) => U): U[];\n\n\treadonly length: number;\n\n\t/**\n\t * Get an editor for this sequence.\n\t */\n\tsequenceEditor(): SequenceFieldEditBuilder;\n\n\t/*\n\t * TODO:\n\t * Remove these editing methods and replace their use with use of `sequenceEditor`.\n\t * These editing methods replicate the API exposed by simple-tree, but using flex-tree types.\n\t * As these methods just re-abstract the lower level SequenceFieldEditBuilder API, they add little value.\n\t * Migrating the logic implementing them to simple-tree (and having it just use `sequenceEditor` directly)\n\t * avoids duplicating the API surface (and documentation), as well as makes it simpler to implement the desired user facing validation and errors\n\t * since simple-tree becomes responsible for all the validation and can produce usage errors in terms of the public package API.\n\t */\n\t// #region Editing Methods\n\n\t/**\n\t * Inserts new item(s) at a specified location.\n\t * @param index - The index at which to insert `value`.\n\t * @param value - The content to insert.\n\t * @throws Throws if `index` is not in the range [0, `list.length`).\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tinsertAt(index: number, value: FlexibleNodeSubSequence<TTypes>): void;\n\n\t/**\n\t * Inserts new item(s) at the start of the sequence.\n\t * @param value - The content to insert.\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tinsertAtStart(value: FlexibleNodeSubSequence<TTypes>): void;\n\n\t/**\n\t * Inserts new item(s) at the end of the sequence.\n\t * @param value - The content to insert.\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tinsertAtEnd(value: FlexibleNodeSubSequence<TTypes>): void;\n\n\t/**\n\t * Removes the item at the specified location.\n\t * @param index - The index at which to remove the item.\n\t * @throws Throws if `index` is not in the range [0, `list.length`).\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tremoveAt(index: number): void;\n\n\t/**\n\t * Moves the specified item to the start of the sequence.\n\t * @param sourceIndex - The index of the item to move.\n\t * @throws Throws if `sourceIndex` is not in the range [0, `list.length`).\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveToStart(sourceIndex: number): void;\n\n\t/**\n\t * Moves the specified item to the start of the sequence.\n\t * @param sourceIndex - The index of the item to move.\n\t * @param source - The source sequence to move the item out of.\n\t * @throws Throws if `sourceIndex` is not in the range [0, `list.length`).\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveToStart(sourceIndex: number, source: FlexTreeSequenceField<FlexAllowedTypes>): void;\n\n\t/**\n\t * Moves the specified item to the end of the sequence.\n\t * @param sourceIndex - The index of the item to move.\n\t * @throws Throws if `sourceIndex` is not in the range [0, `list.length`).\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveToEnd(sourceIndex: number): void;\n\n\t/**\n\t * Moves the specified item to the end of the sequence.\n\t * @param sourceIndex - The index of the item to move.\n\t * @param source - The source sequence to move the item out of.\n\t * @throws Throws if `sourceIndex` is not in the range [0, `list.length`).\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveToEnd(sourceIndex: number, source: FlexTreeSequenceField<FlexAllowedTypes>): void;\n\n\t/**\n\t * Moves the specified item to the desired location in the sequence.\n\t * @param index - The index to move the item to.\n\t * This is based on the state of the sequence before moving the source item.\n\t * @param sourceIndex - The index of the item to move.\n\t * @throws Throws if any of the input indices are not in the range [0, `list.length`).\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveToIndex(index: number, sourceIndex: number): void;\n\n\t/**\n\t * Moves the specified item to the desired location in the sequence.\n\t * @param index - The index to move the item to.\n\t * @param sourceIndex - The index of the item to move.\n\t * @param source - The source sequence to move the item out of.\n\t * @throws Throws if any of the input indices are not in the range [0, `list.length`).\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveToIndex(\n\t\tindex: number,\n\t\tsourceIndex: number,\n\t\tsource: FlexTreeSequenceField<FlexAllowedTypes>,\n\t): void;\n\n\t/**\n\t * Moves the specified items to the start of the sequence.\n\t * @param sourceStart - The starting index of the range to move (inclusive).\n\t * @param sourceEnd - The ending index of the range to move (exclusive)\n\t * @throws Throws if either of the input indices are not in the range [0, `list.length`) or if `sourceStart` is greater than `sourceEnd`.\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveRangeToStart(sourceStart: number, sourceEnd: number): void;\n\n\t/**\n\t * Moves the specified items to the start of the sequence.\n\t * @param sourceStart - The starting index of the range to move (inclusive).\n\t * @param sourceEnd - The ending index of the range to move (exclusive)\n\t * @param source - The source sequence to move items out of.\n\t * @throws Throws if the types of any of the items being moved are not allowed in the destination sequence,\n\t * if either of the input indices are not in the range [0, `list.length`) or if `sourceStart` is greater than `sourceEnd`.\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveRangeToStart(\n\t\tsourceStart: number,\n\t\tsourceEnd: number,\n\t\tsource: FlexTreeSequenceField<FlexAllowedTypes>,\n\t): void;\n\n\t/**\n\t * Moves the specified items to the end of the sequence.\n\t * @param sourceStart - The starting index of the range to move (inclusive).\n\t * @param sourceEnd - The ending index of the range to move (exclusive)\n\t * @throws Throws if either of the input indices are not in the range [0, `list.length`) or if `sourceStart` is greater than `sourceEnd`.\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveRangeToEnd(sourceStart: number, sourceEnd: number): void;\n\n\t/**\n\t * Moves the specified items to the end of the sequence.\n\t * @param sourceStart - The starting index of the range to move (inclusive).\n\t * @param sourceEnd - The ending index of the range to move (exclusive)\n\t * @param source - The source sequence to move items out of.\n\t * @throws Throws if the types of any of the items being moved are not allowed in the destination sequence,\n\t * if either of the input indices are not in the range [0, `list.length`) or if `sourceStart` is greater than `sourceEnd`.\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveRangeToEnd(\n\t\tsourceStart: number,\n\t\tsourceEnd: number,\n\t\tsource: FlexTreeSequenceField<FlexAllowedTypes>,\n\t): void;\n\n\t/**\n\t * Moves the specified items to the desired location within the sequence.\n\t * @param index - The index to move the items to.\n\t * This is based on the state of the sequence before moving the source items.\n\t * @param sourceStart - The starting index of the range to move (inclusive).\n\t * @param sourceEnd - The ending index of the range to move (exclusive)\n\t * @throws Throws if any of the input indices are not in the range [0, `list.length`) or if `sourceStart` is greater than `sourceEnd`.\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveRangeToIndex(index: number, sourceStart: number, sourceEnd: number): void;\n\n\t/**\n\t * Moves the specified items to the desired location within the sequence.\n\t * @param index - The index to move the items to.\n\t * @param sourceStart - The starting index of the range to move (inclusive).\n\t * @param sourceEnd - The ending index of the range to move (exclusive)\n\t * @param source - The source sequence to move items out of.\n\t * @throws Throws if the types of any of the items being moved are not allowed in the destination sequence,\n\t * if any of the input indices are not in the range [0, `list.length`) or if `sourceStart` is greater than `sourceEnd`.\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveRangeToIndex(\n\t\tindex: number,\n\t\tsourceStart: number,\n\t\tsourceEnd: number,\n\t\t// FlexTreeSequenceField is invariant over its schema so any is required here.\n\t\t// This use of any can be removed by migrating off this deprecated API and deleting it.\n\t\t// If kept, this function should be fixed by making it generic and constraining it to fields which are safe to move content from.\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tsource: FlexTreeSequenceField<any>,\n\t): void;\n\n\t// #endregion\n\n\tboxedIterator(): IterableIterator<FlexTreeTypedNodeUnion<TTypes>>;\n\n\t/**\n\t * Gets the FieldUpPath of a field.\n\t */\n\tgetFieldPath(): FieldUpPath;\n\n\t[Symbol.iterator](): IterableIterator<FlexTreeUnboxNodeUnion<TTypes>>;\n}\n\n/**\n * Field that stores exactly one child.\n *\n * @remarks\n * Unboxes its content, so in schema aware APIs which do unboxing, the RequiredField itself will be skipped over and its content will be returned directly.\n * @internal\n */\nexport interface FlexTreeRequiredField<in out TTypes extends FlexAllowedTypes>\n\textends FlexTreeField {\n\tget content(): FlexTreeUnboxNodeUnion<TTypes>;\n\tset content(content: FlexibleNodeContent<TTypes>);\n}\n\n/**\n * Field that stores zero or one child.\n *\n * @remarks\n * Unboxes its content, so in schema aware APIs which do unboxing, the OptionalField itself will be skipped over and its content will be returned directly.\n *\n * @privateRemarks\n * TODO: Document merge semitics\n * TODO: Allow Optional fields to be used with last write wins OR first write wins merge resolution.\n * TODO:\n * Better centralize the documentation about what kinds of merge semantics are available for field kinds.\n * Maybe link editor?\n * @internal\n */\nexport interface FlexTreeOptionalField<in out TTypes extends FlexAllowedTypes>\n\textends FlexTreeField {\n\tget content(): FlexTreeUnboxNodeUnion<TTypes> | undefined;\n\tset content(newContent: FlexibleNodeContent<TTypes> | undefined);\n}\n\n// #endregion\n\n// #region Typed\n\n/**\n * Schema aware specialization of {@link FlexTreeField}.\n * @internal\n */\nexport type FlexTreeTypedField<TSchema extends FlexFieldSchema> = FlexTreeTypedFieldInner<\n\tTSchema[\"kind\"],\n\tTSchema[\"allowedTypes\"]\n>;\n\n/**\n * Helper for implementing {@link FlexTreeTypedField}.\n * @internal\n */\nexport type FlexTreeTypedFieldInner<\n\tKind extends FlexFieldKind,\n\tTypes extends FlexAllowedTypes,\n> = Kind extends typeof FieldKinds.sequence\n\t? FlexTreeSequenceField<Types>\n\t: Kind extends typeof FieldKinds.required\n\t\t? FlexTreeRequiredField<Types>\n\t\t: Kind extends typeof FieldKinds.optional\n\t\t\t? FlexTreeOptionalField<Types>\n\t\t\t: FlexTreeField;\n\n/**\n * Schema aware specialization of {@link FlexTreeNode} for a given {@link FlexAllowedTypes}.\n * @internal\n */\nexport type FlexTreeTypedNodeUnion<T extends FlexAllowedTypes> =\n\tT extends FlexList<FlexTreeNodeSchema>\n\t\t? FlexTreeTypedNode<Assume<FlexListToUnion<T>, FlexTreeNodeSchema>>\n\t\t: FlexTreeNode;\n\n/**\n * Schema aware specialization of {@link FlexTreeNode} for a given {@link FlexTreeNodeSchema}.\n * @internal\n */\nexport type FlexTreeTypedNode<TSchema extends FlexTreeNodeSchema> =\n\tTSchema extends LeafNodeSchema\n\t\t? FlexTreeLeafNode<TSchema>\n\t\t: TSchema extends FlexMapNodeSchema\n\t\t\t? FlexTreeMapNode<TSchema>\n\t\t\t: TSchema extends FlexFieldNodeSchema\n\t\t\t\t? FlexTreeFieldNode<TSchema>\n\t\t\t\t: TSchema extends FlexObjectNodeSchema\n\t\t\t\t\t? FlexTreeObjectNodeTyped<TSchema>\n\t\t\t\t\t: FlexTreeNode;\n\n// #endregion\n\n// #region Unbox\n\n/**\n * Schema aware unboxed field.\n * @remarks\n * Unboxes fields to their content if appropriate for the kind.\n * Recursively unboxes that content (then its content etc.) as well if the node union does unboxing.\n * @internal\n */\nexport type FlexTreeUnboxField<\n\tTSchema extends FlexFieldSchema,\n\t// If \"notEmpty\", then optional fields will unbox to their content (not their content | undefined)\n\tEmptiness extends \"maybeEmpty\" | \"notEmpty\" = \"maybeEmpty\",\n> = FlexTreeUnboxFieldInner<TSchema[\"kind\"], TSchema[\"allowedTypes\"], Emptiness>;\n\n/**\n * Helper for implementing FlexTreeUnboxField.\n * @internal\n */\nexport type FlexTreeUnboxFieldInner<\n\tKind extends FlexFieldKind,\n\tTTypes extends FlexAllowedTypes,\n\tEmptiness extends \"maybeEmpty\" | \"notEmpty\",\n> = Kind extends typeof FieldKinds.sequence\n\t? FlexTreeSequenceField<TTypes>\n\t: Kind extends typeof FieldKinds.required\n\t\t? FlexTreeUnboxNodeUnion<TTypes>\n\t\t: Kind extends typeof FieldKinds.optional\n\t\t\t? FlexTreeUnboxNodeUnion<TTypes> | (Emptiness extends \"notEmpty\" ? never : undefined)\n\t\t\t: // TODO: forbidden\n\t\t\t\tunknown;\n\n/**\n * Schema aware unboxed union of tree types.\n * @remarks\n * Unboxes when not polymorphic.\n * Recursively unboxes that content as well if the node kind does unboxing.\n * @internal\n */\nexport type FlexTreeUnboxNodeUnion<TTypes extends FlexAllowedTypes> = TTypes extends readonly [\n\tLazyItem<infer InnerType>,\n]\n\t? InnerType extends FlexTreeNodeSchema\n\t\t? FlexTreeUnboxNode<InnerType>\n\t\t: InnerType extends Any\n\t\t\t? FlexTreeNode\n\t\t\t: // This case should not occur. If the result ever ends up unknown, look at places like this to debug.\n\t\t\t\tunknown\n\t: boolean extends IsArrayOfOne<TTypes>\n\t\t? FlexTreeUnknownUnboxed // Unknown if this will unbox. This should mainly happen when TTypes is AllowedTypes.\n\t\t: FlexTreeTypedNodeUnion<TTypes>; // Known to not be a single type, so known not to unbox.\n\n/**\n * `true` if T is known to be an array of one item.\n * `false` if T is known not to be an array of one item.\n * `boolean` if it is unknown if T is an array of one item or not.\n * @internal\n */\nexport type IsArrayOfOne<T extends readonly unknown[]> = T[\"length\"] extends 1\n\t? true\n\t: 1 extends T[\"length\"]\n\t\t? boolean\n\t\t: false;\n\n/**\n * Schema aware unboxed tree type.\n * @remarks\n * Unboxes if the node kind does unboxing.\n * Recursively unboxes that content as well if it does unboxing.\n * @internal\n */\nexport type FlexTreeUnboxNode<TSchema extends FlexTreeNodeSchema> =\n\tTSchema extends LeafNodeSchema\n\t\t? TreeValue<TSchema[\"info\"]>\n\t\t: TSchema extends FlexMapNodeSchema\n\t\t\t? FlexTreeMapNode<TSchema>\n\t\t\t: TSchema extends FlexFieldNodeSchema\n\t\t\t\t? FlexTreeFieldNode<TSchema>\n\t\t\t\t: TSchema extends FlexObjectNodeSchema\n\t\t\t\t\t? FlexTreeObjectNodeTyped<TSchema>\n\t\t\t\t\t: FlexTreeUnknownUnboxed;\n\n/**\n * Unboxed tree type for unknown schema cases.\n * @internal\n */\nexport type FlexTreeUnknownUnboxed = TreeValue | FlexTreeNode;\n\n// #endregion\n"]}
|
|
@@ -7,6 +7,7 @@ export { visitBipartiteIterableTree, Skip, visitBipartiteIterableTreeWithState,
|
|
|
7
7
|
export { getTreeContext, type FlexTreeContext, Context, ContextSlot } from "./context.js";
|
|
8
8
|
export { type FlexTreeNodeEvents } from "./treeEvents.js";
|
|
9
9
|
export type { FlexTreeTypedFieldInner, FlexTreeUnboxFieldInner, FlexTreeObjectNodeFields, FlexTreeUnboxNode, FlexTreeUnboxNodeUnion, IsArrayOfOne, FlexibleNodeSubSequence, } from "./flexTreeTypes.js";
|
|
10
|
-
export { assertFlexTreeEntityNotFreed } from "./lazyEntity.js";
|
|
10
|
+
export { assertFlexTreeEntityNotFreed, isFreedSymbol, LazyEntity, } from "./lazyEntity.js";
|
|
11
11
|
export { getSchemaAndPolicy, indexForAt } from "./utilities.js";
|
|
12
|
+
export { treeStatusFromAnchorCache } from "./utilities.js";
|
|
12
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,UAAU,EACV,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,KAAK,wBAAwB,EAC7B,KAAK,oCAAoC,EACzC,KAAK,2CAA2C,EAChD,oCAAoC,EACpC,2CAA2C,EAC3C,KAAK,6BAA6B,EAClC,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,EAAE,KAAK,eAAe,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE1F,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAG1D,YAAY,EACX,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,EACjB,sBAAsB,EACtB,YAAY,EACZ,uBAAuB,GACvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,UAAU,EACV,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,KAAK,wBAAwB,EAC7B,KAAK,oCAAoC,EACzC,KAAK,2CAA2C,EAChD,oCAAoC,EACpC,2CAA2C,EAC3C,KAAK,6BAA6B,EAClC,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,EAAE,KAAK,eAAe,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE1F,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAG1D,YAAY,EACX,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,EACjB,sBAAsB,EACtB,YAAY,EACZ,uBAAuB,GACvB,MAAM,oBAAoB,CAAC;AAE5B,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"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
export { TreeStatus, flexTreeMarker, FlexTreeEntityKind, isFlexTreeNode, reservedObjectNodeFieldPropertyNames, reservedObjectNodeFieldPropertyNamePrefixes, flexTreeSlot, } from "./flexTreeTypes.js";
|
|
6
6
|
export { visitBipartiteIterableTree, Skip, visitBipartiteIterableTreeWithState, visitIterableTree, visitIterableTreeWithState, } from "./navigation.js";
|
|
7
7
|
export { getTreeContext, Context, ContextSlot } from "./context.js";
|
|
8
|
-
export { assertFlexTreeEntityNotFreed } from "./lazyEntity.js";
|
|
8
|
+
export { assertFlexTreeEntityNotFreed, isFreedSymbol, LazyEntity, } from "./lazyEntity.js";
|
|
9
9
|
export { getSchemaAndPolicy, indexForAt } from "./utilities.js";
|
|
10
|
+
export { treeStatusFromAnchorCache } from "./utilities.js";
|
|
10
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAmBN,UAAU,EAGV,cAAc,EACd,kBAAkB,EAClB,cAAc,EAId,oCAAoC,EACpC,2CAA2C,EAE3C,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;AAe1F,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAmBN,UAAU,EAGV,cAAc,EACd,kBAAkB,EAClB,cAAc,EAId,oCAAoC,EACpC,2CAA2C,EAE3C,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;AAe1F,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 FlexTreeFieldNode,\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 FlexTreeObjectNodeTyped,\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\ttype PropertyNameFromFieldKey,\n\ttype ReservedObjectNodeFieldPropertyNames,\n\ttype ReservedObjectNodeFieldPropertyNamePrefixes,\n\treservedObjectNodeFieldPropertyNames,\n\treservedObjectNodeFieldPropertyNamePrefixes,\n\ttype FlexTreeObjectNodeFieldsInner,\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\n// Below here are things that are used by the above, but not part of the desired API surface.\nexport type {\n\tFlexTreeTypedFieldInner,\n\tFlexTreeUnboxFieldInner,\n\tFlexTreeObjectNodeFields,\n\tFlexTreeUnboxNode,\n\tFlexTreeUnboxNodeUnion,\n\tIsArrayOfOne,\n\tFlexibleNodeSubSequence,\n} 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"]}
|