@fluidframework/tree 2.3.0-288113 → 2.3.0
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/.dependency-cruiser-known-violations.json +28 -40
- package/.vscode/Tree.code-workspace +0 -2
- package/CHANGELOG.md +92 -0
- package/README.md +6 -0
- package/alpha.d.ts +11 -0
- package/api-extractor/api-extractor-lint-alpha.cjs.json +5 -0
- package/api-extractor/api-extractor-lint-alpha.esm.json +5 -0
- package/api-extractor/api-extractor-lint-legacy.cjs.json +5 -0
- package/api-extractor/api-extractor-lint-legacy.esm.json +5 -0
- package/api-extractor/api-extractor.current.json +8 -0
- package/api-extractor/api-extractor.legacy.json +4 -0
- package/api-extractor.json +1 -1
- package/api-report/tree.alpha.api.md +21 -42
- package/api-report/tree.beta.api.md +21 -11
- package/api-report/tree.legacy.alpha.api.md +562 -0
- package/api-report/tree.legacy.public.api.md +559 -0
- package/api-report/tree.public.api.md +8 -13
- package/dist/alpha.d.ts +102 -0
- package/dist/beta.d.ts +6 -2
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/{revertible/revertible.d.ts → revertible.d.ts} +12 -0
- package/dist/core/revertible.d.ts.map +1 -0
- package/dist/core/revertible.js.map +1 -0
- package/dist/core/schema-stored/format.d.ts +3 -3
- package/dist/core/schema-stored/format.js +1 -1
- package/dist/core/schema-stored/format.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +2 -7
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +4 -6
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.d.ts +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.js +6 -2
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/detachedFieldIndex.d.ts +0 -1
- package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndex.js +1 -0
- package/dist/core/tree/detachedFieldIndex.js.map +1 -1
- package/dist/core/tree/visitDelta.d.ts +7 -2
- package/dist/core/tree/visitDelta.d.ts.map +1 -1
- package/dist/core/tree/visitDelta.js.map +1 -1
- package/dist/events/emitter.d.ts +127 -0
- package/dist/events/emitter.d.ts.map +1 -0
- package/dist/events/{events.js → emitter.js} +48 -30
- package/dist/events/emitter.js.map +1 -0
- package/dist/events/index.d.ts +2 -1
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +4 -5
- package/dist/events/index.js.map +1 -1
- package/dist/events/interop.d.ts +36 -0
- package/dist/events/interop.d.ts.map +1 -0
- package/dist/{core/revertible/index.d.ts → events/interop.js} +3 -2
- package/dist/events/interop.js.map +1 -0
- package/dist/events/listeners.d.ts +65 -0
- package/dist/events/listeners.d.ts.map +1 -0
- package/{lib/core/revertible/index.d.ts → dist/events/listeners.js} +3 -2
- package/dist/events/listeners.js.map +1 -0
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +25 -7
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js +36 -15
- package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts +4 -2
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.js +12 -5
- package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts +15 -2
- package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.js +28 -2
- package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +3 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js +5 -4
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/dist/feature-libraries/flex-map-tree/index.d.ts +1 -1
- package/dist/feature-libraries/flex-map-tree/index.d.ts.map +1 -1
- package/dist/feature-libraries/flex-map-tree/index.js +2 -1
- package/dist/feature-libraries/flex-map-tree/index.js.map +1 -1
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts +35 -33
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.js +82 -103
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
- package/dist/feature-libraries/flex-tree/context.d.ts +30 -14
- package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/context.js +10 -7
- package/dist/feature-libraries/flex-tree/context.js.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +57 -190
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js +15 -3
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/dist/feature-libraries/flex-tree/index.d.ts +2 -3
- package/dist/feature-libraries/flex-tree/index.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/index.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyEntity.d.ts +3 -3
- package/dist/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyEntity.js +2 -10
- package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.d.ts +26 -28
- package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +11 -14
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts +5 -26
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.js +23 -74
- package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/dist/feature-libraries/flex-tree/unboxed.d.ts +4 -16
- package/dist/feature-libraries/flex-tree/unboxed.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/unboxed.js +7 -41
- package/dist/feature-libraries/flex-tree/unboxed.js.map +1 -1
- package/dist/feature-libraries/flex-tree/utilities.d.ts +2 -2
- package/dist/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/utilities.js +3 -6
- package/dist/feature-libraries/flex-tree/utilities.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +4 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +3 -5
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +5 -11
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.js +3 -6
- package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/dist/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/discrepancies.js +3 -13
- package/dist/feature-libraries/modular-schema/discrepancies.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +4 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +2 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +12 -5
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +6 -6
- package/dist/feature-libraries/schema-index/format.d.ts +3 -3
- package/dist/feature-libraries/storedToViewSchema.d.ts.map +1 -1
- package/dist/feature-libraries/storedToViewSchema.js +2 -4
- package/dist/feature-libraries/storedToViewSchema.js.map +1 -1
- package/dist/feature-libraries/typed-schema/flexList.d.ts +3 -3
- package/dist/feature-libraries/typed-schema/flexList.js.map +1 -1
- package/dist/feature-libraries/typed-schema/index.d.ts +2 -2
- package/dist/feature-libraries/typed-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/typed-schema/index.js +2 -2
- package/dist/feature-libraries/typed-schema/index.js.map +1 -1
- package/dist/feature-libraries/typed-schema/schemaCollection.d.ts.map +1 -1
- package/dist/feature-libraries/typed-schema/schemaCollection.js +8 -10
- package/dist/feature-libraries/typed-schema/schemaCollection.js.map +1 -1
- package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts +17 -48
- package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
- package/dist/feature-libraries/typed-schema/typedTreeSchema.js +5 -37
- package/dist/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
- package/dist/feature-libraries/typed-schema/view.d.ts +4 -6
- package/dist/feature-libraries/typed-schema/view.d.ts.map +1 -1
- package/dist/feature-libraries/typed-schema/view.js +5 -4
- package/dist/feature-libraries/typed-schema/view.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +33 -36
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +83 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/public.d.ts +0 -1
- package/dist/shared-tree/checkoutFlexTreeView.d.ts +53 -0
- package/dist/shared-tree/checkoutFlexTreeView.d.ts.map +1 -0
- package/dist/shared-tree/{treeView.js → checkoutFlexTreeView.js} +28 -6
- package/dist/shared-tree/checkoutFlexTreeView.js.map +1 -0
- package/dist/shared-tree/index.d.ts +3 -3
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js +2 -2
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/schematizeTree.d.ts +15 -4
- package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
- package/dist/shared-tree/schematizeTree.js +7 -8
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +9 -4
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +25 -12
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +2 -2
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.d.ts +3 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.js +6 -2
- package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts +3 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js +3 -2
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts +2 -1
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.js +2 -2
- package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/dist/shared-tree/treeApi.d.ts +1 -3
- package/dist/shared-tree/treeApi.d.ts.map +1 -1
- package/dist/shared-tree/treeApi.js +6 -4
- package/dist/shared-tree/treeApi.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +2 -13
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +17 -1
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/branch.js +1 -1
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/simple-tree/api/create.d.ts.map +1 -1
- package/dist/simple-tree/api/create.js +1 -1
- package/dist/simple-tree/api/create.js.map +1 -1
- package/{lib/simple-tree → dist/simple-tree/api}/getJsonSchema.d.ts +1 -1
- package/dist/simple-tree/api/getJsonSchema.d.ts.map +1 -0
- package/dist/simple-tree/{getJsonSchema.js → api/getJsonSchema.js} +1 -1
- package/dist/simple-tree/api/getJsonSchema.js.map +1 -0
- package/{lib/simple-tree → dist/simple-tree/api}/getSimpleSchema.d.ts +1 -1
- package/dist/simple-tree/api/getSimpleSchema.d.ts.map +1 -0
- package/dist/simple-tree/{getSimpleSchema.js → api/getSimpleSchema.js} +1 -1
- package/dist/simple-tree/api/getSimpleSchema.js.map +1 -0
- package/dist/simple-tree/api/index.d.ts +5 -0
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +7 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/{lib/simple-tree → dist/simple-tree/api}/jsonSchema.d.ts +1 -1
- package/dist/simple-tree/api/jsonSchema.d.ts.map +1 -0
- package/dist/simple-tree/api/jsonSchema.js.map +1 -0
- package/dist/simple-tree/api/schemaFactory.d.ts +45 -14
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +43 -12
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/{simpleSchema.d.ts → api/simpleSchema.d.ts} +4 -4
- package/dist/simple-tree/api/simpleSchema.d.ts.map +1 -0
- package/dist/simple-tree/api/simpleSchema.js.map +1 -0
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -0
- package/dist/simple-tree/{simpleSchemaToJsonSchema.js → api/simpleSchemaToJsonSchema.js} +4 -4
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -0
- package/dist/simple-tree/api/tree.d.ts +1 -21
- package/dist/simple-tree/api/tree.d.ts.map +1 -1
- package/dist/simple-tree/api/tree.js +3 -38
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/treeApiBeta.d.ts +79 -0
- package/dist/simple-tree/api/treeApiBeta.d.ts.map +1 -0
- package/dist/simple-tree/api/treeApiBeta.js +26 -0
- package/dist/simple-tree/api/treeApiBeta.js.map +1 -0
- package/dist/simple-tree/api/treeNodeApi.d.ts +1 -1
- package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.js +21 -19
- package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
- package/dist/simple-tree/api/verboseTree.js +2 -2
- package/dist/simple-tree/api/verboseTree.js.map +1 -1
- package/dist/simple-tree/{viewSchemaToSimpleSchema.d.ts → api/viewSchemaToSimpleSchema.d.ts} +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -0
- package/dist/simple-tree/{viewSchemaToSimpleSchema.js → api/viewSchemaToSimpleSchema.js} +4 -4
- package/{lib/simple-tree → dist/simple-tree/api}/viewSchemaToSimpleSchema.js.map +1 -1
- package/dist/simple-tree/arrayNode.d.ts +2 -2
- package/dist/simple-tree/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/arrayNode.js +30 -21
- package/dist/simple-tree/arrayNode.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +3 -3
- package/dist/simple-tree/core/index.d.ts.map +1 -1
- package/dist/simple-tree/core/index.js +4 -1
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/schemaCaching.d.ts +5 -0
- package/dist/simple-tree/core/schemaCaching.d.ts.map +1 -1
- package/dist/simple-tree/core/schemaCaching.js +10 -1
- package/dist/simple-tree/core/schemaCaching.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.d.ts +61 -3
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +166 -13
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts +1 -1
- package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/dist/simple-tree/core/types.d.ts +17 -20
- package/dist/simple-tree/core/types.d.ts.map +1 -1
- package/dist/simple-tree/core/types.js.map +1 -1
- package/dist/simple-tree/core/withType.d.ts +3 -2
- package/dist/simple-tree/core/withType.d.ts.map +1 -1
- package/dist/simple-tree/core/withType.js.map +1 -1
- package/dist/simple-tree/index.d.ts +7 -9
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +15 -6
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts +7 -9
- package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js +13 -11
- package/dist/simple-tree/leafNodeSchema.js.map +1 -1
- package/dist/simple-tree/mapNode.d.ts +1 -1
- package/dist/simple-tree/mapNode.d.ts.map +1 -1
- package/dist/simple-tree/mapNode.js +38 -29
- package/dist/simple-tree/mapNode.js.map +1 -1
- package/dist/simple-tree/objectNode.d.ts +9 -7
- package/dist/simple-tree/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/objectNode.js +37 -31
- package/dist/simple-tree/objectNode.js.map +1 -1
- package/dist/simple-tree/proxies.d.ts +1 -14
- package/dist/simple-tree/proxies.d.ts.map +1 -1
- package/dist/simple-tree/proxies.js +12 -15
- package/dist/simple-tree/proxies.js.map +1 -1
- package/dist/simple-tree/proxyBinding.d.ts +2 -62
- package/dist/simple-tree/proxyBinding.d.ts.map +1 -1
- package/dist/simple-tree/proxyBinding.js +8 -181
- package/dist/simple-tree/proxyBinding.js.map +1 -1
- package/dist/simple-tree/schemaTypes.d.ts +7 -7
- package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
- package/dist/simple-tree/schemaTypes.js +4 -4
- package/dist/simple-tree/schemaTypes.js.map +1 -1
- package/dist/simple-tree/toFlexSchema.d.ts +11 -1
- package/dist/simple-tree/toFlexSchema.d.ts.map +1 -1
- package/dist/simple-tree/toFlexSchema.js +54 -31
- package/dist/simple-tree/toFlexSchema.js.map +1 -1
- package/dist/simple-tree/toMapTree.d.ts +25 -37
- package/dist/simple-tree/toMapTree.d.ts.map +1 -1
- package/dist/simple-tree/toMapTree.js +53 -16
- package/dist/simple-tree/toMapTree.js.map +1 -1
- package/dist/simple-tree/treeNodeValid.d.ts.map +1 -1
- package/dist/simple-tree/treeNodeValid.js +7 -10
- package/dist/simple-tree/treeNodeValid.js.map +1 -1
- package/dist/simple-tree/typesUnsafe.d.ts +13 -13
- package/dist/simple-tree/typesUnsafe.js.map +1 -1
- package/dist/simple-tree/walkSchema.d.ts +26 -0
- package/dist/simple-tree/walkSchema.d.ts.map +1 -0
- package/dist/simple-tree/walkSchema.js +49 -0
- package/dist/simple-tree/walkSchema.js.map +1 -0
- package/dist/treeFactory.d.ts +2 -1
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +2 -1
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/typeUtils.d.ts +2 -2
- package/dist/util/typeUtils.js.map +1 -1
- package/legacy.d.ts +11 -0
- package/lib/alpha.d.ts +102 -0
- package/lib/beta.d.ts +6 -2
- package/lib/core/index.d.ts +1 -1
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +1 -1
- package/lib/core/index.js.map +1 -1
- package/lib/core/{revertible/revertible.d.ts → revertible.d.ts} +12 -0
- package/lib/core/revertible.d.ts.map +1 -0
- package/lib/core/revertible.js.map +1 -0
- package/lib/core/schema-stored/format.d.ts +3 -3
- package/lib/core/schema-stored/format.js +1 -1
- package/lib/core/schema-stored/format.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +2 -7
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +4 -6
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.d.ts +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.js +6 -2
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/core/tree/detachedFieldIndex.d.ts +0 -1
- package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndex.js +1 -0
- package/lib/core/tree/detachedFieldIndex.js.map +1 -1
- package/lib/core/tree/visitDelta.d.ts +7 -2
- package/lib/core/tree/visitDelta.d.ts.map +1 -1
- package/lib/core/tree/visitDelta.js.map +1 -1
- package/lib/events/emitter.d.ts +127 -0
- package/lib/events/emitter.d.ts.map +1 -0
- package/lib/events/{events.js → emitter.js} +48 -29
- package/lib/events/emitter.js.map +1 -0
- package/lib/events/index.d.ts +2 -1
- package/lib/events/index.d.ts.map +1 -1
- package/lib/events/index.js +1 -1
- package/lib/events/index.js.map +1 -1
- package/lib/events/interop.d.ts +36 -0
- package/lib/events/interop.d.ts.map +1 -0
- package/{src/core/revertible/index.ts → lib/events/interop.js} +2 -2
- package/lib/events/interop.js.map +1 -0
- package/lib/events/listeners.d.ts +65 -0
- package/lib/events/listeners.d.ts.map +1 -0
- package/lib/{core/revertible/index.js → events/listeners.js} +2 -2
- package/lib/events/listeners.js.map +1 -0
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +25 -7
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js +37 -16
- package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts +4 -2
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.js +12 -5
- package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts +15 -2
- package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js +28 -2
- package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +3 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js +5 -4
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/flex-map-tree/index.d.ts +1 -1
- package/lib/feature-libraries/flex-map-tree/index.d.ts.map +1 -1
- package/lib/feature-libraries/flex-map-tree/index.js +1 -1
- package/lib/feature-libraries/flex-map-tree/index.js.map +1 -1
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts +35 -33
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.js +83 -104
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
- package/lib/feature-libraries/flex-tree/context.d.ts +30 -14
- package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/context.js +10 -7
- package/lib/feature-libraries/flex-tree/context.js.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +57 -190
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js +15 -2
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/lib/feature-libraries/flex-tree/index.d.ts +2 -3
- package/lib/feature-libraries/flex-tree/index.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/index.js +1 -1
- package/lib/feature-libraries/flex-tree/index.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyEntity.d.ts +3 -3
- package/lib/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyEntity.js +2 -10
- package/lib/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.d.ts +26 -28
- package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +11 -13
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts +5 -26
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.js +23 -72
- package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/lib/feature-libraries/flex-tree/unboxed.d.ts +4 -16
- package/lib/feature-libraries/flex-tree/unboxed.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/unboxed.js +5 -37
- package/lib/feature-libraries/flex-tree/unboxed.js.map +1 -1
- package/lib/feature-libraries/flex-tree/utilities.d.ts +2 -2
- package/lib/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/utilities.js +3 -6
- package/lib/feature-libraries/flex-tree/utilities.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +4 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +3 -5
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +5 -5
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.js +3 -6
- package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/lib/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/discrepancies.js +3 -13
- package/lib/feature-libraries/modular-schema/discrepancies.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +4 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +2 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +12 -5
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +6 -6
- package/lib/feature-libraries/schema-index/format.d.ts +3 -3
- package/lib/feature-libraries/storedToViewSchema.d.ts.map +1 -1
- package/lib/feature-libraries/storedToViewSchema.js +3 -5
- package/lib/feature-libraries/storedToViewSchema.js.map +1 -1
- package/lib/feature-libraries/typed-schema/flexList.d.ts +3 -3
- package/lib/feature-libraries/typed-schema/flexList.js.map +1 -1
- package/lib/feature-libraries/typed-schema/index.d.ts +2 -2
- package/lib/feature-libraries/typed-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/typed-schema/index.js +2 -2
- package/lib/feature-libraries/typed-schema/index.js.map +1 -1
- package/lib/feature-libraries/typed-schema/schemaCollection.d.ts.map +1 -1
- package/lib/feature-libraries/typed-schema/schemaCollection.js +9 -11
- package/lib/feature-libraries/typed-schema/schemaCollection.js.map +1 -1
- package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts +17 -48
- package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
- package/lib/feature-libraries/typed-schema/typedTreeSchema.js +5 -36
- package/lib/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
- package/lib/feature-libraries/typed-schema/view.d.ts +4 -6
- package/lib/feature-libraries/typed-schema/view.d.ts.map +1 -1
- package/lib/feature-libraries/typed-schema/view.js +5 -4
- package/lib/feature-libraries/typed-schema/view.js.map +1 -1
- package/lib/index.d.ts +4 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -5
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +83 -0
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/public.d.ts +0 -1
- package/lib/shared-tree/checkoutFlexTreeView.d.ts +53 -0
- package/lib/shared-tree/checkoutFlexTreeView.d.ts.map +1 -0
- package/lib/shared-tree/{treeView.js → checkoutFlexTreeView.js} +26 -5
- package/lib/shared-tree/checkoutFlexTreeView.js.map +1 -0
- package/lib/shared-tree/index.d.ts +3 -3
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js +1 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/schematizeTree.d.ts +15 -4
- package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
- package/lib/shared-tree/schematizeTree.js +8 -9
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +9 -4
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +26 -13
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +2 -2
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.d.ts +3 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.js +6 -2
- package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts +3 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js +3 -2
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts +2 -1
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.js +2 -2
- package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/lib/shared-tree/treeApi.d.ts +1 -3
- package/lib/shared-tree/treeApi.d.ts.map +1 -1
- package/lib/shared-tree/treeApi.js +7 -5
- package/lib/shared-tree/treeApi.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +2 -13
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +18 -2
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/branch.js +1 -1
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/simple-tree/api/create.d.ts.map +1 -1
- package/lib/simple-tree/api/create.js +2 -2
- package/lib/simple-tree/api/create.js.map +1 -1
- package/{dist/simple-tree → lib/simple-tree/api}/getJsonSchema.d.ts +1 -1
- package/lib/simple-tree/api/getJsonSchema.d.ts.map +1 -0
- package/lib/simple-tree/{getJsonSchema.js → api/getJsonSchema.js} +1 -1
- package/lib/simple-tree/api/getJsonSchema.js.map +1 -0
- package/{dist/simple-tree → lib/simple-tree/api}/getSimpleSchema.d.ts +1 -1
- package/lib/simple-tree/api/getSimpleSchema.d.ts.map +1 -0
- package/lib/simple-tree/{getSimpleSchema.js → api/getSimpleSchema.js} +1 -1
- package/lib/simple-tree/api/getSimpleSchema.js.map +1 -0
- package/lib/simple-tree/api/index.d.ts +5 -0
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +3 -0
- package/lib/simple-tree/api/index.js.map +1 -1
- package/{dist/simple-tree → lib/simple-tree/api}/jsonSchema.d.ts +1 -1
- package/lib/simple-tree/api/jsonSchema.d.ts.map +1 -0
- package/lib/simple-tree/api/jsonSchema.js.map +1 -0
- package/lib/simple-tree/api/schemaFactory.d.ts +45 -14
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +43 -12
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/{simpleSchema.d.ts → api/simpleSchema.d.ts} +4 -4
- package/lib/simple-tree/api/simpleSchema.d.ts.map +1 -0
- package/lib/simple-tree/api/simpleSchema.js.map +1 -0
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -0
- package/lib/simple-tree/{simpleSchemaToJsonSchema.js → api/simpleSchemaToJsonSchema.js} +4 -4
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -0
- package/lib/simple-tree/api/tree.d.ts +1 -21
- package/lib/simple-tree/api/tree.d.ts.map +1 -1
- package/lib/simple-tree/api/tree.js +2 -34
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/treeApiBeta.d.ts +79 -0
- package/lib/simple-tree/api/treeApiBeta.d.ts.map +1 -0
- package/lib/simple-tree/api/treeApiBeta.js +23 -0
- package/lib/simple-tree/api/treeApiBeta.js.map +1 -0
- package/lib/simple-tree/api/treeNodeApi.d.ts +1 -1
- package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.js +23 -21
- package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/api/verboseTree.js +1 -1
- package/lib/simple-tree/api/verboseTree.js.map +1 -1
- package/lib/simple-tree/{viewSchemaToSimpleSchema.d.ts → api/viewSchemaToSimpleSchema.d.ts} +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -0
- package/lib/simple-tree/{viewSchemaToSimpleSchema.js → api/viewSchemaToSimpleSchema.js} +4 -4
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -0
- package/lib/simple-tree/arrayNode.d.ts +2 -2
- package/lib/simple-tree/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/arrayNode.js +33 -24
- package/lib/simple-tree/arrayNode.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +3 -3
- package/lib/simple-tree/core/index.d.ts.map +1 -1
- package/lib/simple-tree/core/index.js +2 -2
- package/lib/simple-tree/core/index.js.map +1 -1
- package/lib/simple-tree/core/schemaCaching.d.ts +5 -0
- package/lib/simple-tree/core/schemaCaching.d.ts.map +1 -1
- package/lib/simple-tree/core/schemaCaching.js +8 -0
- package/lib/simple-tree/core/schemaCaching.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.d.ts +61 -3
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +156 -5
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts +1 -1
- package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/lib/simple-tree/core/types.d.ts +17 -20
- package/lib/simple-tree/core/types.d.ts.map +1 -1
- package/lib/simple-tree/core/types.js.map +1 -1
- package/lib/simple-tree/core/withType.d.ts +3 -2
- package/lib/simple-tree/core/withType.d.ts.map +1 -1
- package/lib/simple-tree/core/withType.js.map +1 -1
- package/lib/simple-tree/index.d.ts +7 -9
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +5 -5
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.d.ts +7 -9
- package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js +14 -12
- package/lib/simple-tree/leafNodeSchema.js.map +1 -1
- package/lib/simple-tree/mapNode.d.ts +1 -1
- package/lib/simple-tree/mapNode.d.ts.map +1 -1
- package/lib/simple-tree/mapNode.js +38 -29
- package/lib/simple-tree/mapNode.js.map +1 -1
- package/lib/simple-tree/objectNode.d.ts +9 -7
- package/lib/simple-tree/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/objectNode.js +40 -34
- package/lib/simple-tree/objectNode.js.map +1 -1
- package/lib/simple-tree/proxies.d.ts +1 -14
- package/lib/simple-tree/proxies.d.ts.map +1 -1
- package/lib/simple-tree/proxies.js +11 -14
- package/lib/simple-tree/proxies.js.map +1 -1
- package/lib/simple-tree/proxyBinding.d.ts +2 -62
- package/lib/simple-tree/proxyBinding.d.ts.map +1 -1
- package/lib/simple-tree/proxyBinding.js +6 -174
- package/lib/simple-tree/proxyBinding.js.map +1 -1
- package/lib/simple-tree/schemaTypes.d.ts +7 -7
- package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
- package/lib/simple-tree/schemaTypes.js +4 -4
- package/lib/simple-tree/schemaTypes.js.map +1 -1
- package/lib/simple-tree/toFlexSchema.d.ts +11 -1
- package/lib/simple-tree/toFlexSchema.d.ts.map +1 -1
- package/lib/simple-tree/toFlexSchema.js +29 -8
- package/lib/simple-tree/toFlexSchema.js.map +1 -1
- package/lib/simple-tree/toMapTree.d.ts +25 -37
- package/lib/simple-tree/toMapTree.d.ts.map +1 -1
- package/lib/simple-tree/toMapTree.js +54 -17
- package/lib/simple-tree/toMapTree.js.map +1 -1
- package/lib/simple-tree/treeNodeValid.d.ts.map +1 -1
- package/lib/simple-tree/treeNodeValid.js +8 -11
- package/lib/simple-tree/treeNodeValid.js.map +1 -1
- package/lib/simple-tree/typesUnsafe.d.ts +13 -13
- package/lib/simple-tree/typesUnsafe.js.map +1 -1
- package/lib/simple-tree/walkSchema.d.ts +26 -0
- package/lib/simple-tree/walkSchema.d.ts.map +1 -0
- package/lib/simple-tree/walkSchema.js +43 -0
- package/lib/simple-tree/walkSchema.js.map +1 -0
- package/lib/treeFactory.d.ts +2 -1
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +2 -1
- package/lib/treeFactory.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/lib/util/typeUtils.d.ts +2 -2
- package/lib/util/typeUtils.js.map +1 -1
- package/package.json +57 -25
- package/src/core/index.ts +1 -1
- package/src/core/{revertible/revertible.ts → revertible.ts} +15 -0
- package/src/core/schema-stored/format.ts +1 -1
- package/src/core/schema-stored/schema.ts +6 -13
- package/src/core/tree/anchorSet.ts +18 -3
- package/src/core/tree/detachedFieldIndex.ts +6 -5
- package/src/core/tree/visitDelta.ts +7 -2
- package/src/events/{events.ts → emitter.ts} +52 -139
- package/src/events/index.ts +7 -7
- package/src/events/interop.ts +49 -0
- package/src/events/listeners.ts +68 -0
- package/src/feature-libraries/chunked-forest/chunkTree.ts +63 -18
- package/src/feature-libraries/chunked-forest/chunkedForest.ts +18 -4
- package/src/feature-libraries/chunked-forest/uniformChunk.ts +33 -0
- package/src/feature-libraries/default-schema/defaultEditBuilder.ts +5 -3
- package/src/feature-libraries/flex-map-tree/index.ts +1 -0
- package/src/feature-libraries/flex-map-tree/mapTreeNode.ts +135 -210
- package/src/feature-libraries/flex-tree/README.md +4 -75
- package/src/feature-libraries/flex-tree/context.ts +37 -16
- package/src/feature-libraries/flex-tree/flexTreeTypes.ts +69 -291
- package/src/feature-libraries/flex-tree/index.ts +7 -13
- package/src/feature-libraries/flex-tree/lazyEntity.ts +2 -11
- package/src/feature-libraries/flex-tree/lazyField.ts +49 -73
- package/src/feature-libraries/flex-tree/lazyNode.ts +25 -154
- package/src/feature-libraries/flex-tree/unboxed.ts +9 -68
- package/src/feature-libraries/flex-tree/utilities.ts +4 -8
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +4 -1
- package/src/feature-libraries/index.ts +2 -27
- package/src/feature-libraries/modular-schema/comparison.ts +4 -6
- package/src/feature-libraries/modular-schema/discrepancies.ts +7 -16
- package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +4 -1
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +14 -4
- package/src/feature-libraries/storedToViewSchema.ts +5 -6
- package/src/feature-libraries/typed-schema/flexList.ts +3 -3
- package/src/feature-libraries/typed-schema/index.ts +1 -3
- package/src/feature-libraries/typed-schema/schemaCollection.ts +15 -17
- package/src/feature-libraries/typed-schema/typedTreeSchema.ts +35 -127
- package/src/feature-libraries/typed-schema/view.ts +4 -13
- package/src/index.ts +4 -8
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/checkoutFlexTreeView.ts +89 -0
- package/src/shared-tree/index.ts +2 -7
- package/src/shared-tree/schematizeTree.ts +23 -12
- package/src/shared-tree/schematizingTreeView.ts +34 -24
- package/src/shared-tree/sharedTree.ts +6 -1
- package/src/shared-tree/sharedTreeChangeEnricher.ts +6 -1
- package/src/shared-tree/sharedTreeChangeFamily.ts +7 -1
- package/src/shared-tree/sharedTreeEditBuilder.ts +9 -4
- package/src/shared-tree/treeApi.ts +10 -10
- package/src/shared-tree/treeCheckout.ts +26 -15
- package/src/shared-tree-core/branch.ts +1 -1
- package/src/simple-tree/ProxyBinding.md +23 -23
- package/src/simple-tree/api/create.ts +8 -3
- package/src/simple-tree/{getJsonSchema.ts → api/getJsonSchema.ts} +3 -3
- package/src/simple-tree/{getSimpleSchema.ts → api/getSimpleSchema.ts} +3 -3
- package/src/simple-tree/api/index.ts +20 -0
- package/src/simple-tree/{jsonSchema.ts → api/jsonSchema.ts} +1 -1
- package/src/simple-tree/api/schemaFactory.ts +44 -13
- package/src/simple-tree/{simpleSchema.ts → api/simpleSchema.ts} +4 -4
- package/src/simple-tree/{simpleSchemaToJsonSchema.ts → api/simpleSchemaToJsonSchema.ts} +4 -4
- package/src/simple-tree/api/tree.ts +2 -71
- package/src/simple-tree/api/treeApiBeta.ts +101 -0
- package/src/simple-tree/api/treeNodeApi.ts +32 -23
- package/src/simple-tree/api/verboseTree.ts +1 -1
- package/src/simple-tree/{viewSchemaToSimpleSchema.ts → api/viewSchemaToSimpleSchema.ts} +5 -5
- package/src/simple-tree/arrayNode.ts +37 -31
- package/src/simple-tree/core/index.ts +4 -1
- package/src/simple-tree/core/schemaCaching.ts +10 -0
- package/src/simple-tree/core/treeNodeKernel.ts +198 -5
- package/src/simple-tree/core/treeNodeSchema.ts +1 -1
- package/src/simple-tree/core/types.ts +16 -27
- package/src/simple-tree/core/withType.ts +3 -1
- package/src/simple-tree/index.ts +29 -21
- package/src/simple-tree/leafNodeSchema.ts +24 -28
- package/src/simple-tree/mapNode.ts +47 -29
- package/src/simple-tree/objectNode.ts +51 -46
- package/src/simple-tree/proxies.ts +22 -51
- package/src/simple-tree/proxyBinding.ts +3 -254
- package/src/simple-tree/schemaTypes.ts +8 -8
- package/src/simple-tree/toFlexSchema.ts +40 -7
- package/src/simple-tree/toMapTree.ts +113 -79
- package/src/simple-tree/treeNodeValid.ts +10 -13
- package/src/simple-tree/typesUnsafe.ts +13 -13
- package/src/simple-tree/walkSchema.ts +81 -0
- package/src/treeFactory.ts +2 -1
- package/src/util/typeUtils.ts +2 -2
- package/dist/core/revertible/index.d.ts.map +0 -1
- package/dist/core/revertible/index.js +0 -10
- package/dist/core/revertible/index.js.map +0 -1
- package/dist/core/revertible/revertible.d.ts.map +0 -1
- package/dist/core/revertible/revertible.js.map +0 -1
- package/dist/domains/index.d.ts +0 -8
- package/dist/domains/index.d.ts.map +0 -1
- package/dist/domains/index.js +0 -20
- package/dist/domains/index.js.map +0 -1
- package/dist/domains/json/index.d.ts +0 -7
- package/dist/domains/json/index.d.ts.map +0 -1
- package/dist/domains/json/index.js +0 -17
- package/dist/domains/json/index.js.map +0 -1
- package/dist/domains/json/jsonCursor.d.ts +0 -52
- package/dist/domains/json/jsonCursor.d.ts.map +0 -1
- package/dist/domains/json/jsonCursor.js +0 -197
- package/dist/domains/json/jsonCursor.js.map +0 -1
- package/dist/domains/json/jsonDomainSchema.d.ts +0 -24
- package/dist/domains/json/jsonDomainSchema.d.ts.map +0 -1
- package/dist/domains/json/jsonDomainSchema.js +0 -32
- package/dist/domains/json/jsonDomainSchema.js.map +0 -1
- package/dist/domains/leafDomain.d.ts +0 -72
- package/dist/domains/leafDomain.d.ts.map +0 -1
- package/dist/domains/leafDomain.js +0 -88
- package/dist/domains/leafDomain.js.map +0 -1
- package/dist/domains/schemaBuilder.d.ts +0 -103
- package/dist/domains/schemaBuilder.d.ts.map +0 -1
- package/dist/domains/schemaBuilder.js +0 -121
- package/dist/domains/schemaBuilder.js.map +0 -1
- package/dist/domains/testRecursiveDomain.d.ts +0 -17
- package/dist/domains/testRecursiveDomain.d.ts.map +0 -1
- package/dist/domains/testRecursiveDomain.js +0 -35
- package/dist/domains/testRecursiveDomain.js.map +0 -1
- package/dist/events/events.d.ts +0 -207
- package/dist/events/events.d.ts.map +0 -1
- package/dist/events/events.js.map +0 -1
- package/dist/feature-libraries/schemaBuilder.d.ts +0 -31
- package/dist/feature-libraries/schemaBuilder.d.ts.map +0 -1
- package/dist/feature-libraries/schemaBuilder.js +0 -40
- package/dist/feature-libraries/schemaBuilder.js.map +0 -1
- package/dist/feature-libraries/schemaBuilderBase.d.ts +0 -191
- package/dist/feature-libraries/schemaBuilderBase.d.ts.map +0 -1
- package/dist/feature-libraries/schemaBuilderBase.js +0 -201
- package/dist/feature-libraries/schemaBuilderBase.js.map +0 -1
- package/dist/shared-tree/treeView.d.ts +0 -73
- package/dist/shared-tree/treeView.d.ts.map +0 -1
- package/dist/shared-tree/treeView.js.map +0 -1
- package/dist/simple-tree/getJsonSchema.d.ts.map +0 -1
- package/dist/simple-tree/getJsonSchema.js.map +0 -1
- package/dist/simple-tree/getSimpleSchema.d.ts.map +0 -1
- package/dist/simple-tree/getSimpleSchema.js.map +0 -1
- package/dist/simple-tree/jsonSchema.d.ts.map +0 -1
- package/dist/simple-tree/jsonSchema.js.map +0 -1
- package/dist/simple-tree/simpleSchema.d.ts.map +0 -1
- package/dist/simple-tree/simpleSchema.js.map +0 -1
- package/dist/simple-tree/simpleSchemaToJsonSchema.d.ts.map +0 -1
- package/dist/simple-tree/simpleSchemaToJsonSchema.js.map +0 -1
- package/dist/simple-tree/viewSchemaToSimpleSchema.d.ts.map +0 -1
- package/dist/simple-tree/viewSchemaToSimpleSchema.js.map +0 -1
- package/lib/core/revertible/index.d.ts.map +0 -1
- package/lib/core/revertible/index.js.map +0 -1
- package/lib/core/revertible/revertible.d.ts.map +0 -1
- package/lib/core/revertible/revertible.js.map +0 -1
- package/lib/domains/index.d.ts +0 -8
- package/lib/domains/index.d.ts.map +0 -1
- package/lib/domains/index.js +0 -8
- package/lib/domains/index.js.map +0 -1
- package/lib/domains/json/index.d.ts +0 -7
- package/lib/domains/json/index.d.ts.map +0 -1
- package/lib/domains/json/index.js +0 -7
- package/lib/domains/json/index.js.map +0 -1
- package/lib/domains/json/jsonCursor.d.ts +0 -52
- package/lib/domains/json/jsonCursor.d.ts.map +0 -1
- package/lib/domains/json/jsonCursor.js +0 -192
- package/lib/domains/json/jsonCursor.js.map +0 -1
- package/lib/domains/json/jsonDomainSchema.d.ts +0 -24
- package/lib/domains/json/jsonDomainSchema.d.ts.map +0 -1
- package/lib/domains/json/jsonDomainSchema.js +0 -29
- package/lib/domains/json/jsonDomainSchema.js.map +0 -1
- package/lib/domains/leafDomain.d.ts +0 -72
- package/lib/domains/leafDomain.d.ts.map +0 -1
- package/lib/domains/leafDomain.js +0 -85
- package/lib/domains/leafDomain.js.map +0 -1
- package/lib/domains/schemaBuilder.d.ts +0 -103
- package/lib/domains/schemaBuilder.d.ts.map +0 -1
- package/lib/domains/schemaBuilder.js +0 -117
- package/lib/domains/schemaBuilder.js.map +0 -1
- package/lib/domains/testRecursiveDomain.d.ts +0 -17
- package/lib/domains/testRecursiveDomain.d.ts.map +0 -1
- package/lib/domains/testRecursiveDomain.js +0 -32
- package/lib/domains/testRecursiveDomain.js.map +0 -1
- package/lib/events/events.d.ts +0 -207
- package/lib/events/events.d.ts.map +0 -1
- package/lib/events/events.js.map +0 -1
- package/lib/feature-libraries/schemaBuilder.d.ts +0 -31
- package/lib/feature-libraries/schemaBuilder.d.ts.map +0 -1
- package/lib/feature-libraries/schemaBuilder.js +0 -36
- package/lib/feature-libraries/schemaBuilder.js.map +0 -1
- package/lib/feature-libraries/schemaBuilderBase.d.ts +0 -191
- package/lib/feature-libraries/schemaBuilderBase.d.ts.map +0 -1
- package/lib/feature-libraries/schemaBuilderBase.js +0 -195
- package/lib/feature-libraries/schemaBuilderBase.js.map +0 -1
- package/lib/shared-tree/treeView.d.ts +0 -73
- package/lib/shared-tree/treeView.d.ts.map +0 -1
- package/lib/shared-tree/treeView.js.map +0 -1
- package/lib/simple-tree/getJsonSchema.d.ts.map +0 -1
- package/lib/simple-tree/getJsonSchema.js.map +0 -1
- package/lib/simple-tree/getSimpleSchema.d.ts.map +0 -1
- package/lib/simple-tree/getSimpleSchema.js.map +0 -1
- package/lib/simple-tree/jsonSchema.d.ts.map +0 -1
- package/lib/simple-tree/jsonSchema.js.map +0 -1
- package/lib/simple-tree/simpleSchema.d.ts.map +0 -1
- package/lib/simple-tree/simpleSchema.js.map +0 -1
- package/lib/simple-tree/simpleSchemaToJsonSchema.d.ts.map +0 -1
- package/lib/simple-tree/simpleSchemaToJsonSchema.js.map +0 -1
- package/lib/simple-tree/viewSchemaToSimpleSchema.d.ts.map +0 -1
- package/src/domains/README.md +0 -6
- package/src/domains/fence.json +0 -5
- package/src/domains/index.ts +0 -19
- package/src/domains/json/fence.json +0 -5
- package/src/domains/json/index.ts +0 -13
- package/src/domains/json/jsonCursor.ts +0 -247
- package/src/domains/json/jsonDomainSchema.ts +0 -47
- package/src/domains/leafDomain.ts +0 -97
- package/src/domains/schemaBuilder.ts +0 -153
- package/src/domains/testRecursiveDomain.ts +0 -38
- package/src/events/fence.json +0 -5
- package/src/feature-libraries/schemaBuilder.ts +0 -45
- package/src/feature-libraries/schemaBuilderBase.ts +0 -393
- package/src/shared-tree/treeView.ts +0 -113
- /package/dist/core/{revertible/revertible.js → revertible.js} +0 -0
- /package/dist/simple-tree/{jsonSchema.js → api/jsonSchema.js} +0 -0
- /package/dist/simple-tree/{simpleSchema.js → api/simpleSchema.js} +0 -0
- /package/dist/simple-tree/{simpleSchemaToJsonSchema.d.ts → api/simpleSchemaToJsonSchema.d.ts} +0 -0
- /package/lib/core/{revertible/revertible.js → revertible.js} +0 -0
- /package/lib/simple-tree/{jsonSchema.js → api/jsonSchema.js} +0 -0
- /package/lib/simple-tree/{simpleSchema.js → api/simpleSchema.js} +0 -0
- /package/lib/simple-tree/{simpleSchemaToJsonSchema.d.ts → api/simpleSchemaToJsonSchema.d.ts} +0 -0
|
@@ -35,8 +35,10 @@ import {
|
|
|
35
35
|
makeAnonChange,
|
|
36
36
|
makeDetachedFieldIndex,
|
|
37
37
|
rebaseChange,
|
|
38
|
+
rootFieldKey,
|
|
38
39
|
tagChange,
|
|
39
40
|
visitDelta,
|
|
41
|
+
type RevertibleFactory,
|
|
40
42
|
} from "../core/index.js";
|
|
41
43
|
import {
|
|
42
44
|
type HasListeners,
|
|
@@ -87,21 +89,6 @@ export interface CheckoutEvents {
|
|
|
87
89
|
commitApplied(data: CommitMetadata, getRevertible?: RevertibleFactory): void;
|
|
88
90
|
}
|
|
89
91
|
|
|
90
|
-
/**
|
|
91
|
-
* Factory for creating a {@link Revertible}.
|
|
92
|
-
* Will error if invoked outside the scope of the `commitApplied` event that provides it, or if invoked multiple times.
|
|
93
|
-
*
|
|
94
|
-
* @param onRevertibleDisposed - A callback that will be invoked when the `Revertible` generated by this factory is disposed.
|
|
95
|
-
* This happens when the `Revertible` is disposed manually, or when the `TreeView` that the `Revertible` belongs to is disposed,
|
|
96
|
-
* whichever happens first.
|
|
97
|
-
* This is typically used to clean up any resources associated with the `Revertible` in the host application.
|
|
98
|
-
*
|
|
99
|
-
* @sealed @public
|
|
100
|
-
*/
|
|
101
|
-
export type RevertibleFactory = (
|
|
102
|
-
onRevertibleDisposed?: (revertible: Revertible) => void,
|
|
103
|
-
) => Revertible;
|
|
104
|
-
|
|
105
92
|
/**
|
|
106
93
|
* Provides a means for interacting with a SharedTree.
|
|
107
94
|
* This includes reading data from the tree and running transactions to mutate the tree.
|
|
@@ -237,6 +224,7 @@ export function createTreeCheckout(
|
|
|
237
224
|
makeFieldBatchCodec(defaultCodecOptions, defaultFieldBatchVersion),
|
|
238
225
|
{ jsonValidator: noopValidator },
|
|
239
226
|
args?.chunkCompressionStrategy,
|
|
227
|
+
idCompressor,
|
|
240
228
|
);
|
|
241
229
|
const branch =
|
|
242
230
|
args?.branch ??
|
|
@@ -656,6 +644,7 @@ export class TreeCheckout implements ITreeCheckoutFork {
|
|
|
656
644
|
}
|
|
657
645
|
|
|
658
646
|
public getRemovedRoots(): [string | number | undefined, number, JsonableTree][] {
|
|
647
|
+
this.assertNoUntrackedRoots();
|
|
659
648
|
const trees: [string | number | undefined, number, JsonableTree][] = [];
|
|
660
649
|
const cursor = this.forest.allocateCursor("getRemovedRoots");
|
|
661
650
|
for (const { id, root } of this.removedRoots.entries()) {
|
|
@@ -739,6 +728,28 @@ export class TreeCheckout implements ITreeCheckoutFork {
|
|
|
739
728
|
|
|
740
729
|
return { age: revertAge };
|
|
741
730
|
}
|
|
731
|
+
|
|
732
|
+
private assertNoUntrackedRoots(): void {
|
|
733
|
+
const cursor = this.forest.getCursorAboveDetachedFields();
|
|
734
|
+
const rootFields = new Set([rootFieldKey]);
|
|
735
|
+
for (const { root } of this.removedRoots.entries()) {
|
|
736
|
+
rootFields.add(this.removedRoots.toFieldKey(root));
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
if (!cursor.firstField()) {
|
|
740
|
+
return;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
do {
|
|
744
|
+
const field = cursor.getFieldKey();
|
|
745
|
+
assert(
|
|
746
|
+
rootFields.has(field),
|
|
747
|
+
0xa22 /* Forest has a root field which is unknown to the detached field index */,
|
|
748
|
+
);
|
|
749
|
+
|
|
750
|
+
rootFields.delete(field);
|
|
751
|
+
} while (cursor.nextField());
|
|
752
|
+
}
|
|
742
753
|
}
|
|
743
754
|
|
|
744
755
|
/**
|
|
@@ -387,7 +387,7 @@ export class SharedTreeBranch<
|
|
|
387
387
|
const commit =
|
|
388
388
|
commits[i] ?? fail("This wont run because we are iterating through commits");
|
|
389
389
|
const inverse = this.changeFamily.rebaser.changeRevision(
|
|
390
|
-
this.changeFamily.rebaser.invert(commit,
|
|
390
|
+
this.changeFamily.rebaser.invert(commit, true),
|
|
391
391
|
revision,
|
|
392
392
|
commit.revision,
|
|
393
393
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# simple-tree
|
|
1
|
+
# simple-tree node Binding
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Hydration is a three step process which provides the ability to use a simple-tree node both before and after it is inserted into the tree.
|
|
4
4
|
This allows developers to "read back" values that they insert into the tree much more succinctly.
|
|
5
5
|
Here is an example:
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ function addPoint(curve: Curve, x: number, y: number): Point {
|
|
|
10
10
|
curve.points.insertAtEnd(point);
|
|
11
11
|
// After insertion, `point` can be queried:
|
|
12
12
|
assert(point.x === 3);
|
|
13
|
-
// In fact, `point` is the same
|
|
13
|
+
// In fact, `point` is the same simple-tree node object that you would get from reading it off of its new parent in the tree:
|
|
14
14
|
assert(point === curve.points[curve.points.length - 1]);
|
|
15
15
|
// So, to read the content that was just inserted, the original object can be used and there is no need to read via the parent:
|
|
16
16
|
return point;
|
|
@@ -20,22 +20,22 @@ function addPoint(curve: Curve, x: number, y: number): Point {
|
|
|
20
20
|
|
|
21
21
|
## Implementation
|
|
22
22
|
|
|
23
|
-
This feature is supported by doing some bookkeeping to ensure that the
|
|
23
|
+
This feature is supported by doing some bookkeeping to ensure that the simple-tree objects,
|
|
24
24
|
flex tree nodes and anchor nodes in the tree get associated and disassociated at the right times.
|
|
25
|
-
There are three states that a node
|
|
25
|
+
There are three states that a node simple-tree node can be in: "raw", "marinated" and "cooked".
|
|
26
26
|
|
|
27
27
|
Note from the public API perspective, `Unhydrated` nodes are "raw", and hydrated nodes are either "marinated" or "cooked".
|
|
28
28
|
|
|
29
29
|
### Raw Proxies
|
|
30
30
|
|
|
31
|
-
A newly created
|
|
31
|
+
A newly created simple-tree node, a.k.a. a **raw** simple-tree node. A raw simple-tree node is produced by invoking the schema-provided constructor for a node:
|
|
32
32
|
|
|
33
33
|
```ts
|
|
34
34
|
const rawPoint = new Point({ x: 3, y: 3 });
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
Such a
|
|
38
|
-
As
|
|
37
|
+
Such a simple-tree node will be raw until it is inserted into the tree and becomes "marinated" (see below).
|
|
38
|
+
As raw nodes can be read or mutated.
|
|
39
39
|
|
|
40
40
|
### Marinated Proxies
|
|
41
41
|
|
|
@@ -60,15 +60,15 @@ app.graph = {
|
|
|
60
60
|
};
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
A marinated
|
|
64
|
-
When insertion occurs, an `AnchorNode` will be created for the location of the new content.
|
|
65
|
-
The
|
|
66
|
-
Note that the `AnchorNode`
|
|
63
|
+
A marinated simple-tree node, by definition, is bound bi-directionally to an `AnchorNode`.
|
|
64
|
+
When insertion occurs, an `AnchorNode` will be created (if not already present) for the location of the new content.
|
|
65
|
+
The simple-tree node for that content will then be mapped to the `AnchorNode` (via its kernel) and the `AnchorNode` will be mapped to the simple-tree node.
|
|
66
|
+
Note that the `AnchorNode` may not yet have a `FlexTreeNode` associated with it - that happens when the node becomes "cooked" (see below).
|
|
67
67
|
|
|
68
68
|
### Cooked Proxies
|
|
69
69
|
|
|
70
|
-
A
|
|
71
|
-
This happens lazily on demand, if/when a marinated
|
|
70
|
+
A simple-tree node is fully cooked when it finally associates itself with a `FlexTreeNode`.
|
|
71
|
+
This happens lazily on demand, if/when a marinated simple-tree node is read or mutated (by the local client).
|
|
72
72
|
|
|
73
73
|
```ts
|
|
74
74
|
const point = new Point({ x: 3, y: 3 }); // `point` is raw
|
|
@@ -76,29 +76,29 @@ curves.points.insertAtEnd(point); // `point` becomes marinated
|
|
|
76
76
|
const x = point.x; // `point` becomes cooked in order to support the read of `x`
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
-
This laziness prevents the
|
|
79
|
+
This laziness prevents the simple-tree node tree from generating unnecessary `FlexTreeNodes`.
|
|
80
80
|
|
|
81
|
-
Cooking a marinated
|
|
81
|
+
Cooking a marinated simple-tree node works as follows:
|
|
82
82
|
|
|
83
|
-
1. Get the `AnchorNode` associated with the marinated
|
|
83
|
+
1. Get the `AnchorNode` associated with the marinated simple-tree node.
|
|
84
84
|
2. Get or create a `FlexTreeNode` for the anchor.
|
|
85
|
-
3. This will cause the `FlexTreeNode` to be generated which corresponds to the
|
|
85
|
+
3. This will cause the `FlexTreeNode` to be generated which corresponds to the simple-tree node.
|
|
86
86
|
|
|
87
87
|
### Mappings
|
|
88
88
|
|
|
89
89
|
```mermaid
|
|
90
90
|
graph LR;
|
|
91
|
-
AnchorNode(AnchorNode)<-->|Cooked|FlexTreeNode(FlexTreeNode)
|
|
92
|
-
AnchorNode<--->|Marinated|
|
|
91
|
+
AnchorNode(AnchorNode)<-->|Cooked and sometimes when Marinated|FlexTreeNode(FlexTreeNode)
|
|
92
|
+
AnchorNode<--->|Marinated or Cooked|TreeNode(TreeNode)-.->|Raw|RawTreeNode(RawTreeNode)
|
|
93
93
|
linkStyle 0 stroke:#0f0
|
|
94
94
|
linkStyle 1 stroke:#00f
|
|
95
95
|
linkStyle 2 stroke:#f00
|
|
96
96
|
```
|
|
97
97
|
|
|
98
|
-
Note that it is possible for the `Cooked` mappings between an `AnchorNode` and a `FlexTreeNode` to exist regardless of whether there is also a
|
|
99
|
-
In that case, when that
|
|
98
|
+
Note that it is possible for the `Cooked` mappings between an `AnchorNode` and a `FlexTreeNode` to exist regardless of whether there is also a simple-tree node yet created for that node.
|
|
99
|
+
In that case, when that simple-tree node is created it will immediately be given its `Marinated` mappings and therefore already be cooked.
|
|
100
100
|
|
|
101
101
|
`RawTreeNode`s, which implement the `FlexTreeNode` interface (or at least, as of 2024-03-21, pretend to), are substitutes for the true `FlexTreeNode`s that don't yet exist for a raw node.
|
|
102
|
-
The `Raw` mapping is removed when a
|
|
102
|
+
The `Raw` mapping is removed when a simple-tree node is marinated, and the `RawTreeNode` is forgotten.
|
|
103
103
|
|
|
104
104
|
See [proxyBinding.ts](./proxyBinding.ts) for more details.
|
|
@@ -23,12 +23,13 @@ import {
|
|
|
23
23
|
FieldKinds,
|
|
24
24
|
intoStoredSchema,
|
|
25
25
|
mapTreeFromCursor,
|
|
26
|
+
UnhydratedContext,
|
|
26
27
|
type NodeKeyManager,
|
|
27
28
|
} from "../../feature-libraries/index.js";
|
|
28
|
-
import { getOrCreateNodeFromFlexTreeNode
|
|
29
|
+
import { getOrCreateNodeFromFlexTreeNode } from "../proxies.js";
|
|
29
30
|
import { getOrCreateMapTreeNode, isFieldInSchema } from "../../feature-libraries/index.js";
|
|
30
31
|
import { toFlexSchema } from "../toFlexSchema.js";
|
|
31
|
-
import { inSchemaOrThrow, mapTreeFromNodeData } from "../toMapTree.js";
|
|
32
|
+
import { inSchemaOrThrow, mapTreeFromNodeData, type InsertableContent } from "../toMapTree.js";
|
|
32
33
|
import {
|
|
33
34
|
applySchemaToParserOptions,
|
|
34
35
|
cursorFromVerbose,
|
|
@@ -171,7 +172,11 @@ export function createFromCursor<TSchema extends ImplicitFieldSchema>(
|
|
|
171
172
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
172
173
|
const mapTree = mapTrees[0]!;
|
|
173
174
|
const rootSchema = flexSchema.nodeSchema.get(mapTree.type) ?? fail("missing schema");
|
|
174
|
-
const mapTreeNode = getOrCreateMapTreeNode(
|
|
175
|
+
const mapTreeNode = getOrCreateMapTreeNode(
|
|
176
|
+
new UnhydratedContext(flexSchema),
|
|
177
|
+
rootSchema,
|
|
178
|
+
mapTree,
|
|
179
|
+
);
|
|
175
180
|
|
|
176
181
|
// TODO: ensure this works for InnerNodes to create unhydrated nodes
|
|
177
182
|
const result = getOrCreateNodeFromFlexTreeNode(mapTreeNode);
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { JsonTreeSchema } from "./jsonSchema.js";
|
|
7
|
-
import type { ImplicitAllowedTypes } from "
|
|
7
|
+
import type { ImplicitAllowedTypes } from "../schemaTypes.js";
|
|
8
8
|
import { toJsonSchema } from "./simpleSchemaToJsonSchema.js";
|
|
9
9
|
import { getSimpleSchema } from "./getSimpleSchema.js";
|
|
10
|
-
import { getOrCreate } from "
|
|
11
|
-
import type { TreeNodeSchema } from "
|
|
10
|
+
import { getOrCreate } from "../../util/index.js";
|
|
11
|
+
import type { TreeNodeSchema } from "../core/index.js";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Cache in which the results of {@link getJsonSchema} are saved.
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { getOrCreate } from "
|
|
7
|
-
import type { TreeNodeSchema } from "
|
|
8
|
-
import type { ImplicitAllowedTypes } from "
|
|
6
|
+
import { getOrCreate } from "../../util/index.js";
|
|
7
|
+
import type { TreeNodeSchema } from "../core/index.js";
|
|
8
|
+
import type { ImplicitAllowedTypes } from "../schemaTypes.js";
|
|
9
9
|
import type { SimpleTreeSchema } from "./simpleSchema.js";
|
|
10
10
|
import { toSimpleTreeSchema } from "./viewSchemaToSimpleSchema.js";
|
|
11
11
|
|
|
@@ -26,6 +26,26 @@ export {
|
|
|
26
26
|
} from "./schemaCreationUtilities.js";
|
|
27
27
|
export { treeNodeApi, type TreeNodeApi } from "./treeNodeApi.js";
|
|
28
28
|
export { createFromInsertable, cursorFromInsertable } from "./create.js";
|
|
29
|
+
export type { SimpleTreeSchema } from "./simpleSchema.js";
|
|
30
|
+
export {
|
|
31
|
+
type JsonSchemaId,
|
|
32
|
+
type JsonSchemaType,
|
|
33
|
+
type JsonObjectNodeSchema,
|
|
34
|
+
type JsonArrayNodeSchema,
|
|
35
|
+
type JsonMapNodeSchema,
|
|
36
|
+
type JsonLeafNodeSchema,
|
|
37
|
+
type JsonSchemaRef,
|
|
38
|
+
type JsonRefPath,
|
|
39
|
+
type JsonNodeSchema,
|
|
40
|
+
type JsonNodeSchemaBase,
|
|
41
|
+
type JsonTreeSchema,
|
|
42
|
+
type JsonFieldSchema,
|
|
43
|
+
type JsonLeafSchemaType,
|
|
44
|
+
} from "./jsonSchema.js";
|
|
45
|
+
export { getJsonSchema } from "./getJsonSchema.js";
|
|
46
|
+
export { getSimpleSchema } from "./getSimpleSchema.js";
|
|
47
|
+
|
|
48
|
+
export { TreeBeta, type NodeChangedData, type TreeChangeEventsBeta } from "./treeApiBeta.js";
|
|
29
49
|
|
|
30
50
|
// Exporting the schema (RecursiveObject) to test that recursive types are working correctly.
|
|
31
51
|
// These are `@internal` so they can't be included in the `InternalClassTreeTypes` due to https://github.com/microsoft/rushstack/issues/3639
|
|
@@ -100,7 +100,7 @@ export function schemaFromValue(value: TreeValue): TreeNodeSchema {
|
|
|
100
100
|
/**
|
|
101
101
|
* The name of a schema produced by {@link SchemaFactory}, including its optional scope prefix.
|
|
102
102
|
*
|
|
103
|
-
* @public
|
|
103
|
+
* @system @public
|
|
104
104
|
*/
|
|
105
105
|
export type ScopedSchemaName<
|
|
106
106
|
TScope extends string | undefined,
|
|
@@ -134,17 +134,46 @@ export type ScopedSchemaName<
|
|
|
134
134
|
* The usage below generalizes this to include array and map like objects as well.
|
|
135
135
|
*
|
|
136
136
|
* There are two ways to use these APIs:
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
137
|
+
*
|
|
138
|
+
* Customizable Approach:
|
|
139
|
+
*
|
|
140
|
+
* 1. Declaration: `class X extends schemaFactory.object("x", {}) {}`
|
|
141
|
+
*
|
|
142
|
+
* 2. Allows adding "local" (non-persisted) members: Yes. Members (including methods) can be added to the class.
|
|
143
|
+
*
|
|
144
|
+
* 3. Prototype: The user-defined class.
|
|
145
|
+
*
|
|
146
|
+
* 4. Structurally named Schema: Not Supported.
|
|
147
|
+
*
|
|
148
|
+
* 5. Explicitly named Objects: Supported.
|
|
149
|
+
*
|
|
150
|
+
* 6. Explicitly named Maps and Arrays: Supported: Both declaration approaches can be used.
|
|
151
|
+
*
|
|
152
|
+
* 7. Node.js `assert.deepEqual`: Compares like class instances: equal to other nodes of the same type with the same content, including custom local fields.
|
|
153
|
+
*
|
|
154
|
+
* 8. IntelliSense: Shows and links to user-defined class by name: `X`.
|
|
155
|
+
*
|
|
156
|
+
* 9. Recursion: Supported with special declaration patterns.
|
|
157
|
+
*
|
|
158
|
+
* POJO Emulation Approach:
|
|
159
|
+
*
|
|
160
|
+
* 1. Declaration: `const X = schemaFactory.object("x", {}); type X = NodeFromSchema<typeof X>;`
|
|
161
|
+
*
|
|
162
|
+
* 2. Allows adding "local" (non-persisted) members: No. Attempting to set non-field members will result in an error.
|
|
163
|
+
*
|
|
164
|
+
* 3. Prototype: `Object.prototype`, `Map.prototype`, or `Array.prototype` depending on node kind.
|
|
165
|
+
*
|
|
166
|
+
* 4. Structurally named Schema: Supported.
|
|
167
|
+
*
|
|
168
|
+
* 5. Explicitly named Objects: Supported.
|
|
169
|
+
*
|
|
170
|
+
* 6. Explicitly named Maps and Arrays: Not Supported.
|
|
171
|
+
*
|
|
172
|
+
* 7. Node.js `assert.deepEqual`: Compares like plain objects: equal to plain JavaScript objects with the same fields, and other nodes with the same fields, even if the types are different.
|
|
173
|
+
*
|
|
174
|
+
* 8. IntelliSense: Shows internal type generation logic: `object & TreeNode & ObjectFromSchemaRecord<{}> & WithType<"test.x">`.
|
|
175
|
+
*
|
|
176
|
+
* 9. Recursion: Unsupported: Generated `.d.ts` files replace recursive references with `any`, breaking the use of recursive schema across compilation boundaries.
|
|
148
177
|
*
|
|
149
178
|
* Note that while "POJO Emulation" nodes act a lot like POJO objects, they are not true POJO objects:
|
|
150
179
|
*
|
|
@@ -165,6 +194,8 @@ export type ScopedSchemaName<
|
|
|
165
194
|
* Allowing (or banning) custom/out-of-schema properties on the class is also possible in both modes: it could be orthogonal.
|
|
166
195
|
* Also for consistency, if keeping the current approach to detecting `POJO Emulation` mode it might make sense to make explicitly named Maps and Arrays do the detection the same as how object does it.
|
|
167
196
|
*
|
|
197
|
+
* Note: the comparison between the customizable and POJO modes is not done in a table because TSDoc does not currently have support for embedded markdown.
|
|
198
|
+
*
|
|
168
199
|
* @sealed @public
|
|
169
200
|
*/
|
|
170
201
|
export class SchemaFactory<
|
|
@@ -748,7 +779,7 @@ export function structuralName<const T extends string>(
|
|
|
748
779
|
names.sort();
|
|
749
780
|
// Ensure name can't have collisions by quoting and escaping any quotes in the names of types.
|
|
750
781
|
// Using JSON is a simple way to accomplish this.
|
|
751
|
-
// The outer `[]` around the result
|
|
782
|
+
// The outer `[]` around the result were needed so that a single type name "Any" would not collide with the "any" case which used to exist.
|
|
752
783
|
inner = JSON.stringify(names);
|
|
753
784
|
}
|
|
754
785
|
return `${collectionName}<${inner}>`;
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type { ValueSchema } from "
|
|
7
|
-
import type { NodeKind } from "
|
|
8
|
-
import type { FieldKind } from "
|
|
6
|
+
import type { ValueSchema } from "../../core/index.js";
|
|
7
|
+
import type { NodeKind } from "../core/index.js";
|
|
8
|
+
import type { FieldKind } from "../schemaTypes.js";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Base interface for all {@link SimpleNodeSchema} implementations.
|
|
@@ -28,7 +28,7 @@ export interface SimpleNodeSchemaBase<TNodeKind extends NodeKind> {
|
|
|
28
28
|
*/
|
|
29
29
|
export interface SimpleObjectNodeSchema extends SimpleNodeSchemaBase<NodeKind.Object> {
|
|
30
30
|
/**
|
|
31
|
-
* Schemas for each of the object's fields, keyed off of schema's
|
|
31
|
+
* Schemas for each of the object's fields, keyed off of schema's property keys.
|
|
32
32
|
*/
|
|
33
33
|
readonly fields: Record<string, SimpleFieldSchema>;
|
|
34
34
|
}
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
import { unreachableCase } from "@fluidframework/core-utils/internal";
|
|
7
7
|
import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
8
|
-
import { ValueSchema } from "
|
|
9
|
-
import { getOrCreate } from "
|
|
8
|
+
import { ValueSchema } from "../../core/index.js";
|
|
9
|
+
import { getOrCreate } from "../../util/index.js";
|
|
10
10
|
import type {
|
|
11
11
|
JsonArrayNodeSchema,
|
|
12
12
|
JsonFieldSchema,
|
|
@@ -19,7 +19,7 @@ import type {
|
|
|
19
19
|
JsonTreeSchema,
|
|
20
20
|
JsonLeafSchemaType,
|
|
21
21
|
} from "./jsonSchema.js";
|
|
22
|
-
import { FieldKind } from "
|
|
22
|
+
import { FieldKind } from "../schemaTypes.js";
|
|
23
23
|
import type {
|
|
24
24
|
SimpleArrayNodeSchema,
|
|
25
25
|
SimpleLeafNodeSchema,
|
|
@@ -28,7 +28,7 @@ import type {
|
|
|
28
28
|
SimpleObjectNodeSchema,
|
|
29
29
|
SimpleTreeSchema,
|
|
30
30
|
} from "./simpleSchema.js";
|
|
31
|
-
import { NodeKind } from "
|
|
31
|
+
import { NodeKind } from "../core/index.js";
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* Generates a JSON Schema representation from a simple tree schema.
|
|
@@ -6,18 +6,14 @@
|
|
|
6
6
|
import type { IFluidLoadable, IDisposable } from "@fluidframework/core-interfaces";
|
|
7
7
|
import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
8
8
|
|
|
9
|
-
import type { CommitMetadata } from "../../core/index.js";
|
|
9
|
+
import type { CommitMetadata, RevertibleFactory } from "../../core/index.js";
|
|
10
10
|
import type { Listenable } from "../../events/index.js";
|
|
11
|
-
import type { RevertibleFactory } from "../../shared-tree/index.js";
|
|
12
11
|
|
|
13
12
|
import {
|
|
14
|
-
type ImplicitAllowedTypes,
|
|
15
|
-
normalizeFieldSchema,
|
|
16
13
|
type ImplicitFieldSchema,
|
|
17
14
|
type InsertableTreeFieldFromImplicitField,
|
|
18
15
|
type TreeFieldFromImplicitField,
|
|
19
16
|
FieldKind,
|
|
20
|
-
normalizeAllowedTypes,
|
|
21
17
|
} from "../schemaTypes.js";
|
|
22
18
|
import { NodeKind, type TreeNodeSchema } from "../core/index.js";
|
|
23
19
|
import { toFlexSchema } from "../toFlexSchema.js";
|
|
@@ -27,6 +23,7 @@ import { isObjectNodeSchema, type ObjectNodeSchema } from "../objectNodeTypes.js
|
|
|
27
23
|
import { markSchemaMostDerived } from "./schemaFactory.js";
|
|
28
24
|
import { fail, getOrCreate } from "../../util/index.js";
|
|
29
25
|
import type { MakeNominal } from "../../util/index.js";
|
|
26
|
+
import { walkFieldSchema } from "../walkSchema.js";
|
|
30
27
|
/**
|
|
31
28
|
* Channel for a Fluid Tree DDS.
|
|
32
29
|
* @remarks
|
|
@@ -343,72 +340,6 @@ export function checkUnion(union: Iterable<TreeNodeSchema>, errors: string[]): v
|
|
|
343
340
|
}
|
|
344
341
|
}
|
|
345
342
|
|
|
346
|
-
export function walkNodeSchema(
|
|
347
|
-
schema: TreeNodeSchema,
|
|
348
|
-
visitor: SchemaVisitor,
|
|
349
|
-
visitedSet: Set<TreeNodeSchema>,
|
|
350
|
-
): void {
|
|
351
|
-
if (visitedSet.has(schema)) {
|
|
352
|
-
return;
|
|
353
|
-
}
|
|
354
|
-
visitedSet.add(schema);
|
|
355
|
-
if (schema instanceof LeafNodeSchema) {
|
|
356
|
-
// nothing to do
|
|
357
|
-
} else if (isObjectNodeSchema(schema)) {
|
|
358
|
-
for (const field of schema.fields.values()) {
|
|
359
|
-
walkFieldSchema(field, visitor, visitedSet);
|
|
360
|
-
}
|
|
361
|
-
} else {
|
|
362
|
-
assert(
|
|
363
|
-
schema.kind === NodeKind.Array || schema.kind === NodeKind.Map,
|
|
364
|
-
0x9b3 /* invalid schema */,
|
|
365
|
-
);
|
|
366
|
-
const childTypes = schema.info as ImplicitAllowedTypes;
|
|
367
|
-
walkAllowedTypes(normalizeAllowedTypes(childTypes), visitor, visitedSet);
|
|
368
|
-
}
|
|
369
|
-
// This visit is done at the end so the traversal order is most inner types first.
|
|
370
|
-
// This was picked since when fixing errors,
|
|
371
|
-
// working from the inner types out to the types that use them will probably go better than the reverse.
|
|
372
|
-
// This does not however ensure all types referenced by a type are visited before it, since in recursive cases thats impossible.
|
|
373
|
-
visitor.node?.(schema);
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
export function walkFieldSchema(
|
|
377
|
-
schema: ImplicitFieldSchema,
|
|
378
|
-
visitor: SchemaVisitor,
|
|
379
|
-
visitedSet: Set<TreeNodeSchema> = new Set(),
|
|
380
|
-
): void {
|
|
381
|
-
walkAllowedTypes(normalizeFieldSchema(schema).allowedTypeSet, visitor, visitedSet);
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
export function walkAllowedTypes(
|
|
385
|
-
allowedTypes: Iterable<TreeNodeSchema>,
|
|
386
|
-
visitor: SchemaVisitor,
|
|
387
|
-
visitedSet: Set<TreeNodeSchema>,
|
|
388
|
-
): void {
|
|
389
|
-
for (const childType of allowedTypes) {
|
|
390
|
-
walkNodeSchema(childType, visitor, visitedSet);
|
|
391
|
-
}
|
|
392
|
-
visitor.allowedTypes?.(allowedTypes);
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
/**
|
|
396
|
-
* Callbacks for use in {@link walkFieldSchema} / {@link walkAllowedTypes} / {@link walkNodeSchema}.
|
|
397
|
-
*/
|
|
398
|
-
export interface SchemaVisitor {
|
|
399
|
-
/**
|
|
400
|
-
* Called once for each node schema.
|
|
401
|
-
*/
|
|
402
|
-
node?: (schema: TreeNodeSchema) => void;
|
|
403
|
-
/**
|
|
404
|
-
* Called once for each set of allowed types.
|
|
405
|
-
* Includes implicit allowed types (when a single type was used instead of an array).
|
|
406
|
-
*
|
|
407
|
-
* This includes every field, but also the allowed types array for maps and arrays and the root if starting at {@link walkAllowedTypes}.
|
|
408
|
-
*/
|
|
409
|
-
allowedTypes?: (allowedTypes: Iterable<TreeNodeSchema>) => void;
|
|
410
|
-
}
|
|
411
|
-
|
|
412
343
|
/**
|
|
413
344
|
* An editable view of a (version control style) branch of a shared tree based on some schema.
|
|
414
345
|
*
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { NodeKind, TreeChangeEvents, TreeNode, WithType } from "../core/index.js";
|
|
7
|
+
import { treeNodeApi } from "./treeNodeApi.js";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Data included for {@link TreeChangeEventsBeta.nodeChanged}.
|
|
11
|
+
* @sealed @beta
|
|
12
|
+
*/
|
|
13
|
+
export interface NodeChangedData<TNode extends TreeNode = TreeNode> {
|
|
14
|
+
/**
|
|
15
|
+
* When the node changed is an object or Map node, this lists all the properties which changed.
|
|
16
|
+
* @remarks
|
|
17
|
+
* This only includes changes to the node itself (which would trigger {@link TreeChangeEvents.nodeChanged}).
|
|
18
|
+
*
|
|
19
|
+
* Set to `undefined` when the {@link NodeKind} does not support this feature (currently just ArrayNodes).
|
|
20
|
+
*
|
|
21
|
+
* When defined, the set should never be empty, since `nodeChanged` will only be triggered when there is a change, and for the supported node types, the only things that can change are properties.
|
|
22
|
+
*/
|
|
23
|
+
readonly changedProperties?: ReadonlySet<
|
|
24
|
+
// For Object nodes, make changedProperties required and strongly typed with the property names from the schema:
|
|
25
|
+
TNode extends WithType<string, NodeKind.Object, infer TInfo>
|
|
26
|
+
? string & keyof TInfo
|
|
27
|
+
: string
|
|
28
|
+
>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Extensions to {@link TreeChangeEvents} which are not yet stable.
|
|
33
|
+
*
|
|
34
|
+
* @sealed @beta
|
|
35
|
+
*/
|
|
36
|
+
export interface TreeChangeEventsBeta<TNode extends TreeNode = TreeNode>
|
|
37
|
+
extends TreeChangeEvents {
|
|
38
|
+
/**
|
|
39
|
+
* Emitted by a node after a batch of changes has been applied to the tree, if any of the changes affected the node.
|
|
40
|
+
*
|
|
41
|
+
* - Object nodes define a change as being when the value of one of its properties changes (i.e., the property's value is set, including when set to `undefined`).
|
|
42
|
+
*
|
|
43
|
+
* - Array nodes define a change as when an element is added, removed, moved or replaced.
|
|
44
|
+
*
|
|
45
|
+
* - Map nodes define a change as when an entry is added, updated, or removed.
|
|
46
|
+
*
|
|
47
|
+
* @remarks
|
|
48
|
+
* This event is not emitted when:
|
|
49
|
+
*
|
|
50
|
+
* - Properties of a child node change. Notably, updates to an array node or a map node (like adding or removing
|
|
51
|
+
* elements/entries) will emit this event on the array/map node itself, but not on the node that contains the
|
|
52
|
+
* array/map node as one of its properties.
|
|
53
|
+
*
|
|
54
|
+
* - The node is moved to a different location in the tree or removed from the tree.
|
|
55
|
+
* In this case the event is emitted on the _parent_ node, not the node itself.
|
|
56
|
+
*
|
|
57
|
+
* For remote edits, this event is not guaranteed to occur in the same order or quantity that it did in
|
|
58
|
+
* the client that made the original edit.
|
|
59
|
+
*
|
|
60
|
+
* When the event is emitted, the tree is guaranteed to be in-schema.
|
|
61
|
+
*
|
|
62
|
+
* @privateRemarks
|
|
63
|
+
* This event occurs whenever the apparent contents of the node instance change, regardless of what caused the change.
|
|
64
|
+
* For example, it will fire when the local client reassigns a child, when part of a remote edit is applied to the
|
|
65
|
+
* node, or when the node has to be updated due to resolution of a merge conflict
|
|
66
|
+
* (for example a previously applied local change might be undone, then reapplied differently or not at all).
|
|
67
|
+
*
|
|
68
|
+
* TODO: define and document event ordering (ex: bottom up, with nodeChanged before treeChange on each level).
|
|
69
|
+
*
|
|
70
|
+
* This defines a property which is a function instead of using the method syntax to avoid function bi-variance issues with the input data to the callback.
|
|
71
|
+
*/
|
|
72
|
+
nodeChanged: (
|
|
73
|
+
data: NodeChangedData<TNode> &
|
|
74
|
+
// For object and Map nodes, make properties specific to them required instead of optional:
|
|
75
|
+
(TNode extends WithType<string, NodeKind.Map | NodeKind.Object>
|
|
76
|
+
? Required<Pick<NodeChangedData<TNode>, "changedProperties">>
|
|
77
|
+
: unknown),
|
|
78
|
+
) => void;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Extensions to {@link Tree} which are not yet stable.
|
|
83
|
+
* @sealed @beta
|
|
84
|
+
*/
|
|
85
|
+
export const TreeBeta = {
|
|
86
|
+
/**
|
|
87
|
+
* Register an event listener on the given node.
|
|
88
|
+
* @param node - The node whose events should be subscribed to.
|
|
89
|
+
* @param eventName - Which event to subscribe to.
|
|
90
|
+
* @param listener - The callback to trigger for the event. The tree can be read during the callback, but it is invalid to modify the tree during this callback.
|
|
91
|
+
* @returns A callback function which will deregister the event.
|
|
92
|
+
* This callback should be called only once.
|
|
93
|
+
*/
|
|
94
|
+
on<K extends keyof TreeChangeEventsBeta<TNode>, TNode extends TreeNode>(
|
|
95
|
+
node: TNode,
|
|
96
|
+
eventName: K,
|
|
97
|
+
listener: NoInfer<TreeChangeEventsBeta<TNode>[K]>,
|
|
98
|
+
): () => void {
|
|
99
|
+
return treeNodeApi.on(node, eventName, listener);
|
|
100
|
+
},
|
|
101
|
+
} as const;
|