@fluidframework/tree 2.3.0-288113 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dependency-cruiser-known-violations.json +28 -40
- package/.vscode/Tree.code-workspace +0 -2
- package/CHANGELOG.md +92 -0
- package/README.md +6 -0
- package/alpha.d.ts +11 -0
- package/api-extractor/api-extractor-lint-alpha.cjs.json +5 -0
- package/api-extractor/api-extractor-lint-alpha.esm.json +5 -0
- package/api-extractor/api-extractor-lint-legacy.cjs.json +5 -0
- package/api-extractor/api-extractor-lint-legacy.esm.json +5 -0
- package/api-extractor/api-extractor.current.json +8 -0
- package/api-extractor/api-extractor.legacy.json +4 -0
- package/api-extractor.json +1 -1
- package/api-report/tree.alpha.api.md +21 -42
- package/api-report/tree.beta.api.md +21 -11
- package/api-report/tree.legacy.alpha.api.md +562 -0
- package/api-report/tree.legacy.public.api.md +559 -0
- package/api-report/tree.public.api.md +8 -13
- package/dist/alpha.d.ts +102 -0
- package/dist/beta.d.ts +6 -2
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/{revertible/revertible.d.ts → revertible.d.ts} +12 -0
- package/dist/core/revertible.d.ts.map +1 -0
- package/dist/core/revertible.js.map +1 -0
- package/dist/core/schema-stored/format.d.ts +3 -3
- package/dist/core/schema-stored/format.js +1 -1
- package/dist/core/schema-stored/format.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +2 -7
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +4 -6
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.d.ts +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.js +6 -2
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/detachedFieldIndex.d.ts +0 -1
- package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndex.js +1 -0
- package/dist/core/tree/detachedFieldIndex.js.map +1 -1
- package/dist/core/tree/visitDelta.d.ts +7 -2
- package/dist/core/tree/visitDelta.d.ts.map +1 -1
- package/dist/core/tree/visitDelta.js.map +1 -1
- package/dist/events/emitter.d.ts +127 -0
- package/dist/events/emitter.d.ts.map +1 -0
- package/dist/events/{events.js → emitter.js} +48 -30
- package/dist/events/emitter.js.map +1 -0
- package/dist/events/index.d.ts +2 -1
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +4 -5
- package/dist/events/index.js.map +1 -1
- package/dist/events/interop.d.ts +36 -0
- package/dist/events/interop.d.ts.map +1 -0
- package/dist/{core/revertible/index.d.ts → events/interop.js} +3 -2
- package/dist/events/interop.js.map +1 -0
- package/dist/events/listeners.d.ts +65 -0
- package/dist/events/listeners.d.ts.map +1 -0
- package/{lib/core/revertible/index.d.ts → dist/events/listeners.js} +3 -2
- package/dist/events/listeners.js.map +1 -0
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +25 -7
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js +36 -15
- package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts +4 -2
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.js +12 -5
- package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts +15 -2
- package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.js +28 -2
- package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +3 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js +5 -4
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/dist/feature-libraries/flex-map-tree/index.d.ts +1 -1
- package/dist/feature-libraries/flex-map-tree/index.d.ts.map +1 -1
- package/dist/feature-libraries/flex-map-tree/index.js +2 -1
- package/dist/feature-libraries/flex-map-tree/index.js.map +1 -1
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts +35 -33
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.js +82 -103
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
- package/dist/feature-libraries/flex-tree/context.d.ts +30 -14
- package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/context.js +10 -7
- package/dist/feature-libraries/flex-tree/context.js.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +57 -190
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js +15 -3
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/dist/feature-libraries/flex-tree/index.d.ts +2 -3
- package/dist/feature-libraries/flex-tree/index.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/index.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyEntity.d.ts +3 -3
- package/dist/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyEntity.js +2 -10
- package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.d.ts +26 -28
- package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +11 -14
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts +5 -26
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.js +23 -74
- package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/dist/feature-libraries/flex-tree/unboxed.d.ts +4 -16
- package/dist/feature-libraries/flex-tree/unboxed.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/unboxed.js +7 -41
- package/dist/feature-libraries/flex-tree/unboxed.js.map +1 -1
- package/dist/feature-libraries/flex-tree/utilities.d.ts +2 -2
- package/dist/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/utilities.js +3 -6
- package/dist/feature-libraries/flex-tree/utilities.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +4 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +3 -5
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +5 -11
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.js +3 -6
- package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/dist/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/discrepancies.js +3 -13
- package/dist/feature-libraries/modular-schema/discrepancies.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +4 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +2 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +12 -5
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +6 -6
- package/dist/feature-libraries/schema-index/format.d.ts +3 -3
- package/dist/feature-libraries/storedToViewSchema.d.ts.map +1 -1
- package/dist/feature-libraries/storedToViewSchema.js +2 -4
- package/dist/feature-libraries/storedToViewSchema.js.map +1 -1
- package/dist/feature-libraries/typed-schema/flexList.d.ts +3 -3
- package/dist/feature-libraries/typed-schema/flexList.js.map +1 -1
- package/dist/feature-libraries/typed-schema/index.d.ts +2 -2
- package/dist/feature-libraries/typed-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/typed-schema/index.js +2 -2
- package/dist/feature-libraries/typed-schema/index.js.map +1 -1
- package/dist/feature-libraries/typed-schema/schemaCollection.d.ts.map +1 -1
- package/dist/feature-libraries/typed-schema/schemaCollection.js +8 -10
- package/dist/feature-libraries/typed-schema/schemaCollection.js.map +1 -1
- package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts +17 -48
- package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
- package/dist/feature-libraries/typed-schema/typedTreeSchema.js +5 -37
- package/dist/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
- package/dist/feature-libraries/typed-schema/view.d.ts +4 -6
- package/dist/feature-libraries/typed-schema/view.d.ts.map +1 -1
- package/dist/feature-libraries/typed-schema/view.js +5 -4
- package/dist/feature-libraries/typed-schema/view.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +33 -36
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +83 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/public.d.ts +0 -1
- package/dist/shared-tree/checkoutFlexTreeView.d.ts +53 -0
- package/dist/shared-tree/checkoutFlexTreeView.d.ts.map +1 -0
- package/dist/shared-tree/{treeView.js → checkoutFlexTreeView.js} +28 -6
- package/dist/shared-tree/checkoutFlexTreeView.js.map +1 -0
- package/dist/shared-tree/index.d.ts +3 -3
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js +2 -2
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/schematizeTree.d.ts +15 -4
- package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
- package/dist/shared-tree/schematizeTree.js +7 -8
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +9 -4
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +25 -12
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +2 -2
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.d.ts +3 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.js +6 -2
- package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts +3 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js +3 -2
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts +2 -1
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.js +2 -2
- package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/dist/shared-tree/treeApi.d.ts +1 -3
- package/dist/shared-tree/treeApi.d.ts.map +1 -1
- package/dist/shared-tree/treeApi.js +6 -4
- package/dist/shared-tree/treeApi.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +2 -13
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +17 -1
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/branch.js +1 -1
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/simple-tree/api/create.d.ts.map +1 -1
- package/dist/simple-tree/api/create.js +1 -1
- package/dist/simple-tree/api/create.js.map +1 -1
- package/{lib/simple-tree → dist/simple-tree/api}/getJsonSchema.d.ts +1 -1
- package/dist/simple-tree/api/getJsonSchema.d.ts.map +1 -0
- package/dist/simple-tree/{getJsonSchema.js → api/getJsonSchema.js} +1 -1
- package/dist/simple-tree/api/getJsonSchema.js.map +1 -0
- package/{lib/simple-tree → dist/simple-tree/api}/getSimpleSchema.d.ts +1 -1
- package/dist/simple-tree/api/getSimpleSchema.d.ts.map +1 -0
- package/dist/simple-tree/{getSimpleSchema.js → api/getSimpleSchema.js} +1 -1
- package/dist/simple-tree/api/getSimpleSchema.js.map +1 -0
- package/dist/simple-tree/api/index.d.ts +5 -0
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +7 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/{lib/simple-tree → dist/simple-tree/api}/jsonSchema.d.ts +1 -1
- package/dist/simple-tree/api/jsonSchema.d.ts.map +1 -0
- package/dist/simple-tree/api/jsonSchema.js.map +1 -0
- package/dist/simple-tree/api/schemaFactory.d.ts +45 -14
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +43 -12
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/{simpleSchema.d.ts → api/simpleSchema.d.ts} +4 -4
- package/dist/simple-tree/api/simpleSchema.d.ts.map +1 -0
- package/dist/simple-tree/api/simpleSchema.js.map +1 -0
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -0
- package/dist/simple-tree/{simpleSchemaToJsonSchema.js → api/simpleSchemaToJsonSchema.js} +4 -4
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -0
- package/dist/simple-tree/api/tree.d.ts +1 -21
- package/dist/simple-tree/api/tree.d.ts.map +1 -1
- package/dist/simple-tree/api/tree.js +3 -38
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/treeApiBeta.d.ts +79 -0
- package/dist/simple-tree/api/treeApiBeta.d.ts.map +1 -0
- package/dist/simple-tree/api/treeApiBeta.js +26 -0
- package/dist/simple-tree/api/treeApiBeta.js.map +1 -0
- package/dist/simple-tree/api/treeNodeApi.d.ts +1 -1
- package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.js +21 -19
- package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
- package/dist/simple-tree/api/verboseTree.js +2 -2
- package/dist/simple-tree/api/verboseTree.js.map +1 -1
- package/dist/simple-tree/{viewSchemaToSimpleSchema.d.ts → api/viewSchemaToSimpleSchema.d.ts} +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -0
- package/dist/simple-tree/{viewSchemaToSimpleSchema.js → api/viewSchemaToSimpleSchema.js} +4 -4
- package/{lib/simple-tree → dist/simple-tree/api}/viewSchemaToSimpleSchema.js.map +1 -1
- package/dist/simple-tree/arrayNode.d.ts +2 -2
- package/dist/simple-tree/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/arrayNode.js +30 -21
- package/dist/simple-tree/arrayNode.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +3 -3
- package/dist/simple-tree/core/index.d.ts.map +1 -1
- package/dist/simple-tree/core/index.js +4 -1
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/schemaCaching.d.ts +5 -0
- package/dist/simple-tree/core/schemaCaching.d.ts.map +1 -1
- package/dist/simple-tree/core/schemaCaching.js +10 -1
- package/dist/simple-tree/core/schemaCaching.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.d.ts +61 -3
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +166 -13
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts +1 -1
- package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/dist/simple-tree/core/types.d.ts +17 -20
- package/dist/simple-tree/core/types.d.ts.map +1 -1
- package/dist/simple-tree/core/types.js.map +1 -1
- package/dist/simple-tree/core/withType.d.ts +3 -2
- package/dist/simple-tree/core/withType.d.ts.map +1 -1
- package/dist/simple-tree/core/withType.js.map +1 -1
- package/dist/simple-tree/index.d.ts +7 -9
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +15 -6
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts +7 -9
- package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js +13 -11
- package/dist/simple-tree/leafNodeSchema.js.map +1 -1
- package/dist/simple-tree/mapNode.d.ts +1 -1
- package/dist/simple-tree/mapNode.d.ts.map +1 -1
- package/dist/simple-tree/mapNode.js +38 -29
- package/dist/simple-tree/mapNode.js.map +1 -1
- package/dist/simple-tree/objectNode.d.ts +9 -7
- package/dist/simple-tree/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/objectNode.js +37 -31
- package/dist/simple-tree/objectNode.js.map +1 -1
- package/dist/simple-tree/proxies.d.ts +1 -14
- package/dist/simple-tree/proxies.d.ts.map +1 -1
- package/dist/simple-tree/proxies.js +12 -15
- package/dist/simple-tree/proxies.js.map +1 -1
- package/dist/simple-tree/proxyBinding.d.ts +2 -62
- package/dist/simple-tree/proxyBinding.d.ts.map +1 -1
- package/dist/simple-tree/proxyBinding.js +8 -181
- package/dist/simple-tree/proxyBinding.js.map +1 -1
- package/dist/simple-tree/schemaTypes.d.ts +7 -7
- package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
- package/dist/simple-tree/schemaTypes.js +4 -4
- package/dist/simple-tree/schemaTypes.js.map +1 -1
- package/dist/simple-tree/toFlexSchema.d.ts +11 -1
- package/dist/simple-tree/toFlexSchema.d.ts.map +1 -1
- package/dist/simple-tree/toFlexSchema.js +54 -31
- package/dist/simple-tree/toFlexSchema.js.map +1 -1
- package/dist/simple-tree/toMapTree.d.ts +25 -37
- package/dist/simple-tree/toMapTree.d.ts.map +1 -1
- package/dist/simple-tree/toMapTree.js +53 -16
- package/dist/simple-tree/toMapTree.js.map +1 -1
- package/dist/simple-tree/treeNodeValid.d.ts.map +1 -1
- package/dist/simple-tree/treeNodeValid.js +7 -10
- package/dist/simple-tree/treeNodeValid.js.map +1 -1
- package/dist/simple-tree/typesUnsafe.d.ts +13 -13
- package/dist/simple-tree/typesUnsafe.js.map +1 -1
- package/dist/simple-tree/walkSchema.d.ts +26 -0
- package/dist/simple-tree/walkSchema.d.ts.map +1 -0
- package/dist/simple-tree/walkSchema.js +49 -0
- package/dist/simple-tree/walkSchema.js.map +1 -0
- package/dist/treeFactory.d.ts +2 -1
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +2 -1
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/typeUtils.d.ts +2 -2
- package/dist/util/typeUtils.js.map +1 -1
- package/legacy.d.ts +11 -0
- package/lib/alpha.d.ts +102 -0
- package/lib/beta.d.ts +6 -2
- package/lib/core/index.d.ts +1 -1
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +1 -1
- package/lib/core/index.js.map +1 -1
- package/lib/core/{revertible/revertible.d.ts → revertible.d.ts} +12 -0
- package/lib/core/revertible.d.ts.map +1 -0
- package/lib/core/revertible.js.map +1 -0
- package/lib/core/schema-stored/format.d.ts +3 -3
- package/lib/core/schema-stored/format.js +1 -1
- package/lib/core/schema-stored/format.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +2 -7
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +4 -6
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.d.ts +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.js +6 -2
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/core/tree/detachedFieldIndex.d.ts +0 -1
- package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndex.js +1 -0
- package/lib/core/tree/detachedFieldIndex.js.map +1 -1
- package/lib/core/tree/visitDelta.d.ts +7 -2
- package/lib/core/tree/visitDelta.d.ts.map +1 -1
- package/lib/core/tree/visitDelta.js.map +1 -1
- package/lib/events/emitter.d.ts +127 -0
- package/lib/events/emitter.d.ts.map +1 -0
- package/lib/events/{events.js → emitter.js} +48 -29
- package/lib/events/emitter.js.map +1 -0
- package/lib/events/index.d.ts +2 -1
- package/lib/events/index.d.ts.map +1 -1
- package/lib/events/index.js +1 -1
- package/lib/events/index.js.map +1 -1
- package/lib/events/interop.d.ts +36 -0
- package/lib/events/interop.d.ts.map +1 -0
- package/{src/core/revertible/index.ts → lib/events/interop.js} +2 -2
- package/lib/events/interop.js.map +1 -0
- package/lib/events/listeners.d.ts +65 -0
- package/lib/events/listeners.d.ts.map +1 -0
- package/lib/{core/revertible/index.js → events/listeners.js} +2 -2
- package/lib/events/listeners.js.map +1 -0
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +25 -7
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js +37 -16
- package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts +4 -2
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.js +12 -5
- package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts +15 -2
- package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js +28 -2
- package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +3 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js +5 -4
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/flex-map-tree/index.d.ts +1 -1
- package/lib/feature-libraries/flex-map-tree/index.d.ts.map +1 -1
- package/lib/feature-libraries/flex-map-tree/index.js +1 -1
- package/lib/feature-libraries/flex-map-tree/index.js.map +1 -1
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts +35 -33
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.js +83 -104
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
- package/lib/feature-libraries/flex-tree/context.d.ts +30 -14
- package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/context.js +10 -7
- package/lib/feature-libraries/flex-tree/context.js.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +57 -190
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js +15 -2
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/lib/feature-libraries/flex-tree/index.d.ts +2 -3
- package/lib/feature-libraries/flex-tree/index.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/index.js +1 -1
- package/lib/feature-libraries/flex-tree/index.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyEntity.d.ts +3 -3
- package/lib/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyEntity.js +2 -10
- package/lib/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.d.ts +26 -28
- package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +11 -13
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts +5 -26
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.js +23 -72
- package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/lib/feature-libraries/flex-tree/unboxed.d.ts +4 -16
- package/lib/feature-libraries/flex-tree/unboxed.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/unboxed.js +5 -37
- package/lib/feature-libraries/flex-tree/unboxed.js.map +1 -1
- package/lib/feature-libraries/flex-tree/utilities.d.ts +2 -2
- package/lib/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/utilities.js +3 -6
- package/lib/feature-libraries/flex-tree/utilities.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +4 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +3 -5
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +5 -5
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.js +3 -6
- package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/lib/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/discrepancies.js +3 -13
- package/lib/feature-libraries/modular-schema/discrepancies.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +4 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +2 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +12 -5
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +6 -6
- package/lib/feature-libraries/schema-index/format.d.ts +3 -3
- package/lib/feature-libraries/storedToViewSchema.d.ts.map +1 -1
- package/lib/feature-libraries/storedToViewSchema.js +3 -5
- package/lib/feature-libraries/storedToViewSchema.js.map +1 -1
- package/lib/feature-libraries/typed-schema/flexList.d.ts +3 -3
- package/lib/feature-libraries/typed-schema/flexList.js.map +1 -1
- package/lib/feature-libraries/typed-schema/index.d.ts +2 -2
- package/lib/feature-libraries/typed-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/typed-schema/index.js +2 -2
- package/lib/feature-libraries/typed-schema/index.js.map +1 -1
- package/lib/feature-libraries/typed-schema/schemaCollection.d.ts.map +1 -1
- package/lib/feature-libraries/typed-schema/schemaCollection.js +9 -11
- package/lib/feature-libraries/typed-schema/schemaCollection.js.map +1 -1
- package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts +17 -48
- package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
- package/lib/feature-libraries/typed-schema/typedTreeSchema.js +5 -36
- package/lib/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
- package/lib/feature-libraries/typed-schema/view.d.ts +4 -6
- package/lib/feature-libraries/typed-schema/view.d.ts.map +1 -1
- package/lib/feature-libraries/typed-schema/view.js +5 -4
- package/lib/feature-libraries/typed-schema/view.js.map +1 -1
- package/lib/index.d.ts +4 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -5
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +83 -0
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/public.d.ts +0 -1
- package/lib/shared-tree/checkoutFlexTreeView.d.ts +53 -0
- package/lib/shared-tree/checkoutFlexTreeView.d.ts.map +1 -0
- package/lib/shared-tree/{treeView.js → checkoutFlexTreeView.js} +26 -5
- package/lib/shared-tree/checkoutFlexTreeView.js.map +1 -0
- package/lib/shared-tree/index.d.ts +3 -3
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js +1 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/schematizeTree.d.ts +15 -4
- package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
- package/lib/shared-tree/schematizeTree.js +8 -9
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +9 -4
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +26 -13
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +2 -2
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.d.ts +3 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.js +6 -2
- package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts +3 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js +3 -2
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts +2 -1
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.js +2 -2
- package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/lib/shared-tree/treeApi.d.ts +1 -3
- package/lib/shared-tree/treeApi.d.ts.map +1 -1
- package/lib/shared-tree/treeApi.js +7 -5
- package/lib/shared-tree/treeApi.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +2 -13
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +18 -2
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/branch.js +1 -1
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/simple-tree/api/create.d.ts.map +1 -1
- package/lib/simple-tree/api/create.js +2 -2
- package/lib/simple-tree/api/create.js.map +1 -1
- package/{dist/simple-tree → lib/simple-tree/api}/getJsonSchema.d.ts +1 -1
- package/lib/simple-tree/api/getJsonSchema.d.ts.map +1 -0
- package/lib/simple-tree/{getJsonSchema.js → api/getJsonSchema.js} +1 -1
- package/lib/simple-tree/api/getJsonSchema.js.map +1 -0
- package/{dist/simple-tree → lib/simple-tree/api}/getSimpleSchema.d.ts +1 -1
- package/lib/simple-tree/api/getSimpleSchema.d.ts.map +1 -0
- package/lib/simple-tree/{getSimpleSchema.js → api/getSimpleSchema.js} +1 -1
- package/lib/simple-tree/api/getSimpleSchema.js.map +1 -0
- package/lib/simple-tree/api/index.d.ts +5 -0
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +3 -0
- package/lib/simple-tree/api/index.js.map +1 -1
- package/{dist/simple-tree → lib/simple-tree/api}/jsonSchema.d.ts +1 -1
- package/lib/simple-tree/api/jsonSchema.d.ts.map +1 -0
- package/lib/simple-tree/api/jsonSchema.js.map +1 -0
- package/lib/simple-tree/api/schemaFactory.d.ts +45 -14
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +43 -12
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/{simpleSchema.d.ts → api/simpleSchema.d.ts} +4 -4
- package/lib/simple-tree/api/simpleSchema.d.ts.map +1 -0
- package/lib/simple-tree/api/simpleSchema.js.map +1 -0
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -0
- package/lib/simple-tree/{simpleSchemaToJsonSchema.js → api/simpleSchemaToJsonSchema.js} +4 -4
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -0
- package/lib/simple-tree/api/tree.d.ts +1 -21
- package/lib/simple-tree/api/tree.d.ts.map +1 -1
- package/lib/simple-tree/api/tree.js +2 -34
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/treeApiBeta.d.ts +79 -0
- package/lib/simple-tree/api/treeApiBeta.d.ts.map +1 -0
- package/lib/simple-tree/api/treeApiBeta.js +23 -0
- package/lib/simple-tree/api/treeApiBeta.js.map +1 -0
- package/lib/simple-tree/api/treeNodeApi.d.ts +1 -1
- package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.js +23 -21
- package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/api/verboseTree.js +1 -1
- package/lib/simple-tree/api/verboseTree.js.map +1 -1
- package/lib/simple-tree/{viewSchemaToSimpleSchema.d.ts → api/viewSchemaToSimpleSchema.d.ts} +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -0
- package/lib/simple-tree/{viewSchemaToSimpleSchema.js → api/viewSchemaToSimpleSchema.js} +4 -4
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -0
- package/lib/simple-tree/arrayNode.d.ts +2 -2
- package/lib/simple-tree/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/arrayNode.js +33 -24
- package/lib/simple-tree/arrayNode.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +3 -3
- package/lib/simple-tree/core/index.d.ts.map +1 -1
- package/lib/simple-tree/core/index.js +2 -2
- package/lib/simple-tree/core/index.js.map +1 -1
- package/lib/simple-tree/core/schemaCaching.d.ts +5 -0
- package/lib/simple-tree/core/schemaCaching.d.ts.map +1 -1
- package/lib/simple-tree/core/schemaCaching.js +8 -0
- package/lib/simple-tree/core/schemaCaching.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.d.ts +61 -3
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +156 -5
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts +1 -1
- package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/lib/simple-tree/core/types.d.ts +17 -20
- package/lib/simple-tree/core/types.d.ts.map +1 -1
- package/lib/simple-tree/core/types.js.map +1 -1
- package/lib/simple-tree/core/withType.d.ts +3 -2
- package/lib/simple-tree/core/withType.d.ts.map +1 -1
- package/lib/simple-tree/core/withType.js.map +1 -1
- package/lib/simple-tree/index.d.ts +7 -9
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +5 -5
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.d.ts +7 -9
- package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js +14 -12
- package/lib/simple-tree/leafNodeSchema.js.map +1 -1
- package/lib/simple-tree/mapNode.d.ts +1 -1
- package/lib/simple-tree/mapNode.d.ts.map +1 -1
- package/lib/simple-tree/mapNode.js +38 -29
- package/lib/simple-tree/mapNode.js.map +1 -1
- package/lib/simple-tree/objectNode.d.ts +9 -7
- package/lib/simple-tree/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/objectNode.js +40 -34
- package/lib/simple-tree/objectNode.js.map +1 -1
- package/lib/simple-tree/proxies.d.ts +1 -14
- package/lib/simple-tree/proxies.d.ts.map +1 -1
- package/lib/simple-tree/proxies.js +11 -14
- package/lib/simple-tree/proxies.js.map +1 -1
- package/lib/simple-tree/proxyBinding.d.ts +2 -62
- package/lib/simple-tree/proxyBinding.d.ts.map +1 -1
- package/lib/simple-tree/proxyBinding.js +6 -174
- package/lib/simple-tree/proxyBinding.js.map +1 -1
- package/lib/simple-tree/schemaTypes.d.ts +7 -7
- package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
- package/lib/simple-tree/schemaTypes.js +4 -4
- package/lib/simple-tree/schemaTypes.js.map +1 -1
- package/lib/simple-tree/toFlexSchema.d.ts +11 -1
- package/lib/simple-tree/toFlexSchema.d.ts.map +1 -1
- package/lib/simple-tree/toFlexSchema.js +29 -8
- package/lib/simple-tree/toFlexSchema.js.map +1 -1
- package/lib/simple-tree/toMapTree.d.ts +25 -37
- package/lib/simple-tree/toMapTree.d.ts.map +1 -1
- package/lib/simple-tree/toMapTree.js +54 -17
- package/lib/simple-tree/toMapTree.js.map +1 -1
- package/lib/simple-tree/treeNodeValid.d.ts.map +1 -1
- package/lib/simple-tree/treeNodeValid.js +8 -11
- package/lib/simple-tree/treeNodeValid.js.map +1 -1
- package/lib/simple-tree/typesUnsafe.d.ts +13 -13
- package/lib/simple-tree/typesUnsafe.js.map +1 -1
- package/lib/simple-tree/walkSchema.d.ts +26 -0
- package/lib/simple-tree/walkSchema.d.ts.map +1 -0
- package/lib/simple-tree/walkSchema.js +43 -0
- package/lib/simple-tree/walkSchema.js.map +1 -0
- package/lib/treeFactory.d.ts +2 -1
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +2 -1
- package/lib/treeFactory.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/lib/util/typeUtils.d.ts +2 -2
- package/lib/util/typeUtils.js.map +1 -1
- package/package.json +57 -25
- package/src/core/index.ts +1 -1
- package/src/core/{revertible/revertible.ts → revertible.ts} +15 -0
- package/src/core/schema-stored/format.ts +1 -1
- package/src/core/schema-stored/schema.ts +6 -13
- package/src/core/tree/anchorSet.ts +18 -3
- package/src/core/tree/detachedFieldIndex.ts +6 -5
- package/src/core/tree/visitDelta.ts +7 -2
- package/src/events/{events.ts → emitter.ts} +52 -139
- package/src/events/index.ts +7 -7
- package/src/events/interop.ts +49 -0
- package/src/events/listeners.ts +68 -0
- package/src/feature-libraries/chunked-forest/chunkTree.ts +63 -18
- package/src/feature-libraries/chunked-forest/chunkedForest.ts +18 -4
- package/src/feature-libraries/chunked-forest/uniformChunk.ts +33 -0
- package/src/feature-libraries/default-schema/defaultEditBuilder.ts +5 -3
- package/src/feature-libraries/flex-map-tree/index.ts +1 -0
- package/src/feature-libraries/flex-map-tree/mapTreeNode.ts +135 -210
- package/src/feature-libraries/flex-tree/README.md +4 -75
- package/src/feature-libraries/flex-tree/context.ts +37 -16
- package/src/feature-libraries/flex-tree/flexTreeTypes.ts +69 -291
- package/src/feature-libraries/flex-tree/index.ts +7 -13
- package/src/feature-libraries/flex-tree/lazyEntity.ts +2 -11
- package/src/feature-libraries/flex-tree/lazyField.ts +49 -73
- package/src/feature-libraries/flex-tree/lazyNode.ts +25 -154
- package/src/feature-libraries/flex-tree/unboxed.ts +9 -68
- package/src/feature-libraries/flex-tree/utilities.ts +4 -8
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +4 -1
- package/src/feature-libraries/index.ts +2 -27
- package/src/feature-libraries/modular-schema/comparison.ts +4 -6
- package/src/feature-libraries/modular-schema/discrepancies.ts +7 -16
- package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +4 -1
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +14 -4
- package/src/feature-libraries/storedToViewSchema.ts +5 -6
- package/src/feature-libraries/typed-schema/flexList.ts +3 -3
- package/src/feature-libraries/typed-schema/index.ts +1 -3
- package/src/feature-libraries/typed-schema/schemaCollection.ts +15 -17
- package/src/feature-libraries/typed-schema/typedTreeSchema.ts +35 -127
- package/src/feature-libraries/typed-schema/view.ts +4 -13
- package/src/index.ts +4 -8
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/checkoutFlexTreeView.ts +89 -0
- package/src/shared-tree/index.ts +2 -7
- package/src/shared-tree/schematizeTree.ts +23 -12
- package/src/shared-tree/schematizingTreeView.ts +34 -24
- package/src/shared-tree/sharedTree.ts +6 -1
- package/src/shared-tree/sharedTreeChangeEnricher.ts +6 -1
- package/src/shared-tree/sharedTreeChangeFamily.ts +7 -1
- package/src/shared-tree/sharedTreeEditBuilder.ts +9 -4
- package/src/shared-tree/treeApi.ts +10 -10
- package/src/shared-tree/treeCheckout.ts +26 -15
- package/src/shared-tree-core/branch.ts +1 -1
- package/src/simple-tree/ProxyBinding.md +23 -23
- package/src/simple-tree/api/create.ts +8 -3
- package/src/simple-tree/{getJsonSchema.ts → api/getJsonSchema.ts} +3 -3
- package/src/simple-tree/{getSimpleSchema.ts → api/getSimpleSchema.ts} +3 -3
- package/src/simple-tree/api/index.ts +20 -0
- package/src/simple-tree/{jsonSchema.ts → api/jsonSchema.ts} +1 -1
- package/src/simple-tree/api/schemaFactory.ts +44 -13
- package/src/simple-tree/{simpleSchema.ts → api/simpleSchema.ts} +4 -4
- package/src/simple-tree/{simpleSchemaToJsonSchema.ts → api/simpleSchemaToJsonSchema.ts} +4 -4
- package/src/simple-tree/api/tree.ts +2 -71
- package/src/simple-tree/api/treeApiBeta.ts +101 -0
- package/src/simple-tree/api/treeNodeApi.ts +32 -23
- package/src/simple-tree/api/verboseTree.ts +1 -1
- package/src/simple-tree/{viewSchemaToSimpleSchema.ts → api/viewSchemaToSimpleSchema.ts} +5 -5
- package/src/simple-tree/arrayNode.ts +37 -31
- package/src/simple-tree/core/index.ts +4 -1
- package/src/simple-tree/core/schemaCaching.ts +10 -0
- package/src/simple-tree/core/treeNodeKernel.ts +198 -5
- package/src/simple-tree/core/treeNodeSchema.ts +1 -1
- package/src/simple-tree/core/types.ts +16 -27
- package/src/simple-tree/core/withType.ts +3 -1
- package/src/simple-tree/index.ts +29 -21
- package/src/simple-tree/leafNodeSchema.ts +24 -28
- package/src/simple-tree/mapNode.ts +47 -29
- package/src/simple-tree/objectNode.ts +51 -46
- package/src/simple-tree/proxies.ts +22 -51
- package/src/simple-tree/proxyBinding.ts +3 -254
- package/src/simple-tree/schemaTypes.ts +8 -8
- package/src/simple-tree/toFlexSchema.ts +40 -7
- package/src/simple-tree/toMapTree.ts +113 -79
- package/src/simple-tree/treeNodeValid.ts +10 -13
- package/src/simple-tree/typesUnsafe.ts +13 -13
- package/src/simple-tree/walkSchema.ts +81 -0
- package/src/treeFactory.ts +2 -1
- package/src/util/typeUtils.ts +2 -2
- package/dist/core/revertible/index.d.ts.map +0 -1
- package/dist/core/revertible/index.js +0 -10
- package/dist/core/revertible/index.js.map +0 -1
- package/dist/core/revertible/revertible.d.ts.map +0 -1
- package/dist/core/revertible/revertible.js.map +0 -1
- package/dist/domains/index.d.ts +0 -8
- package/dist/domains/index.d.ts.map +0 -1
- package/dist/domains/index.js +0 -20
- package/dist/domains/index.js.map +0 -1
- package/dist/domains/json/index.d.ts +0 -7
- package/dist/domains/json/index.d.ts.map +0 -1
- package/dist/domains/json/index.js +0 -17
- package/dist/domains/json/index.js.map +0 -1
- package/dist/domains/json/jsonCursor.d.ts +0 -52
- package/dist/domains/json/jsonCursor.d.ts.map +0 -1
- package/dist/domains/json/jsonCursor.js +0 -197
- package/dist/domains/json/jsonCursor.js.map +0 -1
- package/dist/domains/json/jsonDomainSchema.d.ts +0 -24
- package/dist/domains/json/jsonDomainSchema.d.ts.map +0 -1
- package/dist/domains/json/jsonDomainSchema.js +0 -32
- package/dist/domains/json/jsonDomainSchema.js.map +0 -1
- package/dist/domains/leafDomain.d.ts +0 -72
- package/dist/domains/leafDomain.d.ts.map +0 -1
- package/dist/domains/leafDomain.js +0 -88
- package/dist/domains/leafDomain.js.map +0 -1
- package/dist/domains/schemaBuilder.d.ts +0 -103
- package/dist/domains/schemaBuilder.d.ts.map +0 -1
- package/dist/domains/schemaBuilder.js +0 -121
- package/dist/domains/schemaBuilder.js.map +0 -1
- package/dist/domains/testRecursiveDomain.d.ts +0 -17
- package/dist/domains/testRecursiveDomain.d.ts.map +0 -1
- package/dist/domains/testRecursiveDomain.js +0 -35
- package/dist/domains/testRecursiveDomain.js.map +0 -1
- package/dist/events/events.d.ts +0 -207
- package/dist/events/events.d.ts.map +0 -1
- package/dist/events/events.js.map +0 -1
- package/dist/feature-libraries/schemaBuilder.d.ts +0 -31
- package/dist/feature-libraries/schemaBuilder.d.ts.map +0 -1
- package/dist/feature-libraries/schemaBuilder.js +0 -40
- package/dist/feature-libraries/schemaBuilder.js.map +0 -1
- package/dist/feature-libraries/schemaBuilderBase.d.ts +0 -191
- package/dist/feature-libraries/schemaBuilderBase.d.ts.map +0 -1
- package/dist/feature-libraries/schemaBuilderBase.js +0 -201
- package/dist/feature-libraries/schemaBuilderBase.js.map +0 -1
- package/dist/shared-tree/treeView.d.ts +0 -73
- package/dist/shared-tree/treeView.d.ts.map +0 -1
- package/dist/shared-tree/treeView.js.map +0 -1
- package/dist/simple-tree/getJsonSchema.d.ts.map +0 -1
- package/dist/simple-tree/getJsonSchema.js.map +0 -1
- package/dist/simple-tree/getSimpleSchema.d.ts.map +0 -1
- package/dist/simple-tree/getSimpleSchema.js.map +0 -1
- package/dist/simple-tree/jsonSchema.d.ts.map +0 -1
- package/dist/simple-tree/jsonSchema.js.map +0 -1
- package/dist/simple-tree/simpleSchema.d.ts.map +0 -1
- package/dist/simple-tree/simpleSchema.js.map +0 -1
- package/dist/simple-tree/simpleSchemaToJsonSchema.d.ts.map +0 -1
- package/dist/simple-tree/simpleSchemaToJsonSchema.js.map +0 -1
- package/dist/simple-tree/viewSchemaToSimpleSchema.d.ts.map +0 -1
- package/dist/simple-tree/viewSchemaToSimpleSchema.js.map +0 -1
- package/lib/core/revertible/index.d.ts.map +0 -1
- package/lib/core/revertible/index.js.map +0 -1
- package/lib/core/revertible/revertible.d.ts.map +0 -1
- package/lib/core/revertible/revertible.js.map +0 -1
- package/lib/domains/index.d.ts +0 -8
- package/lib/domains/index.d.ts.map +0 -1
- package/lib/domains/index.js +0 -8
- package/lib/domains/index.js.map +0 -1
- package/lib/domains/json/index.d.ts +0 -7
- package/lib/domains/json/index.d.ts.map +0 -1
- package/lib/domains/json/index.js +0 -7
- package/lib/domains/json/index.js.map +0 -1
- package/lib/domains/json/jsonCursor.d.ts +0 -52
- package/lib/domains/json/jsonCursor.d.ts.map +0 -1
- package/lib/domains/json/jsonCursor.js +0 -192
- package/lib/domains/json/jsonCursor.js.map +0 -1
- package/lib/domains/json/jsonDomainSchema.d.ts +0 -24
- package/lib/domains/json/jsonDomainSchema.d.ts.map +0 -1
- package/lib/domains/json/jsonDomainSchema.js +0 -29
- package/lib/domains/json/jsonDomainSchema.js.map +0 -1
- package/lib/domains/leafDomain.d.ts +0 -72
- package/lib/domains/leafDomain.d.ts.map +0 -1
- package/lib/domains/leafDomain.js +0 -85
- package/lib/domains/leafDomain.js.map +0 -1
- package/lib/domains/schemaBuilder.d.ts +0 -103
- package/lib/domains/schemaBuilder.d.ts.map +0 -1
- package/lib/domains/schemaBuilder.js +0 -117
- package/lib/domains/schemaBuilder.js.map +0 -1
- package/lib/domains/testRecursiveDomain.d.ts +0 -17
- package/lib/domains/testRecursiveDomain.d.ts.map +0 -1
- package/lib/domains/testRecursiveDomain.js +0 -32
- package/lib/domains/testRecursiveDomain.js.map +0 -1
- package/lib/events/events.d.ts +0 -207
- package/lib/events/events.d.ts.map +0 -1
- package/lib/events/events.js.map +0 -1
- package/lib/feature-libraries/schemaBuilder.d.ts +0 -31
- package/lib/feature-libraries/schemaBuilder.d.ts.map +0 -1
- package/lib/feature-libraries/schemaBuilder.js +0 -36
- package/lib/feature-libraries/schemaBuilder.js.map +0 -1
- package/lib/feature-libraries/schemaBuilderBase.d.ts +0 -191
- package/lib/feature-libraries/schemaBuilderBase.d.ts.map +0 -1
- package/lib/feature-libraries/schemaBuilderBase.js +0 -195
- package/lib/feature-libraries/schemaBuilderBase.js.map +0 -1
- package/lib/shared-tree/treeView.d.ts +0 -73
- package/lib/shared-tree/treeView.d.ts.map +0 -1
- package/lib/shared-tree/treeView.js.map +0 -1
- package/lib/simple-tree/getJsonSchema.d.ts.map +0 -1
- package/lib/simple-tree/getJsonSchema.js.map +0 -1
- package/lib/simple-tree/getSimpleSchema.d.ts.map +0 -1
- package/lib/simple-tree/getSimpleSchema.js.map +0 -1
- package/lib/simple-tree/jsonSchema.d.ts.map +0 -1
- package/lib/simple-tree/jsonSchema.js.map +0 -1
- package/lib/simple-tree/simpleSchema.d.ts.map +0 -1
- package/lib/simple-tree/simpleSchema.js.map +0 -1
- package/lib/simple-tree/simpleSchemaToJsonSchema.d.ts.map +0 -1
- package/lib/simple-tree/simpleSchemaToJsonSchema.js.map +0 -1
- package/lib/simple-tree/viewSchemaToSimpleSchema.d.ts.map +0 -1
- package/src/domains/README.md +0 -6
- package/src/domains/fence.json +0 -5
- package/src/domains/index.ts +0 -19
- package/src/domains/json/fence.json +0 -5
- package/src/domains/json/index.ts +0 -13
- package/src/domains/json/jsonCursor.ts +0 -247
- package/src/domains/json/jsonDomainSchema.ts +0 -47
- package/src/domains/leafDomain.ts +0 -97
- package/src/domains/schemaBuilder.ts +0 -153
- package/src/domains/testRecursiveDomain.ts +0 -38
- package/src/events/fence.json +0 -5
- package/src/feature-libraries/schemaBuilder.ts +0 -45
- package/src/feature-libraries/schemaBuilderBase.ts +0 -393
- package/src/shared-tree/treeView.ts +0 -113
- /package/dist/core/{revertible/revertible.js → revertible.js} +0 -0
- /package/dist/simple-tree/{jsonSchema.js → api/jsonSchema.js} +0 -0
- /package/dist/simple-tree/{simpleSchema.js → api/simpleSchema.js} +0 -0
- /package/dist/simple-tree/{simpleSchemaToJsonSchema.d.ts → api/simpleSchemaToJsonSchema.d.ts} +0 -0
- /package/lib/core/{revertible/revertible.js → revertible.js} +0 -0
- /package/lib/simple-tree/{jsonSchema.js → api/jsonSchema.js} +0 -0
- /package/lib/simple-tree/{simpleSchema.js → api/simpleSchema.js} +0 -0
- /package/lib/simple-tree/{simpleSchemaToJsonSchema.d.ts → api/simpleSchemaToJsonSchema.d.ts} +0 -0
|
@@ -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, JsonNodeSchema>;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"simpleSchema.d.ts","sourceRoot":"","sources":["../../src/simple-tree/simpleSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,SAA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M,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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"simpleSchemaToJsonSchema.js","sourceRoot":"","sources":["../../src/simple-tree/simpleSchemaToJsonSchema.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAsE;AACtE,uEAAsE;AACtE,+CAA+C;AAC/C,+CAA+C;AAa/C,qDAA6C;AAS7C,8CAA2C;AAE3C;;;GAGG;AACH,SAAgB,YAAY,CAAC,MAAwB;IACpD,MAAM,WAAW,GAAG,kBAAkB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAE3D,MAAM,KAAK,GAAoB,EAAE,CAAC;IAClC,KAAK,MAAM,WAAW,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;QAC/C,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC;IAC1C,CAAC;IAED,OAAO;QACN,KAAK,EAAE,WAAW;QAClB,KAAK;KACL,CAAC;AACH,CAAC;AAZD,oCAYC;AAED,SAAS,kBAAkB,CAC1B,WAAkD;IAElD,MAAM,MAAM,GAAmC,EAAE,CAAC;IAClD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC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EAAE,mBAAQ,CAAC,MAAM;QACpC,UAAU;QACV,QAAQ;QACR,oBAAoB,EAAE,KAAK;KAC3B,CAAC;AACH,CAAC;AAED,SAAS,oBAAoB,CAAC,MAA2B;IACxD,MAAM,YAAY,GAAoB,EAAE,CAAC;IACzC,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACpC,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IACH,OAAO;QACN,IAAI,EAAE,QAAQ;QACd,mBAAmB,EAAE,mBAAQ,CAAC,GAAG;QACjC,iBAAiB,EAAE;YAClB,MAAM,EAAE;gBACP,KAAK,EAAE,YAAY;aACnB;SACD;KACD,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,QAAgB;IACxC,OAAO;QACN,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC;KAC/B,CAAC;AACH,CAAC;AAED,SAAS,aAAa,CAAC,QAAgB;IACtC,OAAO,WAAW,QAAQ,EAAE,CAAC;AAC9B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { ValueSchema } from \"../core/index.js\";\nimport { getOrCreate } from \"../util/index.js\";\nimport type {\n\tJsonArrayNodeSchema,\n\tJsonFieldSchema,\n\tJsonSchemaRef,\n\tJsonRefPath,\n\tJsonLeafNodeSchema,\n\tJsonMapNodeSchema,\n\tJsonNodeSchema,\n\tJsonObjectNodeSchema,\n\tJsonTreeSchema,\n\tJsonLeafSchemaType,\n} from \"./jsonSchema.js\";\nimport { FieldKind } from \"./schemaTypes.js\";\nimport type {\n\tSimpleArrayNodeSchema,\n\tSimpleLeafNodeSchema,\n\tSimpleMapNodeSchema,\n\tSimpleNodeSchema,\n\tSimpleObjectNodeSchema,\n\tSimpleTreeSchema,\n} from \"./simpleSchema.js\";\nimport { NodeKind } from \"./core/index.js\";\n\n/**\n * Generates a JSON Schema representation from a simple tree schema.\n * @internal\n */\nexport function toJsonSchema(schema: SimpleTreeSchema): JsonTreeSchema {\n\tconst definitions = convertDefinitions(schema.definitions);\n\n\tconst anyOf: JsonSchemaRef[] = [];\n\tfor (const allowedType of schema.allowedTypes) {\n\t\tanyOf.push(createSchemaRef(allowedType));\n\t}\n\n\treturn {\n\t\t$defs: definitions,\n\t\tanyOf,\n\t};\n}\n\nfunction convertDefinitions(\n\tdefinitions: ReadonlyMap<string, SimpleNodeSchema>,\n): Record<string, JsonNodeSchema> {\n\tconst result: Record<string, JsonNodeSchema> = {};\n\tfor (const [key, value] of definitions) {\n\t\tresult[key] = convertNodeSchema(value);\n\t}\n\treturn result;\n}\n\n/**\n * Private symbol under which the results of {@link convertNodeSchema} are cached on an input {@link SimpleNodeSchema}.\n */\nconst nodeJsonSchemaCache = new WeakMap<SimpleNodeSchema, JsonNodeSchema>();\n\n/**\n * Converts an input {@link SimpleNodeSchema} to a {@link JsonNodeSchema}.\n *\n * @remarks Caches the result on the input schema for future calls.\n */\nfunction convertNodeSchema(schema: SimpleNodeSchema): JsonNodeSchema {\n\treturn getOrCreate(nodeJsonSchemaCache, schema, () => {\n\t\tswitch (schema.kind) {\n\t\t\tcase NodeKind.Array:\n\t\t\t\treturn convertArrayNodeSchema(schema);\n\t\t\tcase NodeKind.Leaf:\n\t\t\t\treturn convertLeafNodeSchema(schema);\n\t\t\tcase NodeKind.Map:\n\t\t\t\treturn convertMapNodeSchema(schema);\n\t\t\tcase NodeKind.Object:\n\t\t\t\treturn convertObjectNodeSchema(schema);\n\t\t\tdefault:\n\t\t\t\tthrow new TypeError(`Unknown node schema kind: ${(schema as SimpleNodeSchema).kind}`);\n\t\t}\n\t});\n}\n\nfunction convertArrayNodeSchema(schema: SimpleArrayNodeSchema): JsonArrayNodeSchema {\n\tconst allowedTypes: JsonSchemaRef[] = [];\n\tschema.allowedTypes.forEach((type) => {\n\t\tallowedTypes.push(createSchemaRef(type));\n\t});\n\treturn {\n\t\ttype: \"array\",\n\t\t_treeNodeSchemaKind: NodeKind.Array,\n\t\titems: {\n\t\t\tanyOf: allowedTypes,\n\t\t},\n\t};\n}\n\nfunction convertLeafNodeSchema(schema: SimpleLeafNodeSchema): JsonLeafNodeSchema {\n\tlet type: JsonLeafSchemaType;\n\tswitch (schema.leafKind) {\n\t\tcase ValueSchema.String:\n\t\t\ttype = \"string\";\n\t\t\tbreak;\n\t\tcase ValueSchema.Number:\n\t\t\ttype = \"number\";\n\t\t\tbreak;\n\t\tcase ValueSchema.Boolean:\n\t\t\ttype = \"boolean\";\n\t\t\tbreak;\n\t\tcase ValueSchema.Null:\n\t\t\ttype = \"null\";\n\t\t\tbreak;\n\t\tcase ValueSchema.FluidHandle:\n\t\t\tthrow new UsageError(\"Fluid handles are not supported via JSON Schema.\");\n\t\tdefault:\n\t\t\tunreachableCase(schema.leafKind);\n\t}\n\n\treturn {\n\t\ttype,\n\t\t_treeNodeSchemaKind: NodeKind.Leaf,\n\t};\n}\n\nfunction convertObjectNodeSchema(schema: SimpleObjectNodeSchema): JsonObjectNodeSchema {\n\tconst properties: Record<string, JsonFieldSchema> = {};\n\tconst required: string[] = [];\n\tfor (const [key, value] of Object.entries(schema.fields)) {\n\t\tconst anyOf: JsonSchemaRef[] = [];\n\t\tfor (const allowedType of value.allowedTypes) {\n\t\t\tanyOf.push(createSchemaRef(allowedType));\n\t\t}\n\n\t\tproperties[key] = {\n\t\t\tanyOf,\n\t\t};\n\t\tif (value.kind === FieldKind.Required) {\n\t\t\trequired.push(key);\n\t\t}\n\t}\n\treturn {\n\t\ttype: \"object\",\n\t\t_treeNodeSchemaKind: NodeKind.Object,\n\t\tproperties,\n\t\trequired,\n\t\tadditionalProperties: false,\n\t};\n}\n\nfunction convertMapNodeSchema(schema: SimpleMapNodeSchema): JsonMapNodeSchema {\n\tconst allowedTypes: JsonSchemaRef[] = [];\n\tschema.allowedTypes.forEach((type) => {\n\t\tallowedTypes.push(createSchemaRef(type));\n\t});\n\treturn {\n\t\ttype: \"object\",\n\t\t_treeNodeSchemaKind: NodeKind.Map,\n\t\tpatternProperties: {\n\t\t\t\"^.*$\": {\n\t\t\t\tanyOf: allowedTypes,\n\t\t\t},\n\t\t},\n\t};\n}\n\nfunction createSchemaRef(schemaId: string): JsonSchemaRef {\n\treturn {\n\t\t\"$ref\": createRefPath(schemaId),\n\t};\n}\n\nfunction createRefPath(schemaId: string): JsonRefPath {\n\treturn `#/$defs/${schemaId}`;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"viewSchemaToSimpleSchema.d.ts","sourceRoot":"","sources":["../../src/simple-tree/viewSchemaToSimpleSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAGN,KAAK,oBAAoB,EACzB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAOX,gBAAgB,EAChB,MAAM,mBAAmB,CAAC;AAM3B;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,oBAAoB,GAAG,gBAAgB,CAYjF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"viewSchemaToSimpleSchema.js","sourceRoot":"","sources":["../../src/simple-tree/viewSchemaToSimpleSchema.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA8E;AAC9E,qDAI0B;AAW1B,+CAA+C;AAC/C,6DAAiF;AACjF,8CAAgE;AAEhE;;GAEG;AACH,SAAgB,kBAAkB,CAAC,MAA4B;IAC9D,MAAM,gBAAgB,GAAG,IAAA,qCAAoB,EAAC,MAAM,CAAC,CAAC;IAEtD,MAAM,YAAY,GAAG,2BAA2B,CAAC,gBAAgB,CAAC,CAAC;IAEnE,MAAM,WAAW,GAAG,IAAI,GAAG,EAA4B,CAAC;IACxD,iCAAiC,CAAC,gBAAgB,EAAE,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C;YACrB,6FAA6F;YAE7F,4DAA4D;YAC5D,MAAM,WAAW,GAAG,IAAA,qCAAoB,EAAC,MAAM,CAAC,IAA4B,CAAC,CAAC;YAC9E,iCAAiC,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;YAC5D,MAAM;QACP,CAAC;QACD,KAAK,mBAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;YACtB,IAAA,iBAAM,EAAC,IAAA,uCAAkB,EAAC,MAAM,CAAC,EAAE,KAAK,CAAC,4BAA4B,CAAC,CAAC;YACvE,KAAK,MAAM,CAAC,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;gBACvC,iCAAiC,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;YACvD,CAAC;YACD,MAAM;QACP,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACT,IAAA,0BAAe,EAAC,IAAI,CAAC,CAAC;QACvB,CAAC;IACF,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport {\n\tnormalizeFieldSchema,\n\ttype FieldSchema,\n\ttype ImplicitAllowedTypes,\n} from \"./schemaTypes.js\";\nimport type {\n\tSimpleArrayNodeSchema,\n\tSimpleFieldSchema,\n\tSimpleLeafNodeSchema,\n\tSimpleMapNodeSchema,\n\tSimpleNodeSchema,\n\tSimpleObjectNodeSchema,\n\tSimpleTreeSchema,\n} from \"./simpleSchema.js\";\nimport type { ValueSchema } from \"../core/index.js\";\nimport { getOrCreate } from \"../util/index.js\";\nimport { isObjectNodeSchema, type ObjectNodeSchema } from \"./objectNodeTypes.js\";\nimport { NodeKind, type TreeNodeSchema } from \"./core/index.js\";\n\n/**\n * Converts a \"view\" schema to a \"simple\" schema representation.\n */\nexport function toSimpleTreeSchema(schema: ImplicitAllowedTypes): SimpleTreeSchema {\n\tconst normalizedSchema = normalizeFieldSchema(schema);\n\n\tconst allowedTypes = allowedTypesFromFieldSchema(normalizedSchema);\n\n\tconst definitions = new Map<string, SimpleNodeSchema>();\n\tpopulateSchemaDefinitionsForField(normalizedSchema, definitions);\n\n\treturn {\n\t\tallowedTypes,\n\t\tdefinitions,\n\t};\n}\n\n/**\n * Cache in which the results of {@link toSimpleNodeSchema} are saved.\n */\nconst simpleNodeSchemaCache = new WeakMap<TreeNodeSchema, SimpleNodeSchema>();\n\n/**\n * Creates a {@link SimpleNodeSchema} from a {@link TreeNodeSchema}.\n *\n * @remarks Caches the result on the input schema for future calls.\n */\nfunction toSimpleNodeSchema(schema: TreeNodeSchema): SimpleNodeSchema {\n\treturn getOrCreate(simpleNodeSchemaCache, schema, () => {\n\t\tconst kind = schema.kind;\n\t\tswitch (kind) {\n\t\t\tcase NodeKind.Leaf: {\n\t\t\t\treturn leafSchemaToSimpleSchema(schema);\n\t\t\t}\n\t\t\tcase NodeKind.Map: {\n\t\t\t\treturn mapSchemaToSimpleSchema(schema);\n\t\t\t}\n\t\t\tcase NodeKind.Array: {\n\t\t\t\treturn arraySchemaToSimpleSchema(schema);\n\t\t\t}\n\t\t\tcase NodeKind.Object: {\n\t\t\t\tassert(isObjectNodeSchema(schema), 0xa06 /* Expected object schema */);\n\t\t\t\treturn objectSchemaToSimpleSchema(schema);\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tunreachableCase(kind);\n\t\t\t}\n\t\t}\n\t});\n}\n\n// TODO: Use a stronger type for leaf schemas once one is available (see object schema handler for an example).\nfunction leafSchemaToSimpleSchema(schema: TreeNodeSchema): SimpleLeafNodeSchema {\n\treturn {\n\t\tkind: NodeKind.Leaf,\n\t\tleafKind: schema.info as ValueSchema,\n\t};\n}\n\n// TODO: Use a stronger type for array schemas once one is available (see object schema handler for an example).\nfunction arraySchemaToSimpleSchema(schema: TreeNodeSchema): SimpleArrayNodeSchema {\n\tconst fieldSchema = normalizeFieldSchema(schema.info as ImplicitAllowedTypes);\n\tconst allowedTypes = allowedTypesFromFieldSchema(fieldSchema);\n\treturn {\n\t\tkind: NodeKind.Array,\n\t\tallowedTypes,\n\t};\n}\n\n// TODO: Use a stronger type for map schemas once one is available (see object schema handler for an example).\nfunction mapSchemaToSimpleSchema(schema: TreeNodeSchema): SimpleMapNodeSchema {\n\tconst fieldSchema = normalizeFieldSchema(schema.info as ImplicitAllowedTypes);\n\tconst allowedTypes = allowedTypesFromFieldSchema(fieldSchema);\n\treturn {\n\t\tkind: NodeKind.Map,\n\t\tallowedTypes,\n\t};\n}\n\nfunction objectSchemaToSimpleSchema(schema: ObjectNodeSchema): SimpleObjectNodeSchema {\n\tconst fields: Record<string, SimpleFieldSchema> = {};\n\tfor (const [key, field] of schema.fields) {\n\t\tfields[key] = fieldSchemaToSimpleSchema(field);\n\t}\n\treturn {\n\t\tkind: NodeKind.Object,\n\t\tfields,\n\t};\n}\n\n/**\n * Private symbol under which the results of {@link toSimpleNodeSchema} are cached on an input {@link TreeNodeSchema}.\n */\nconst simpleFieldSchemaCacheSymbol = Symbol(\"simpleFieldSchemaCache\");\n\nfunction fieldSchemaToSimpleSchema(schema: FieldSchema): SimpleFieldSchema {\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tif ((schema as any)[simpleFieldSchemaCacheSymbol] !== undefined) {\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\treturn (schema as any)[simpleFieldSchemaCacheSymbol] as SimpleFieldSchema;\n\t}\n\n\tconst allowedTypes = allowedTypesFromFieldSchema(schema);\n\tconst result = {\n\t\tkind: schema.kind,\n\t\tallowedTypes,\n\t};\n\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t(schema as any)[simpleFieldSchemaCacheSymbol] = result;\n\n\treturn result;\n}\n\nfunction allowedTypesFromFieldSchema(schema: FieldSchema): Set<string> {\n\tconst allowedTypes = new Set<string>();\n\tfor (const type of schema.allowedTypeSet) {\n\t\tallowedTypes.add(type.identifier);\n\t}\n\treturn allowedTypes;\n}\n\n/**\n * Recursively populates `definitions` by walking the input field schema tree.\n */\nfunction populateSchemaDefinitionsForField(\n\tschema: FieldSchema,\n\tdefinitions: Map<string, SimpleNodeSchema>,\n): void {\n\tfor (const child of schema.allowedTypeSet) {\n\t\tpopulateSchemaDefinitionsForNode(child, definitions);\n\t}\n}\n\n/**\n * Recursively populates `definitions` by walking the input node schema tree.\n */\nfunction populateSchemaDefinitionsForNode(\n\tschema: TreeNodeSchema,\n\tdefinitions: Map<string, SimpleNodeSchema>,\n): void {\n\tif (definitions.has(schema.identifier)) {\n\t\t// If the definition has already been populated, no need to recurse.\n\t\treturn;\n\t}\n\n\t// Populate definition for this schema\n\tdefinitions.set(schema.identifier, toSimpleNodeSchema(schema));\n\n\t// Recurse into children to populate definitions for them\n\tconst kind = schema.kind;\n\tswitch (kind) {\n\t\tcase NodeKind.Leaf: {\n\t\t\t// Leaf node, so no need to recurse\n\t\t\tbreak;\n\t\t}\n\t\tcase NodeKind.Map: {\n\t\t\t// TODO: Utilize a map schema type-guard once one exists (see object case for an example).\n\n\t\t\t// Recursively populate definitions for allowed map children\n\t\t\tconst fieldSchema = normalizeFieldSchema(schema.info as ImplicitAllowedTypes);\n\t\t\tpopulateSchemaDefinitionsForField(fieldSchema, definitions);\n\t\t\tbreak;\n\t\t}\n\t\tcase NodeKind.Array: {\n\t\t\t// TODO: Utilize an array schema type-guard once one exists (see object case for an example).\n\n\t\t\t// Recursively populate definitions for allowed map children\n\t\t\tconst fieldSchema = normalizeFieldSchema(schema.info as ImplicitAllowedTypes);\n\t\t\tpopulateSchemaDefinitionsForField(fieldSchema, definitions);\n\t\t\tbreak;\n\t\t}\n\t\tcase NodeKind.Object: {\n\t\t\tassert(isObjectNodeSchema(schema), 0xa07 /* Expected object schema */);\n\t\t\tfor (const [, field] of schema.fields) {\n\t\t\t\tpopulateSchemaDefinitionsForField(field, definitions);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tdefault: {\n\t\t\tunreachableCase(kind);\n\t\t}\n\t}\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/revertible/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,UAAU,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/revertible/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAmB,gBAAgB,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { type Revertible, RevertibleStatus } from \"./revertible.js\";\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"revertible.d.ts","sourceRoot":"","sources":["../../../src/core/revertible/revertible.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;GAOG;AACH,MAAM,WAAW,UAAU;IAC1B;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAElC;;OAEG;IACH,MAAM,IAAI,IAAI,CAAC;IACf;;;;;;OAMG;IACH,MAAM,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAE/B;;OAEG;IACH,OAAO,IAAI,IAAI,CAAC;CAChB;AAED;;;;GAIG;AACH,oBAAY,gBAAgB;IAC3B,sCAAsC;IACtC,KAAK,IAAA;IACL,0EAA0E;IAC1E,QAAQ,IAAA;CACR"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"revertible.js","sourceRoot":"","sources":["../../../src/core/revertible/revertible.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAmCH;;;;GAIG;AACH,MAAM,CAAN,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC3B,sCAAsC;IACtC,yDAAK,CAAA;IACL,0EAA0E;IAC1E,+DAAQ,CAAA;AACT,CAAC,EALW,gBAAgB,KAAhB,gBAAgB,QAK3B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Allows reversion of a change made to SharedTree.\n *\n * @remarks\n * Applications wanting to implement undo/redo support might typically maintain two stacks of Revertibles, with optional eviction policy to free up memory.\n *\n * @sealed @public\n */\nexport interface Revertible {\n\t/**\n\t * The current status of the revertible.\n\t */\n\treadonly status: RevertibleStatus;\n\n\t/**\n\t * Reverts the associated change and disposes it.\n\t */\n\trevert(): void;\n\t/**\n\t * Reverts the associated change and optionally disposes it.\n\t *\n\t * @param dispose - If true, the revertible will be disposed after being reverted.\n\t * If false, the revertible will remain valid. This can be useful for scenarios where the revert may be dropped\n\t * due to merge conflicts, and one wants to attempt reverting again.\n\t */\n\trevert(dispose: boolean): void;\n\n\t/**\n\t * Disposes this revertible, allowing associated resources to be released.\n\t */\n\tdispose(): void;\n}\n\n/**\n * The status of a {@link Revertible}.\n *\n * @public\n */\nexport enum RevertibleStatus {\n\t/** The revertible can be reverted. */\n\tValid,\n\t/** The revertible has been disposed. Reverting it will have no effect. */\n\tDisposed,\n}\n"]}
|
package/lib/domains/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
export { SchemaBuilder } from "./schemaBuilder.js";
|
|
6
|
-
export { cursorToJsonObject, jsonArray, jsonObject, jsonRoot, jsonSchema, singleJsonCursor, typedJsonCursor, type TypedJsonCompatible, type TypedJsonCompatibleObject, } from "./json/index.js";
|
|
7
|
-
export { leaf } from "./leafDomain.js";
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/domains/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EACN,kBAAkB,EAClB,SAAS,EACT,UAAU,EACV,QAAQ,EACR,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,GAC9B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC"}
|
package/lib/domains/index.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
export { SchemaBuilder } from "./schemaBuilder.js";
|
|
6
|
-
export { cursorToJsonObject, jsonArray, jsonObject, jsonRoot, jsonSchema, singleJsonCursor, typedJsonCursor, } from "./json/index.js";
|
|
7
|
-
export { leaf } from "./leafDomain.js";
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
package/lib/domains/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/domains/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EACN,kBAAkB,EAClB,SAAS,EACT,UAAU,EACV,QAAQ,EACR,UAAU,EACV,gBAAgB,EAChB,eAAe,GAGf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { SchemaBuilder } from \"./schemaBuilder.js\";\nexport {\n\tcursorToJsonObject,\n\tjsonArray,\n\tjsonObject,\n\tjsonRoot,\n\tjsonSchema,\n\tsingleJsonCursor,\n\ttypedJsonCursor,\n\ttype TypedJsonCompatible,\n\ttype TypedJsonCompatibleObject,\n} from \"./json/index.js\";\n\nexport { leaf } from \"./leafDomain.js\";\n"]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
export { singleJsonCursor, cursorToJsonObject, typedJsonCursor, type TypedJsonCompatible, type TypedJsonCompatibleObject, } from "./jsonCursor.js";
|
|
6
|
-
export { jsonSchema, jsonObject, jsonArray, jsonRoot } from "./jsonDomainSchema.js";
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/domains/json/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,GAC9B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
export { singleJsonCursor, cursorToJsonObject, typedJsonCursor, } from "./jsonCursor.js";
|
|
6
|
-
export { jsonSchema, jsonObject, jsonArray, jsonRoot } from "./jsonDomainSchema.js";
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domains/json/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,GAGf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tsingleJsonCursor,\n\tcursorToJsonObject,\n\ttypedJsonCursor,\n\ttype TypedJsonCompatible,\n\ttype TypedJsonCompatibleObject,\n} from \"./jsonCursor.js\";\nexport { jsonSchema, jsonObject, jsonArray, jsonRoot } from \"./jsonDomainSchema.js\";\n"]}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { type ITreeCursor, type ITreeCursorSynchronous } from "../../core/index.js";
|
|
6
|
-
import { TreeNodeSchemaBase } from "../../feature-libraries/index.js";
|
|
7
|
-
import { type JsonCompatible } from "../../util/index.js";
|
|
8
|
-
import type { IFluidHandle } from "@fluidframework/core-interfaces/internal";
|
|
9
|
-
/**
|
|
10
|
-
* Used to read generic json compatible data as a tree in the JSON domain.
|
|
11
|
-
* The returned tree will have a schema in the json domain as defined by {@link jsonRoot}.
|
|
12
|
-
*
|
|
13
|
-
* @returns an {@link ITreeCursorSynchronous} for a single {@link JsonCompatible}.
|
|
14
|
-
*/
|
|
15
|
-
export declare function singleJsonCursor(root: JsonCompatible): ITreeCursorSynchronous;
|
|
16
|
-
/**
|
|
17
|
-
* Extract a JS object tree from the contents of the given ITreeCursor.
|
|
18
|
-
* Assumes that ITreeCursor contains only unaugmented JsonTypes.
|
|
19
|
-
*/
|
|
20
|
-
export declare function cursorToJsonObject(reader: ITreeCursor): JsonCompatible;
|
|
21
|
-
/** Used to construct a {@link TypedJsonCursor} */
|
|
22
|
-
export interface TypedJsonCompatibleObject {
|
|
23
|
-
[key: string]: TypedJsonCompatible;
|
|
24
|
-
[typedJsonSymbol]: string | TreeNodeSchemaBase;
|
|
25
|
-
}
|
|
26
|
-
/** Used to construct a {@link TypedJsonCursor} */
|
|
27
|
-
export type TypedJsonCompatible = JsonCompatible | TypedJsonCompatibleObject | TypedJsonCompatible[] | IFluidHandle | JsonCompatible;
|
|
28
|
-
declare const typedJsonSymbol: unique symbol;
|
|
29
|
-
/**
|
|
30
|
-
* A variant of {@link singleJsonCursor} which allows types to be provided for nodes.
|
|
31
|
-
*
|
|
32
|
-
* @remarks Types are optional, but if present will be used to derive the type of the node when the cursor is read.
|
|
33
|
-
*
|
|
34
|
-
* This cursor differs from singleJsonCursor in that it inlines arrays, (arrays are not boxed into an "array node" but are directly interpreted as sequence fields).
|
|
35
|
-
*
|
|
36
|
-
* It also allows Fluid handles as input.
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* ```ts
|
|
40
|
-
* const cursor = typedJsonCursor({
|
|
41
|
-
* [typedJsonCursor.type]: Point,
|
|
42
|
-
* x: 3,
|
|
43
|
-
* y: 42
|
|
44
|
-
* });
|
|
45
|
-
* ```
|
|
46
|
-
*/
|
|
47
|
-
declare const singleTypedJsonCursor: {
|
|
48
|
-
(root: TypedJsonCompatible): ITreeCursorSynchronous;
|
|
49
|
-
type: typeof typedJsonSymbol;
|
|
50
|
-
};
|
|
51
|
-
export { singleTypedJsonCursor as typedJsonCursor };
|
|
52
|
-
//# sourceMappingURL=jsonCursor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jsonCursor.d.ts","sourceRoot":"","sources":["../../../src/domains/json/jsonCursor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAGN,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAG3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAGN,kBAAkB,EAClB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAA0B,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAKlF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAqE7E;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,cAAc,GAAG,sBAAsB,CAE7E;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,WAAW,GAAG,cAAc,CAqCtE;AAID,kDAAkD;AAClD,MAAM,WAAW,yBAAyB;IACzC,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB,CAAC;IACnC,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG,kBAAkB,CAAC;CAC/C;AAED,kDAAkD;AAClD,MAAM,MAAM,mBAAmB,GAC5B,cAAc,GACd,yBAAyB,GACzB,mBAAmB,EAAE,GACrB,YAAY,GACZ,cAAc,CAAC;AAElB,QAAA,MAAM,eAAe,eAA6B,CAAC;AAyDnD;;;;;;;;;;;;;;;;;GAiBG;AACH,QAAA,MAAM,qBAAqB;WAAmB,mBAAmB,GAAG,sBAAsB;;CAEzF,CAAC;AAIF,OAAO,EAAE,qBAAqB,IAAI,eAAe,EAAE,CAAC"}
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { assert } from "@fluidframework/core-utils/internal";
|
|
6
|
-
import { EmptyKey, mapCursorField, mapCursorFields, } from "../../core/index.js";
|
|
7
|
-
import { stackTreeNodeCursor, TreeNodeSchemaBase, } from "../../feature-libraries/index.js";
|
|
8
|
-
import { brand, isReadonlyArray } from "../../util/index.js";
|
|
9
|
-
import { leaf } from "../leafDomain.js";
|
|
10
|
-
import { jsonArray, jsonObject } from "./jsonDomainSchema.js";
|
|
11
|
-
import { isFluidHandle } from "@fluidframework/runtime-utils/internal";
|
|
12
|
-
const adapter = {
|
|
13
|
-
value: (node) => node !== null && typeof node === "object"
|
|
14
|
-
? undefined // arrays and objects have no defined value
|
|
15
|
-
: node, // null, boolean, numbers, and strings are their own values
|
|
16
|
-
type: (node) => {
|
|
17
|
-
const type = typeof node;
|
|
18
|
-
switch (type) {
|
|
19
|
-
case "number":
|
|
20
|
-
return leaf.number.name;
|
|
21
|
-
case "string":
|
|
22
|
-
return leaf.string.name;
|
|
23
|
-
case "boolean":
|
|
24
|
-
return leaf.boolean.name;
|
|
25
|
-
default:
|
|
26
|
-
if (node === null) {
|
|
27
|
-
return leaf.null.name;
|
|
28
|
-
}
|
|
29
|
-
else if (isReadonlyArray(node)) {
|
|
30
|
-
return jsonArray.name;
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
return jsonObject.name;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
keysFromNode: (node) => {
|
|
38
|
-
switch (typeof node) {
|
|
39
|
-
case "object":
|
|
40
|
-
if (node === null) {
|
|
41
|
-
return [];
|
|
42
|
-
}
|
|
43
|
-
else if (isReadonlyArray(node)) {
|
|
44
|
-
return node.length === 0 ? [] : [EmptyKey];
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
return Object.keys(node);
|
|
48
|
-
}
|
|
49
|
-
default:
|
|
50
|
-
return [];
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
getFieldFromNode: (node, key) => {
|
|
54
|
-
// Object.prototype.hasOwnProperty can return true for strings (ex: with key "0"), so we have to filter them out.
|
|
55
|
-
// Rather than just special casing strings, we can handle them with an early return for all primitives.
|
|
56
|
-
if (typeof node !== "object") {
|
|
57
|
-
return [];
|
|
58
|
-
}
|
|
59
|
-
if (node === null) {
|
|
60
|
-
return [];
|
|
61
|
-
}
|
|
62
|
-
if (isReadonlyArray(node)) {
|
|
63
|
-
return key === EmptyKey ? node : [];
|
|
64
|
-
}
|
|
65
|
-
if (Object.prototype.hasOwnProperty.call(node, key)) {
|
|
66
|
-
const field = node[key];
|
|
67
|
-
assert(field !== undefined, 0x41e /* explicit undefined fields should not be preserved in JSON */);
|
|
68
|
-
return [field];
|
|
69
|
-
}
|
|
70
|
-
return [];
|
|
71
|
-
},
|
|
72
|
-
};
|
|
73
|
-
/**
|
|
74
|
-
* Used to read generic json compatible data as a tree in the JSON domain.
|
|
75
|
-
* The returned tree will have a schema in the json domain as defined by {@link jsonRoot}.
|
|
76
|
-
*
|
|
77
|
-
* @returns an {@link ITreeCursorSynchronous} for a single {@link JsonCompatible}.
|
|
78
|
-
*/
|
|
79
|
-
export function singleJsonCursor(root) {
|
|
80
|
-
return stackTreeNodeCursor(adapter, root);
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Extract a JS object tree from the contents of the given ITreeCursor.
|
|
84
|
-
* Assumes that ITreeCursor contains only unaugmented JsonTypes.
|
|
85
|
-
*/
|
|
86
|
-
export function cursorToJsonObject(reader) {
|
|
87
|
-
const type = reader.type;
|
|
88
|
-
switch (type) {
|
|
89
|
-
case leaf.number.name:
|
|
90
|
-
case leaf.boolean.name:
|
|
91
|
-
case leaf.string.name:
|
|
92
|
-
assert(reader.value !== undefined, 0x84f /* out of schema: missing value */);
|
|
93
|
-
assert(!isFluidHandle(reader.value), 0x850 /* out of schema: unexpected FluidHandle */);
|
|
94
|
-
return reader.value;
|
|
95
|
-
case jsonArray.name: {
|
|
96
|
-
reader.enterField(EmptyKey);
|
|
97
|
-
const result = mapCursorField(reader, cursorToJsonObject);
|
|
98
|
-
reader.exitField();
|
|
99
|
-
return result;
|
|
100
|
-
}
|
|
101
|
-
case jsonObject.name: {
|
|
102
|
-
const result = {};
|
|
103
|
-
mapCursorFields(reader, (cursor) => {
|
|
104
|
-
const key = cursor.getFieldKey();
|
|
105
|
-
assert(cursor.firstNode(), 0x420 /* expected non-empty field */);
|
|
106
|
-
// like `result[key] = cursorToJsonObject(reader);` except safe when keyString == "__proto__".
|
|
107
|
-
Object.defineProperty(result, key, {
|
|
108
|
-
enumerable: true,
|
|
109
|
-
configurable: true,
|
|
110
|
-
writable: true,
|
|
111
|
-
value: cursorToJsonObject(reader),
|
|
112
|
-
});
|
|
113
|
-
assert(!cursor.nextNode(), 0x421 /* expected exactly one node */);
|
|
114
|
-
});
|
|
115
|
-
return result;
|
|
116
|
-
}
|
|
117
|
-
default: {
|
|
118
|
-
assert(type === leaf.null.name, 0x422 /* unexpected type */);
|
|
119
|
-
return null;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
const typedJsonSymbol = Symbol("JSON Cursor Type");
|
|
124
|
-
function isObject(json) {
|
|
125
|
-
if (typeof json === "object" && json !== null) {
|
|
126
|
-
const typed = json;
|
|
127
|
-
return typed[typedJsonSymbol] !== undefined;
|
|
128
|
-
}
|
|
129
|
-
return false;
|
|
130
|
-
}
|
|
131
|
-
const typedAdapter = {
|
|
132
|
-
value: (node) => {
|
|
133
|
-
if (isFluidHandle(node)) {
|
|
134
|
-
return node;
|
|
135
|
-
}
|
|
136
|
-
// TODO: Get rid of this cast by combining TypedJsonCompatible and JsonCompatible into a single cursor with flags to configure behavior.
|
|
137
|
-
// This cast is necessary because TypedJsonCompatible can have Fluid handles underneath it, however, `adapter` only cares if `node` itself is a FluidHandle, which it is not.
|
|
138
|
-
return adapter.value(node);
|
|
139
|
-
},
|
|
140
|
-
type: (node) => {
|
|
141
|
-
if (isFluidHandle(node)) {
|
|
142
|
-
return leaf.handle.name;
|
|
143
|
-
}
|
|
144
|
-
if (isObject(node)) {
|
|
145
|
-
const type = node[typedJsonSymbol];
|
|
146
|
-
return type instanceof TreeNodeSchemaBase ? type.name : brand(type);
|
|
147
|
-
}
|
|
148
|
-
return adapter.type(node);
|
|
149
|
-
},
|
|
150
|
-
keysFromNode: (node) => {
|
|
151
|
-
if (isFluidHandle(node)) {
|
|
152
|
-
return [];
|
|
153
|
-
}
|
|
154
|
-
return adapter.keysFromNode(node);
|
|
155
|
-
},
|
|
156
|
-
getFieldFromNode: (node, key) => {
|
|
157
|
-
if (isFluidHandle(node)) {
|
|
158
|
-
return [];
|
|
159
|
-
}
|
|
160
|
-
const field = adapter.getFieldFromNode(node, key);
|
|
161
|
-
if (isReadonlyArray(field) && field.length === 1 && isReadonlyArray(field[0])) {
|
|
162
|
-
// If the field is an array wrapping another array, then unbox to the inner array
|
|
163
|
-
return field[0];
|
|
164
|
-
}
|
|
165
|
-
return field;
|
|
166
|
-
},
|
|
167
|
-
};
|
|
168
|
-
/**
|
|
169
|
-
* A variant of {@link singleJsonCursor} which allows types to be provided for nodes.
|
|
170
|
-
*
|
|
171
|
-
* @remarks Types are optional, but if present will be used to derive the type of the node when the cursor is read.
|
|
172
|
-
*
|
|
173
|
-
* This cursor differs from singleJsonCursor in that it inlines arrays, (arrays are not boxed into an "array node" but are directly interpreted as sequence fields).
|
|
174
|
-
*
|
|
175
|
-
* It also allows Fluid handles as input.
|
|
176
|
-
*
|
|
177
|
-
* @example
|
|
178
|
-
* ```ts
|
|
179
|
-
* const cursor = typedJsonCursor({
|
|
180
|
-
* [typedJsonCursor.type]: Point,
|
|
181
|
-
* x: 3,
|
|
182
|
-
* y: 42
|
|
183
|
-
* });
|
|
184
|
-
* ```
|
|
185
|
-
*/
|
|
186
|
-
const singleTypedJsonCursor = function (root) {
|
|
187
|
-
return stackTreeNodeCursor(typedAdapter, root);
|
|
188
|
-
};
|
|
189
|
-
singleTypedJsonCursor.type = typedJsonSymbol;
|
|
190
|
-
export { singleTypedJsonCursor as typedJsonCursor };
|
|
191
|
-
// #endregion TypedJsonCursor
|
|
192
|
-
//# sourceMappingURL=jsonCursor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jsonCursor.js","sourceRoot":"","sources":["../../../src/domains/json/jsonCursor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAE7D,OAAO,EACN,QAAQ,EAIR,cAAc,EACd,eAAe,GACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEN,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,IAAI,CAAC,IAAsB,CAAC,CAAC;IAC7C,CAAC;IACD,YAAY,EAAE,CAAC,IAAyB,EAAuB,EAAE;QAChE,IAAI,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;YACzB,OAAO,EAAE,CAAC;QACX,CAAC;QACD,OAAO,OAAO,CAAC,YAAY,CAAC,IAAsB,CAAC,CAAC;IACrD,CAAC;IACD,gBAAgB,EAAE,CACjB,IAAyB,EACzB,GAAa,EACoB,EAAE;QACnC,IAAI,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;YACzB,OAAO,EAAE,CAAC;QACX,CAAC;QAED,MAAM,KAAK,GAAG,OAAO,CAAC,gBAAgB,CAAC,IAAsB,EAAE,GAAG,CAAC,CAAC;QACpE,IAAI,eAAe,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAC/E,iFAAiF;YACjF,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;QACjB,CAAC;QAED,OAAO,KAAK,CAAC;IACd,CAAC;CACD,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,qBAAqB,GAAG,UAAU,IAAyB;IAChE,OAAO,mBAAmB,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;AAChD,CAAC,CAAC;AAEF,qBAAqB,CAAC,IAAI,GAAG,eAAe,CAAC;AAE7C,OAAO,EAAE,qBAAqB,IAAI,eAAe,EAAE,CAAC;AAEpD,6BAA6B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tEmptyKey,\n\ttype FieldKey,\n\ttype ITreeCursor,\n\ttype ITreeCursorSynchronous,\n\tmapCursorField,\n\tmapCursorFields,\n} from \"../../core/index.js\";\nimport {\n\ttype CursorAdapter,\n\tstackTreeNodeCursor,\n\tTreeNodeSchemaBase,\n} from \"../../feature-libraries/index.js\";\nimport { brand, isReadonlyArray, type JsonCompatible } from \"../../util/index.js\";\nimport { leaf } from \"../leafDomain.js\";\n\nimport { jsonArray, jsonObject } from \"./jsonDomainSchema.js\";\nimport { isFluidHandle } from \"@fluidframework/runtime-utils/internal\";\nimport type { IFluidHandle } from \"@fluidframework/core-interfaces/internal\";\n\nconst adapter: CursorAdapter<JsonCompatible> = {\n\tvalue: (node: JsonCompatible) =>\n\t\tnode !== null && typeof node === \"object\"\n\t\t\t? undefined // arrays and objects have no defined value\n\t\t\t: node, // null, boolean, numbers, and strings are their own values\n\ttype: (node: JsonCompatible) => {\n\t\tconst type = typeof node;\n\n\t\tswitch (type) {\n\t\t\tcase \"number\":\n\t\t\t\treturn leaf.number.name;\n\t\t\tcase \"string\":\n\t\t\t\treturn leaf.string.name;\n\t\t\tcase \"boolean\":\n\t\t\t\treturn leaf.boolean.name;\n\t\t\tdefault:\n\t\t\t\tif (node === null) {\n\t\t\t\t\treturn leaf.null.name;\n\t\t\t\t} else if (isReadonlyArray(node)) {\n\t\t\t\t\treturn jsonArray.name;\n\t\t\t\t} else {\n\t\t\t\t\treturn jsonObject.name;\n\t\t\t\t}\n\t\t}\n\t},\n\tkeysFromNode: (node: JsonCompatible): readonly FieldKey[] => {\n\t\tswitch (typeof node) {\n\t\t\tcase \"object\":\n\t\t\t\tif (node === null) {\n\t\t\t\t\treturn [];\n\t\t\t\t} else if (isReadonlyArray(node)) {\n\t\t\t\t\treturn node.length === 0 ? [] : [EmptyKey];\n\t\t\t\t} else {\n\t\t\t\t\treturn Object.keys(node) as FieldKey[];\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn [];\n\t\t}\n\t},\n\tgetFieldFromNode: (node: JsonCompatible, key: FieldKey): readonly JsonCompatible[] => {\n\t\t// Object.prototype.hasOwnProperty can return true for strings (ex: with key \"0\"), so we have to filter them out.\n\t\t// Rather than just special casing strings, we can handle them with an early return for all primitives.\n\t\tif (typeof node !== \"object\") {\n\t\t\treturn [];\n\t\t}\n\n\t\tif (node === null) {\n\t\t\treturn [];\n\t\t}\n\n\t\tif (isReadonlyArray(node)) {\n\t\t\treturn key === EmptyKey ? node : [];\n\t\t}\n\n\t\tif (Object.prototype.hasOwnProperty.call(node, key)) {\n\t\t\tconst field = node[key];\n\t\t\tassert(\n\t\t\t\tfield !== undefined,\n\t\t\t\t0x41e /* explicit undefined fields should not be preserved in JSON */,\n\t\t\t);\n\t\t\treturn [field];\n\t\t}\n\n\t\treturn [];\n\t},\n};\n\n/**\n * Used to read generic json compatible data as a tree in the JSON domain.\n * The returned tree will have a schema in the json domain as defined by {@link jsonRoot}.\n *\n * @returns an {@link ITreeCursorSynchronous} for a single {@link JsonCompatible}.\n */\nexport function singleJsonCursor(root: JsonCompatible): ITreeCursorSynchronous {\n\treturn stackTreeNodeCursor(adapter, root);\n}\n\n/**\n * Extract a JS object tree from the contents of the given ITreeCursor.\n * Assumes that ITreeCursor contains only unaugmented JsonTypes.\n */\nexport function cursorToJsonObject(reader: ITreeCursor): JsonCompatible {\n\tconst type = reader.type;\n\n\tswitch (type) {\n\t\tcase leaf.number.name:\n\t\tcase leaf.boolean.name:\n\t\tcase leaf.string.name:\n\t\t\tassert(reader.value !== undefined, 0x84f /* out of schema: missing value */);\n\t\t\tassert(!isFluidHandle(reader.value), 0x850 /* out of schema: unexpected FluidHandle */);\n\t\t\treturn reader.value;\n\t\tcase jsonArray.name: {\n\t\t\treader.enterField(EmptyKey);\n\t\t\tconst result = mapCursorField(reader, cursorToJsonObject);\n\t\t\treader.exitField();\n\t\t\treturn result;\n\t\t}\n\t\tcase jsonObject.name: {\n\t\t\tconst result: JsonCompatible = {};\n\t\t\tmapCursorFields(reader, (cursor) => {\n\t\t\t\tconst key = cursor.getFieldKey();\n\t\t\t\tassert(cursor.firstNode(), 0x420 /* expected non-empty field */);\n\t\t\t\t// like `result[key] = cursorToJsonObject(reader);` except safe when keyString == \"__proto__\".\n\t\t\t\tObject.defineProperty(result, key, {\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t\twritable: true,\n\t\t\t\t\tvalue: cursorToJsonObject(reader),\n\t\t\t\t});\n\t\t\t\tassert(!cursor.nextNode(), 0x421 /* expected exactly one node */);\n\t\t\t});\n\t\t\treturn result;\n\t\t}\n\t\tdefault: {\n\t\t\tassert(type === leaf.null.name, 0x422 /* unexpected type */);\n\t\t\treturn null;\n\t\t}\n\t}\n}\n\n// #region TypedJsonCursor\n\n/** Used to construct a {@link TypedJsonCursor} */\nexport interface TypedJsonCompatibleObject {\n\t[key: string]: TypedJsonCompatible;\n\t[typedJsonSymbol]: string | TreeNodeSchemaBase;\n}\n\n/** Used to construct a {@link TypedJsonCursor} */\nexport type TypedJsonCompatible =\n\t| JsonCompatible\n\t| TypedJsonCompatibleObject\n\t| TypedJsonCompatible[]\n\t| IFluidHandle\n\t| JsonCompatible;\n\nconst typedJsonSymbol = Symbol(\"JSON Cursor Type\");\n\nfunction isObject(json: TypedJsonCompatible): json is TypedJsonCompatibleObject {\n\tif (typeof json === \"object\" && json !== null) {\n\t\tconst typed = json as Partial<TypedJsonCompatibleObject>;\n\t\treturn typed[typedJsonSymbol] !== undefined;\n\t}\n\n\treturn false;\n}\n\nconst typedAdapter: CursorAdapter<TypedJsonCompatible> = {\n\tvalue: (node: TypedJsonCompatible) => {\n\t\tif (isFluidHandle(node)) {\n\t\t\treturn node;\n\t\t}\n\n\t\t// TODO: Get rid of this cast by combining TypedJsonCompatible and JsonCompatible into a single cursor with flags to configure behavior.\n\t\t// This cast is necessary because TypedJsonCompatible can have Fluid handles underneath it, however, `adapter` only cares if `node` itself is a FluidHandle, which it is not.\n\t\treturn adapter.value(node as JsonCompatible);\n\t},\n\ttype: (node: TypedJsonCompatible) => {\n\t\tif (isFluidHandle(node)) {\n\t\t\treturn leaf.handle.name;\n\t\t}\n\n\t\tif (isObject(node)) {\n\t\t\tconst type = node[typedJsonSymbol];\n\t\t\treturn type instanceof TreeNodeSchemaBase ? type.name : brand(type);\n\t\t}\n\n\t\treturn adapter.type(node as JsonCompatible);\n\t},\n\tkeysFromNode: (node: TypedJsonCompatible): readonly FieldKey[] => {\n\t\tif (isFluidHandle(node)) {\n\t\t\treturn [];\n\t\t}\n\t\treturn adapter.keysFromNode(node as JsonCompatible);\n\t},\n\tgetFieldFromNode: (\n\t\tnode: TypedJsonCompatible,\n\t\tkey: FieldKey,\n\t): readonly TypedJsonCompatible[] => {\n\t\tif (isFluidHandle(node)) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst field = adapter.getFieldFromNode(node as JsonCompatible, key);\n\t\tif (isReadonlyArray(field) && field.length === 1 && isReadonlyArray(field[0])) {\n\t\t\t// If the field is an array wrapping another array, then unbox to the inner array\n\t\t\treturn field[0];\n\t\t}\n\n\t\treturn field;\n\t},\n};\n\n/**\n * A variant of {@link singleJsonCursor} which allows types to be provided for nodes.\n *\n * @remarks Types are optional, but if present will be used to derive the type of the node when the cursor is read.\n *\n * This cursor differs from singleJsonCursor in that it inlines arrays, (arrays are not boxed into an \"array node\" but are directly interpreted as sequence fields).\n *\n * It also allows Fluid handles as input.\n *\n * @example\n * ```ts\n * const cursor = typedJsonCursor({\n * [typedJsonCursor.type]: Point,\n * x: 3,\n * y: 42\n * });\n * ```\n */\nconst singleTypedJsonCursor = function (root: TypedJsonCompatible): ITreeCursorSynchronous {\n\treturn stackTreeNodeCursor(typedAdapter, root);\n};\n\nsingleTypedJsonCursor.type = typedJsonSymbol;\n\nexport { singleTypedJsonCursor as typedJsonCursor };\n\n// #endregion TypedJsonCursor\n"]}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { ValueSchema } from "../../core/index.js";
|
|
6
|
-
import { FlexFieldSchema } from "../../feature-libraries/index.js";
|
|
7
|
-
/**
|
|
8
|
-
* Types allowed as roots of Json content.
|
|
9
|
-
*/
|
|
10
|
-
export declare const jsonRoot: readonly [() => import("../../feature-libraries/index.js").FlexMapNodeSchema<"com.fluidframework.json.object", FlexFieldSchema<import("../../feature-libraries/index.js").Optional, readonly [any, () => import("../../feature-libraries/index.js").FlexObjectNodeSchema<"com.fluidframework.json.array", {
|
|
11
|
-
readonly [x: string]: FlexFieldSchema<import("../../feature-libraries/index.js").Sequence, readonly [any, any, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.number", ValueSchema.Number>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.boolean", ValueSchema.Boolean>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.string", ValueSchema.String>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.null", ValueSchema.Null>]>;
|
|
12
|
-
}>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.number", ValueSchema.Number>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.boolean", ValueSchema.Boolean>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.string", ValueSchema.String>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.null", ValueSchema.Null>]>>, () => import("../../feature-libraries/index.js").FlexObjectNodeSchema<"com.fluidframework.json.array", {
|
|
13
|
-
readonly [x: string]: FlexFieldSchema<import("../../feature-libraries/index.js").Sequence, readonly [() => import("../../feature-libraries/index.js").FlexMapNodeSchema<"com.fluidframework.json.object", FlexFieldSchema<import("../../feature-libraries/index.js").Optional, readonly [any, any, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.number", ValueSchema.Number>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.boolean", ValueSchema.Boolean>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.string", ValueSchema.String>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.null", ValueSchema.Null>]>>, any, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.number", ValueSchema.Number>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.boolean", ValueSchema.Boolean>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.string", ValueSchema.String>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.null", ValueSchema.Null>]>;
|
|
14
|
-
}>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.number", ValueSchema.Number>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.boolean", ValueSchema.Boolean>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.string", ValueSchema.String>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.null", ValueSchema.Null>];
|
|
15
|
-
export declare const jsonObject: import("../../feature-libraries/index.js").FlexMapNodeSchema<"com.fluidframework.json.object", FlexFieldSchema<import("../../feature-libraries/index.js").Optional, readonly [() => import("../../feature-libraries/index.js").FlexMapNodeSchema<"com.fluidframework.json.object", FlexFieldSchema<import("../../feature-libraries/index.js").Optional, readonly [any, () => import("../../feature-libraries/index.js").FlexObjectNodeSchema<"com.fluidframework.json.array", {
|
|
16
|
-
readonly [x: string]: FlexFieldSchema<import("../../feature-libraries/index.js").Sequence, readonly [any, any, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.number", ValueSchema.Number>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.boolean", ValueSchema.Boolean>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.string", ValueSchema.String>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.null", ValueSchema.Null>]>;
|
|
17
|
-
}>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.number", ValueSchema.Number>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.boolean", ValueSchema.Boolean>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.string", ValueSchema.String>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.null", ValueSchema.Null>]>>, () => import("../../feature-libraries/index.js").FlexObjectNodeSchema<"com.fluidframework.json.array", {
|
|
18
|
-
readonly [x: string]: FlexFieldSchema<import("../../feature-libraries/index.js").Sequence, readonly [() => import("../../feature-libraries/index.js").FlexMapNodeSchema<"com.fluidframework.json.object", FlexFieldSchema<import("../../feature-libraries/index.js").Optional, readonly [any, any, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.number", ValueSchema.Number>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.boolean", ValueSchema.Boolean>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.string", ValueSchema.String>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.null", ValueSchema.Null>]>>, any, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.number", ValueSchema.Number>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.boolean", ValueSchema.Boolean>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.string", ValueSchema.String>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.null", ValueSchema.Null>]>;
|
|
19
|
-
}>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.number", ValueSchema.Number>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.boolean", ValueSchema.Boolean>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.string", ValueSchema.String>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.null", ValueSchema.Null>]>>;
|
|
20
|
-
export declare const jsonArray: import("../../feature-libraries/index.js").FlexObjectNodeSchema<"com.fluidframework.json.array", {
|
|
21
|
-
readonly [x: string]: FlexFieldSchema<import("../../feature-libraries/index.js").Sequence, readonly [() => import("../../feature-libraries/index.js").FlexMapNodeSchema<"com.fluidframework.json.object", FlexFieldSchema<import("../../feature-libraries/index.js").Optional, readonly [any, () => import("../../feature-libraries/index.js").FlexObjectNodeSchema<"com.fluidframework.json.array", any>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.number", ValueSchema.Number>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.boolean", ValueSchema.Boolean>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.string", ValueSchema.String>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.null", ValueSchema.Null>]>>, () => import("../../feature-libraries/index.js").FlexObjectNodeSchema<"com.fluidframework.json.array", any>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.number", ValueSchema.Number>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.boolean", ValueSchema.Boolean>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.string", ValueSchema.String>, import("../../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.null", ValueSchema.Null>]>;
|
|
22
|
-
}>;
|
|
23
|
-
export declare const jsonSchema: import("../../feature-libraries/schemaBuilderBase.js").SchemaLibrary;
|
|
24
|
-
//# sourceMappingURL=jsonDomainSchema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jsonDomainSchema.d.ts","sourceRoot":"","sources":["../../../src/domains/json/jsonDomainSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAY,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAGN,eAAe,EAEf,MAAM,kCAAkC,CAAC;AAW1C;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;qcAAkE,CAAC;AAOxF,eAAO,MAAM,UAAU;;;;ucAGtB,CAAC;AAEF,eAAO,MAAM,SAAS;;EAEpB,CAAC;AAEH,eAAO,MAAM,UAAU,sEAAwB,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
// Adding this unused import makes the generated d.ts file produced by TypeScript stop breaking API-Extractor's rollup generation.
|
|
6
|
-
// Without this import, TypeScript generates inline `import("../..")` statements in the d.ts file,
|
|
7
|
-
// which API-Extractor leaves as is when generating the rollup, leaving them pointing at the wrong directory.
|
|
8
|
-
// API-Extractor issue: https://github.com/microsoft/rushstack/issues/4507
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-imports
|
|
10
|
-
import { EmptyKey } from "../../core/index.js";
|
|
11
|
-
import { FieldKinds, FlexFieldSchema, SchemaBuilderInternal, } from "../../feature-libraries/index.js";
|
|
12
|
-
import { leaf } from "../leafDomain.js";
|
|
13
|
-
const builder = new SchemaBuilderInternal({
|
|
14
|
-
scope: "com.fluidframework.json",
|
|
15
|
-
libraries: [leaf.library],
|
|
16
|
-
});
|
|
17
|
-
const jsonPrimitives = [...leaf.primitives, leaf.null];
|
|
18
|
-
/**
|
|
19
|
-
* Types allowed as roots of Json content.
|
|
20
|
-
*/
|
|
21
|
-
export const jsonRoot = [() => jsonObject, () => jsonArray, ...jsonPrimitives];
|
|
22
|
-
{
|
|
23
|
-
}
|
|
24
|
-
export const jsonObject = builder.mapRecursive("object", FlexFieldSchema.createUnsafe(FieldKinds.optional, jsonRoot));
|
|
25
|
-
export const jsonArray = builder.objectRecursive("array", {
|
|
26
|
-
[EmptyKey]: FlexFieldSchema.createUnsafe(FieldKinds.sequence, jsonRoot),
|
|
27
|
-
});
|
|
28
|
-
export const jsonSchema = builder.intoLibrary();
|
|
29
|
-
//# sourceMappingURL=jsonDomainSchema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jsonDomainSchema.js","sourceRoot":"","sources":["../../../src/domains/json/jsonDomainSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,kIAAkI;AAClI,kGAAkG;AAClG,6GAA6G;AAC7G,0EAA0E;AAC1E,+FAA+F;AAC/F,OAAO,EAAE,QAAQ,EAAe,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EACN,UAAU,EAEV,eAAe,EACf,qBAAqB,GACrB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,MAAM,OAAO,GAAG,IAAI,qBAAqB,CAAC;IACzC,KAAK,EAAE,yBAAyB;IAChC,SAAS,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;CACzB,CAAC,CAAC;AAEH,MAAM,cAAc,GAAG,CAAC,GAAG,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAU,CAAC;AAEhE;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,GAAG,cAAc,CAAU,CAAC;AAExF,CAAC;AAGD,CAAC;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO,CAAC,YAAY,CAC7C,QAAQ,EACR,eAAe,CAAC,YAAY,CAAC,UAAU,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAC3D,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,OAAO,CAAC,eAAe,CAAC,OAAO,EAAE;IACzD,CAAC,QAAQ,CAAC,EAAE,eAAe,CAAC,YAAY,CAAC,UAAU,CAAC,QAAQ,EAAE,QAAQ,CAAC;CACvE,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// Adding this unused import makes the generated d.ts file produced by TypeScript stop breaking API-Extractor's rollup generation.\n// Without this import, TypeScript generates inline `import(\"../..\")` statements in the d.ts file,\n// which API-Extractor leaves as is when generating the rollup, leaving them pointing at the wrong directory.\n// API-Extractor issue: https://github.com/microsoft/rushstack/issues/4507\n// eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-imports\nimport { EmptyKey, ValueSchema } from \"../../core/index.js\";\nimport {\n\tFieldKinds,\n\ttype FlexAllowedTypes,\n\tFlexFieldSchema,\n\tSchemaBuilderInternal,\n} from \"../../feature-libraries/index.js\";\nimport type { requireAssignableTo } from \"../../util/index.js\";\nimport { leaf } from \"../leafDomain.js\";\n\nconst builder = new SchemaBuilderInternal({\n\tscope: \"com.fluidframework.json\",\n\tlibraries: [leaf.library],\n});\n\nconst jsonPrimitives = [...leaf.primitives, leaf.null] as const;\n\n/**\n * Types allowed as roots of Json content.\n */\nexport const jsonRoot = [() => jsonObject, () => jsonArray, ...jsonPrimitives] as const;\n\n{\n\t// Recursive objects don't get this type checking automatically, so confirm it\n\ttype _check = requireAssignableTo<typeof jsonRoot, FlexAllowedTypes>;\n}\n\nexport const jsonObject = builder.mapRecursive(\n\t\"object\",\n\tFlexFieldSchema.createUnsafe(FieldKinds.optional, jsonRoot),\n);\n\nexport const jsonArray = builder.objectRecursive(\"array\", {\n\t[EmptyKey]: FlexFieldSchema.createUnsafe(FieldKinds.sequence, jsonRoot),\n});\n\nexport const jsonSchema = builder.intoLibrary();\n"]}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { ValueSchema } from "../core/index.js";
|
|
6
|
-
/**
|
|
7
|
-
* Built-in {@link LeafNodeSchema}.
|
|
8
|
-
*/
|
|
9
|
-
export declare const leaf: {
|
|
10
|
-
/**
|
|
11
|
-
* {@link LeafNodeSchema} for holding a JavaScript `number`.
|
|
12
|
-
*
|
|
13
|
-
* @remarks
|
|
14
|
-
* The number is a [double-precision 64-bit binary format IEEE 754](https://en.wikipedia.org/wiki/Double-precision_floating-point_format) value, however there are some exceptions:
|
|
15
|
-
* - `NaN`, and the infinities should not be used.
|
|
16
|
-
* - `-0` may be converted to `0` in some cases.
|
|
17
|
-
*
|
|
18
|
-
* These limitations match the limitations of JSON.
|
|
19
|
-
* @privateRemarks
|
|
20
|
-
* TODO:
|
|
21
|
-
* We should be much more clear about what happens if you use problematic values.
|
|
22
|
-
* We should validate and/or normalize them when inserting content.
|
|
23
|
-
*/
|
|
24
|
-
number: import("../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.number", ValueSchema.Number>;
|
|
25
|
-
/**
|
|
26
|
-
* {@link LeafNodeSchema} for holding a boolean.
|
|
27
|
-
*/
|
|
28
|
-
boolean: import("../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.boolean", ValueSchema.Boolean>;
|
|
29
|
-
/**
|
|
30
|
-
* {@link LeafNodeSchema} for holding a JavaScript `string`.
|
|
31
|
-
*
|
|
32
|
-
* @remarks
|
|
33
|
-
* Strings containing unpaired UTF-16 surrogate pair code units may not be handled correctly.
|
|
34
|
-
*
|
|
35
|
-
* These limitations come from the use of UTF-8 encoding of the strings, which requires them to be valid unicode.
|
|
36
|
-
* JavaScript does not make this requirement for its strings so not all possible JavaScript strings are supported.
|
|
37
|
-
* @privateRemarks
|
|
38
|
-
* TODO:
|
|
39
|
-
* We should be much more clear about what happens if you use problematic values.
|
|
40
|
-
* We should validate and/or normalize them when inserting content.
|
|
41
|
-
*/
|
|
42
|
-
string: import("../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.string", ValueSchema.String>;
|
|
43
|
-
/**
|
|
44
|
-
* {@link LeafNodeSchema} for holding an {@link @fluidframework/core-interfaces#(IFluidHandle:interface)}.
|
|
45
|
-
*/
|
|
46
|
-
handle: import("../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.handle", ValueSchema.FluidHandle>;
|
|
47
|
-
/**
|
|
48
|
-
* {@link LeafNodeSchema} for JavaScript `null`.
|
|
49
|
-
*
|
|
50
|
-
* @remarks
|
|
51
|
-
* There are good [reasons to avoid using null](https://www.npmjs.com/package/%40rushstack/eslint-plugin#rushstackno-new-null) in JavaScript, however sometimes it is desired.
|
|
52
|
-
* This {@link LeafNodeSchema} node provides the option to include nulls in trees when desired.
|
|
53
|
-
* Unless directly inter-operating with existing data using null, consider other approaches, like wrapping the value in an optional field, or using a more specifically named empty object node.
|
|
54
|
-
*/
|
|
55
|
-
null: import("../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.null", ValueSchema.Null>;
|
|
56
|
-
/**
|
|
57
|
-
* The set of {@link LeafNodeSchema} which correspond to JavaScript primitive (non-object) types.
|
|
58
|
-
*/
|
|
59
|
-
primitives: readonly [import("../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.number", ValueSchema.Number>, import("../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.boolean", ValueSchema.Boolean>, import("../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.string", ValueSchema.String>];
|
|
60
|
-
/**
|
|
61
|
-
* All {@link LeafNodeSchema} defined in this library..
|
|
62
|
-
*/
|
|
63
|
-
all: readonly [import("../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.handle", ValueSchema.FluidHandle>, import("../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.null", ValueSchema.Null>, import("../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.number", ValueSchema.Number>, import("../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.boolean", ValueSchema.Boolean>, import("../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.string", ValueSchema.String>];
|
|
64
|
-
/**
|
|
65
|
-
* {@link SchemaLibrary} of the {@link LeafNodeSchema}.
|
|
66
|
-
*
|
|
67
|
-
* @privateRemarks
|
|
68
|
-
* This is included by default in schema produced with {@link SchemaBuilder}.
|
|
69
|
-
*/
|
|
70
|
-
library: import("../feature-libraries/schemaBuilderBase.js").SchemaLibrary;
|
|
71
|
-
};
|
|
72
|
-
//# sourceMappingURL=leafDomain.d.ts.map
|