@fluidframework/tree 2.2.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dependency-cruiser-known-violations.json +28 -40
- package/.vscode/Tree.code-workspace +0 -2
- package/CHANGELOG.md +92 -0
- package/README.md +6 -0
- package/alpha.d.ts +11 -0
- package/api-extractor/api-extractor-lint-alpha.cjs.json +5 -0
- package/api-extractor/api-extractor-lint-alpha.esm.json +5 -0
- package/api-extractor/api-extractor-lint-legacy.cjs.json +5 -0
- package/api-extractor/api-extractor-lint-legacy.esm.json +5 -0
- package/api-extractor/api-extractor.current.json +8 -0
- package/api-extractor/api-extractor.legacy.json +4 -0
- package/api-extractor.json +1 -1
- package/api-report/tree.alpha.api.md +21 -6
- package/api-report/tree.beta.api.md +21 -6
- package/api-report/tree.legacy.alpha.api.md +562 -0
- package/api-report/tree.legacy.public.api.md +559 -0
- package/api-report/tree.public.api.md +6 -6
- package/dist/alpha.d.ts +102 -0
- package/dist/beta.d.ts +6 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/{revertible/revertible.d.ts → revertible.d.ts} +12 -0
- package/dist/core/revertible.d.ts.map +1 -0
- package/dist/core/revertible.js.map +1 -0
- package/dist/core/schema-stored/format.d.ts +3 -3
- package/dist/core/schema-stored/format.js +1 -1
- package/dist/core/schema-stored/format.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +2 -7
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +4 -6
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.d.ts +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.d.ts +4 -6
- package/dist/core/tree/anchorSet.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.js +15 -1
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/detachedFieldIndex.d.ts +0 -1
- package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndex.js +1 -0
- package/dist/core/tree/detachedFieldIndex.js.map +1 -1
- package/dist/core/tree/visitDelta.d.ts +7 -2
- package/dist/core/tree/visitDelta.d.ts.map +1 -1
- package/dist/core/tree/visitDelta.js.map +1 -1
- package/dist/events/emitter.d.ts +127 -0
- package/dist/events/emitter.d.ts.map +1 -0
- package/dist/events/{events.js → emitter.js} +49 -28
- package/dist/events/emitter.js.map +1 -0
- package/dist/events/index.d.ts +2 -1
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +4 -5
- package/dist/events/index.js.map +1 -1
- package/dist/events/interop.d.ts +36 -0
- package/dist/events/interop.d.ts.map +1 -0
- package/dist/{core/revertible/index.d.ts → events/interop.js} +3 -2
- package/dist/events/interop.js.map +1 -0
- package/dist/events/listeners.d.ts +65 -0
- package/dist/events/listeners.d.ts.map +1 -0
- package/{lib/core/revertible/index.d.ts → dist/events/listeners.js} +3 -2
- package/dist/events/listeners.js.map +1 -0
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +25 -7
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js +36 -15
- package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts +4 -2
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.js +12 -5
- package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts +15 -2
- package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.js +28 -2
- package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +3 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js +5 -4
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/dist/feature-libraries/flex-map-tree/index.d.ts +1 -1
- package/dist/feature-libraries/flex-map-tree/index.d.ts.map +1 -1
- package/dist/feature-libraries/flex-map-tree/index.js +2 -1
- package/dist/feature-libraries/flex-map-tree/index.js.map +1 -1
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts +35 -35
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.js +82 -115
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
- package/dist/feature-libraries/flex-tree/context.d.ts +30 -14
- package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/context.js +10 -7
- package/dist/feature-libraries/flex-tree/context.js.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +57 -281
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js +15 -32
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/dist/feature-libraries/flex-tree/index.d.ts +2 -3
- package/dist/feature-libraries/flex-tree/index.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/index.js +1 -3
- package/dist/feature-libraries/flex-tree/index.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyEntity.d.ts +3 -3
- package/dist/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyEntity.js +2 -10
- package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.d.ts +26 -29
- package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +11 -17
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts +6 -34
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.js +23 -159
- package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/dist/feature-libraries/flex-tree/unboxed.d.ts +4 -16
- package/dist/feature-libraries/flex-tree/unboxed.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/unboxed.js +7 -41
- package/dist/feature-libraries/flex-tree/unboxed.js.map +1 -1
- package/dist/feature-libraries/flex-tree/utilities.d.ts +2 -2
- package/dist/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/utilities.js +3 -6
- package/dist/feature-libraries/flex-tree/utilities.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +4 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +3 -5
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +5 -13
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.js +3 -6
- package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/dist/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/discrepancies.js +3 -13
- package/dist/feature-libraries/modular-schema/discrepancies.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +4 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +2 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +12 -5
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +6 -6
- package/dist/feature-libraries/schema-index/format.d.ts +3 -3
- package/dist/feature-libraries/storedToViewSchema.d.ts.map +1 -1
- package/dist/feature-libraries/storedToViewSchema.js +2 -4
- package/dist/feature-libraries/storedToViewSchema.js.map +1 -1
- package/dist/feature-libraries/typed-schema/flexList.d.ts +3 -3
- package/dist/feature-libraries/typed-schema/flexList.js.map +1 -1
- package/dist/feature-libraries/typed-schema/index.d.ts +2 -2
- package/dist/feature-libraries/typed-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/typed-schema/index.js +2 -2
- package/dist/feature-libraries/typed-schema/index.js.map +1 -1
- package/dist/feature-libraries/typed-schema/schemaCollection.d.ts.map +1 -1
- package/dist/feature-libraries/typed-schema/schemaCollection.js +8 -10
- package/dist/feature-libraries/typed-schema/schemaCollection.js.map +1 -1
- package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts +17 -48
- package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
- package/dist/feature-libraries/typed-schema/typedTreeSchema.js +5 -37
- package/dist/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
- package/dist/feature-libraries/typed-schema/view.d.ts +4 -6
- package/dist/feature-libraries/typed-schema/view.d.ts.map +1 -1
- package/dist/feature-libraries/typed-schema/view.js +5 -4
- package/dist/feature-libraries/typed-schema/view.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +83 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/shared-tree/checkoutFlexTreeView.d.ts +53 -0
- package/dist/shared-tree/checkoutFlexTreeView.d.ts.map +1 -0
- package/dist/shared-tree/{treeView.js → checkoutFlexTreeView.js} +28 -6
- package/dist/shared-tree/checkoutFlexTreeView.js.map +1 -0
- package/dist/shared-tree/index.d.ts +3 -3
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js +2 -2
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/schematizeTree.d.ts +15 -4
- package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
- package/dist/shared-tree/schematizeTree.js +7 -8
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +9 -4
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +25 -12
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +2 -2
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.d.ts +3 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.js +6 -2
- package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts +3 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js +3 -2
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts +2 -1
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.js +2 -2
- package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/dist/shared-tree/treeApi.d.ts +1 -3
- package/dist/shared-tree/treeApi.d.ts.map +1 -1
- package/dist/shared-tree/treeApi.js +6 -4
- package/dist/shared-tree/treeApi.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +2 -13
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +17 -1
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/branch.js +1 -1
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/simple-tree/api/create.d.ts.map +1 -1
- package/dist/simple-tree/api/create.js +1 -1
- package/dist/simple-tree/api/create.js.map +1 -1
- package/{lib/simple-tree → dist/simple-tree/api}/getJsonSchema.d.ts +1 -1
- package/dist/simple-tree/api/getJsonSchema.d.ts.map +1 -0
- package/dist/simple-tree/{getJsonSchema.js → api/getJsonSchema.js} +1 -1
- package/dist/simple-tree/api/getJsonSchema.js.map +1 -0
- package/{lib/simple-tree → dist/simple-tree/api}/getSimpleSchema.d.ts +1 -1
- package/dist/simple-tree/api/getSimpleSchema.d.ts.map +1 -0
- package/dist/simple-tree/{getSimpleSchema.js → api/getSimpleSchema.js} +1 -1
- package/dist/simple-tree/api/getSimpleSchema.js.map +1 -0
- package/dist/simple-tree/api/index.d.ts +5 -0
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +7 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/{lib/simple-tree → dist/simple-tree/api}/jsonSchema.d.ts +1 -1
- package/dist/simple-tree/api/jsonSchema.d.ts.map +1 -0
- package/dist/simple-tree/api/jsonSchema.js.map +1 -0
- package/dist/simple-tree/api/schemaFactory.d.ts +45 -14
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +43 -12
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/{simpleSchema.d.ts → api/simpleSchema.d.ts} +4 -4
- package/dist/simple-tree/api/simpleSchema.d.ts.map +1 -0
- package/dist/simple-tree/api/simpleSchema.js.map +1 -0
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -0
- package/dist/simple-tree/{simpleSchemaToJsonSchema.js → api/simpleSchemaToJsonSchema.js} +4 -4
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -0
- package/dist/simple-tree/api/tree.d.ts +1 -21
- package/dist/simple-tree/api/tree.d.ts.map +1 -1
- package/dist/simple-tree/api/tree.js +3 -38
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/treeApiBeta.d.ts +79 -0
- package/dist/simple-tree/api/treeApiBeta.d.ts.map +1 -0
- package/dist/simple-tree/api/treeApiBeta.js +26 -0
- package/dist/simple-tree/api/treeApiBeta.js.map +1 -0
- package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.js +51 -21
- package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
- package/dist/simple-tree/api/verboseTree.js +2 -2
- package/dist/simple-tree/api/verboseTree.js.map +1 -1
- package/dist/simple-tree/{viewSchemaToSimpleSchema.d.ts → api/viewSchemaToSimpleSchema.d.ts} +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -0
- package/dist/simple-tree/{viewSchemaToSimpleSchema.js → api/viewSchemaToSimpleSchema.js} +4 -4
- package/{lib/simple-tree → dist/simple-tree/api}/viewSchemaToSimpleSchema.js.map +1 -1
- package/dist/simple-tree/arrayNode.d.ts +2 -2
- package/dist/simple-tree/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/arrayNode.js +33 -38
- package/dist/simple-tree/arrayNode.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +2 -2
- package/dist/simple-tree/core/index.d.ts.map +1 -1
- package/dist/simple-tree/core/index.js +4 -1
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/schemaCaching.d.ts +5 -0
- package/dist/simple-tree/core/schemaCaching.d.ts.map +1 -1
- package/dist/simple-tree/core/schemaCaching.js +10 -1
- package/dist/simple-tree/core/schemaCaching.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.d.ts +78 -7
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +219 -30
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts +1 -1
- package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/dist/simple-tree/core/types.d.ts +23 -8
- package/dist/simple-tree/core/types.d.ts.map +1 -1
- package/dist/simple-tree/core/types.js.map +1 -1
- package/dist/simple-tree/core/withType.d.ts +3 -2
- package/dist/simple-tree/core/withType.d.ts.map +1 -1
- package/dist/simple-tree/core/withType.js.map +1 -1
- package/dist/simple-tree/index.d.ts +7 -9
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +15 -6
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts +7 -9
- package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js +13 -11
- package/dist/simple-tree/leafNodeSchema.js.map +1 -1
- package/dist/simple-tree/mapNode.d.ts +1 -1
- package/dist/simple-tree/mapNode.d.ts.map +1 -1
- package/dist/simple-tree/mapNode.js +38 -29
- package/dist/simple-tree/mapNode.js.map +1 -1
- package/dist/simple-tree/objectNode.d.ts +9 -7
- package/dist/simple-tree/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/objectNode.js +37 -31
- package/dist/simple-tree/objectNode.js.map +1 -1
- package/dist/simple-tree/proxies.d.ts +1 -14
- package/dist/simple-tree/proxies.d.ts.map +1 -1
- package/dist/simple-tree/proxies.js +12 -15
- package/dist/simple-tree/proxies.js.map +1 -1
- package/dist/simple-tree/proxyBinding.d.ts +2 -62
- package/dist/simple-tree/proxyBinding.d.ts.map +1 -1
- package/dist/simple-tree/proxyBinding.js +8 -181
- package/dist/simple-tree/proxyBinding.js.map +1 -1
- package/dist/simple-tree/schemaTypes.d.ts +7 -7
- package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
- package/dist/simple-tree/schemaTypes.js +4 -4
- package/dist/simple-tree/schemaTypes.js.map +1 -1
- package/dist/simple-tree/toFlexSchema.d.ts +11 -1
- package/dist/simple-tree/toFlexSchema.d.ts.map +1 -1
- package/dist/simple-tree/toFlexSchema.js +54 -31
- package/dist/simple-tree/toFlexSchema.js.map +1 -1
- package/dist/simple-tree/toMapTree.d.ts +25 -37
- package/dist/simple-tree/toMapTree.d.ts.map +1 -1
- package/dist/simple-tree/toMapTree.js +53 -16
- package/dist/simple-tree/toMapTree.js.map +1 -1
- package/dist/simple-tree/treeNodeValid.d.ts.map +1 -1
- package/dist/simple-tree/treeNodeValid.js +7 -10
- package/dist/simple-tree/treeNodeValid.js.map +1 -1
- package/dist/simple-tree/typesUnsafe.d.ts +13 -13
- package/dist/simple-tree/typesUnsafe.js.map +1 -1
- package/dist/simple-tree/walkSchema.d.ts +26 -0
- package/dist/simple-tree/walkSchema.d.ts.map +1 -0
- package/dist/simple-tree/walkSchema.js +49 -0
- package/dist/simple-tree/walkSchema.js.map +1 -0
- package/dist/treeFactory.d.ts +2 -1
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +2 -1
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/typeUtils.d.ts +2 -2
- package/dist/util/typeUtils.js.map +1 -1
- package/legacy.d.ts +11 -0
- package/lib/alpha.d.ts +102 -0
- package/lib/beta.d.ts +6 -1
- package/lib/core/index.d.ts +1 -1
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +1 -1
- package/lib/core/index.js.map +1 -1
- package/lib/core/{revertible/revertible.d.ts → revertible.d.ts} +12 -0
- package/lib/core/revertible.d.ts.map +1 -0
- package/lib/core/revertible.js.map +1 -0
- package/lib/core/schema-stored/format.d.ts +3 -3
- package/lib/core/schema-stored/format.js +1 -1
- package/lib/core/schema-stored/format.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +2 -7
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +4 -6
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.d.ts +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.d.ts +4 -6
- package/lib/core/tree/anchorSet.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.js +15 -1
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/core/tree/detachedFieldIndex.d.ts +0 -1
- package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndex.js +1 -0
- package/lib/core/tree/detachedFieldIndex.js.map +1 -1
- package/lib/core/tree/visitDelta.d.ts +7 -2
- package/lib/core/tree/visitDelta.d.ts.map +1 -1
- package/lib/core/tree/visitDelta.js.map +1 -1
- package/lib/events/emitter.d.ts +127 -0
- package/lib/events/emitter.d.ts.map +1 -0
- package/lib/events/{events.js → emitter.js} +49 -27
- package/lib/events/emitter.js.map +1 -0
- package/lib/events/index.d.ts +2 -1
- package/lib/events/index.d.ts.map +1 -1
- package/lib/events/index.js +1 -1
- package/lib/events/index.js.map +1 -1
- package/lib/events/interop.d.ts +36 -0
- package/lib/events/interop.d.ts.map +1 -0
- package/{src/core/revertible/index.ts → lib/events/interop.js} +2 -2
- package/lib/events/interop.js.map +1 -0
- package/lib/events/listeners.d.ts +65 -0
- package/lib/events/listeners.d.ts.map +1 -0
- package/lib/{core/revertible/index.js → events/listeners.js} +2 -2
- package/lib/events/listeners.js.map +1 -0
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +25 -7
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js +37 -16
- package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts +4 -2
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.js +12 -5
- package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts +15 -2
- package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js +28 -2
- package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +3 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js +5 -4
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/flex-map-tree/index.d.ts +1 -1
- package/lib/feature-libraries/flex-map-tree/index.d.ts.map +1 -1
- package/lib/feature-libraries/flex-map-tree/index.js +1 -1
- package/lib/feature-libraries/flex-map-tree/index.js.map +1 -1
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts +35 -35
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.js +83 -116
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
- package/lib/feature-libraries/flex-tree/context.d.ts +30 -14
- package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/context.js +10 -7
- package/lib/feature-libraries/flex-tree/context.js.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +57 -281
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js +15 -31
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/lib/feature-libraries/flex-tree/index.d.ts +2 -3
- package/lib/feature-libraries/flex-tree/index.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/index.js +2 -2
- package/lib/feature-libraries/flex-tree/index.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyEntity.d.ts +3 -3
- package/lib/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyEntity.js +2 -10
- package/lib/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.d.ts +26 -29
- package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +11 -16
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts +6 -34
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.js +24 -156
- package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/lib/feature-libraries/flex-tree/unboxed.d.ts +4 -16
- package/lib/feature-libraries/flex-tree/unboxed.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/unboxed.js +5 -37
- package/lib/feature-libraries/flex-tree/unboxed.js.map +1 -1
- package/lib/feature-libraries/flex-tree/utilities.d.ts +2 -2
- package/lib/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/utilities.js +3 -6
- package/lib/feature-libraries/flex-tree/utilities.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +4 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +3 -5
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +5 -5
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.js +3 -6
- package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/lib/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/discrepancies.js +3 -13
- package/lib/feature-libraries/modular-schema/discrepancies.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +4 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +2 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +12 -5
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +6 -6
- package/lib/feature-libraries/schema-index/format.d.ts +3 -3
- package/lib/feature-libraries/storedToViewSchema.d.ts.map +1 -1
- package/lib/feature-libraries/storedToViewSchema.js +3 -5
- package/lib/feature-libraries/storedToViewSchema.js.map +1 -1
- package/lib/feature-libraries/typed-schema/flexList.d.ts +3 -3
- package/lib/feature-libraries/typed-schema/flexList.js.map +1 -1
- package/lib/feature-libraries/typed-schema/index.d.ts +2 -2
- package/lib/feature-libraries/typed-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/typed-schema/index.js +2 -2
- package/lib/feature-libraries/typed-schema/index.js.map +1 -1
- package/lib/feature-libraries/typed-schema/schemaCollection.d.ts.map +1 -1
- package/lib/feature-libraries/typed-schema/schemaCollection.js +9 -11
- package/lib/feature-libraries/typed-schema/schemaCollection.js.map +1 -1
- package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts +17 -48
- package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
- package/lib/feature-libraries/typed-schema/typedTreeSchema.js +5 -36
- package/lib/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
- package/lib/feature-libraries/typed-schema/view.d.ts +4 -6
- package/lib/feature-libraries/typed-schema/view.d.ts.map +1 -1
- package/lib/feature-libraries/typed-schema/view.js +5 -4
- package/lib/feature-libraries/typed-schema/view.js.map +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +83 -0
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/shared-tree/checkoutFlexTreeView.d.ts +53 -0
- package/lib/shared-tree/checkoutFlexTreeView.d.ts.map +1 -0
- package/lib/shared-tree/{treeView.js → checkoutFlexTreeView.js} +26 -5
- package/lib/shared-tree/checkoutFlexTreeView.js.map +1 -0
- package/lib/shared-tree/index.d.ts +3 -3
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js +1 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/schematizeTree.d.ts +15 -4
- package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
- package/lib/shared-tree/schematizeTree.js +8 -9
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +9 -4
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +26 -13
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +2 -2
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.d.ts +3 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.js +6 -2
- package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts +3 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js +3 -2
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts +2 -1
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.js +2 -2
- package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/lib/shared-tree/treeApi.d.ts +1 -3
- package/lib/shared-tree/treeApi.d.ts.map +1 -1
- package/lib/shared-tree/treeApi.js +7 -5
- package/lib/shared-tree/treeApi.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +2 -13
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +18 -2
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/branch.js +1 -1
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/simple-tree/api/create.d.ts.map +1 -1
- package/lib/simple-tree/api/create.js +2 -2
- package/lib/simple-tree/api/create.js.map +1 -1
- package/{dist/simple-tree → lib/simple-tree/api}/getJsonSchema.d.ts +1 -1
- package/lib/simple-tree/api/getJsonSchema.d.ts.map +1 -0
- package/lib/simple-tree/{getJsonSchema.js → api/getJsonSchema.js} +1 -1
- package/lib/simple-tree/api/getJsonSchema.js.map +1 -0
- package/{dist/simple-tree → lib/simple-tree/api}/getSimpleSchema.d.ts +1 -1
- package/lib/simple-tree/api/getSimpleSchema.d.ts.map +1 -0
- package/lib/simple-tree/{getSimpleSchema.js → api/getSimpleSchema.js} +1 -1
- package/lib/simple-tree/api/getSimpleSchema.js.map +1 -0
- package/lib/simple-tree/api/index.d.ts +5 -0
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +3 -0
- package/lib/simple-tree/api/index.js.map +1 -1
- package/{dist/simple-tree → lib/simple-tree/api}/jsonSchema.d.ts +1 -1
- package/lib/simple-tree/api/jsonSchema.d.ts.map +1 -0
- package/lib/simple-tree/api/jsonSchema.js.map +1 -0
- package/lib/simple-tree/api/schemaFactory.d.ts +45 -14
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +43 -12
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/{simpleSchema.d.ts → api/simpleSchema.d.ts} +4 -4
- package/lib/simple-tree/api/simpleSchema.d.ts.map +1 -0
- package/lib/simple-tree/api/simpleSchema.js.map +1 -0
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -0
- package/lib/simple-tree/{simpleSchemaToJsonSchema.js → api/simpleSchemaToJsonSchema.js} +4 -4
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -0
- package/lib/simple-tree/api/tree.d.ts +1 -21
- package/lib/simple-tree/api/tree.d.ts.map +1 -1
- package/lib/simple-tree/api/tree.js +2 -34
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/treeApiBeta.d.ts +79 -0
- package/lib/simple-tree/api/treeApiBeta.d.ts.map +1 -0
- package/lib/simple-tree/api/treeApiBeta.js +23 -0
- package/lib/simple-tree/api/treeApiBeta.js.map +1 -0
- package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.js +53 -23
- package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/api/verboseTree.js +1 -1
- package/lib/simple-tree/api/verboseTree.js.map +1 -1
- package/lib/simple-tree/{viewSchemaToSimpleSchema.d.ts → api/viewSchemaToSimpleSchema.d.ts} +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -0
- package/lib/simple-tree/{viewSchemaToSimpleSchema.js → api/viewSchemaToSimpleSchema.js} +4 -4
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -0
- package/lib/simple-tree/arrayNode.d.ts +2 -2
- package/lib/simple-tree/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/arrayNode.js +36 -41
- package/lib/simple-tree/arrayNode.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +2 -2
- package/lib/simple-tree/core/index.d.ts.map +1 -1
- package/lib/simple-tree/core/index.js +2 -2
- package/lib/simple-tree/core/index.js.map +1 -1
- package/lib/simple-tree/core/schemaCaching.d.ts +5 -0
- package/lib/simple-tree/core/schemaCaching.d.ts.map +1 -1
- package/lib/simple-tree/core/schemaCaching.js +8 -0
- package/lib/simple-tree/core/schemaCaching.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.d.ts +78 -7
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +211 -24
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts +1 -1
- package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/lib/simple-tree/core/types.d.ts +23 -8
- package/lib/simple-tree/core/types.d.ts.map +1 -1
- package/lib/simple-tree/core/types.js.map +1 -1
- package/lib/simple-tree/core/withType.d.ts +3 -2
- package/lib/simple-tree/core/withType.d.ts.map +1 -1
- package/lib/simple-tree/core/withType.js.map +1 -1
- package/lib/simple-tree/index.d.ts +7 -9
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +5 -5
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.d.ts +7 -9
- package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js +14 -12
- package/lib/simple-tree/leafNodeSchema.js.map +1 -1
- package/lib/simple-tree/mapNode.d.ts +1 -1
- package/lib/simple-tree/mapNode.d.ts.map +1 -1
- package/lib/simple-tree/mapNode.js +38 -29
- package/lib/simple-tree/mapNode.js.map +1 -1
- package/lib/simple-tree/objectNode.d.ts +9 -7
- package/lib/simple-tree/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/objectNode.js +40 -34
- package/lib/simple-tree/objectNode.js.map +1 -1
- package/lib/simple-tree/proxies.d.ts +1 -14
- package/lib/simple-tree/proxies.d.ts.map +1 -1
- package/lib/simple-tree/proxies.js +11 -14
- package/lib/simple-tree/proxies.js.map +1 -1
- package/lib/simple-tree/proxyBinding.d.ts +2 -62
- package/lib/simple-tree/proxyBinding.d.ts.map +1 -1
- package/lib/simple-tree/proxyBinding.js +6 -174
- package/lib/simple-tree/proxyBinding.js.map +1 -1
- package/lib/simple-tree/schemaTypes.d.ts +7 -7
- package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
- package/lib/simple-tree/schemaTypes.js +4 -4
- package/lib/simple-tree/schemaTypes.js.map +1 -1
- package/lib/simple-tree/toFlexSchema.d.ts +11 -1
- package/lib/simple-tree/toFlexSchema.d.ts.map +1 -1
- package/lib/simple-tree/toFlexSchema.js +29 -8
- package/lib/simple-tree/toFlexSchema.js.map +1 -1
- package/lib/simple-tree/toMapTree.d.ts +25 -37
- package/lib/simple-tree/toMapTree.d.ts.map +1 -1
- package/lib/simple-tree/toMapTree.js +54 -17
- package/lib/simple-tree/toMapTree.js.map +1 -1
- package/lib/simple-tree/treeNodeValid.d.ts.map +1 -1
- package/lib/simple-tree/treeNodeValid.js +8 -11
- package/lib/simple-tree/treeNodeValid.js.map +1 -1
- package/lib/simple-tree/typesUnsafe.d.ts +13 -13
- package/lib/simple-tree/typesUnsafe.js.map +1 -1
- package/lib/simple-tree/walkSchema.d.ts +26 -0
- package/lib/simple-tree/walkSchema.d.ts.map +1 -0
- package/lib/simple-tree/walkSchema.js +43 -0
- package/lib/simple-tree/walkSchema.js.map +1 -0
- package/lib/treeFactory.d.ts +2 -1
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +2 -1
- package/lib/treeFactory.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/lib/util/typeUtils.d.ts +2 -2
- package/lib/util/typeUtils.js.map +1 -1
- package/package.json +58 -36
- package/src/core/index.ts +1 -1
- package/src/core/{revertible/revertible.ts → revertible.ts} +15 -0
- package/src/core/schema-stored/format.ts +1 -1
- package/src/core/schema-stored/schema.ts +6 -13
- package/src/core/tree/anchorSet.ts +35 -9
- package/src/core/tree/detachedFieldIndex.ts +6 -5
- package/src/core/tree/visitDelta.ts +7 -2
- package/src/events/{events.ts → emitter.ts} +55 -134
- package/src/events/index.ts +7 -7
- package/src/events/interop.ts +49 -0
- package/src/events/listeners.ts +68 -0
- package/src/feature-libraries/chunked-forest/chunkTree.ts +63 -18
- package/src/feature-libraries/chunked-forest/chunkedForest.ts +18 -4
- package/src/feature-libraries/chunked-forest/uniformChunk.ts +33 -0
- package/src/feature-libraries/default-schema/defaultEditBuilder.ts +5 -3
- package/src/feature-libraries/flex-map-tree/index.ts +1 -0
- package/src/feature-libraries/flex-map-tree/mapTreeNode.ts +135 -231
- package/src/feature-libraries/flex-tree/README.md +4 -75
- package/src/feature-libraries/flex-tree/context.ts +37 -16
- package/src/feature-libraries/flex-tree/flexTreeTypes.ts +69 -458
- package/src/feature-libraries/flex-tree/index.ts +7 -29
- package/src/feature-libraries/flex-tree/lazyEntity.ts +2 -11
- package/src/feature-libraries/flex-tree/lazyField.ts +49 -79
- package/src/feature-libraries/flex-tree/lazyNode.ts +26 -306
- package/src/feature-libraries/flex-tree/unboxed.ts +9 -68
- package/src/feature-libraries/flex-tree/utilities.ts +4 -8
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +4 -1
- package/src/feature-libraries/index.ts +2 -41
- package/src/feature-libraries/modular-schema/comparison.ts +4 -6
- package/src/feature-libraries/modular-schema/discrepancies.ts +7 -16
- package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +4 -1
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +14 -4
- package/src/feature-libraries/storedToViewSchema.ts +5 -6
- package/src/feature-libraries/typed-schema/flexList.ts +3 -3
- package/src/feature-libraries/typed-schema/index.ts +1 -3
- package/src/feature-libraries/typed-schema/schemaCollection.ts +15 -17
- package/src/feature-libraries/typed-schema/typedTreeSchema.ts +35 -127
- package/src/feature-libraries/typed-schema/view.ts +4 -13
- package/src/index.ts +5 -1
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/checkoutFlexTreeView.ts +89 -0
- package/src/shared-tree/index.ts +2 -7
- package/src/shared-tree/schematizeTree.ts +23 -12
- package/src/shared-tree/schematizingTreeView.ts +34 -24
- package/src/shared-tree/sharedTree.ts +6 -1
- package/src/shared-tree/sharedTreeChangeEnricher.ts +6 -1
- package/src/shared-tree/sharedTreeChangeFamily.ts +7 -1
- package/src/shared-tree/sharedTreeEditBuilder.ts +9 -4
- package/src/shared-tree/treeApi.ts +10 -10
- package/src/shared-tree/treeCheckout.ts +26 -15
- package/src/shared-tree-core/branch.ts +1 -1
- package/src/simple-tree/ProxyBinding.md +23 -23
- package/src/simple-tree/api/create.ts +8 -3
- package/src/simple-tree/{getJsonSchema.ts → api/getJsonSchema.ts} +3 -3
- package/src/simple-tree/{getSimpleSchema.ts → api/getSimpleSchema.ts} +3 -3
- package/src/simple-tree/api/index.ts +20 -0
- package/src/simple-tree/{jsonSchema.ts → api/jsonSchema.ts} +1 -1
- package/src/simple-tree/api/schemaFactory.ts +44 -13
- package/src/simple-tree/{simpleSchema.ts → api/simpleSchema.ts} +4 -4
- package/src/simple-tree/{simpleSchemaToJsonSchema.ts → api/simpleSchemaToJsonSchema.ts} +4 -4
- package/src/simple-tree/api/tree.ts +2 -71
- package/src/simple-tree/api/treeApiBeta.ts +101 -0
- package/src/simple-tree/api/treeNodeApi.ts +63 -22
- package/src/simple-tree/api/verboseTree.ts +1 -1
- package/src/simple-tree/{viewSchemaToSimpleSchema.ts → api/viewSchemaToSimpleSchema.ts} +5 -5
- package/src/simple-tree/arrayNode.ts +38 -41
- package/src/simple-tree/core/index.ts +4 -0
- package/src/simple-tree/core/schemaCaching.ts +10 -0
- package/src/simple-tree/core/treeNodeKernel.ts +279 -27
- package/src/simple-tree/core/treeNodeSchema.ts +1 -1
- package/src/simple-tree/core/types.ts +23 -8
- package/src/simple-tree/core/withType.ts +3 -1
- package/src/simple-tree/index.ts +29 -20
- package/src/simple-tree/leafNodeSchema.ts +24 -28
- package/src/simple-tree/mapNode.ts +47 -29
- package/src/simple-tree/objectNode.ts +51 -46
- package/src/simple-tree/proxies.ts +22 -51
- package/src/simple-tree/proxyBinding.ts +3 -254
- package/src/simple-tree/schemaTypes.ts +8 -8
- package/src/simple-tree/toFlexSchema.ts +40 -7
- package/src/simple-tree/toMapTree.ts +113 -79
- package/src/simple-tree/treeNodeValid.ts +10 -13
- package/src/simple-tree/typesUnsafe.ts +13 -13
- package/src/simple-tree/walkSchema.ts +81 -0
- package/src/treeFactory.ts +2 -1
- package/src/util/typeUtils.ts +2 -2
- package/dist/core/revertible/index.d.ts.map +0 -1
- package/dist/core/revertible/index.js +0 -10
- package/dist/core/revertible/index.js.map +0 -1
- package/dist/core/revertible/revertible.d.ts.map +0 -1
- package/dist/core/revertible/revertible.js.map +0 -1
- package/dist/domains/index.d.ts +0 -8
- package/dist/domains/index.d.ts.map +0 -1
- package/dist/domains/index.js +0 -20
- package/dist/domains/index.js.map +0 -1
- package/dist/domains/json/index.d.ts +0 -7
- package/dist/domains/json/index.d.ts.map +0 -1
- package/dist/domains/json/index.js +0 -17
- package/dist/domains/json/index.js.map +0 -1
- package/dist/domains/json/jsonCursor.d.ts +0 -52
- package/dist/domains/json/jsonCursor.d.ts.map +0 -1
- package/dist/domains/json/jsonCursor.js +0 -197
- package/dist/domains/json/jsonCursor.js.map +0 -1
- package/dist/domains/json/jsonDomainSchema.d.ts +0 -24
- package/dist/domains/json/jsonDomainSchema.d.ts.map +0 -1
- package/dist/domains/json/jsonDomainSchema.js +0 -32
- package/dist/domains/json/jsonDomainSchema.js.map +0 -1
- package/dist/domains/leafDomain.d.ts +0 -72
- package/dist/domains/leafDomain.d.ts.map +0 -1
- package/dist/domains/leafDomain.js +0 -88
- package/dist/domains/leafDomain.js.map +0 -1
- package/dist/domains/schemaBuilder.d.ts +0 -103
- package/dist/domains/schemaBuilder.d.ts.map +0 -1
- package/dist/domains/schemaBuilder.js +0 -121
- package/dist/domains/schemaBuilder.js.map +0 -1
- package/dist/domains/testRecursiveDomain.d.ts +0 -17
- package/dist/domains/testRecursiveDomain.d.ts.map +0 -1
- package/dist/domains/testRecursiveDomain.js +0 -35
- package/dist/domains/testRecursiveDomain.js.map +0 -1
- package/dist/events/events.d.ts +0 -201
- package/dist/events/events.d.ts.map +0 -1
- package/dist/events/events.js.map +0 -1
- package/dist/feature-libraries/schemaBuilder.d.ts +0 -31
- package/dist/feature-libraries/schemaBuilder.d.ts.map +0 -1
- package/dist/feature-libraries/schemaBuilder.js +0 -40
- package/dist/feature-libraries/schemaBuilder.js.map +0 -1
- package/dist/feature-libraries/schemaBuilderBase.d.ts +0 -191
- package/dist/feature-libraries/schemaBuilderBase.d.ts.map +0 -1
- package/dist/feature-libraries/schemaBuilderBase.js +0 -201
- package/dist/feature-libraries/schemaBuilderBase.js.map +0 -1
- package/dist/shared-tree/treeView.d.ts +0 -73
- package/dist/shared-tree/treeView.d.ts.map +0 -1
- package/dist/shared-tree/treeView.js.map +0 -1
- package/dist/simple-tree/getJsonSchema.d.ts.map +0 -1
- package/dist/simple-tree/getJsonSchema.js.map +0 -1
- package/dist/simple-tree/getSimpleSchema.d.ts.map +0 -1
- package/dist/simple-tree/getSimpleSchema.js.map +0 -1
- package/dist/simple-tree/jsonSchema.d.ts.map +0 -1
- package/dist/simple-tree/jsonSchema.js.map +0 -1
- package/dist/simple-tree/simpleSchema.d.ts.map +0 -1
- package/dist/simple-tree/simpleSchema.js.map +0 -1
- package/dist/simple-tree/simpleSchemaToJsonSchema.d.ts.map +0 -1
- package/dist/simple-tree/simpleSchemaToJsonSchema.js.map +0 -1
- package/dist/simple-tree/viewSchemaToSimpleSchema.d.ts.map +0 -1
- package/dist/simple-tree/viewSchemaToSimpleSchema.js.map +0 -1
- package/lib/core/revertible/index.d.ts.map +0 -1
- package/lib/core/revertible/index.js.map +0 -1
- package/lib/core/revertible/revertible.d.ts.map +0 -1
- package/lib/core/revertible/revertible.js.map +0 -1
- package/lib/domains/index.d.ts +0 -8
- package/lib/domains/index.d.ts.map +0 -1
- package/lib/domains/index.js +0 -8
- package/lib/domains/index.js.map +0 -1
- package/lib/domains/json/index.d.ts +0 -7
- package/lib/domains/json/index.d.ts.map +0 -1
- package/lib/domains/json/index.js +0 -7
- package/lib/domains/json/index.js.map +0 -1
- package/lib/domains/json/jsonCursor.d.ts +0 -52
- package/lib/domains/json/jsonCursor.d.ts.map +0 -1
- package/lib/domains/json/jsonCursor.js +0 -192
- package/lib/domains/json/jsonCursor.js.map +0 -1
- package/lib/domains/json/jsonDomainSchema.d.ts +0 -24
- package/lib/domains/json/jsonDomainSchema.d.ts.map +0 -1
- package/lib/domains/json/jsonDomainSchema.js +0 -29
- package/lib/domains/json/jsonDomainSchema.js.map +0 -1
- package/lib/domains/leafDomain.d.ts +0 -72
- package/lib/domains/leafDomain.d.ts.map +0 -1
- package/lib/domains/leafDomain.js +0 -85
- package/lib/domains/leafDomain.js.map +0 -1
- package/lib/domains/schemaBuilder.d.ts +0 -103
- package/lib/domains/schemaBuilder.d.ts.map +0 -1
- package/lib/domains/schemaBuilder.js +0 -117
- package/lib/domains/schemaBuilder.js.map +0 -1
- package/lib/domains/testRecursiveDomain.d.ts +0 -17
- package/lib/domains/testRecursiveDomain.d.ts.map +0 -1
- package/lib/domains/testRecursiveDomain.js +0 -32
- package/lib/domains/testRecursiveDomain.js.map +0 -1
- package/lib/events/events.d.ts +0 -201
- package/lib/events/events.d.ts.map +0 -1
- package/lib/events/events.js.map +0 -1
- package/lib/feature-libraries/schemaBuilder.d.ts +0 -31
- package/lib/feature-libraries/schemaBuilder.d.ts.map +0 -1
- package/lib/feature-libraries/schemaBuilder.js +0 -36
- package/lib/feature-libraries/schemaBuilder.js.map +0 -1
- package/lib/feature-libraries/schemaBuilderBase.d.ts +0 -191
- package/lib/feature-libraries/schemaBuilderBase.d.ts.map +0 -1
- package/lib/feature-libraries/schemaBuilderBase.js +0 -195
- package/lib/feature-libraries/schemaBuilderBase.js.map +0 -1
- package/lib/shared-tree/treeView.d.ts +0 -73
- package/lib/shared-tree/treeView.d.ts.map +0 -1
- package/lib/shared-tree/treeView.js.map +0 -1
- package/lib/simple-tree/getJsonSchema.d.ts.map +0 -1
- package/lib/simple-tree/getJsonSchema.js.map +0 -1
- package/lib/simple-tree/getSimpleSchema.d.ts.map +0 -1
- package/lib/simple-tree/getSimpleSchema.js.map +0 -1
- package/lib/simple-tree/jsonSchema.d.ts.map +0 -1
- package/lib/simple-tree/jsonSchema.js.map +0 -1
- package/lib/simple-tree/simpleSchema.d.ts.map +0 -1
- package/lib/simple-tree/simpleSchema.js.map +0 -1
- package/lib/simple-tree/simpleSchemaToJsonSchema.d.ts.map +0 -1
- package/lib/simple-tree/simpleSchemaToJsonSchema.js.map +0 -1
- package/lib/simple-tree/viewSchemaToSimpleSchema.d.ts.map +0 -1
- package/src/domains/README.md +0 -6
- package/src/domains/fence.json +0 -5
- package/src/domains/index.ts +0 -19
- package/src/domains/json/fence.json +0 -5
- package/src/domains/json/index.ts +0 -13
- package/src/domains/json/jsonCursor.ts +0 -247
- package/src/domains/json/jsonDomainSchema.ts +0 -47
- package/src/domains/leafDomain.ts +0 -97
- package/src/domains/schemaBuilder.ts +0 -153
- package/src/domains/testRecursiveDomain.ts +0 -38
- package/src/events/fence.json +0 -5
- package/src/feature-libraries/schemaBuilder.ts +0 -45
- package/src/feature-libraries/schemaBuilderBase.ts +0 -393
- package/src/shared-tree/treeView.ts +0 -113
- /package/dist/core/{revertible/revertible.js → revertible.js} +0 -0
- /package/dist/simple-tree/{jsonSchema.js → api/jsonSchema.js} +0 -0
- /package/dist/simple-tree/{simpleSchema.js → api/simpleSchema.js} +0 -0
- /package/dist/simple-tree/{simpleSchemaToJsonSchema.d.ts → api/simpleSchemaToJsonSchema.d.ts} +0 -0
- /package/lib/core/{revertible/revertible.js → revertible.js} +0 -0
- /package/lib/simple-tree/{jsonSchema.js → api/jsonSchema.js} +0 -0
- /package/lib/simple-tree/{simpleSchema.js → api/simpleSchema.js} +0 -0
- /package/lib/simple-tree/{simpleSchemaToJsonSchema.d.ts → api/simpleSchemaToJsonSchema.d.ts} +0 -0
|
@@ -1,85 +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 { SchemaBuilderInternal } from "../feature-libraries/index.js";
|
|
7
|
-
/**
|
|
8
|
-
* Names in this domain follow https://en.wikipedia.org/wiki/Reverse_domain_name_notation
|
|
9
|
-
*/
|
|
10
|
-
const builder = new SchemaBuilderInternal({ scope: "com.fluidframework.leaf" });
|
|
11
|
-
const number = builder.leaf("number", ValueSchema.Number);
|
|
12
|
-
const boolean = builder.leaf("boolean", ValueSchema.Boolean);
|
|
13
|
-
const string = builder.leaf("string", ValueSchema.String);
|
|
14
|
-
const handle = builder.leaf("handle", ValueSchema.FluidHandle);
|
|
15
|
-
const nullSchema = builder.leaf("null", ValueSchema.Null);
|
|
16
|
-
const primitives = [number, boolean, string];
|
|
17
|
-
const all = [handle, nullSchema, ...primitives];
|
|
18
|
-
const library = builder.intoLibrary();
|
|
19
|
-
/**
|
|
20
|
-
* Built-in {@link LeafNodeSchema}.
|
|
21
|
-
*/
|
|
22
|
-
export const leaf = {
|
|
23
|
-
/**
|
|
24
|
-
* {@link LeafNodeSchema} for holding a JavaScript `number`.
|
|
25
|
-
*
|
|
26
|
-
* @remarks
|
|
27
|
-
* 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:
|
|
28
|
-
* - `NaN`, and the infinities should not be used.
|
|
29
|
-
* - `-0` may be converted to `0` in some cases.
|
|
30
|
-
*
|
|
31
|
-
* These limitations match the limitations of JSON.
|
|
32
|
-
* @privateRemarks
|
|
33
|
-
* TODO:
|
|
34
|
-
* We should be much more clear about what happens if you use problematic values.
|
|
35
|
-
* We should validate and/or normalize them when inserting content.
|
|
36
|
-
*/
|
|
37
|
-
number,
|
|
38
|
-
/**
|
|
39
|
-
* {@link LeafNodeSchema} for holding a boolean.
|
|
40
|
-
*/
|
|
41
|
-
boolean,
|
|
42
|
-
/**
|
|
43
|
-
* {@link LeafNodeSchema} for holding a JavaScript `string`.
|
|
44
|
-
*
|
|
45
|
-
* @remarks
|
|
46
|
-
* Strings containing unpaired UTF-16 surrogate pair code units may not be handled correctly.
|
|
47
|
-
*
|
|
48
|
-
* These limitations come from the use of UTF-8 encoding of the strings, which requires them to be valid unicode.
|
|
49
|
-
* JavaScript does not make this requirement for its strings so not all possible JavaScript strings are supported.
|
|
50
|
-
* @privateRemarks
|
|
51
|
-
* TODO:
|
|
52
|
-
* We should be much more clear about what happens if you use problematic values.
|
|
53
|
-
* We should validate and/or normalize them when inserting content.
|
|
54
|
-
*/
|
|
55
|
-
string,
|
|
56
|
-
/**
|
|
57
|
-
* {@link LeafNodeSchema} for holding an {@link @fluidframework/core-interfaces#(IFluidHandle:interface)}.
|
|
58
|
-
*/
|
|
59
|
-
handle,
|
|
60
|
-
/**
|
|
61
|
-
* {@link LeafNodeSchema} for JavaScript `null`.
|
|
62
|
-
*
|
|
63
|
-
* @remarks
|
|
64
|
-
* 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.
|
|
65
|
-
* This {@link LeafNodeSchema} node provides the option to include nulls in trees when desired.
|
|
66
|
-
* 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.
|
|
67
|
-
*/
|
|
68
|
-
null: nullSchema,
|
|
69
|
-
/**
|
|
70
|
-
* The set of {@link LeafNodeSchema} which correspond to JavaScript primitive (non-object) types.
|
|
71
|
-
*/
|
|
72
|
-
primitives,
|
|
73
|
-
/**
|
|
74
|
-
* All {@link LeafNodeSchema} defined in this library..
|
|
75
|
-
*/
|
|
76
|
-
all,
|
|
77
|
-
/**
|
|
78
|
-
* {@link SchemaLibrary} of the {@link LeafNodeSchema}.
|
|
79
|
-
*
|
|
80
|
-
* @privateRemarks
|
|
81
|
-
* This is included by default in schema produced with {@link SchemaBuilder}.
|
|
82
|
-
*/
|
|
83
|
-
library,
|
|
84
|
-
};
|
|
85
|
-
//# sourceMappingURL=leafDomain.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"leafDomain.js","sourceRoot":"","sources":["../../src/domains/leafDomain.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAEtE;;GAEG;AACH,MAAM,OAAO,GAAG,IAAI,qBAAqB,CAAC,EAAE,KAAK,EAAE,yBAAyB,EAAE,CAAC,CAAC;AAEhF,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;AAC1D,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;AAC7D,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;AAC1D,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;AAC/D,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;AAE1D,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAU,CAAC;AACtD,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,UAAU,CAAU,CAAC;AAEzD,MAAM,OAAO,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;AAEtC;;GAEG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG;IACnB;;;;;;;;;;;;;OAaG;IACH,MAAM;IAEN;;OAEG;IACH,OAAO;IAEP;;;;;;;;;;;;OAYG;IACH,MAAM;IAEN;;OAEG;IACH,MAAM;IAEN;;;;;;;OAOG;IACH,IAAI,EAAE,UAAU;IAEhB;;OAEG;IACH,UAAU;IAEV;;OAEG;IACH,GAAG;IAEH;;;;;OAKG;IACH,OAAO;CACP,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ValueSchema } from \"../core/index.js\";\nimport { SchemaBuilderInternal } from \"../feature-libraries/index.js\";\n\n/**\n * Names in this domain follow https://en.wikipedia.org/wiki/Reverse_domain_name_notation\n */\nconst builder = new SchemaBuilderInternal({ scope: \"com.fluidframework.leaf\" });\n\nconst number = builder.leaf(\"number\", ValueSchema.Number);\nconst boolean = builder.leaf(\"boolean\", ValueSchema.Boolean);\nconst string = builder.leaf(\"string\", ValueSchema.String);\nconst handle = builder.leaf(\"handle\", ValueSchema.FluidHandle);\nconst nullSchema = builder.leaf(\"null\", ValueSchema.Null);\n\nconst primitives = [number, boolean, string] as const;\nconst all = [handle, nullSchema, ...primitives] as const;\n\nconst library = builder.intoLibrary();\n\n/**\n * Built-in {@link LeafNodeSchema}.\n */\nexport const leaf = {\n\t/**\n\t * {@link LeafNodeSchema} for holding a JavaScript `number`.\n\t *\n\t * @remarks\n\t * 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:\n\t * - `NaN`, and the infinities should not be used.\n\t * - `-0` may be converted to `0` in some cases.\n\t *\n\t * These limitations match the limitations of JSON.\n\t * @privateRemarks\n\t * TODO:\n\t * We should be much more clear about what happens if you use problematic values.\n\t * We should validate and/or normalize them when inserting content.\n\t */\n\tnumber,\n\n\t/**\n\t * {@link LeafNodeSchema} for holding a boolean.\n\t */\n\tboolean,\n\n\t/**\n\t * {@link LeafNodeSchema} for holding a JavaScript `string`.\n\t *\n\t * @remarks\n\t * Strings containing unpaired UTF-16 surrogate pair code units may not be handled correctly.\n\t *\n\t * These limitations come from the use of UTF-8 encoding of the strings, which requires them to be valid unicode.\n\t * JavaScript does not make this requirement for its strings so not all possible JavaScript strings are supported.\n\t * @privateRemarks\n\t * TODO:\n\t * We should be much more clear about what happens if you use problematic values.\n\t * We should validate and/or normalize them when inserting content.\n\t */\n\tstring,\n\n\t/**\n\t * {@link LeafNodeSchema} for holding an {@link @fluidframework/core-interfaces#(IFluidHandle:interface)}.\n\t */\n\thandle,\n\n\t/**\n\t * {@link LeafNodeSchema} for JavaScript `null`.\n\t *\n\t * @remarks\n\t * 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.\n\t * This {@link LeafNodeSchema} node provides the option to include nulls in trees when desired.\n\t * 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.\n\t */\n\tnull: nullSchema,\n\n\t/**\n\t * The set of {@link LeafNodeSchema} which correspond to JavaScript primitive (non-object) types.\n\t */\n\tprimitives,\n\n\t/**\n\t * All {@link LeafNodeSchema} defined in this library..\n\t */\n\tall,\n\n\t/**\n\t * {@link SchemaLibrary} of the {@link LeafNodeSchema}.\n\t *\n\t * @privateRemarks\n\t * This is included by default in schema produced with {@link SchemaBuilder}.\n\t */\n\tlibrary,\n};\n"]}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { FieldKinds, type FlexFieldSchema, type FlexImplicitAllowedTypes, type FlexImplicitFieldSchema, type FlexObjectNodeSchema, type NormalizeAllowedTypes, SchemaBuilderBase, type SchemaBuilderOptions, type Unenforced } from "../feature-libraries/index.js";
|
|
6
|
-
import type { RestrictiveReadonlyRecord } from "../util/index.js";
|
|
7
|
-
/**
|
|
8
|
-
* Builds schema libraries, and the schema within them.
|
|
9
|
-
*
|
|
10
|
-
* @remarks
|
|
11
|
-
* Fields, when inferred from {@link FlexImplicitFieldSchema}, default to the `Required` {@link FlexFieldKind} (except for in Maps, which default to `Optional`).
|
|
12
|
-
* Implicitly includes `leaf` schema library by default.
|
|
13
|
-
*
|
|
14
|
-
* This type has some built in defaults which impact compatibility.
|
|
15
|
-
* This includes which {@link FlexFieldKind}s it uses.
|
|
16
|
-
* To ensure that these defaults can be updated without compatibility issues,
|
|
17
|
-
* this class is versioned: the number in its name indicates its compatibility,
|
|
18
|
-
* and if its defaults are changed to ones that would not be compatible with a version of the application using the previous versions,
|
|
19
|
-
* this number will be updated to make it impossible for an app to implicitly do a compatibility breaking change by updating this package.
|
|
20
|
-
* Major package version updates are allowed to break API compatibility, but must not break content compatibility unless a corresponding code change is made in the app to opt in.
|
|
21
|
-
*
|
|
22
|
-
* @privateRemarks
|
|
23
|
-
* TODO: Maybe rename to DefaultSchemaBuilder1 because of the versioning implications above.
|
|
24
|
-
* Same applies to SchemaBuilder.
|
|
25
|
-
* TODO: figure out a way to link `leaf` above without breaking API Extractor.
|
|
26
|
-
* @sealed
|
|
27
|
-
* @deprecated Users of this class should either use {@link SchemaBuilderBase} and explicitly work with {@link FlexFieldSchema}, or use SchemaFactory and work at its higher level of abstraction.
|
|
28
|
-
*/
|
|
29
|
-
export declare class SchemaBuilder<TScope extends string = string, TName extends string | number = string> extends SchemaBuilderBase<TScope, typeof FieldKinds.required, TName> {
|
|
30
|
-
constructor(options: SchemaBuilderOptions<TScope>);
|
|
31
|
-
objectRecursive<const Name extends TName, const T extends Unenforced<RestrictiveReadonlyRecord<string, FlexImplicitFieldSchema>>>(name: Name, t: T): FlexObjectNodeSchema<`${TScope}.${Name}`, T>;
|
|
32
|
-
/**
|
|
33
|
-
* Define a schema for an {@link FieldKinds.optional|optional field}.
|
|
34
|
-
* @remarks
|
|
35
|
-
* Shorthand for passing `FieldKinds.optional` to {@link FlexFieldSchema.create}.
|
|
36
|
-
*
|
|
37
|
-
* This method is also available as an instance method on {@link SchemaBuilder}.
|
|
38
|
-
*/
|
|
39
|
-
static optional: <const T extends FlexImplicitAllowedTypes>(allowedTypes: T) => FlexFieldSchema<import("../feature-libraries/index.js").Optional, NormalizeAllowedTypes<T>>;
|
|
40
|
-
/**
|
|
41
|
-
* Define a schema for an {@link FieldKinds.optional|optional field}.
|
|
42
|
-
* @remarks
|
|
43
|
-
* Shorthand for passing `FieldKinds.optional` to {@link FlexFieldSchema.create}.
|
|
44
|
-
*
|
|
45
|
-
* Since this creates a {@link FlexFieldSchema} (and not a {@link FlexTreeNodeSchema}), the resulting schema is structurally typed, and not impacted by the {@link SchemaBuilderBase.scope}:
|
|
46
|
-
* therefore this method is the same as the static version.
|
|
47
|
-
*/
|
|
48
|
-
readonly optional: <const T extends FlexImplicitAllowedTypes>(allowedTypes: T) => FlexFieldSchema<import("../feature-libraries/index.js").Optional, NormalizeAllowedTypes<T>>;
|
|
49
|
-
/**
|
|
50
|
-
* Define a schema for a {@link FieldKinds.required|required field}.
|
|
51
|
-
* @remarks
|
|
52
|
-
* Shorthand for passing `FieldKinds.required` to {@link FlexFieldSchema.create}.
|
|
53
|
-
*
|
|
54
|
-
* This method is also available as an instance method on {@link SchemaBuilder}.
|
|
55
|
-
*/
|
|
56
|
-
static required: <const T extends FlexImplicitAllowedTypes>(allowedTypes: T) => FlexFieldSchema<import("../feature-libraries/index.js").Required, NormalizeAllowedTypes<T>>;
|
|
57
|
-
/**
|
|
58
|
-
* Define a schema for a {@link FieldKinds.required|required field}.
|
|
59
|
-
* @remarks
|
|
60
|
-
* Shorthand for passing `FieldKinds.required` to {@link FlexFieldSchema.create}.
|
|
61
|
-
* Note that `FieldKinds.required` is the current default field kind, so APIs accepting {@link FlexImplicitFieldSchema}
|
|
62
|
-
* can be passed the `allowedTypes` and will implicitly wrap it up in a {@link FieldKinds.required|required field}.
|
|
63
|
-
*
|
|
64
|
-
* Since this creates a {@link FlexFieldSchema} (and not a {@link FlexTreeNodeSchema}), the resulting schema is structurally typed, and not impacted by the {@link SchemaBuilderBase.scope}:
|
|
65
|
-
* therefore this method is the same as the static version.
|
|
66
|
-
*/
|
|
67
|
-
readonly required: <const T extends FlexImplicitAllowedTypes>(allowedTypes: T) => FlexFieldSchema<import("../feature-libraries/index.js").Required, NormalizeAllowedTypes<T>>;
|
|
68
|
-
/**
|
|
69
|
-
* Define a schema for a {@link FieldKinds.sequence|sequence field}.
|
|
70
|
-
* @remarks
|
|
71
|
-
* Shorthand for passing `FieldKinds.sequence` to {@link FlexFieldSchema.create}.
|
|
72
|
-
*
|
|
73
|
-
* This method is also available as an instance method on {@link SchemaBuilder}
|
|
74
|
-
*/
|
|
75
|
-
static sequence: <const T extends FlexImplicitAllowedTypes>(allowedTypes: T) => FlexFieldSchema<import("../feature-libraries/index.js").Sequence, NormalizeAllowedTypes<T>>;
|
|
76
|
-
/**
|
|
77
|
-
* Define a schema for a {@link FieldKinds.sequence|sequence field}.
|
|
78
|
-
* @remarks
|
|
79
|
-
* Shorthand for passing `FieldKinds.sequence` to {@link FlexFieldSchema.create}.
|
|
80
|
-
*
|
|
81
|
-
* Since this creates a {@link FlexFieldSchema} (and not a {@link FlexTreeNodeSchema}), the resulting schema is structurally typed, and not impacted by the {@link SchemaBuilderBase.scope}:
|
|
82
|
-
* therefore this method is the same as the static version.
|
|
83
|
-
*/
|
|
84
|
-
readonly sequence: <const T extends FlexImplicitAllowedTypes>(allowedTypes: T) => FlexFieldSchema<import("../feature-libraries/index.js").Sequence, NormalizeAllowedTypes<T>>;
|
|
85
|
-
/**
|
|
86
|
-
* Define a schema for an {@link FieldKinds.identifier|identifier field}.
|
|
87
|
-
* @remarks
|
|
88
|
-
* Shorthand for passing `FieldKinds.identifier` to {@link TreeFieldSchema.create}.
|
|
89
|
-
*
|
|
90
|
-
* This method is also available as an instance method on {@link SchemaBuilder}
|
|
91
|
-
*/
|
|
92
|
-
static identifier: <const T extends FlexImplicitAllowedTypes>(allowedTypes: T) => FlexFieldSchema<import("../feature-libraries/index.js").Identifier, NormalizeAllowedTypes<T>>;
|
|
93
|
-
/**
|
|
94
|
-
* Define a schema for a {@link FieldKinds.identifier|identifier field}.
|
|
95
|
-
* @remarks
|
|
96
|
-
* Shorthand for passing `FieldKinds.identifier` to {@link TreeFieldSchema.create}.
|
|
97
|
-
*
|
|
98
|
-
* Since this creates a {@link TreeFieldSchema} (and not a {@link FlexTreeNodeSchema}), the resulting schema is structurally typed, and not impacted by the {@link SchemaBuilderBase.scope}:
|
|
99
|
-
* therefore this method is the same as the static version.
|
|
100
|
-
*/
|
|
101
|
-
readonly identifier: <const T extends FlexImplicitAllowedTypes>(allowedTypes: T) => FlexFieldSchema<import("../feature-libraries/index.js").Identifier, NormalizeAllowedTypes<T>>;
|
|
102
|
-
}
|
|
103
|
-
//# sourceMappingURL=schemaBuilder.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schemaBuilder.d.ts","sourceRoot":"","sources":["../../src/domains/schemaBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,UAAU,EAEV,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,iBAAiB,EACjB,KAAK,oBAAoB,EACzB,KAAK,UAAU,EACf,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAIlE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,aAAa,CACzB,MAAM,SAAS,MAAM,GAAG,MAAM,EAC9B,KAAK,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,CACrC,SAAQ,iBAAiB,CAAC,MAAM,EAAE,OAAO,UAAU,CAAC,QAAQ,EAAE,KAAK,CAAC;gBAClD,OAAO,EAAE,oBAAoB,CAAC,MAAM,CAAC;IAQxC,eAAe,CAC9B,KAAK,CAAC,IAAI,SAAS,KAAK,EACxB,KAAK,CAAC,CAAC,SAAS,UAAU,CAAC,yBAAyB,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC,EACrF,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IAOlB;;;;;;OAMG;IACH,OAAc,QAAQ,6JAAoC;IAE1D;;;;;;;OAOG;IACH,SAAgB,QAAQ,6JAA0B;IAElD;;;;;;OAMG;IACH,OAAc,QAAQ,6JAAoC;IAE1D;;;;;;;;;OASG;IACH,SAAgB,QAAQ,6JAA0B;IAElD;;;;;;OAMG;IACH,OAAc,QAAQ,6JAAoC;IAE1D;;;;;;;OAOG;IACH,SAAgB,QAAQ,6JAA0B;IAElD;;;;;;OAMG;IACH,OAAc,UAAU,+JAAsC;IAE9D;;;;;;;OAOG;IACH,SAAgB,UAAU,+JAA4B;CACtD"}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { FieldKinds, SchemaBuilderBase, } from "../feature-libraries/index.js";
|
|
6
|
-
import { leaf } from "./leafDomain.js";
|
|
7
|
-
/**
|
|
8
|
-
* Builds schema libraries, and the schema within them.
|
|
9
|
-
*
|
|
10
|
-
* @remarks
|
|
11
|
-
* Fields, when inferred from {@link FlexImplicitFieldSchema}, default to the `Required` {@link FlexFieldKind} (except for in Maps, which default to `Optional`).
|
|
12
|
-
* Implicitly includes `leaf` schema library by default.
|
|
13
|
-
*
|
|
14
|
-
* This type has some built in defaults which impact compatibility.
|
|
15
|
-
* This includes which {@link FlexFieldKind}s it uses.
|
|
16
|
-
* To ensure that these defaults can be updated without compatibility issues,
|
|
17
|
-
* this class is versioned: the number in its name indicates its compatibility,
|
|
18
|
-
* and if its defaults are changed to ones that would not be compatible with a version of the application using the previous versions,
|
|
19
|
-
* this number will be updated to make it impossible for an app to implicitly do a compatibility breaking change by updating this package.
|
|
20
|
-
* Major package version updates are allowed to break API compatibility, but must not break content compatibility unless a corresponding code change is made in the app to opt in.
|
|
21
|
-
*
|
|
22
|
-
* @privateRemarks
|
|
23
|
-
* TODO: Maybe rename to DefaultSchemaBuilder1 because of the versioning implications above.
|
|
24
|
-
* Same applies to SchemaBuilder.
|
|
25
|
-
* TODO: figure out a way to link `leaf` above without breaking API Extractor.
|
|
26
|
-
* @sealed
|
|
27
|
-
* @deprecated Users of this class should either use {@link SchemaBuilderBase} and explicitly work with {@link FlexFieldSchema}, or use SchemaFactory and work at its higher level of abstraction.
|
|
28
|
-
*/
|
|
29
|
-
export class SchemaBuilder extends SchemaBuilderBase {
|
|
30
|
-
constructor(options) {
|
|
31
|
-
super(FieldKinds.required, {
|
|
32
|
-
...options,
|
|
33
|
-
libraries: [...(options.libraries ?? []), leaf.library],
|
|
34
|
-
});
|
|
35
|
-
/**
|
|
36
|
-
* Define a schema for an {@link FieldKinds.optional|optional field}.
|
|
37
|
-
* @remarks
|
|
38
|
-
* Shorthand for passing `FieldKinds.optional` to {@link FlexFieldSchema.create}.
|
|
39
|
-
*
|
|
40
|
-
* Since this creates a {@link FlexFieldSchema} (and not a {@link FlexTreeNodeSchema}), the resulting schema is structurally typed, and not impacted by the {@link SchemaBuilderBase.scope}:
|
|
41
|
-
* therefore this method is the same as the static version.
|
|
42
|
-
*/
|
|
43
|
-
this.optional = SchemaBuilder.optional;
|
|
44
|
-
/**
|
|
45
|
-
* Define a schema for a {@link FieldKinds.required|required field}.
|
|
46
|
-
* @remarks
|
|
47
|
-
* Shorthand for passing `FieldKinds.required` to {@link FlexFieldSchema.create}.
|
|
48
|
-
* Note that `FieldKinds.required` is the current default field kind, so APIs accepting {@link FlexImplicitFieldSchema}
|
|
49
|
-
* can be passed the `allowedTypes` and will implicitly wrap it up in a {@link FieldKinds.required|required field}.
|
|
50
|
-
*
|
|
51
|
-
* Since this creates a {@link FlexFieldSchema} (and not a {@link FlexTreeNodeSchema}), the resulting schema is structurally typed, and not impacted by the {@link SchemaBuilderBase.scope}:
|
|
52
|
-
* therefore this method is the same as the static version.
|
|
53
|
-
*/
|
|
54
|
-
this.required = SchemaBuilder.required;
|
|
55
|
-
/**
|
|
56
|
-
* Define a schema for a {@link FieldKinds.sequence|sequence field}.
|
|
57
|
-
* @remarks
|
|
58
|
-
* Shorthand for passing `FieldKinds.sequence` to {@link FlexFieldSchema.create}.
|
|
59
|
-
*
|
|
60
|
-
* Since this creates a {@link FlexFieldSchema} (and not a {@link FlexTreeNodeSchema}), the resulting schema is structurally typed, and not impacted by the {@link SchemaBuilderBase.scope}:
|
|
61
|
-
* therefore this method is the same as the static version.
|
|
62
|
-
*/
|
|
63
|
-
this.sequence = SchemaBuilder.sequence;
|
|
64
|
-
/**
|
|
65
|
-
* Define a schema for a {@link FieldKinds.identifier|identifier field}.
|
|
66
|
-
* @remarks
|
|
67
|
-
* Shorthand for passing `FieldKinds.identifier` to {@link TreeFieldSchema.create}.
|
|
68
|
-
*
|
|
69
|
-
* Since this creates a {@link TreeFieldSchema} (and not a {@link FlexTreeNodeSchema}), the resulting schema is structurally typed, and not impacted by the {@link SchemaBuilderBase.scope}:
|
|
70
|
-
* therefore this method is the same as the static version.
|
|
71
|
-
*/
|
|
72
|
-
this.identifier = SchemaBuilder.identifier;
|
|
73
|
-
}
|
|
74
|
-
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
75
|
-
objectRecursive(name, t) {
|
|
76
|
-
return this.object(name, t);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Define a schema for an {@link FieldKinds.optional|optional field}.
|
|
81
|
-
* @remarks
|
|
82
|
-
* Shorthand for passing `FieldKinds.optional` to {@link FlexFieldSchema.create}.
|
|
83
|
-
*
|
|
84
|
-
* This method is also available as an instance method on {@link SchemaBuilder}.
|
|
85
|
-
*/
|
|
86
|
-
SchemaBuilder.optional = fieldHelper(FieldKinds.optional);
|
|
87
|
-
/**
|
|
88
|
-
* Define a schema for a {@link FieldKinds.required|required field}.
|
|
89
|
-
* @remarks
|
|
90
|
-
* Shorthand for passing `FieldKinds.required` to {@link FlexFieldSchema.create}.
|
|
91
|
-
*
|
|
92
|
-
* This method is also available as an instance method on {@link SchemaBuilder}.
|
|
93
|
-
*/
|
|
94
|
-
SchemaBuilder.required = fieldHelper(FieldKinds.required);
|
|
95
|
-
/**
|
|
96
|
-
* Define a schema for a {@link FieldKinds.sequence|sequence field}.
|
|
97
|
-
* @remarks
|
|
98
|
-
* Shorthand for passing `FieldKinds.sequence` to {@link FlexFieldSchema.create}.
|
|
99
|
-
*
|
|
100
|
-
* This method is also available as an instance method on {@link SchemaBuilder}
|
|
101
|
-
*/
|
|
102
|
-
SchemaBuilder.sequence = fieldHelper(FieldKinds.sequence);
|
|
103
|
-
/**
|
|
104
|
-
* Define a schema for an {@link FieldKinds.identifier|identifier field}.
|
|
105
|
-
* @remarks
|
|
106
|
-
* Shorthand for passing `FieldKinds.identifier` to {@link TreeFieldSchema.create}.
|
|
107
|
-
*
|
|
108
|
-
* This method is also available as an instance method on {@link SchemaBuilder}
|
|
109
|
-
*/
|
|
110
|
-
SchemaBuilder.identifier = fieldHelper(FieldKinds.identifier);
|
|
111
|
-
/**
|
|
112
|
-
* Returns a wrapper around SchemaBuilder.field for a specific FieldKind.
|
|
113
|
-
*/
|
|
114
|
-
function fieldHelper(kind) {
|
|
115
|
-
return (allowedTypes) => SchemaBuilder.field(kind, allowedTypes);
|
|
116
|
-
}
|
|
117
|
-
//# sourceMappingURL=schemaBuilder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schemaBuilder.js","sourceRoot":"","sources":["../../src/domains/schemaBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,UAAU,EAOV,iBAAiB,GAGjB,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,OAAO,aAGX,SAAQ,iBAA4D;IACrE,YAAmB,OAAqC;QACvD,KAAK,CAAC,UAAU,CAAC,QAAQ,EAAE;YAC1B,GAAG,OAAO;YACV,SAAS,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC;SACvD,CAAC,CAAC;QAuBJ;;;;;;;WAOG;QACa,aAAQ,GAAG,aAAa,CAAC,QAAQ,CAAC;QAWlD;;;;;;;;;WASG;QACa,aAAQ,GAAG,aAAa,CAAC,QAAQ,CAAC;QAWlD;;;;;;;WAOG;QACa,aAAQ,GAAG,aAAa,CAAC,QAAQ,CAAC;QAWlD;;;;;;;WAOG;QACa,eAAU,GAAG,aAAa,CAAC,UAAU,CAAC;IAzFtD,CAAC;IAED,4EAA4E;IAC5D,eAAe,CAG7B,IAAU,EAAE,CAAI;QACjB,OAAO,IAAI,CAAC,MAAM,CACjB,IAAI,EACJ,CAA0E,CACf,CAAC;IAC9D,CAAC;;AAED;;;;;;GAMG;AACW,sBAAQ,GAAG,WAAW,CAAC,UAAU,CAAC,QAAQ,CAAC,AAAnC,CAAoC;AAY1D;;;;;;GAMG;AACW,sBAAQ,GAAG,WAAW,CAAC,UAAU,CAAC,QAAQ,CAAC,AAAnC,CAAoC;AAc1D;;;;;;GAMG;AACW,sBAAQ,GAAG,WAAW,CAAC,UAAU,CAAC,QAAQ,CAAC,AAAnC,CAAoC;AAY1D;;;;;;GAMG;AACW,wBAAU,GAAG,WAAW,CAAC,UAAU,CAAC,UAAU,CAAC,AAArC,CAAsC;AAa/D;;GAEG;AACH,SAAS,WAAW,CAA6B,IAAU;IAC1D,OAAO,CACN,YAAe,EACmC,EAAE,CACpD,aAAa,CAAC,KAAK,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tFieldKinds,\n\ttype FlexFieldKind,\n\ttype FlexFieldSchema,\n\ttype FlexImplicitAllowedTypes,\n\ttype FlexImplicitFieldSchema,\n\ttype FlexObjectNodeSchema,\n\ttype NormalizeAllowedTypes,\n\tSchemaBuilderBase,\n\ttype SchemaBuilderOptions,\n\ttype Unenforced,\n} from \"../feature-libraries/index.js\";\nimport type { RestrictiveReadonlyRecord } from \"../util/index.js\";\n\nimport { leaf } from \"./leafDomain.js\";\n\n/**\n * Builds schema libraries, and the schema within them.\n *\n * @remarks\n * Fields, when inferred from {@link FlexImplicitFieldSchema}, default to the `Required` {@link FlexFieldKind} (except for in Maps, which default to `Optional`).\n * Implicitly includes `leaf` schema library by default.\n *\n * This type has some built in defaults which impact compatibility.\n * This includes which {@link FlexFieldKind}s it uses.\n * To ensure that these defaults can be updated without compatibility issues,\n * this class is versioned: the number in its name indicates its compatibility,\n * and if its defaults are changed to ones that would not be compatible with a version of the application using the previous versions,\n * this number will be updated to make it impossible for an app to implicitly do a compatibility breaking change by updating this package.\n * Major package version updates are allowed to break API compatibility, but must not break content compatibility unless a corresponding code change is made in the app to opt in.\n *\n * @privateRemarks\n * TODO: Maybe rename to DefaultSchemaBuilder1 because of the versioning implications above.\n * Same applies to SchemaBuilder.\n * TODO: figure out a way to link `leaf` above without breaking API Extractor.\n * @sealed\n * @deprecated Users of this class should either use {@link SchemaBuilderBase} and explicitly work with {@link FlexFieldSchema}, or use SchemaFactory and work at its higher level of abstraction.\n */\nexport class SchemaBuilder<\n\tTScope extends string = string,\n\tTName extends string | number = string,\n> extends SchemaBuilderBase<TScope, typeof FieldKinds.required, TName> {\n\tpublic constructor(options: SchemaBuilderOptions<TScope>) {\n\t\tsuper(FieldKinds.required, {\n\t\t\t...options,\n\t\t\tlibraries: [...(options.libraries ?? []), leaf.library],\n\t\t});\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n\tpublic override objectRecursive<\n\t\tconst Name extends TName,\n\t\tconst T extends Unenforced<RestrictiveReadonlyRecord<string, FlexImplicitFieldSchema>>,\n\t>(name: Name, t: T) {\n\t\treturn this.object(\n\t\t\tname,\n\t\t\tt as unknown as RestrictiveReadonlyRecord<string, FlexImplicitFieldSchema>,\n\t\t) as unknown as FlexObjectNodeSchema<`${TScope}.${Name}`, T>;\n\t}\n\n\t/**\n\t * Define a schema for an {@link FieldKinds.optional|optional field}.\n\t * @remarks\n\t * Shorthand for passing `FieldKinds.optional` to {@link FlexFieldSchema.create}.\n\t *\n\t * This method is also available as an instance method on {@link SchemaBuilder}.\n\t */\n\tpublic static optional = fieldHelper(FieldKinds.optional);\n\n\t/**\n\t * Define a schema for an {@link FieldKinds.optional|optional field}.\n\t * @remarks\n\t * Shorthand for passing `FieldKinds.optional` to {@link FlexFieldSchema.create}.\n\t *\n\t * Since this creates a {@link FlexFieldSchema} (and not a {@link FlexTreeNodeSchema}), the resulting schema is structurally typed, and not impacted by the {@link SchemaBuilderBase.scope}:\n\t * therefore this method is the same as the static version.\n\t */\n\tpublic readonly optional = SchemaBuilder.optional;\n\n\t/**\n\t * Define a schema for a {@link FieldKinds.required|required field}.\n\t * @remarks\n\t * Shorthand for passing `FieldKinds.required` to {@link FlexFieldSchema.create}.\n\t *\n\t * This method is also available as an instance method on {@link SchemaBuilder}.\n\t */\n\tpublic static required = fieldHelper(FieldKinds.required);\n\n\t/**\n\t * Define a schema for a {@link FieldKinds.required|required field}.\n\t * @remarks\n\t * Shorthand for passing `FieldKinds.required` to {@link FlexFieldSchema.create}.\n\t * Note that `FieldKinds.required` is the current default field kind, so APIs accepting {@link FlexImplicitFieldSchema}\n\t * can be passed the `allowedTypes` and will implicitly wrap it up in a {@link FieldKinds.required|required field}.\n\t *\n\t * Since this creates a {@link FlexFieldSchema} (and not a {@link FlexTreeNodeSchema}), the resulting schema is structurally typed, and not impacted by the {@link SchemaBuilderBase.scope}:\n\t * therefore this method is the same as the static version.\n\t */\n\tpublic readonly required = SchemaBuilder.required;\n\n\t/**\n\t * Define a schema for a {@link FieldKinds.sequence|sequence field}.\n\t * @remarks\n\t * Shorthand for passing `FieldKinds.sequence` to {@link FlexFieldSchema.create}.\n\t *\n\t * This method is also available as an instance method on {@link SchemaBuilder}\n\t */\n\tpublic static sequence = fieldHelper(FieldKinds.sequence);\n\n\t/**\n\t * Define a schema for a {@link FieldKinds.sequence|sequence field}.\n\t * @remarks\n\t * Shorthand for passing `FieldKinds.sequence` to {@link FlexFieldSchema.create}.\n\t *\n\t * Since this creates a {@link FlexFieldSchema} (and not a {@link FlexTreeNodeSchema}), the resulting schema is structurally typed, and not impacted by the {@link SchemaBuilderBase.scope}:\n\t * therefore this method is the same as the static version.\n\t */\n\tpublic readonly sequence = SchemaBuilder.sequence;\n\n\t/**\n\t * Define a schema for an {@link FieldKinds.identifier|identifier field}.\n\t * @remarks\n\t * Shorthand for passing `FieldKinds.identifier` to {@link TreeFieldSchema.create}.\n\t *\n\t * This method is also available as an instance method on {@link SchemaBuilder}\n\t */\n\tpublic static identifier = fieldHelper(FieldKinds.identifier);\n\n\t/**\n\t * Define a schema for a {@link FieldKinds.identifier|identifier field}.\n\t * @remarks\n\t * Shorthand for passing `FieldKinds.identifier` to {@link TreeFieldSchema.create}.\n\t *\n\t * Since this creates a {@link TreeFieldSchema} (and not a {@link FlexTreeNodeSchema}), the resulting schema is structurally typed, and not impacted by the {@link SchemaBuilderBase.scope}:\n\t * therefore this method is the same as the static version.\n\t */\n\tpublic readonly identifier = SchemaBuilder.identifier;\n}\n\n/**\n * Returns a wrapper around SchemaBuilder.field for a specific FieldKind.\n */\nfunction fieldHelper<Kind extends FlexFieldKind>(kind: Kind) {\n\treturn <const T extends FlexImplicitAllowedTypes>(\n\t\tallowedTypes: T,\n\t): FlexFieldSchema<Kind, NormalizeAllowedTypes<T>> =>\n\t\tSchemaBuilder.field(kind, allowedTypes);\n}\n"]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* This file exists and is package exported to aid in testing of exporting recursive types across package boundaries.
|
|
7
|
-
* Sometimes when TypeScript generates d.ts files, they type check significantly differently than the original source (One example of this: https://github.com/microsoft/TypeScript/issues/20979).
|
|
8
|
-
* Unfortunately our recursive schema types are an example of types that have this kind of issue: the d.ts files tend to get "any" instead of the recursive type reference.
|
|
9
|
-
* Currently we do not have tooling in place to test this in our test suite, and exporting these types here is a temporary crutch to aid in diagnosing this issue.
|
|
10
|
-
*/
|
|
11
|
-
import { FlexFieldSchema } from "../feature-libraries/index.js";
|
|
12
|
-
export declare const recursiveObject: import("../feature-libraries/index.js").FlexObjectNodeSchema<"Test Recursive Domain.object", {
|
|
13
|
-
readonly recursive: FlexFieldSchema<import("../feature-libraries/index.js").Optional, readonly [() => import("../feature-libraries/index.js").FlexObjectNodeSchema<"Test Recursive Domain.object", any>]>;
|
|
14
|
-
readonly number: import("../feature-libraries/index.js").LeafNodeSchema<"com.fluidframework.leaf.number", import("../index.js").ValueSchema.Number>;
|
|
15
|
-
}>;
|
|
16
|
-
export declare const library: import("../feature-libraries/schemaBuilderBase.js").SchemaLibrary;
|
|
17
|
-
//# sourceMappingURL=testRecursiveDomain.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testRecursiveDomain.d.ts","sourceRoot":"","sources":["../../src/domains/testRecursiveDomain.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAEH,OAAO,EAAc,eAAe,EAAqB,MAAM,+BAA+B,CAAC;AAM/F,eAAO,MAAM,eAAe;;;EAG1B,CAAC;AAEH,eAAO,MAAM,OAAO,mEAAwB,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* This file exists and is package exported to aid in testing of exporting recursive types across package boundaries.
|
|
7
|
-
* Sometimes when TypeScript generates d.ts files, they type check significantly differently than the original source (One example of this: https://github.com/microsoft/TypeScript/issues/20979).
|
|
8
|
-
* Unfortunately our recursive schema types are an example of types that have this kind of issue: the d.ts files tend to get "any" instead of the recursive type reference.
|
|
9
|
-
* Currently we do not have tooling in place to test this in our test suite, and exporting these types here is a temporary crutch to aid in diagnosing this issue.
|
|
10
|
-
*/
|
|
11
|
-
import { FieldKinds, FlexFieldSchema, SchemaBuilderBase } from "../feature-libraries/index.js";
|
|
12
|
-
import { leaf } from "./leafDomain.js";
|
|
13
|
-
const builder = new SchemaBuilderBase(FieldKinds.optional, { scope: "Test Recursive Domain" });
|
|
14
|
-
export const recursiveObject = builder.objectRecursive("object", {
|
|
15
|
-
recursive: FlexFieldSchema.createUnsafe(FieldKinds.optional, [() => recursiveObject]),
|
|
16
|
-
number: leaf.number,
|
|
17
|
-
});
|
|
18
|
-
export const library = builder.intoLibrary();
|
|
19
|
-
{
|
|
20
|
-
const b = new SchemaBuilderBase(FieldKinds.optional, { scope: "Test Recursive Domain" });
|
|
21
|
-
const node = b.objectRecursive("object", {
|
|
22
|
-
child: FlexFieldSchema.createUnsafe(FieldKinds.optional, [() => node]),
|
|
23
|
-
});
|
|
24
|
-
const _field = FlexFieldSchema.createUnsafe(FieldKinds.optional, [node]);
|
|
25
|
-
// All these cause TSC to "RangeError: Maximum call stack size exceeded"
|
|
26
|
-
// const _field4 = FlexFieldSchema.create(FieldKinds.optional, [node]);
|
|
27
|
-
// const _field2 = b.optional(node);
|
|
28
|
-
// const _field3 = SchemaBuilder.optional(node);
|
|
29
|
-
// const schema = b.intoSchema(field);
|
|
30
|
-
// const schema = b.intoSchema(_field);
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=testRecursiveDomain.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testRecursiveDomain.js","sourceRoot":"","sources":["../../src/domains/testRecursiveDomain.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAE/F,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,MAAM,OAAO,GAAG,IAAI,iBAAiB,CAAC,UAAU,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,uBAAuB,EAAE,CAAC,CAAC;AAE/F,MAAM,CAAC,MAAM,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,QAAQ,EAAE;IAChE,SAAS,EAAE,eAAe,CAAC,YAAY,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,CAAC;IACrF,MAAM,EAAE,IAAI,CAAC,MAAM;CACnB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;AAE7C,CAAC;IACA,MAAM,CAAC,GAAG,IAAI,iBAAiB,CAAC,UAAU,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,uBAAuB,EAAE,CAAC,CAAC;IACzF,MAAM,IAAI,GAAG,CAAC,CAAC,eAAe,CAAC,QAAQ,EAAE;QACxC,KAAK,EAAE,eAAe,CAAC,YAAY,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;KACtE,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,eAAe,CAAC,YAAY,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IACzE,wEAAwE;IACxE,uEAAuE;IACvE,oCAAoC;IACpC,gDAAgD;IAChD,sCAAsC;IACtC,uCAAuC;AACxC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * This file exists and is package exported to aid in testing of exporting recursive types across package boundaries.\n * Sometimes when TypeScript generates d.ts files, they type check significantly differently than the original source (One example of this: https://github.com/microsoft/TypeScript/issues/20979).\n * Unfortunately our recursive schema types are an example of types that have this kind of issue: the d.ts files tend to get \"any\" instead of the recursive type reference.\n * Currently we do not have tooling in place to test this in our test suite, and exporting these types here is a temporary crutch to aid in diagnosing this issue.\n */\n\nimport { FieldKinds, FlexFieldSchema, SchemaBuilderBase } from \"../feature-libraries/index.js\";\n\nimport { leaf } from \"./leafDomain.js\";\n\nconst builder = new SchemaBuilderBase(FieldKinds.optional, { scope: \"Test Recursive Domain\" });\n\nexport const recursiveObject = builder.objectRecursive(\"object\", {\n\trecursive: FlexFieldSchema.createUnsafe(FieldKinds.optional, [() => recursiveObject]),\n\tnumber: leaf.number,\n});\n\nexport const library = builder.intoLibrary();\n\n{\n\tconst b = new SchemaBuilderBase(FieldKinds.optional, { scope: \"Test Recursive Domain\" });\n\tconst node = b.objectRecursive(\"object\", {\n\t\tchild: FlexFieldSchema.createUnsafe(FieldKinds.optional, [() => node]),\n\t});\n\tconst _field = FlexFieldSchema.createUnsafe(FieldKinds.optional, [node]);\n\t// All these cause TSC to \"RangeError: Maximum call stack size exceeded\"\n\t// const _field4 = FlexFieldSchema.create(FieldKinds.optional, [node]);\n\t// const _field2 = b.optional(node);\n\t// const _field3 = SchemaBuilder.optional(node);\n\t// const schema = b.intoSchema(field);\n\t// const schema = b.intoSchema(_field);\n}\n"]}
|
package/lib/events/events.d.ts
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import type { IEvent } from "@fluidframework/core-interfaces";
|
|
6
|
-
/**
|
|
7
|
-
* Convert a union of types to an intersection of those types. Useful for `TransformEvents`.
|
|
8
|
-
* @privateRemarks
|
|
9
|
-
* First an always true extends clause is used (T extends T) to distribute T into to a union of types contravariant over each member of the T union.
|
|
10
|
-
* Then the constraint on the type parameter in this new context is inferred, giving the intersection.
|
|
11
|
-
*/
|
|
12
|
-
export type UnionToIntersection<T> = (T extends T ? (k: T) => unknown : never) extends (k: infer U) => unknown ? U : never;
|
|
13
|
-
/**
|
|
14
|
-
* `true` iff the given type is an acceptable shape for a {@link Listeners | event} listener
|
|
15
|
-
* @public
|
|
16
|
-
*/
|
|
17
|
-
export type IsListener<TListener> = TListener extends (...args: any[]) => void ? true : false;
|
|
18
|
-
/**
|
|
19
|
-
* Used to specify the kinds of events emitted by a {@link Listenable}.
|
|
20
|
-
*
|
|
21
|
-
* @remarks
|
|
22
|
-
* Any object type is a valid {@link Listeners}, but only the {@link IsListener | event-like} properties of that
|
|
23
|
-
* type will be included.
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* ```typescript
|
|
27
|
-
* interface MyEvents {
|
|
28
|
-
* load: (user: string, data: IUserData) => void;
|
|
29
|
-
* error: (errorCode: number) => void;
|
|
30
|
-
* }
|
|
31
|
-
* ```
|
|
32
|
-
*
|
|
33
|
-
* @public
|
|
34
|
-
*/
|
|
35
|
-
export type Listeners<T extends object> = {
|
|
36
|
-
[P in (string | symbol) & keyof T as IsListener<T[P]> extends true ? P : never]: T[P];
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* Converts a {@link Listeners} type (i.e. the event registry for a {@link Listenable}) into a type consumable
|
|
40
|
-
* by an IEventProvider from `@fluidframework/core-interfaces`.
|
|
41
|
-
* @param E - the `Events` type to transform
|
|
42
|
-
* @param Target - an optional `IEvent` type that will be merged into the result along with the transformed `E`
|
|
43
|
-
*
|
|
44
|
-
* @example
|
|
45
|
-
*
|
|
46
|
-
* ```typescript
|
|
47
|
-
* interface MyEvents {
|
|
48
|
-
* load: (user: string, data: IUserData) => void;
|
|
49
|
-
* error: (errorCode: number) => void;
|
|
50
|
-
* }
|
|
51
|
-
*
|
|
52
|
-
* class MySharedObject extends SharedObject<TransformEvents<MyEvents, ISharedObjectEvents>> {
|
|
53
|
-
* // ...
|
|
54
|
-
* }
|
|
55
|
-
* ```
|
|
56
|
-
*/
|
|
57
|
-
export type TransformListeners<TListeners extends Listeners<TListeners>, TTarget extends IEvent = IEvent> = {
|
|
58
|
-
[P in keyof Listeners<TListeners>]: (event: P, listener: TListeners[P]) => void;
|
|
59
|
-
} extends Record<string | number | symbol, infer Z> ? UnionToIntersection<Z> & TTarget : never;
|
|
60
|
-
/**
|
|
61
|
-
* An object which allows the registration of listeners so that subscribers can be notified when an event happens.
|
|
62
|
-
* @param TListeners - All the {@link Listeners | events} that this subscribable supports
|
|
63
|
-
*
|
|
64
|
-
* @privateRemarks
|
|
65
|
-
* `EventEmitter` can be used as a base class to implement this via extension.
|
|
66
|
-
* ```ts
|
|
67
|
-
* type MyEventEmitter = IEventEmitter<{
|
|
68
|
-
* load: (user: string, data: IUserData) => void;
|
|
69
|
-
* error: (errorCode: number) => void;
|
|
70
|
-
* }>
|
|
71
|
-
* ```
|
|
72
|
-
* {@link createEmitter} can help implement this interface via delegation.
|
|
73
|
-
*
|
|
74
|
-
* @sealed @public
|
|
75
|
-
*/
|
|
76
|
-
export interface Listenable<TListeners extends object> {
|
|
77
|
-
/**
|
|
78
|
-
* Register an event listener.
|
|
79
|
-
* @param eventName - the name of the event
|
|
80
|
-
* @param listener - the handler to run when the event is fired by the emitter
|
|
81
|
-
* @returns a {@link Off | function} which will deregister the listener when called.
|
|
82
|
-
* This deregistration function is idempotent and therefore may be safely called more than once with no effect.
|
|
83
|
-
* @remarks Do not register the exact same `listener` object for the same event more than once.
|
|
84
|
-
* Doing so will result in undefined behavior, and is not guaranteed to behave the same in future versions of this library.
|
|
85
|
-
*/
|
|
86
|
-
on<K extends keyof Listeners<TListeners>>(eventName: K, listener: TListeners[K]): Off;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* A function that, when called, will deregister an event listener subscription that was previously registered.
|
|
90
|
-
* @remarks
|
|
91
|
-
* It is returned by the {@link Listenable.on | event registration function} when event registration occurs.
|
|
92
|
-
* @public
|
|
93
|
-
*/
|
|
94
|
-
export type Off = () => void;
|
|
95
|
-
/**
|
|
96
|
-
* Interface for an event emitter that can emit typed events to subscribed listeners.
|
|
97
|
-
*/
|
|
98
|
-
export interface IEmitter<TListeners extends Listeners<TListeners>> {
|
|
99
|
-
/**
|
|
100
|
-
* Emits an event with the specified name and arguments, notifying all subscribers by calling their registered listener functions.
|
|
101
|
-
* @param eventName - the name of the event to fire
|
|
102
|
-
* @param args - the arguments passed to the event listener functions
|
|
103
|
-
*/
|
|
104
|
-
emit<K extends keyof Listeners<TListeners>>(eventName: K, ...args: Parameters<TListeners[K]>): void;
|
|
105
|
-
/**
|
|
106
|
-
* Emits an event with the specified name and arguments, notifying all subscribers by calling their registered listener functions.
|
|
107
|
-
* It also collects the return values of all listeners into an array.
|
|
108
|
-
*
|
|
109
|
-
* Warning: This method should be used with caution. It deviates from the standard event-based integration pattern as creates substantial coupling between the emitter and its listeners.
|
|
110
|
-
* For the majority of use-cases it is recommended to use the standard {@link IEmitter.emit} functionality.
|
|
111
|
-
* @param eventName - the name of the event to fire
|
|
112
|
-
* @param args - the arguments passed to the event listener functions
|
|
113
|
-
* @returns An array of the return values of each listener, preserving the order listeners were called.
|
|
114
|
-
*/
|
|
115
|
-
emitAndCollect<K extends keyof Listeners<TListeners>>(eventName: K, ...args: Parameters<TListeners[K]>): ReturnType<TListeners[K]>[];
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Create a {@link Listenable} that can be instructed to emit events via the {@link IEmitter} interface.
|
|
119
|
-
*
|
|
120
|
-
* A class can delegate handling {@link Listenable} to the returned value while using it to emit the events.
|
|
121
|
-
* See also `EventEmitter` which be used as a base class to implement {@link Listenable} via extension.
|
|
122
|
-
*/
|
|
123
|
-
export declare function createEmitter<TListeners extends object>(noListeners?: NoListenersCallback<TListeners>): Listenable<TListeners> & IEmitter<TListeners> & HasListeners<TListeners>;
|
|
124
|
-
/**
|
|
125
|
-
* Called when the last listener for `eventName` is removed.
|
|
126
|
-
* Useful for determining when to clean up resources related to detecting when the event might occurs.
|
|
127
|
-
*/
|
|
128
|
-
export type NoListenersCallback<TListeners extends object> = (eventName: keyof Listeners<TListeners>) => void;
|
|
129
|
-
/**
|
|
130
|
-
*/
|
|
131
|
-
export interface HasListeners<TListeners extends Listeners<TListeners>> {
|
|
132
|
-
/**
|
|
133
|
-
* When no `eventName` is provided, returns true iff there are any listeners.
|
|
134
|
-
*
|
|
135
|
-
* When `eventName` is provided, returns true iff there are listeners for that event.
|
|
136
|
-
*
|
|
137
|
-
* @remarks
|
|
138
|
-
* This can be used to know when its safe to cleanup data-structures which only exist to fire events for their listeners.
|
|
139
|
-
*/
|
|
140
|
-
hasListeners(eventName?: keyof Listeners<TListeners>): boolean;
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* Provides an API for subscribing to and listening to events.
|
|
144
|
-
*
|
|
145
|
-
* @remarks Classes wishing to emit events may either extend this class or compose over it.
|
|
146
|
-
*
|
|
147
|
-
* @example Extending this class
|
|
148
|
-
*
|
|
149
|
-
* ```typescript
|
|
150
|
-
* interface MyEvents {
|
|
151
|
-
* "loaded": () => void;
|
|
152
|
-
* }
|
|
153
|
-
*
|
|
154
|
-
* class MyClass extends EventEmitter<MyEvents> {
|
|
155
|
-
* private load() {
|
|
156
|
-
* this.emit("loaded");
|
|
157
|
-
* }
|
|
158
|
-
* }
|
|
159
|
-
* ```
|
|
160
|
-
*
|
|
161
|
-
* @example Composing over this class
|
|
162
|
-
*
|
|
163
|
-
* ```typescript
|
|
164
|
-
* class MyClass implements ISubscribable<MyEvents> {
|
|
165
|
-
* private readonly events = EventEmitter.create<MyEvents>();
|
|
166
|
-
*
|
|
167
|
-
* private load() {
|
|
168
|
-
* this.events.emit("loaded");
|
|
169
|
-
* }
|
|
170
|
-
*
|
|
171
|
-
* public on<K extends keyof MyEvents>(eventName: K, listener: MyEvents[K]): Off {
|
|
172
|
-
* return this.events.on(eventName, listener);
|
|
173
|
-
* }
|
|
174
|
-
* }
|
|
175
|
-
* ```
|
|
176
|
-
*/
|
|
177
|
-
export declare class EventEmitter<TListeners extends Listeners<TListeners>> implements Listenable<TListeners>, HasListeners<TListeners> {
|
|
178
|
-
private readonly noListeners?;
|
|
179
|
-
protected readonly listeners: Map<keyof TListeners, Map<Off, (...args: any[]) => TListeners[keyof TListeners]>>;
|
|
180
|
-
protected constructor(noListeners?: NoListenersCallback<TListeners> | undefined);
|
|
181
|
-
protected emit<K extends keyof TListeners>(eventName: K, ...args: Parameters<TListeners[K]>): void;
|
|
182
|
-
protected emitAndCollect<K extends keyof TListeners>(eventName: K, ...args: Parameters<TListeners[K]>): ReturnType<TListeners[K]>[];
|
|
183
|
-
/**
|
|
184
|
-
* Register an event listener.
|
|
185
|
-
* @param eventName - the name of the event
|
|
186
|
-
* @param listener - the handler to run when the event is fired by the emitter
|
|
187
|
-
* @returns a function which will deregister the listener when run.
|
|
188
|
-
* This function will error if called more than once.
|
|
189
|
-
*/
|
|
190
|
-
on<K extends keyof Listeners<TListeners>>(eventName: K, listener: TListeners[K]): Off;
|
|
191
|
-
hasListeners(eventName?: keyof TListeners): boolean;
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* This class exposes the constructor and the `emit` method of `EventEmitter`, elevating them from protected to public
|
|
195
|
-
*/
|
|
196
|
-
export declare class ComposableEventEmitter<TListeners extends Listeners<TListeners>> extends EventEmitter<TListeners> implements IEmitter<TListeners> {
|
|
197
|
-
constructor(noListeners?: NoListenersCallback<TListeners>);
|
|
198
|
-
emit<K extends keyof TListeners>(eventName: K, ...args: Parameters<TListeners[K]>): void;
|
|
199
|
-
emitAndCollect<K extends keyof TListeners>(eventName: K, ...args: Parameters<TListeners[K]>): ReturnType<TListeners[K]>[];
|
|
200
|
-
}
|
|
201
|
-
//# sourceMappingURL=events.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/events/events.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAG9D;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,GAAG,KAAK,CAAC,SAAS,CACtF,CAAC,EAAE,MAAM,CAAC,KACN,OAAO,GACT,CAAC,GACD,KAAK,CAAC;AAET;;;GAGG;AACH,MAAM,MAAM,UAAU,CAAC,SAAS,IAAI,SAAS,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;AAE9F;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,MAAM,IAAI;KACxC,CAAC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;CACrF,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,kBAAkB,CAC7B,UAAU,SAAS,SAAS,CAAC,UAAU,CAAC,EACxC,OAAO,SAAS,MAAM,GAAG,MAAM,IAC5B;KACF,CAAC,IAAI,MAAM,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI;CAC/E,SAAS,MAAM,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,MAAM,CAAC,CAAC,GAChD,mBAAmB,CAAC,CAAC,CAAC,GAAG,OAAO,GAChC,KAAK,CAAC;AAET;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,UAAU,CAAC,UAAU,SAAS,MAAM;IACpD;;;;;;;;OAQG;IACH,EAAE,CAAC,CAAC,SAAS,MAAM,SAAS,CAAC,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;CACtF;AAED;;;;;GAKG;AACH,MAAM,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC;AAE7B;;GAEG;AACH,MAAM,WAAW,QAAQ,CAAC,UAAU,SAAS,SAAS,CAAC,UAAU,CAAC;IACjE;;;;OAIG;IACH,IAAI,CAAC,CAAC,SAAS,MAAM,SAAS,CAAC,UAAU,CAAC,EACzC,SAAS,EAAE,CAAC,EACZ,GAAG,IAAI,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAChC,IAAI,CAAC;IAER;;;;;;;;;OASG;IACH,cAAc,CAAC,CAAC,SAAS,MAAM,SAAS,CAAC,UAAU,CAAC,EACnD,SAAS,EAAE,CAAC,EACZ,GAAG,IAAI,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAChC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;CAC/B;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,UAAU,SAAS,MAAM,EACtD,WAAW,CAAC,EAAE,mBAAmB,CAAC,UAAU,CAAC,GAC3C,UAAU,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAC,UAAU,CAAC,GAAG,YAAY,CAAC,UAAU,CAAC,CAE1E;AAED;;;GAGG;AACH,MAAM,MAAM,mBAAmB,CAAC,UAAU,SAAS,MAAM,IAAI,CAC5D,SAAS,EAAE,MAAM,SAAS,CAAC,UAAU,CAAC,KAClC,IAAI,CAAC;AAEV;GACG;AACH,MAAM,WAAW,YAAY,CAAC,UAAU,SAAS,SAAS,CAAC,UAAU,CAAC;IACrE;;;;;;;OAOG;IACH,YAAY,CAAC,SAAS,CAAC,EAAE,MAAM,SAAS,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC;CAC/D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,qBAAa,YAAY,CAAC,UAAU,SAAS,SAAS,CAAC,UAAU,CAAC,CACjE,YAAW,UAAU,CAAC,UAAU,CAAC,EAAE,YAAY,CAAC,UAAU,CAAC;IASrC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC;IAPnD,SAAS,CAAC,QAAQ,CAAC,SAAS,2CAER,GAAG,EAAE,KAAK,UAAU,CAAC,MAAM,UAAU,CAAC,GACtD;IAIJ,SAAS,aAA8B,WAAW,CAAC,6CAAiC;IAEpF,SAAS,CAAC,IAAI,CAAC,CAAC,SAAS,MAAM,UAAU,EACxC,SAAS,EAAE,CAAC,EACZ,GAAG,IAAI,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAChC,IAAI;IAcP,SAAS,CAAC,cAAc,CAAC,CAAC,SAAS,MAAM,UAAU,EAClD,SAAS,EAAE,CAAC,EACZ,GAAG,IAAI,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAChC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE;IAa9B;;;;;;OAMG;IACI,EAAE,CAAC,CAAC,SAAS,MAAM,SAAS,CAAC,UAAU,CAAC,EAC9C,SAAS,EAAE,CAAC,EACZ,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC,GACrB,GAAG;IAeC,YAAY,CAAC,SAAS,CAAC,EAAE,MAAM,UAAU,GAAG,OAAO;CAM1D;AAED;;GAEG;AACH,qBAAa,sBAAsB,CAAC,UAAU,SAAS,SAAS,CAAC,UAAU,CAAC,CAC3E,SAAQ,YAAY,CAAC,UAAU,CAC/B,YAAW,QAAQ,CAAC,UAAU,CAAC;gBAEZ,WAAW,CAAC,EAAE,mBAAmB,CAAC,UAAU,CAAC;IAIhD,IAAI,CAAC,CAAC,SAAS,MAAM,UAAU,EAC9C,SAAS,EAAE,CAAC,EACZ,GAAG,IAAI,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAChC,IAAI;IAIS,cAAc,CAAC,CAAC,SAAS,MAAM,UAAU,EACxD,SAAS,EAAE,CAAC,EACZ,GAAG,IAAI,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAChC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE;CAG9B"}
|