@fluidframework/tree 2.2.0 → 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 -6
- package/api-report/tree.beta.api.md +21 -6
- 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 +6 -6
- package/dist/alpha.d.ts +102 -0
- package/dist/beta.d.ts +6 -1
- 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 +4 -6
- package/dist/core/tree/anchorSet.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.js +15 -1
- 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} +49 -28
- 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 -35
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.js +82 -115
- 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 -281
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js +15 -32
- 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 +1 -3
- 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 -29
- package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +11 -17
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts +6 -34
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.js +23 -159
- 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 -13
- 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 +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +83 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -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.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.js +51 -21
- 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 +33 -38
- package/dist/simple-tree/arrayNode.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +2 -2
- 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 +78 -7
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +219 -30
- 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 +23 -8
- 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 -1
- 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 +4 -6
- package/lib/core/tree/anchorSet.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.js +15 -1
- 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} +49 -27
- 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 -35
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.js +83 -116
- 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 -281
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js +15 -31
- 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 +2 -2
- 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 -29
- package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +11 -16
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts +6 -34
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.js +24 -156
- 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 +3 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +83 -0
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -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.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.js +53 -23
- 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 +36 -41
- package/lib/simple-tree/arrayNode.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +2 -2
- 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 +78 -7
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +211 -24
- 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 +23 -8
- 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 +58 -36
- 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 +35 -9
- package/src/core/tree/detachedFieldIndex.ts +6 -5
- package/src/core/tree/visitDelta.ts +7 -2
- package/src/events/{events.ts → emitter.ts} +55 -134
- 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 -231
- 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 -458
- package/src/feature-libraries/flex-tree/index.ts +7 -29
- package/src/feature-libraries/flex-tree/lazyEntity.ts +2 -11
- package/src/feature-libraries/flex-tree/lazyField.ts +49 -79
- package/src/feature-libraries/flex-tree/lazyNode.ts +26 -306
- 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 -41
- 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 +5 -1
- 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 +63 -22
- 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 +38 -41
- package/src/simple-tree/core/index.ts +4 -0
- package/src/simple-tree/core/schemaCaching.ts +10 -0
- package/src/simple-tree/core/treeNodeKernel.ts +279 -27
- package/src/simple-tree/core/treeNodeSchema.ts +1 -1
- package/src/simple-tree/core/types.ts +23 -8
- package/src/simple-tree/core/withType.ts +3 -1
- package/src/simple-tree/index.ts +29 -20
- 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 -201
- 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 -201
- 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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schemaBuilder.js","sourceRoot":"","sources":["../../src/feature-libraries/schemaBuilder.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,wDAAuD;AACvD,iEAAsF;AACtF,sDAAyD;AAEzD;;;;GAIG;AACH,MAAa,qBAEX,SAAQ,wCAAqD;IAC9D,YAAmB,OAAqC;QACvD,KAAK,CAAC,qBAAU,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACrC,CAAC;IAED;;;;;;;;;;;;OAYG;IACI,IAAI,CACV,IAAU,EACV,CAAI;QAEJ,MAAM,MAAM,GAAG,yBAAc,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;QACjE,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QAC3B,OAAO,MAAM,CAAC;IACf,CAAC;CACD;AA5BD,sDA4BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ValueSchema } from \"../core/index.js\";\n\nimport { FieldKinds } from \"./default-schema/index.js\";\nimport { SchemaBuilderBase, type SchemaBuilderOptions } from \"./schemaBuilderBase.js\";\nimport { LeafNodeSchema } from \"./typed-schema/index.js\";\n\n/**\n * Extends {@link SchemaBuilderBase} with functionality only used to create built in special libraries.\n * Defaults to \"required\" fields.\n * @privateRemarks Should not be package exported.\n */\nexport class SchemaBuilderInternal<\n\tTScope extends `com.fluidframework.${string}`,\n> extends SchemaBuilderBase<TScope, typeof FieldKinds.required> {\n\tpublic constructor(options: SchemaBuilderOptions<TScope>) {\n\t\tsuper(FieldKinds.required, options);\n\t}\n\n\t/**\n\t * Define (and add to this library) a {@link TreeNodeSchema} for a node that wraps a value.\n\t * Such nodes will be implicitly unwrapped to the value in some APIs.\n\t *\n\t * The name must be unique among all TreeNodeSchema in the the document schema.\n\t *\n\t * In addition to the normal properties of all nodes (having a schema for example),\n\t * Leaf nodes only contain a value.\n\t * Leaf nodes cannot have fields.\n\t *\n\t * TODO: Maybe ban undefined from allowed values here.\n\t * TODO: Decide and document how unwrapping works for non-primitive terminals.\n\t */\n\tpublic leaf<Name extends string, const T extends ValueSchema>(\n\t\tname: Name,\n\t\tt: T,\n\t): LeafNodeSchema<`${TScope}.${Name}`, T> {\n\t\tconst schema = LeafNodeSchema.create(this, this.scoped(name), t);\n\t\tthis.addNodeSchema(schema);\n\t\treturn schema;\n\t}\n}\n"]}
|
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import type { TreeNodeSchemaIdentifier } from "../core/index.js";
|
|
6
|
-
import { type Assume, type RestrictiveReadonlyRecord } from "../util/index.js";
|
|
7
|
-
import type { FlexFieldKind } from "./modular-schema/index.js";
|
|
8
|
-
import { Any, type FlexAllowedTypes, FlexFieldSchema, type FlexList, type FlexMapFieldSchema, FlexMapNodeSchema, FlexObjectNodeSchema, type FlexTreeNodeSchema, type FlexTreeSchema, type SchemaCollection, type SchemaLibraryData, type SchemaLintConfiguration, type Unenforced } from "./typed-schema/index.js";
|
|
9
|
-
/**
|
|
10
|
-
* Configuration for a SchemaBuilder.
|
|
11
|
-
*/
|
|
12
|
-
export interface SchemaBuilderOptions<TScope extends string = string> {
|
|
13
|
-
/**
|
|
14
|
-
* Prefix appended to the identifiers of all {@link FlexTreeNodeSchema} produced by this builder.
|
|
15
|
-
* Use of [Reverse domain name notation](https://en.wikipedia.org/wiki/Reverse_domain_name_notation) or a UUIDv4 is recommended to avoid collisions.
|
|
16
|
-
*/
|
|
17
|
-
scope: TScope;
|
|
18
|
-
/**
|
|
19
|
-
* Name used to refer to this builder in error messages.
|
|
20
|
-
* Has no impact on the actual generated schema.
|
|
21
|
-
* Defaults to scope.
|
|
22
|
-
*/
|
|
23
|
-
name?: string;
|
|
24
|
-
/**
|
|
25
|
-
* Optional configuration for "linting".
|
|
26
|
-
* See {@link SchemaLintConfiguration}. Currently defaults to enabling all lints.
|
|
27
|
-
*/
|
|
28
|
-
lint?: Partial<SchemaLintConfiguration>;
|
|
29
|
-
/**
|
|
30
|
-
* Libraries to include in this one.
|
|
31
|
-
*
|
|
32
|
-
* @remarks
|
|
33
|
-
* Unlike adding of individual schema, adding of libraries is idempotent.
|
|
34
|
-
* If a single library is added multiple times (even indirectly via libraries it was added into),
|
|
35
|
-
* only a single copy will be included, so they will not conflict.
|
|
36
|
-
* This allows adding any library this one depends on without risk of conflicts for users of this library.
|
|
37
|
-
* Contents within the added libraries can still conflict however.
|
|
38
|
-
* Such errors will be reported when finalizing this builder into a library or document schema.
|
|
39
|
-
*/
|
|
40
|
-
libraries?: SchemaLibrary[];
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Builds schema libraries, and the schema within them.
|
|
44
|
-
* *
|
|
45
|
-
* @privateRemarks
|
|
46
|
-
* This class does not directly depend on any specific field kinds,
|
|
47
|
-
* or bake in any defaults that might have compatibility implications.
|
|
48
|
-
* All use of such implicit defaults is done by subclasses, which thus get versioning implications.
|
|
49
|
-
*/
|
|
50
|
-
export declare class SchemaBuilderBase<TScope extends string, TDefaultKind extends FlexFieldKind, TName extends number | string = string> {
|
|
51
|
-
private readonly defaultKind;
|
|
52
|
-
private readonly lintConfiguration;
|
|
53
|
-
private readonly libraries;
|
|
54
|
-
private finalized;
|
|
55
|
-
private readonly treeNodeSchema;
|
|
56
|
-
private readonly adapters;
|
|
57
|
-
/**
|
|
58
|
-
* Prefix appended to the identifiers of all {@link FlexTreeNodeSchema} produced by this builder.
|
|
59
|
-
*/
|
|
60
|
-
readonly scope: TScope;
|
|
61
|
-
/**
|
|
62
|
-
* Used in error messages to identify content produced by this builder.
|
|
63
|
-
*/
|
|
64
|
-
readonly name: string;
|
|
65
|
-
/**
|
|
66
|
-
* @param defaultKind - The default field kind to use when inferring a {@link FlexFieldSchema} from {@link FlexImplicitAllowedTypes}.
|
|
67
|
-
*/
|
|
68
|
-
constructor(defaultKind: TDefaultKind, options: SchemaBuilderOptions<TScope>);
|
|
69
|
-
protected scoped<Name extends TName>(name: Name): TreeNodeSchemaIdentifier<`${TScope}.${Name}`>;
|
|
70
|
-
/**
|
|
71
|
-
* Adds more libraries to this one.
|
|
72
|
-
*
|
|
73
|
-
* Unlike adding of individual schema, adding of libraries is idempotent.
|
|
74
|
-
* If a single library is added multiple times (even indirectly via libraries it was added into),
|
|
75
|
-
* only a single copy will be included, so they will not conflict.
|
|
76
|
-
* This allows adding any library this one depends on without risk of conflicts for users of this library.
|
|
77
|
-
* Contents within the added libraries can still conflict however.
|
|
78
|
-
* Such errors will be reported when finalizing this builder into a library of document schema.
|
|
79
|
-
*/
|
|
80
|
-
private addLibraries;
|
|
81
|
-
protected addNodeSchema<T extends FlexTreeNodeSchema>(schema: T): void;
|
|
82
|
-
private finalizeCommon;
|
|
83
|
-
/**
|
|
84
|
-
* Produce SchemaLibraries which capture the content added to this builder, as well as any additional SchemaLibraries that were added to it.
|
|
85
|
-
* May only be called once after adding content to builder is complete.
|
|
86
|
-
*/
|
|
87
|
-
intoLibrary(): SchemaLibrary;
|
|
88
|
-
/**
|
|
89
|
-
* Produce a TreeSchema which captures the content added to this builder, any additional SchemaLibraries that were added to it and a root field.
|
|
90
|
-
* Can be used with schematize to provide schema aware access to document content.
|
|
91
|
-
*
|
|
92
|
-
* @remarks
|
|
93
|
-
* May only be called once after adding content to builder is complete.
|
|
94
|
-
*/
|
|
95
|
-
intoSchema<const TSchema extends FlexImplicitFieldSchema>(root: TSchema): FlexTreeSchema<NormalizeField<TSchema, TDefaultKind>>;
|
|
96
|
-
/**
|
|
97
|
-
* Define (and add to this library) a {@link FlexObjectNodeSchema}.
|
|
98
|
-
*
|
|
99
|
-
* The name must be unique among all TreeNodeSchema in the the document schema.
|
|
100
|
-
*/
|
|
101
|
-
object<const Name extends TName, const T extends RestrictiveReadonlyRecord<string, FlexImplicitFieldSchema>>(name: Name, t: T): FlexObjectNodeSchema<`${TScope}.${Name}`, {
|
|
102
|
-
[key in keyof T]: NormalizeField<T[key], TDefaultKind>;
|
|
103
|
-
}>;
|
|
104
|
-
/**
|
|
105
|
-
* Same as `object` but with less type safety and works for recursive objects.
|
|
106
|
-
* Reduced type safety is a side effect of a workaround for a TypeScript limitation.
|
|
107
|
-
*
|
|
108
|
-
* See {@link Unenforced} for details.
|
|
109
|
-
*
|
|
110
|
-
* TODO: Make this work with ImplicitFieldSchema.
|
|
111
|
-
*/
|
|
112
|
-
objectRecursive<const Name extends TName, const T extends Unenforced<RestrictiveReadonlyRecord<string, FlexImplicitFieldSchema>>>(name: Name, t: T): FlexObjectNodeSchema<`${TScope}.${Name}`, T>;
|
|
113
|
-
/**
|
|
114
|
-
* Define (and add to this library) a {@link FlexMapNodeSchema}.
|
|
115
|
-
*/
|
|
116
|
-
map<Name extends TName, const T extends FlexMapFieldSchema>(name: Name, fieldSchema: T): FlexMapNodeSchema<`${TScope}.${Name}`, T>;
|
|
117
|
-
/**
|
|
118
|
-
* Same as `map` but with less type safety and works for recursive objects.
|
|
119
|
-
* Reduced type safety is a side effect of a workaround for a TypeScript limitation.
|
|
120
|
-
*
|
|
121
|
-
* See {@link Unenforced} for details.
|
|
122
|
-
*
|
|
123
|
-
* TODO: Make this work with ImplicitFieldSchema.
|
|
124
|
-
*/
|
|
125
|
-
mapRecursive<Name extends TName, const T extends Unenforced<FlexMapFieldSchema>>(name: Name, t: T): FlexMapNodeSchema<`${TScope}.${Name}`, T>;
|
|
126
|
-
/**
|
|
127
|
-
* Define a {@link FlexFieldSchema}.
|
|
128
|
-
*
|
|
129
|
-
* @param kind - The [kind](https://en.wikipedia.org/wiki/Kind_(type_theory)) of this field.
|
|
130
|
-
* Determine the multiplicity, viewing and editing APIs as well as the merge resolution policy.
|
|
131
|
-
* @param allowedTypes - What types of children are allowed in this field.
|
|
132
|
-
* @returns a {@link FlexFieldSchema} which can be used as a object field (see {@link SchemaBuilderBase.object}),
|
|
133
|
-
* a map field (see {@link SchemaBuilderBase.map}), a field node (see {@link SchemaBuilderBase.fieldNode}) or the root field (see {@link SchemaBuilderBase.intoSchema}).
|
|
134
|
-
*
|
|
135
|
-
* @privateRemarks
|
|
136
|
-
* TODO:
|
|
137
|
-
* If a solution to TreeFieldSchema not being able to have extends clauses gets found,
|
|
138
|
-
* consider just having users do `new TreeFieldSchema` instead?
|
|
139
|
-
*/
|
|
140
|
-
static field<Kind extends FlexFieldKind, T extends FlexImplicitAllowedTypes>(kind: Kind, allowedTypes: T): FlexFieldSchema<Kind, NormalizeAllowedTypes<T>>;
|
|
141
|
-
/**
|
|
142
|
-
* Define a schema for a field.
|
|
143
|
-
* Same as {@link SchemaBuilderBase.field} but is less type safe and supports recursive types.
|
|
144
|
-
* This API is less safe to work around a [limitation of TypeScript](https://github.com/microsoft/TypeScript/issues/55758).
|
|
145
|
-
*
|
|
146
|
-
* T must extends `AllowedTypes`: This cannot be enforced via TypeScript since such an "extends" clauses cause recursive types to error with:
|
|
147
|
-
* "'theSchema' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer."
|
|
148
|
-
*
|
|
149
|
-
* TODO: Try and find a way to provide a more specific type without triggering the above error.
|
|
150
|
-
*/
|
|
151
|
-
static fieldRecursive<Kind extends FlexFieldKind, T extends FlexList<Unenforced<FlexTreeNodeSchema>>>(kind: Kind, ...allowedTypes: T): FlexFieldSchema<Kind, T>;
|
|
152
|
-
/**
|
|
153
|
-
* Normalizes an {@link FlexImplicitFieldSchema} into a {@link FlexFieldSchema} using this schema builder's `defaultKind`.
|
|
154
|
-
*/
|
|
155
|
-
protected normalizeField<TSchema extends FlexImplicitFieldSchema>(schema: TSchema): NormalizeField<TSchema, TDefaultKind>;
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Schema information collected by a SchemaBuilder, including referenced libraries.
|
|
159
|
-
* Can be aggregated into other libraries by adding to their builders.
|
|
160
|
-
*/
|
|
161
|
-
export interface SchemaLibrary extends SchemaCollection {
|
|
162
|
-
/**
|
|
163
|
-
* Schema data aggregated from a collection of libraries by a SchemaBuilder.
|
|
164
|
-
*/
|
|
165
|
-
readonly libraries: ReadonlySet<SchemaLibraryData>;
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Generalized version of AllowedTypes allowing for more concise expressions in some cases.
|
|
169
|
-
*/
|
|
170
|
-
export type FlexImplicitAllowedTypes = FlexAllowedTypes | FlexTreeNodeSchema | Any;
|
|
171
|
-
/**
|
|
172
|
-
* Normalizes an {@link FlexImplicitAllowedTypes} into {@link FlexAllowedTypes}.
|
|
173
|
-
*/
|
|
174
|
-
export type NormalizeAllowedTypes<TSchema extends FlexImplicitAllowedTypes> = TSchema extends FlexTreeNodeSchema ? readonly [TSchema] : TSchema extends Any ? readonly [Any] : TSchema;
|
|
175
|
-
/**
|
|
176
|
-
* Normalizes an {@link FlexImplicitAllowedTypes} into {@link FlexAllowedTypes}.
|
|
177
|
-
*/
|
|
178
|
-
export declare function normalizeAllowedTypes<TSchema extends FlexImplicitAllowedTypes>(schema: TSchema): NormalizeAllowedTypes<TSchema>;
|
|
179
|
-
/**
|
|
180
|
-
* Normalizes an {@link FlexImplicitFieldSchema} into a {@link FlexFieldSchema}.
|
|
181
|
-
*/
|
|
182
|
-
export type NormalizeField<TSchema extends FlexImplicitFieldSchema, TDefault extends FlexFieldKind> = TSchema extends FlexFieldSchema ? TSchema : FlexFieldSchema<TDefault, NormalizeAllowedTypes<Assume<TSchema, FlexImplicitAllowedTypes>>>;
|
|
183
|
-
/**
|
|
184
|
-
* Normalizes an {@link FlexImplicitFieldSchema} into a {@link FlexFieldSchema}.
|
|
185
|
-
*/
|
|
186
|
-
export declare function normalizeField<TSchema extends FlexImplicitFieldSchema, TDefault extends FlexFieldKind>(schema: TSchema, defaultKind: TDefault): NormalizeField<TSchema, TDefault>;
|
|
187
|
-
/**
|
|
188
|
-
* Type that when combined with a default {@link FlexFieldKind} can be normalized into a {@link FlexFieldSchema}.
|
|
189
|
-
*/
|
|
190
|
-
export type FlexImplicitFieldSchema = FlexFieldSchema | FlexImplicitAllowedTypes;
|
|
191
|
-
//# sourceMappingURL=schemaBuilderBase.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schemaBuilderBase.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/schemaBuilderBase.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAY,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EACN,KAAK,MAAM,EACX,KAAK,yBAAyB,EAE9B,MAAM,kBAAkB,CAAC;AAG1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EACN,GAAG,EACH,KAAK,gBAAgB,EACrB,eAAe,EACf,KAAK,QAAQ,EACb,KAAK,kBAAkB,EACvB,iBAAiB,EACjB,oBAAoB,EACpB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAE5B,KAAK,UAAU,EAGf,MAAM,yBAAyB,CAAC;AAEjC;;GAEG;AACH,MAAM,WAAW,oBAAoB,CAAC,MAAM,SAAS,MAAM,GAAG,MAAM;IACnE;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAExC;;;;;;;;;;OAUG;IACH,SAAS,CAAC,EAAE,aAAa,EAAE,CAAC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
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.normalizeField = exports.normalizeAllowedTypes = exports.SchemaBuilderBase = void 0;
|
|
8
|
-
const internal_1 = require("@fluidframework/core-utils/internal");
|
|
9
|
-
const index_js_1 = require("../util/index.js");
|
|
10
|
-
const index_js_2 = require("./default-schema/index.js");
|
|
11
|
-
const index_js_3 = require("./typed-schema/index.js");
|
|
12
|
-
/**
|
|
13
|
-
* Builds schema libraries, and the schema within them.
|
|
14
|
-
* *
|
|
15
|
-
* @privateRemarks
|
|
16
|
-
* This class does not directly depend on any specific field kinds,
|
|
17
|
-
* or bake in any defaults that might have compatibility implications.
|
|
18
|
-
* All use of such implicit defaults is done by subclasses, which thus get versioning implications.
|
|
19
|
-
*/
|
|
20
|
-
class SchemaBuilderBase {
|
|
21
|
-
/**
|
|
22
|
-
* @param defaultKind - The default field kind to use when inferring a {@link FlexFieldSchema} from {@link FlexImplicitAllowedTypes}.
|
|
23
|
-
*/
|
|
24
|
-
constructor(defaultKind, options) {
|
|
25
|
-
this.defaultKind = defaultKind;
|
|
26
|
-
this.finalized = false;
|
|
27
|
-
this.treeNodeSchema = new Map();
|
|
28
|
-
this.adapters = {};
|
|
29
|
-
this.name = options.name ?? options.scope;
|
|
30
|
-
this.lintConfiguration = { ...index_js_3.schemaLintDefault, ...options.lint };
|
|
31
|
-
this.libraries = new Set();
|
|
32
|
-
this.addLibraries(...(options.libraries ?? []));
|
|
33
|
-
this.scope = options.scope;
|
|
34
|
-
}
|
|
35
|
-
scoped(name) {
|
|
36
|
-
return `${this.scope}.${name}`;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Adds more libraries to this one.
|
|
40
|
-
*
|
|
41
|
-
* Unlike adding of individual schema, adding of libraries is idempotent.
|
|
42
|
-
* If a single library is added multiple times (even indirectly via libraries it was added into),
|
|
43
|
-
* only a single copy will be included, so they will not conflict.
|
|
44
|
-
* This allows adding any library this one depends on without risk of conflicts for users of this library.
|
|
45
|
-
* Contents within the added libraries can still conflict however.
|
|
46
|
-
* Such errors will be reported when finalizing this builder into a library of document schema.
|
|
47
|
-
*/
|
|
48
|
-
addLibraries(...libraries) {
|
|
49
|
-
for (const libs of libraries) {
|
|
50
|
-
for (const lib of libs.libraries) {
|
|
51
|
-
this.libraries.add(lib);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
addNodeSchema(schema) {
|
|
56
|
-
(0, internal_1.assert)(!this.treeNodeSchema.has(schema.name), 0x799 /* Conflicting TreeNodeSchema names */);
|
|
57
|
-
this.treeNodeSchema.set(schema.name, schema);
|
|
58
|
-
}
|
|
59
|
-
finalizeCommon(field) {
|
|
60
|
-
(0, internal_1.assert)(!this.finalized, 0x79a /* SchemaBuilder can only be finalized once. */);
|
|
61
|
-
this.finalized = true;
|
|
62
|
-
this.libraries.add({
|
|
63
|
-
name: this.name,
|
|
64
|
-
nodeSchema: this.treeNodeSchema,
|
|
65
|
-
adapters: this.adapters,
|
|
66
|
-
});
|
|
67
|
-
// Check for errors and aggregate data
|
|
68
|
-
return (0, index_js_3.aggregateSchemaLibraries)(this.name, this.lintConfiguration, this.libraries, field);
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Produce SchemaLibraries which capture the content added to this builder, as well as any additional SchemaLibraries that were added to it.
|
|
72
|
-
* May only be called once after adding content to builder is complete.
|
|
73
|
-
*/
|
|
74
|
-
intoLibrary() {
|
|
75
|
-
const aggregated = this.finalizeCommon();
|
|
76
|
-
// Full library set (instead of just aggregated) is kept since it is required to handle deduplication of libraries included through different paths.
|
|
77
|
-
return { nodeSchema: aggregated.nodeSchema, libraries: this.libraries };
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Produce a TreeSchema which captures the content added to this builder, any additional SchemaLibraries that were added to it and a root field.
|
|
81
|
-
* Can be used with schematize to provide schema aware access to document content.
|
|
82
|
-
*
|
|
83
|
-
* @remarks
|
|
84
|
-
* May only be called once after adding content to builder is complete.
|
|
85
|
-
*/
|
|
86
|
-
intoSchema(root) {
|
|
87
|
-
// return this.toDocumentSchemaInternal(normalizeField(root, DefaultFieldKind));
|
|
88
|
-
const field = this.normalizeField(root);
|
|
89
|
-
const library = this.finalizeCommon(field);
|
|
90
|
-
const typed = {
|
|
91
|
-
nodeSchema: library.nodeSchema,
|
|
92
|
-
adapters: library.adapters,
|
|
93
|
-
rootFieldSchema: field,
|
|
94
|
-
policy: index_js_2.defaultSchemaPolicy,
|
|
95
|
-
};
|
|
96
|
-
return typed;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Define (and add to this library) a {@link FlexObjectNodeSchema}.
|
|
100
|
-
*
|
|
101
|
-
* The name must be unique among all TreeNodeSchema in the the document schema.
|
|
102
|
-
*/
|
|
103
|
-
object(name, t) {
|
|
104
|
-
const schema = index_js_3.FlexObjectNodeSchema.create(this, this.scoped(name), (0, index_js_1.transformObjectMap)(t, (field) => this.normalizeField(field)));
|
|
105
|
-
this.addNodeSchema(schema);
|
|
106
|
-
return schema;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Same as `object` but with less type safety and works for recursive objects.
|
|
110
|
-
* Reduced type safety is a side effect of a workaround for a TypeScript limitation.
|
|
111
|
-
*
|
|
112
|
-
* See {@link Unenforced} for details.
|
|
113
|
-
*
|
|
114
|
-
* TODO: Make this work with ImplicitFieldSchema.
|
|
115
|
-
*/
|
|
116
|
-
objectRecursive(name, t) {
|
|
117
|
-
return this.object(name, t);
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Define (and add to this library) a {@link FlexMapNodeSchema}.
|
|
121
|
-
*/
|
|
122
|
-
map(name, fieldSchema) {
|
|
123
|
-
const schema = index_js_3.FlexMapNodeSchema.create(this, this.scoped(name), fieldSchema);
|
|
124
|
-
this.addNodeSchema(schema);
|
|
125
|
-
return schema;
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Same as `map` but with less type safety and works for recursive objects.
|
|
129
|
-
* Reduced type safety is a side effect of a workaround for a TypeScript limitation.
|
|
130
|
-
*
|
|
131
|
-
* See {@link Unenforced} for details.
|
|
132
|
-
*
|
|
133
|
-
* TODO: Make this work with ImplicitFieldSchema.
|
|
134
|
-
*/
|
|
135
|
-
mapRecursive(name, t) {
|
|
136
|
-
return this.map(name, t);
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Define a {@link FlexFieldSchema}.
|
|
140
|
-
*
|
|
141
|
-
* @param kind - The [kind](https://en.wikipedia.org/wiki/Kind_(type_theory)) of this field.
|
|
142
|
-
* Determine the multiplicity, viewing and editing APIs as well as the merge resolution policy.
|
|
143
|
-
* @param allowedTypes - What types of children are allowed in this field.
|
|
144
|
-
* @returns a {@link FlexFieldSchema} which can be used as a object field (see {@link SchemaBuilderBase.object}),
|
|
145
|
-
* a map field (see {@link SchemaBuilderBase.map}), a field node (see {@link SchemaBuilderBase.fieldNode}) or the root field (see {@link SchemaBuilderBase.intoSchema}).
|
|
146
|
-
*
|
|
147
|
-
* @privateRemarks
|
|
148
|
-
* TODO:
|
|
149
|
-
* If a solution to TreeFieldSchema not being able to have extends clauses gets found,
|
|
150
|
-
* consider just having users do `new TreeFieldSchema` instead?
|
|
151
|
-
*/
|
|
152
|
-
static field(kind, allowedTypes) {
|
|
153
|
-
return index_js_3.FlexFieldSchema.create(kind, normalizeAllowedTypes(allowedTypes));
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Define a schema for a field.
|
|
157
|
-
* Same as {@link SchemaBuilderBase.field} but is less type safe and supports recursive types.
|
|
158
|
-
* This API is less safe to work around a [limitation of TypeScript](https://github.com/microsoft/TypeScript/issues/55758).
|
|
159
|
-
*
|
|
160
|
-
* T must extends `AllowedTypes`: This cannot be enforced via TypeScript since such an "extends" clauses cause recursive types to error with:
|
|
161
|
-
* "'theSchema' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer."
|
|
162
|
-
*
|
|
163
|
-
* TODO: Try and find a way to provide a more specific type without triggering the above error.
|
|
164
|
-
*/
|
|
165
|
-
static fieldRecursive(kind, ...allowedTypes) {
|
|
166
|
-
return index_js_3.FlexFieldSchema.createUnsafe(kind, allowedTypes);
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* Normalizes an {@link FlexImplicitFieldSchema} into a {@link FlexFieldSchema} using this schema builder's `defaultKind`.
|
|
170
|
-
*/
|
|
171
|
-
normalizeField(schema) {
|
|
172
|
-
return normalizeField(schema, this.defaultKind);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
exports.SchemaBuilderBase = SchemaBuilderBase;
|
|
176
|
-
/**
|
|
177
|
-
* Normalizes an {@link FlexImplicitAllowedTypes} into {@link FlexAllowedTypes}.
|
|
178
|
-
*/
|
|
179
|
-
function normalizeAllowedTypes(schema) {
|
|
180
|
-
if (schema === index_js_3.Any) {
|
|
181
|
-
return [index_js_3.Any];
|
|
182
|
-
}
|
|
183
|
-
if (schema instanceof index_js_3.TreeNodeSchemaBase) {
|
|
184
|
-
return [schema];
|
|
185
|
-
}
|
|
186
|
-
(0, internal_1.assert)(Array.isArray(schema), 0x7c6 /* invalid ImplicitAllowedTypes */);
|
|
187
|
-
return schema;
|
|
188
|
-
}
|
|
189
|
-
exports.normalizeAllowedTypes = normalizeAllowedTypes;
|
|
190
|
-
/**
|
|
191
|
-
* Normalizes an {@link FlexImplicitFieldSchema} into a {@link FlexFieldSchema}.
|
|
192
|
-
*/
|
|
193
|
-
function normalizeField(schema, defaultKind) {
|
|
194
|
-
if (schema instanceof index_js_3.FlexFieldSchema) {
|
|
195
|
-
return schema;
|
|
196
|
-
}
|
|
197
|
-
const allowedTypes = normalizeAllowedTypes(schema);
|
|
198
|
-
return index_js_3.FlexFieldSchema.create(defaultKind, allowedTypes);
|
|
199
|
-
}
|
|
200
|
-
exports.normalizeField = normalizeField;
|
|
201
|
-
//# sourceMappingURL=schemaBuilderBase.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schemaBuilderBase.js","sourceRoot":"","sources":["../../src/feature-libraries/schemaBuilderBase.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAG7D,+CAI0B;AAE1B,wDAAgE;AAEhE,sDAiBiC;AAuCjC;;;;;;;GAOG;AACH,MAAa,iBAAiB;IAqB7B;;OAEG;IACH,YACkB,WAAyB,EAC1C,OAAqC;QADpB,gBAAW,GAAX,WAAW,CAAc;QAlBnC,cAAS,GAAY,KAAK,CAAC;QAClB,mBAAc,GAC9B,IAAI,GAAG,EAAE,CAAC;QACM,aAAQ,GAAa,EAAE,CAAC;QAkBxC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,KAAK,CAAC;QAC1C,IAAI,CAAC,iBAAiB,GAAG,EAAE,GAAG,4BAAiB,EAAE,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;QACnE,IAAI,CAAC,SAAS,GAAG,IAAI,GAAG,EAAE,CAAC;QAC3B,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,CAAC;QAChD,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAC5B,CAAC;IAES,MAAM,CACf,IAAU;QAEV,OAAO,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,EAAmD,CAAC;IACjF,CAAC;IAED;;;;;;;;;OASG;IACK,YAAY,CAAC,GAAG,SAA0B;QACjD,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;YAC9B,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;gBAClC,IAAI,CAAC,SAAS,CAAC,GAA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CAAC,cAAc,CAI1B,IAAU,EAAE,GAAG,YAAe;QAC/B,OAAO,0BAAe,CAAC,YAAY,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IACzD,CAAC;IAED;;OAEG;IACO,cAAc,CACvB,MAAe;QAEf,OAAO,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IACjD,CAAC;CACD;AA3OD,8CA2OC;AA4BD;;GAEG;AACH,SAAgB,qBAAqB,CACpC,MAAe;IAEf,IAAI,MAAM,KAAK,cAAG,EAAE,CAAC;QACpB,OAAO,CAAC,cAAG,CAA8C,CAAC;IAC3D,CAAC;IACD,IAAI,MAAM,YAAY,6BAAkB,EAAE,CAAC;QAC1C,OAAO,CAAC,MAAM,CAA8C,CAAC;IAC9D,CAAC;IACD,IAAA,iBAAM,EAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACxE,OAAO,MAAmD,CAAC;AAC5D,CAAC;AAXD,sDAWC;AAeD;;GAEG;AACH,SAAgB,cAAc,CAG5B,MAAe,EAAE,WAAqB;IACvC,IAAI,MAAM,YAAY,0BAAe,EAAE,CAAC;QACvC,OAAO,MAA2C,CAAC;IACpD,CAAC;IACD,MAAM,YAAY,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACnD,OAAO,0BAAe,CAAC,MAAM,CAAC,WAAW,EAAE,YAAY,CAGtD,CAAC;AACH,CAAC;AAZD,wCAYC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport type { Adapters, TreeNodeSchemaIdentifier } from \"../core/index.js\";\nimport {\n\ttype Assume,\n\ttype RestrictiveReadonlyRecord,\n\ttransformObjectMap,\n} from \"../util/index.js\";\n\nimport { defaultSchemaPolicy } from \"./default-schema/index.js\";\nimport type { FlexFieldKind } from \"./modular-schema/index.js\";\nimport {\n\tAny,\n\ttype FlexAllowedTypes,\n\tFlexFieldSchema,\n\ttype FlexList,\n\ttype FlexMapFieldSchema,\n\tFlexMapNodeSchema,\n\tFlexObjectNodeSchema,\n\ttype FlexTreeNodeSchema,\n\ttype FlexTreeSchema,\n\ttype SchemaCollection,\n\ttype SchemaLibraryData,\n\ttype SchemaLintConfiguration,\n\tTreeNodeSchemaBase,\n\ttype Unenforced,\n\taggregateSchemaLibraries,\n\tschemaLintDefault,\n} from \"./typed-schema/index.js\";\n\n/**\n * Configuration for a SchemaBuilder.\n */\nexport interface SchemaBuilderOptions<TScope extends string = string> {\n\t/**\n\t * Prefix appended to the identifiers of all {@link FlexTreeNodeSchema} produced by this builder.\n\t * Use of [Reverse domain name notation](https://en.wikipedia.org/wiki/Reverse_domain_name_notation) or a UUIDv4 is recommended to avoid collisions.\n\t */\n\tscope: TScope;\n\n\t/**\n\t * Name used to refer to this builder in error messages.\n\t * Has no impact on the actual generated schema.\n\t * Defaults to scope.\n\t */\n\tname?: string;\n\n\t/**\n\t * Optional configuration for \"linting\".\n\t * See {@link SchemaLintConfiguration}. Currently defaults to enabling all lints.\n\t */\n\tlint?: Partial<SchemaLintConfiguration>;\n\n\t/**\n\t * Libraries to include in this one.\n\t *\n\t * @remarks\n\t * Unlike adding of individual schema, adding of libraries is idempotent.\n\t * If a single library is added multiple times (even indirectly via libraries it was added into),\n\t * only a single copy will be included, so they will not conflict.\n\t * This allows adding any library this one depends on without risk of conflicts for users of this library.\n\t * Contents within the added libraries can still conflict however.\n\t * Such errors will be reported when finalizing this builder into a library or document schema.\n\t */\n\tlibraries?: SchemaLibrary[];\n}\n\n/**\n * Builds schema libraries, and the schema within them.\n * *\n * @privateRemarks\n * This class does not directly depend on any specific field kinds,\n * or bake in any defaults that might have compatibility implications.\n * All use of such implicit defaults is done by subclasses, which thus get versioning implications.\n */\nexport class SchemaBuilderBase<\n\tTScope extends string,\n\tTDefaultKind extends FlexFieldKind,\n\tTName extends number | string = string,\n> {\n\tprivate readonly lintConfiguration: SchemaLintConfiguration;\n\tprivate readonly libraries: Set<SchemaLibraryData>;\n\tprivate finalized: boolean = false;\n\tprivate readonly treeNodeSchema: Map<TreeNodeSchemaIdentifier, FlexTreeNodeSchema> =\n\t\tnew Map();\n\tprivate readonly adapters: Adapters = {};\n\t/**\n\t * Prefix appended to the identifiers of all {@link FlexTreeNodeSchema} produced by this builder.\n\t */\n\tpublic readonly scope: TScope;\n\n\t/**\n\t * Used in error messages to identify content produced by this builder.\n\t */\n\tpublic readonly name: string;\n\n\t/**\n\t * @param defaultKind - The default field kind to use when inferring a {@link FlexFieldSchema} from {@link FlexImplicitAllowedTypes}.\n\t */\n\tpublic constructor(\n\t\tprivate readonly defaultKind: TDefaultKind,\n\t\toptions: SchemaBuilderOptions<TScope>,\n\t) {\n\t\tthis.name = options.name ?? options.scope;\n\t\tthis.lintConfiguration = { ...schemaLintDefault, ...options.lint };\n\t\tthis.libraries = new Set();\n\t\tthis.addLibraries(...(options.libraries ?? []));\n\t\tthis.scope = options.scope;\n\t}\n\n\tprotected scoped<Name extends TName>(\n\t\tname: Name,\n\t): TreeNodeSchemaIdentifier<`${TScope}.${Name}`> {\n\t\treturn `${this.scope}.${name}` as TreeNodeSchemaIdentifier<`${TScope}.${Name}`>;\n\t}\n\n\t/**\n\t * Adds more libraries to this one.\n\t *\n\t * Unlike adding of individual schema, adding of libraries is idempotent.\n\t * If a single library is added multiple times (even indirectly via libraries it was added into),\n\t * only a single copy will be included, so they will not conflict.\n\t * This allows adding any library this one depends on without risk of conflicts for users of this library.\n\t * Contents within the added libraries can still conflict however.\n\t * Such errors will be reported when finalizing this builder into a library of document schema.\n\t */\n\tprivate addLibraries(...libraries: SchemaLibrary[]): void {\n\t\tfor (const libs of libraries) {\n\t\t\tfor (const lib of libs.libraries) {\n\t\t\t\tthis.libraries.add(lib);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected addNodeSchema<T extends FlexTreeNodeSchema>(schema: T): void {\n\t\tassert(\n\t\t\t!this.treeNodeSchema.has(schema.name),\n\t\t\t0x799 /* Conflicting TreeNodeSchema names */,\n\t\t);\n\t\tthis.treeNodeSchema.set(schema.name, schema);\n\t}\n\n\tprivate finalizeCommon(field?: FlexFieldSchema): SchemaLibraryData {\n\t\tassert(!this.finalized, 0x79a /* SchemaBuilder can only be finalized once. */);\n\t\tthis.finalized = true;\n\t\tthis.libraries.add({\n\t\t\tname: this.name,\n\t\t\tnodeSchema: this.treeNodeSchema,\n\t\t\tadapters: this.adapters,\n\t\t});\n\n\t\t// Check for errors and aggregate data\n\t\treturn aggregateSchemaLibraries(this.name, this.lintConfiguration, this.libraries, field);\n\t}\n\n\t/**\n\t * Produce SchemaLibraries which capture the content added to this builder, as well as any additional SchemaLibraries that were added to it.\n\t * May only be called once after adding content to builder is complete.\n\t */\n\tpublic intoLibrary(): SchemaLibrary {\n\t\tconst aggregated = this.finalizeCommon();\n\n\t\t// Full library set (instead of just aggregated) is kept since it is required to handle deduplication of libraries included through different paths.\n\t\treturn { nodeSchema: aggregated.nodeSchema, libraries: this.libraries };\n\t}\n\n\t/**\n\t * Produce a TreeSchema which captures the content added to this builder, any additional SchemaLibraries that were added to it and a root field.\n\t * Can be used with schematize to provide schema aware access to document content.\n\t *\n\t * @remarks\n\t * May only be called once after adding content to builder is complete.\n\t */\n\tpublic intoSchema<const TSchema extends FlexImplicitFieldSchema>(\n\t\troot: TSchema,\n\t): FlexTreeSchema<NormalizeField<TSchema, TDefaultKind>> {\n\t\t// return this.toDocumentSchemaInternal(normalizeField(root, DefaultFieldKind));\n\t\tconst field: NormalizeField<TSchema, TDefaultKind> = this.normalizeField(root);\n\t\tconst library = this.finalizeCommon(field);\n\n\t\tconst typed: FlexTreeSchema<NormalizeField<TSchema, TDefaultKind>> = {\n\t\t\tnodeSchema: library.nodeSchema,\n\t\t\tadapters: library.adapters,\n\t\t\trootFieldSchema: field,\n\t\t\tpolicy: defaultSchemaPolicy,\n\t\t};\n\t\treturn typed;\n\t}\n\n\t/**\n\t * Define (and add to this library) a {@link FlexObjectNodeSchema}.\n\t *\n\t * The name must be unique among all TreeNodeSchema in the the document schema.\n\t */\n\tpublic object<\n\t\tconst Name extends TName,\n\t\tconst T extends RestrictiveReadonlyRecord<string, FlexImplicitFieldSchema>,\n\t>(\n\t\tname: Name,\n\t\tt: T,\n\t): FlexObjectNodeSchema<\n\t\t`${TScope}.${Name}`,\n\t\t{ [key in keyof T]: NormalizeField<T[key], TDefaultKind> }\n\t> {\n\t\tconst schema = FlexObjectNodeSchema.create(\n\t\t\tthis,\n\t\t\tthis.scoped(name),\n\t\t\ttransformObjectMap(t, (field): FlexFieldSchema => this.normalizeField(field)) as {\n\t\t\t\t[key in keyof T]: NormalizeField<T[key], TDefaultKind>;\n\t\t\t},\n\t\t);\n\t\tthis.addNodeSchema(schema);\n\t\treturn schema;\n\t}\n\n\t/**\n\t * Same as `object` but with less type safety and works for recursive objects.\n\t * Reduced type safety is a side effect of a workaround for a TypeScript limitation.\n\t *\n\t * See {@link Unenforced} for details.\n\t *\n\t * TODO: Make this work with ImplicitFieldSchema.\n\t */\n\tpublic objectRecursive<\n\t\tconst Name extends TName,\n\t\tconst T extends Unenforced<RestrictiveReadonlyRecord<string, FlexImplicitFieldSchema>>,\n\t>(name: Name, t: T): FlexObjectNodeSchema<`${TScope}.${Name}`, T> {\n\t\treturn this.object(\n\t\t\tname,\n\t\t\tt as unknown as RestrictiveReadonlyRecord<string, FlexImplicitFieldSchema>,\n\t\t) as unknown as FlexObjectNodeSchema<`${TScope}.${Name}`, T>;\n\t}\n\n\t/**\n\t * Define (and add to this library) a {@link FlexMapNodeSchema}.\n\t */\n\tpublic map<Name extends TName, const T extends FlexMapFieldSchema>(\n\t\tname: Name,\n\t\tfieldSchema: T,\n\t): FlexMapNodeSchema<`${TScope}.${Name}`, T> {\n\t\tconst schema = FlexMapNodeSchema.create(this, this.scoped(name), fieldSchema);\n\t\tthis.addNodeSchema(schema);\n\t\treturn schema;\n\t}\n\n\t/**\n\t * Same as `map` but with less type safety and works for recursive objects.\n\t * Reduced type safety is a side effect of a workaround for a TypeScript limitation.\n\t *\n\t * See {@link Unenforced} for details.\n\t *\n\t * TODO: Make this work with ImplicitFieldSchema.\n\t */\n\tpublic mapRecursive<Name extends TName, const T extends Unenforced<FlexMapFieldSchema>>(\n\t\tname: Name,\n\t\tt: T,\n\t): FlexMapNodeSchema<`${TScope}.${Name}`, T> {\n\t\treturn this.map(name, t as FlexMapFieldSchema) as FlexMapNodeSchema<\n\t\t\t`${TScope}.${Name}`,\n\t\t\tT\n\t\t>;\n\t}\n\n\t/**\n\t * Define a {@link FlexFieldSchema}.\n\t *\n\t * @param kind - The [kind](https://en.wikipedia.org/wiki/Kind_(type_theory)) of this field.\n\t * Determine the multiplicity, viewing and editing APIs as well as the merge resolution policy.\n\t * @param allowedTypes - What types of children are allowed in this field.\n\t * @returns a {@link FlexFieldSchema} which can be used as a object field (see {@link SchemaBuilderBase.object}),\n\t * a map field (see {@link SchemaBuilderBase.map}), a field node (see {@link SchemaBuilderBase.fieldNode}) or the root field (see {@link SchemaBuilderBase.intoSchema}).\n\t *\n\t * @privateRemarks\n\t * TODO:\n\t * If a solution to TreeFieldSchema not being able to have extends clauses gets found,\n\t * consider just having users do `new TreeFieldSchema` instead?\n\t */\n\tpublic static field<Kind extends FlexFieldKind, T extends FlexImplicitAllowedTypes>(\n\t\tkind: Kind,\n\t\tallowedTypes: T,\n\t): FlexFieldSchema<Kind, NormalizeAllowedTypes<T>> {\n\t\treturn FlexFieldSchema.create(kind, normalizeAllowedTypes(allowedTypes));\n\t}\n\n\t/**\n\t * Define a schema for a field.\n\t * Same as {@link SchemaBuilderBase.field} but is less type safe and supports recursive types.\n\t * This API is less safe to work around a [limitation of TypeScript](https://github.com/microsoft/TypeScript/issues/55758).\n\t *\n\t * T must extends `AllowedTypes`: This cannot be enforced via TypeScript since such an \"extends\" clauses cause recursive types to error with:\n\t * \"'theSchema' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.\"\n\t *\n\t * TODO: Try and find a way to provide a more specific type without triggering the above error.\n\t */\n\tpublic static fieldRecursive<\n\t\tKind extends FlexFieldKind,\n\t\t// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-arguments\n\t\tT extends FlexList<Unenforced<FlexTreeNodeSchema>>,\n\t>(kind: Kind, ...allowedTypes: T): FlexFieldSchema<Kind, T> {\n\t\treturn FlexFieldSchema.createUnsafe(kind, allowedTypes);\n\t}\n\n\t/**\n\t * Normalizes an {@link FlexImplicitFieldSchema} into a {@link FlexFieldSchema} using this schema builder's `defaultKind`.\n\t */\n\tprotected normalizeField<TSchema extends FlexImplicitFieldSchema>(\n\t\tschema: TSchema,\n\t): NormalizeField<TSchema, TDefaultKind> {\n\t\treturn normalizeField(schema, this.defaultKind);\n\t}\n}\n\n/**\n * Schema information collected by a SchemaBuilder, including referenced libraries.\n * Can be aggregated into other libraries by adding to their builders.\n */\nexport interface SchemaLibrary extends SchemaCollection {\n\t/**\n\t * Schema data aggregated from a collection of libraries by a SchemaBuilder.\n\t */\n\treadonly libraries: ReadonlySet<SchemaLibraryData>;\n}\n\n/**\n * Generalized version of AllowedTypes allowing for more concise expressions in some cases.\n */\nexport type FlexImplicitAllowedTypes = FlexAllowedTypes | FlexTreeNodeSchema | Any;\n\n/**\n * Normalizes an {@link FlexImplicitAllowedTypes} into {@link FlexAllowedTypes}.\n */\nexport type NormalizeAllowedTypes<TSchema extends FlexImplicitAllowedTypes> =\n\tTSchema extends FlexTreeNodeSchema\n\t\t? readonly [TSchema]\n\t\t: TSchema extends Any\n\t\t\t? readonly [Any]\n\t\t\t: TSchema;\n\n/**\n * Normalizes an {@link FlexImplicitAllowedTypes} into {@link FlexAllowedTypes}.\n */\nexport function normalizeAllowedTypes<TSchema extends FlexImplicitAllowedTypes>(\n\tschema: TSchema,\n): NormalizeAllowedTypes<TSchema> {\n\tif (schema === Any) {\n\t\treturn [Any] as unknown as NormalizeAllowedTypes<TSchema>;\n\t}\n\tif (schema instanceof TreeNodeSchemaBase) {\n\t\treturn [schema] as unknown as NormalizeAllowedTypes<TSchema>;\n\t}\n\tassert(Array.isArray(schema), 0x7c6 /* invalid ImplicitAllowedTypes */);\n\treturn schema as unknown as NormalizeAllowedTypes<TSchema>;\n}\n\n/**\n * Normalizes an {@link FlexImplicitFieldSchema} into a {@link FlexFieldSchema}.\n */\nexport type NormalizeField<\n\tTSchema extends FlexImplicitFieldSchema,\n\tTDefault extends FlexFieldKind,\n> = TSchema extends FlexFieldSchema\n\t? TSchema\n\t: FlexFieldSchema<\n\t\t\tTDefault,\n\t\t\tNormalizeAllowedTypes<Assume<TSchema, FlexImplicitAllowedTypes>>\n\t\t>;\n\n/**\n * Normalizes an {@link FlexImplicitFieldSchema} into a {@link FlexFieldSchema}.\n */\nexport function normalizeField<\n\tTSchema extends FlexImplicitFieldSchema,\n\tTDefault extends FlexFieldKind,\n>(schema: TSchema, defaultKind: TDefault): NormalizeField<TSchema, TDefault> {\n\tif (schema instanceof FlexFieldSchema) {\n\t\treturn schema as NormalizeField<TSchema, TDefault>;\n\t}\n\tconst allowedTypes = normalizeAllowedTypes(schema);\n\treturn FlexFieldSchema.create(defaultKind, allowedTypes) as unknown as NormalizeField<\n\t\tTSchema,\n\t\tTDefault\n\t>;\n}\n\n/**\n * Type that when combined with a default {@link FlexFieldKind} can be normalized into a {@link FlexFieldSchema}.\n */\nexport type FlexImplicitFieldSchema = FlexFieldSchema | FlexImplicitAllowedTypes;\n"]}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { type Context, type FlexFieldSchema, type FlexTreeContext, type FlexTreeSchema, type FlexTreeTypedField, type NodeKeyManager } from "../feature-libraries/index.js";
|
|
6
|
-
import { type IDisposable, disposeSymbol } from "../util/index.js";
|
|
7
|
-
import type { ITreeCheckout, ITreeCheckoutFork } from "./treeCheckout.js";
|
|
8
|
-
/**
|
|
9
|
-
* The portion of {@link FlexTreeView} that does not depend on the schema's type.
|
|
10
|
-
* @privateRemarks
|
|
11
|
-
* Since {@link FlexTreeView}'s schema is invariant, `FlexTreeView<FlexFieldSchema>` does not cover this use case.
|
|
12
|
-
*/
|
|
13
|
-
export interface FlexTreeViewGeneric extends IDisposable {
|
|
14
|
-
/**
|
|
15
|
-
* Context for controlling the FlexTree nodes produced from {@link FlexTreeView.flexTree}.
|
|
16
|
-
*
|
|
17
|
-
* @remarks
|
|
18
|
-
* This is an owning reference: disposing of this view disposes its context.
|
|
19
|
-
*/
|
|
20
|
-
readonly context: FlexTreeContext;
|
|
21
|
-
/**
|
|
22
|
-
* Access non-view schema specific aspects of of this branch.
|
|
23
|
-
*
|
|
24
|
-
* @remarks
|
|
25
|
-
* This is a non-owning reference: disposing of this view does not impact the branch.
|
|
26
|
-
*/
|
|
27
|
-
readonly checkout: ITreeCheckout;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* An editable view of a (version control style) branch of a shared tree.
|
|
31
|
-
* @privateRemarks
|
|
32
|
-
* TODO:
|
|
33
|
-
* If schema aware APIs are removed from flex tree, this can be combined with {@link FlexTreeViewGeneric}.
|
|
34
|
-
*/
|
|
35
|
-
export interface FlexTreeView<in out TRoot extends FlexFieldSchema> extends FlexTreeViewGeneric {
|
|
36
|
-
/**
|
|
37
|
-
* Get a typed view of the tree content using the flex-tree API.
|
|
38
|
-
*/
|
|
39
|
-
readonly flexTree: FlexTreeTypedField<TRoot>;
|
|
40
|
-
/**
|
|
41
|
-
* Spawn a new view which is based off of the current state of this view.
|
|
42
|
-
* Any mutations of the new view will not apply to this view until the new view is merged back into this view via `merge()`.
|
|
43
|
-
*/
|
|
44
|
-
fork(): ITreeViewFork<TRoot>;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Branch (like in a version control system) of SharedTree.
|
|
48
|
-
*
|
|
49
|
-
* {@link FlexTreeView} that has forked off of the main trunk/branch.
|
|
50
|
-
*/
|
|
51
|
-
export interface ITreeViewFork<in out TRoot extends FlexFieldSchema> extends FlexTreeView<TRoot> {
|
|
52
|
-
readonly checkout: ITreeCheckoutFork;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Implementation of FlexTreeView wrapping a ITreeCheckout.
|
|
56
|
-
*/
|
|
57
|
-
export declare class CheckoutFlexTreeView<in out TRoot extends FlexFieldSchema, out TCheckout extends ITreeCheckout = ITreeCheckout> implements FlexTreeView<TRoot> {
|
|
58
|
-
readonly checkout: TCheckout;
|
|
59
|
-
readonly schema: FlexTreeSchema<TRoot>;
|
|
60
|
-
readonly nodeKeyManager: NodeKeyManager;
|
|
61
|
-
private readonly onDispose?;
|
|
62
|
-
readonly context: Context;
|
|
63
|
-
readonly flexTree: FlexTreeTypedField<TRoot>;
|
|
64
|
-
constructor(checkout: TCheckout, schema: FlexTreeSchema<TRoot>, nodeKeyManager: NodeKeyManager, onDispose?: (() => void) | undefined);
|
|
65
|
-
[disposeSymbol](): void;
|
|
66
|
-
fork(): CheckoutFlexTreeView<TRoot, ITreeCheckout & ITreeCheckoutFork>;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Maps the context of every {@link CheckoutFlexTreeView} to the view.
|
|
70
|
-
* In practice, this allows the view or checkout to be obtained from a flex node by first getting the context from the flex node and then using this map.
|
|
71
|
-
*/
|
|
72
|
-
export declare const contextToTreeView: WeakMap<Context, FlexTreeViewGeneric>;
|
|
73
|
-
//# sourceMappingURL=treeView.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"treeView.d.ts","sourceRoot":"","sources":["../../src/shared-tree/treeView.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,OAAO,EACZ,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,kBAAkB,E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M,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QACpC,OAAO,IAAI,oBAAoB,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IAC3E,CAAC;CACD;AA/BD,oDA+BC;AAED;;;GAGG;AACU,QAAA,iBAAiB,GAAG,IAAI,OAAO,EAAgC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\ttype Context,\n\ttype FlexFieldSchema,\n\ttype FlexTreeContext,\n\ttype FlexTreeSchema,\n\ttype FlexTreeTypedField,\n\ttype NodeKeyManager,\n\tgetTreeContext,\n} from \"../feature-libraries/index.js\";\nimport { tryDisposeTreeNode } from \"../simple-tree/index.js\";\nimport { type IDisposable, disposeSymbol } from \"../util/index.js\";\n\nimport type { ITreeCheckout, ITreeCheckoutFork } from \"./treeCheckout.js\";\n\n/**\n * The portion of {@link FlexTreeView} that does not depend on the schema's type.\n * @privateRemarks\n * Since {@link FlexTreeView}'s schema is invariant, `FlexTreeView<FlexFieldSchema>` does not cover this use case.\n */\nexport interface FlexTreeViewGeneric extends IDisposable {\n\t/**\n\t * Context for controlling the FlexTree nodes produced from {@link FlexTreeView.flexTree}.\n\t *\n\t * @remarks\n\t * This is an owning reference: disposing of this view disposes its context.\n\t */\n\treadonly context: FlexTreeContext;\n\n\t/**\n\t * Access non-view schema specific aspects of of this branch.\n\t *\n\t * @remarks\n\t * This is a non-owning reference: disposing of this view does not impact the branch.\n\t */\n\treadonly checkout: ITreeCheckout;\n}\n\n/**\n * An editable view of a (version control style) branch of a shared tree.\n * @privateRemarks\n * TODO:\n * If schema aware APIs are removed from flex tree, this can be combined with {@link FlexTreeViewGeneric}.\n */\nexport interface FlexTreeView<in out TRoot extends FlexFieldSchema>\n\textends FlexTreeViewGeneric {\n\t/**\n\t * Get a typed view of the tree content using the flex-tree API.\n\t */\n\treadonly flexTree: FlexTreeTypedField<TRoot>;\n\n\t/**\n\t * Spawn a new view which is based off of the current state of this view.\n\t * Any mutations of the new view will not apply to this view until the new view is merged back into this view via `merge()`.\n\t */\n\tfork(): ITreeViewFork<TRoot>;\n}\n\n/**\n * Branch (like in a version control system) of SharedTree.\n *\n * {@link FlexTreeView} that has forked off of the main trunk/branch.\n */\nexport interface ITreeViewFork<in out TRoot extends FlexFieldSchema>\n\textends FlexTreeView<TRoot> {\n\treadonly checkout: ITreeCheckoutFork;\n}\n\n/**\n * Implementation of FlexTreeView wrapping a ITreeCheckout.\n */\nexport class CheckoutFlexTreeView<\n\tin out TRoot extends FlexFieldSchema,\n\tout TCheckout extends ITreeCheckout = ITreeCheckout,\n> implements FlexTreeView<TRoot>\n{\n\tpublic readonly context: Context;\n\tpublic readonly flexTree: FlexTreeTypedField<TRoot>;\n\tpublic constructor(\n\t\tpublic readonly checkout: TCheckout,\n\t\tpublic readonly schema: FlexTreeSchema<TRoot>,\n\t\tpublic readonly nodeKeyManager: NodeKeyManager,\n\t\tprivate readonly onDispose?: () => void,\n\t) {\n\t\tthis.context = getTreeContext(schema, this.checkout, nodeKeyManager);\n\t\tcontextToTreeView.set(this.context, this);\n\t\tthis.flexTree = this.context.root as FlexTreeTypedField<TRoot>;\n\t}\n\n\tpublic [disposeSymbol](): void {\n\t\tfor (const anchorNode of this.checkout.forest.anchors) {\n\t\t\ttryDisposeTreeNode(anchorNode);\n\t\t}\n\n\t\tthis.context[disposeSymbol]();\n\t\tthis.onDispose?.();\n\t}\n\n\tpublic fork(): CheckoutFlexTreeView<TRoot, ITreeCheckout & ITreeCheckoutFork> {\n\t\tconst branch = this.checkout.fork();\n\t\treturn new CheckoutFlexTreeView(branch, this.schema, this.nodeKeyManager);\n\t}\n}\n\n/**\n * Maps the context of every {@link CheckoutFlexTreeView} to the view.\n * In practice, this allows the view or checkout to be obtained from a flex node by first getting the context from the flex node and then using this map.\n */\nexport const contextToTreeView = new WeakMap<Context, FlexTreeViewGeneric>();\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getJsonSchema.d.ts","sourceRoot":"","sources":["../../src/simple-tree/getJsonSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAW7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,oBAAoB,GAAG,cAAc,CAK1E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getJsonSchema.js","sourceRoot":"","sources":["../../src/simple-tree/getJsonSchema.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,+EAA6D;AAC7D,6DAAuD;AACvD,+CAA+C;AAG/C;;GAEG;AACH,MAAM,eAAe,GAAG,IAAI,OAAO,EAAkC,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,SAAgB,aAAa,CAAC,MAA4B;IACzD,OAAO,IAAA,sBAAW,EAAC,eAAe,EAAE,MAAM,EAAE,GAAG,EAAE;QAChD,MAAM,YAAY,GAAG,IAAA,oCAAe,EAAC,MAAM,CAAC,CAAC;QAC7C,OAAO,IAAA,0CAAY,EAAC,YAAY,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;AACJ,CAAC;AALD,sCAKC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { JsonTreeSchema } from \"./jsonSchema.js\";\nimport type { ImplicitAllowedTypes } from \"./schemaTypes.js\";\nimport { toJsonSchema } from \"./simpleSchemaToJsonSchema.js\";\nimport { getSimpleSchema } from \"./getSimpleSchema.js\";\nimport { getOrCreate } from \"../util/index.js\";\nimport type { TreeNodeSchema } from \"./core/index.js\";\n\n/**\n * Cache in which the results of {@link getJsonSchema} are saved.\n */\nconst jsonSchemaCache = new WeakMap<TreeNodeSchema, JsonTreeSchema>();\n\n/**\n * Creates a {@link https://json-schema.org/ | JSON Schema} representation of the provided {@link TreeNodeSchema}.\n *\n * @remarks\n * Useful when communicating the schema to external libraries or services.\n * Caches the result for future calls.\n *\n * @example\n *\n * A Shared Tree schema like the following:\n *\n * ```typescript\n * class MyObject extends schemaFactory.object(\"MyObject\", {\n * \tfoo: schemaFactory.number,\n * \tbar: schemaFactory.optional(schemaFactory.string),\n * });\n * ```\n *\n * Will yield JSON Schema like the following:\n *\n * ```json\n * {\n * \t\"$defs\": {\n * \t\t\"com.fluidframework.leaf.string\": {\n * \t\t\t\"type\": \"string\",\n * \t\t},\n * \t\t\"com.fluidframework.leaf.number\": {\n * \t\t\t\"type\": \"number\",\n * \t\t},\n * \t\t\"com.myapp.MyObject\": {\n * \t\t\t\"type\": \"object\",\n * \t\t\t\"properties\": {\n * \t\t\t\t\"foo\": { \"$ref\": \"com.fluidframework.leaf.number\" },\n * \t\t\t\t\"bar\": { \"$ref\": \"com.fluidframework.leaf.string\" },\n * \t\t\t},\n * \t\t\t\"required\": [\"foo\"],\n * \t\t},\n * \t},\n * \t\"anyOf\": [ { \"$ref\": \"#/$defs/com.myapp.MyObject\" } ],\n * }\n * ```\n *\n * @privateRemarks In the future, we may wish to move this to a more discoverable API location.\n * For now, while still an experimental API, it is surfaced as a free function.\n *\n * @alpha\n */\nexport function getJsonSchema(schema: ImplicitAllowedTypes): JsonTreeSchema {\n\treturn getOrCreate(jsonSchemaCache, schema, () => {\n\t\tconst simpleSchema = getSimpleSchema(schema);\n\t\treturn toJsonSchema(simpleSchema);\n\t});\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getSimpleSchema.d.ts","sourceRoot":"","sources":["../../src/simple-tree/getSimpleSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAQ1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,oBAAoB,GAAG,gBAAgB,CAE9E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getSimpleSchema.js","sourceRoot":"","sources":["../../src/simple-tree/getSimpleSchema.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAA+C;AAI/C,+EAAmE;AAEnE;;GAEG;AACH,MAAM,iBAAiB,GAAG,IAAI,OAAO,EAAoC,CAAC;AAE1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,SAAgB,eAAe,CAAC,MAA4B;IAC3D,OAAO,IAAA,sBAAW,EAAC,iBAAiB,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,IAAA,gDAAkB,EAAC,MAAM,CAAC,CAAC,CAAC;AACjF,CAAC;AAFD,0CAEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { getOrCreate } from \"../util/index.js\";\nimport type { TreeNodeSchema } from \"./core/index.js\";\nimport type { ImplicitAllowedTypes } from \"./schemaTypes.js\";\nimport type { SimpleTreeSchema } from \"./simpleSchema.js\";\nimport { toSimpleTreeSchema } from \"./viewSchemaToSimpleSchema.js\";\n\n/**\n * Cache in which the results of {@link getSimpleSchema} saved.\n */\nconst simpleSchemaCache = new WeakMap<TreeNodeSchema, SimpleTreeSchema>();\n\n/**\n * Creates a simplified representation of the provided {@link TreeNodeSchema}.\n *\n * @remarks Caches the result on the input schema for future calls.\n *\n * @example\n *\n * A Shared Tree schema like the following:\n *\n * ```typescript\n * class MyObject extends schemaFactory.object(\"MyObject\", {\n * \tfoo: schemaFactory.number,\n * \tbar: schemaFactory.optional(schemaFactory.string),\n * });\n * ```\n *\n * Will yield JSON Schema like the following:\n *\n * ```typescript\n * {\n * \tdefinitions: [\n * \t\t[\"com.fluidframework.leaf.number\", {\n * \t\t\tkind: \"leaf\",\n * \t\t\ttype: \"number\",\n * \t\t}],\n * \t\t[\"com.fluidframework.leaf.string\", {\n * \t\t\tkind: \"leaf\",\n * \t\t\ttype: \"string\",\n * \t\t}],\n * \t\t[\"com.myapp.MyObject\", {\n * \t\t\tkind: \"object\",\n * \t\t\tfields: {\n * \t\t\t\tfoo: {\n * \t\t\t\t\tkind: \"required\",\n * \t\t\t\t\tallowedTypes: [\"com.fluidframework.leaf.number\"]\n * \t\t\t\t},\n * \t\t\t\tbar: {\n * \t\t\t\t\tkind: \"optional\",\n * \t\t\t\t\tallowedTypes: [\"com.fluidframework.leaf.string\"]\n * \t\t\t\t},\n * \t\t\t},\n * \t\t}],\n * \t],\n * \tallowedTypes: [\"com.myapp.MyObject\"],\n * }\n * ```\n *\n * @privateRemarks In the future, we may wish to move this to a more discoverable API location.\n * For now, while still an experimental API, it is surfaced as a free function.\n */\nexport function getSimpleSchema(schema: ImplicitAllowedTypes): SimpleTreeSchema {\n\treturn getOrCreate(simpleSchemaCache, schema, () => toSimpleTreeSchema(schema));\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jsonSchema.d.ts","sourceRoot":"","sources":["../../src/simple-tree/jsonSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAElC;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG,WAAW,YAAY,EAAE,CAAC;AAEpD;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,OAAO,GAAG,kBAA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IAAI,EAAE,kBAAkB,CAAC;CAClC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC7B;;;OAGG;IACH,IAAI,EAAE,WAAW,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,MAAM,cAAc,GACvB,kBAAkB,GAClB,iBAAiB,GACjB,mBAAmB,GACnB,oBAAoB,CAAC;AAExB;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,aAAa,EAAE,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,cAAe,SAAQ,eAAe;IACtD;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;CACrD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jsonSchema.js","sourceRoot":"","sources":["../../src/simple-tree/jsonSchema.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { NodeKind } from \"./core/index.js\";\n\n/**\n * The fully-qualified {@link TreeNodeSchemaCore.identifier}.\n * @alpha\n */\nexport type JsonSchemaId = string;\n\n/**\n * Reference string pointing to a definition in the schema.\n * Should be the fully-qualified {@link TreeNodeSchemaCore.identifier}.\n * @remarks Of the form `#/$defs/<schema-identifier>`, where the `schema-identifier` is the fully-qualified {@link TreeNodeSchemaCore.identifier}.\n * @example Schema `com.myapp.foo` would be referenced via `#/$defs/com.myapp.foo`.\n * @alpha\n */\nexport type JsonRefPath = `#/$defs/${JsonSchemaId}`;\n\n/**\n * JSON entity type.\n * @see {@link https://json-schema.org/draft/2020-12/json-schema-core#name-instance-data-model}.\n * @alpha\n */\nexport type JsonSchemaType = \"object\" | \"array\" | JsonLeafSchemaType;\n\n/**\n * JSON primitive types.\n * @see {@link https://json-schema.org/draft/2020-12/json-schema-core#name-instance-data-model}.\n * @alpha\n */\nexport type JsonLeafSchemaType = \"string\" | \"number\" | \"boolean\" | \"null\";\n\n/**\n * Base interface for node schemas represented in {@link https://json-schema.org/draft/2020-12/json-schema-core | JSON Schema} format.\n *\n * @sealed\n * @alpha\n */\nexport interface JsonNodeSchemaBase<\n\tTNodeKind extends NodeKind,\n\tTJsonSchemaType extends JsonSchemaType,\n> {\n\t/**\n\t * Kind of {@link TreeNodeSchema} this JSON Schema entry represents.\n\t *\n\t * @remarks There is not a 1:1 mapping between {@link TreeNodeSchema} types and JSON Schema types.\n\t * This is used to disambiguate the type of {@link TreeNodeSchema} this JSON Schema maps to.\n\t *\n\t * Note: This property name is not a part of the JSON Schema spec. This is a Fluid-specific extension.\n\t */\n\treadonly _treeNodeSchemaKind: TNodeKind;\n\n\t/**\n\t * {@inheritDoc JsonSchemaType}\n\t */\n\treadonly type: TJsonSchemaType;\n}\n\n/**\n * JSON Schema for an object node.\n *\n * @see {@link https://json-schema.org/draft/2020-12/json-schema-core#name-instance-data-model}.\n *\n * @sealed\n * @alpha\n */\nexport interface JsonObjectNodeSchema extends JsonNodeSchemaBase<NodeKind.Object, \"object\"> {\n\t/**\n\t * Object fields.\n\t * @remarks Required fields should have a corresponding entry in {@link JsonObjectNodeSchema.required}.\n\t * @see {@link https://json-schema.org/draft/2020-12/json-schema-core#name-properties}.\n\t */\n\treadonly properties: Record<string, JsonFieldSchema>;\n\n\t/**\n\t * List of keys for required fields.\n\t *\n\t * @remarks\n\t * Optional fields should not be included in this list.\n\t * Each key specified must have an entry in {@link JsonObjectNodeSchema.properties}.\n\t */\n\treadonly required?: string[];\n\n\t/**\n\t * Whether or not additional properties (properties not specified by the schema) are allowed in objects of this type.\n\t * @see {@link https://json-schema.org/draft/2020-12/json-schema-core#name-additionalproperties}.\n\t */\n\treadonly additionalProperties?: boolean;\n}\n\n/**\n * JSON Schema for an array node.\n *\n * @see {@link https://json-schema.org/draft/2020-12/json-schema-core#name-instance-data-model}.\n *\n * @sealed\n * @alpha\n */\nexport interface JsonArrayNodeSchema extends JsonNodeSchemaBase<NodeKind.Array, \"array\"> {\n\t/**\n\t * The kinds of items allowed under the array.\n\t * @remarks Always represented via references to {@link JsonTreeSchema.$defs}.\n\t *\n\t * @see {@link https://json-schema.org/draft/2020-12/json-schema-core#name-items}.\n\t */\n\treadonly items: {\n\t\t/**\n\t\t * The kinds of items allowed under the array.\n\t\t * @remarks Always represented via references to {@link JsonTreeSchema.$defs}.\n\t\t * @see {@link https://json-schema.org/draft/2020-12/json-schema-core#name-anyof}.\n\t\t */\n\t\tanyOf: JsonSchemaRef[];\n\t};\n}\n\n/**\n * JSON Schema for a map node.\n *\n * @remarks Special case for map nodes, which do not have a native JSON schema corollary.\n *\n * @see {@link https://json-schema.org/draft/2020-12/json-schema-core#name-instance-data-model}.\n *\n * @sealed\n * @alpha\n */\nexport interface JsonMapNodeSchema extends JsonNodeSchemaBase<NodeKind.Map, \"object\"> {\n\t/**\n\t * Used to control the types of properties that can appear in the \"object\" representation of the map.\n\t * @see {@link https://json-schema.org/draft/2020-12/json-schema-core#name-patternproperties}.\n\t */\n\treadonly patternProperties: {\n\t\t/**\n\t\t * Types allowed in the map.\n\t\t * @remarks This format allows for any (JSON-compliant) key, but restricts the allowed types to only those specified.\n\t\t */\n\t\t\"^.*$\": JsonFieldSchema;\n\t};\n}\n\n/**\n * JSON Schema for a leaf node.\n *\n * @see {@link https://json-schema.org/draft/2020-12/json-schema-core#name-instance-data-model}.\n *\n * @sealed\n * @alpha\n */\nexport interface JsonLeafNodeSchema\n\textends JsonNodeSchemaBase<NodeKind.Leaf, JsonLeafSchemaType> {\n\t/**\n\t * Primitive type.\n\t * @see {@link https://json-schema.org/draft/2020-12/json-schema-core#name-instance-data-model}.\n\t */\n\treadonly type: JsonLeafSchemaType;\n}\n\n/**\n * Type entry containing a reference to a definition in the schema.\n *\n * @see {@link https://json-schema.org/draft/2020-12/json-schema-core#name-schema-references}.\n *\n * @sealed\n * @alpha\n */\nexport interface JsonSchemaRef {\n\t/**\n\t * Reference to a definition in the schema.\n\t * @see {@link https://json-schema.org/draft/2020-12/json-schema-core#name-direct-references-with-ref}.\n\t */\n\t$ref: JsonRefPath;\n}\n\n/**\n * {@link https://json-schema.org/draft/2020-12/json-schema-core | JSON Schema} representation of a {@link TreeNodeSchema}.\n *\n * @alpha\n */\nexport type JsonNodeSchema =\n\t| JsonLeafNodeSchema\n\t| JsonMapNodeSchema\n\t| JsonArrayNodeSchema\n\t| JsonObjectNodeSchema;\n\n/**\n *{@link https://json-schema.org/draft/2020-12/json-schema-core | JSON Schema} representation of a {@link FieldSchema}.\n *\n * @sealed\n * @alpha\n */\nexport interface JsonFieldSchema {\n\t/**\n\t * The kinds of items allowed under the field.\n\t * @remarks Always represented via references to {@link JsonTreeSchema.$defs}.\n\t * @see {@link https://json-schema.org/draft/2020-12/json-schema-core#name-anyof}.\n\t */\n\treadonly anyOf: JsonSchemaRef[];\n}\n\n/**\n * {@link https://json-schema.org/draft/2020-12/json-schema-core | JSON Schema} representation of a tree schema.\n *\n * @remarks\n * Includes the complete set of definitions reachable from the \"root\" schema.\n *\n * Note: This representation only uses a limited subset of supported JSON Schema features.\n * It is scoped to a format that can be used to sufficiently represent supported SharedTree schema.\n *\n * Also note that this schema format contains Fluid-specific extensions, such as the {@link JsonNodeSchemaBase._treeNodeSchemaKind}\n * property, meaning that it is not a *strict* subset.\n * When using these schemas with validation tools (for example, {@link https://ajv.js.org/}), you will need to opt out\n * of *strict* validation to ensure extra properties are allowed.\n *\n * @privateRemarks\n * Extending JSON Schema is permitted by the spec.\n * See {@link https://json-schema.org/draft/2020-12/json-schema-core#name-extending-json-schema}.\n *\n * @sealed\n * @alpha\n */\nexport interface JsonTreeSchema extends JsonFieldSchema {\n\t/**\n\t * The set of definitions reachable from this schema's root.\n\t * @see {@link https://json-schema.org/draft/2020-12/json-schema-core#name-schema-re-use-with-defs}\n\t */\n\treadonly $defs: Record<JsonSchemaId, Json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;AAE1B;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAEzB;;;;;OAKG;IACH,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC3C;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB;IAChC;;;;OAIG;IACH,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAE5D;;;;;OAKG;IACH,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC3C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"simpleSchema.js","sourceRoot":"","sources":["../../src/simple-tree/simpleSchema.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ValueSchema } from \"../core/index.js\";\nimport type { NodeKind } from \"./core/index.js\";\nimport type { FieldKind } from \"./schemaTypes.js\";\n\n/**\n * Base interface for all {@link SimpleNodeSchema} implementations.\n *\n * @sealed\n */\nexport interface SimpleNodeSchemaBase<TNodeKind extends NodeKind> {\n\t/**\n\t * The kind of {@link SimpleNodeSchema}.\n\t *\n\t * @remarks can be used to type-switch between implementations.\n\t */\n\treadonly kind: TNodeKind;\n}\n\n/**\n * A {@link SimpleNodeSchema} for an object node.\n *\n * @sealed\n */\nexport interface SimpleObjectNodeSchema extends SimpleNodeSchemaBase<NodeKind.Object> {\n\t/**\n\t * Schemas for each of the object's fields, keyed off of schema's view keys.\n\t */\n\treadonly fields: Record<string, SimpleFieldSchema>;\n}\n\n/**\n * A {@link SimpleNodeSchema} for an array node.\n *\n * @sealed\n */\nexport interface SimpleArrayNodeSchema extends SimpleNodeSchemaBase<NodeKind.Array> {\n\t/**\n\t * The types allowed in the array.\n\t *\n\t * @remarks Refers to the types by identifier.\n\t * A {@link SimpleTreeSchema} is needed to resolve these identifiers to their schema {@link SimpleTreeSchema.definitions}.\n\t */\n\treadonly allowedTypes: ReadonlySet<string>;\n}\n\n/**\n * A {@link SimpleNodeSchema} for a map node.\n *\n * @sealed\n */\nexport interface SimpleMapNodeSchema extends SimpleNodeSchemaBase<NodeKind.Map> {\n\t/**\n\t * The types allowed as values in the map.\n\t *\n\t * @remarks Refers to the types by identifier.\n\t * A {@link SimpleTreeSchema} is needed to resolve these identifiers to their schema {@link SimpleTreeSchema.definitions}.\n\t */\n\treadonly allowedTypes: ReadonlySet<string>;\n}\n\n/**\n * A {@link SimpleNodeSchema} for a leaf node.\n *\n * @sealed\n */\nexport interface SimpleLeafNodeSchema extends SimpleNodeSchemaBase<NodeKind.Leaf> {\n\t/**\n\t * The kind of leaf node.\n\t */\n\treadonly leafKind: ValueSchema;\n}\n\n/**\n * A simple, shallow representation of a schema for a node.\n *\n * @remarks This definition is incomplete, and references child types by identifiers.\n * To be useful, this generally needs to be used as a part of a complete {@link SimpleTreeSchema}, which\n * contains backing {@link SimpleTreeSchema.definitions} for each referenced identifier.\n */\nexport type SimpleNodeSchema =\n\t| SimpleLeafNodeSchema\n\t| SimpleMapNodeSchema\n\t| SimpleArrayNodeSchema\n\t| SimpleObjectNodeSchema;\n\n/**\n * A simple, shallow representation of a schema for a field.\n *\n * @remarks This definition is incomplete, and references child types by identifiers.\n * To be useful, this generally needs to be used as a part of a complete {@link SimpleTreeSchema}, which\n * contains backing {@link SimpleTreeSchema.definitions} for each referenced identifier.\n *\n * @sealed\n */\nexport interface SimpleFieldSchema {\n\t/**\n\t * The kind of object field.\n\t */\n\treadonly kind: FieldKind;\n\n\t/**\n\t * The types allowed under the field.\n\t *\n\t * @remarks Refers to the types by identifier.\n\t * A {@link SimpleTreeSchema} is needed to resolve these identifiers to their schema {@link SimpleTreeSchema.definitions}.\n\t */\n\treadonly allowedTypes: ReadonlySet<string>;\n}\n\n/**\n * A simplified representation of a schema for a tree.\n *\n * @remarks Contains the complete set of schema {@link SimpleTreeSchema.definitions} required to resolve references\n * by schema identifier.\n *\n * @sealed\n */\nexport interface SimpleTreeSchema {\n\t/**\n\t * The complete set of node schema definitions recursively referenced by the tree's {@link SimpleTreeSchema.allowedTypes}.\n\t *\n\t * @remarks the keys are the schemas' {@link TreeNodeSchemaCore.identifier | identifiers}.\n\t */\n\treadonly definitions: ReadonlyMap<string, SimpleNodeSchema>;\n\n\t/**\n\t * The types allowed under the root of the tree.\n\t *\n\t * @remarks Refers to the types by identifier.\n\t * {@link SimpleTreeSchema.definitions} can be used to resolve these identifiers to their associated schema definition.\n\t */\n\treadonly allowedTypes: ReadonlySet<string>;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"simpleSchemaToJsonSchema.d.ts","sourceRoot":"","sources":["../../src/simple-tree/simpleSchemaToJsonSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EASX,cAAc,EAEd,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAMX,gBAAgB,EAChB,MAAM,mBAAmB,CAAC;AAG3B;;;GAGG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,gBAAgB,GAAG,cAAc,CAYrE"}
|