@fluidframework/tree 2.1.0 → 2.2.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/.mocharc.customBenchmarks.cjs +33 -0
- package/CHANGELOG.md +297 -0
- package/README.md +34 -4
- package/api-extractor.json +17 -0
- package/api-report/tree.alpha.api.md +119 -25
- package/api-report/tree.beta.api.md +51 -25
- package/api-report/tree.public.api.md +51 -25
- package/dist/beta.d.ts +3 -1
- package/dist/codec/discriminatedUnions.d.ts +11 -5
- package/dist/codec/discriminatedUnions.d.ts.map +1 -1
- package/dist/codec/discriminatedUnions.js.map +1 -1
- package/dist/codec/index.d.ts +1 -1
- package/dist/codec/index.d.ts.map +1 -1
- package/dist/codec/index.js.map +1 -1
- package/dist/core/forest/editableForest.d.ts +1 -5
- package/dist/core/forest/editableForest.d.ts.map +1 -1
- package/dist/core/forest/editableForest.js.map +1 -1
- package/dist/core/forest/forest.d.ts +0 -6
- package/dist/core/forest/forest.d.ts.map +1 -1
- package/dist/core/forest/forest.js +0 -2
- package/dist/core/forest/forest.js.map +1 -1
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +3 -4
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/changeRebaser.d.ts +0 -4
- package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
- package/dist/core/rebase/changeRebaser.js.map +1 -1
- package/dist/core/rebase/index.d.ts +1 -1
- package/dist/core/rebase/index.d.ts.map +1 -1
- package/dist/core/rebase/index.js +1 -3
- package/dist/core/rebase/index.js.map +1 -1
- package/dist/core/rebase/types.d.ts +1 -8
- package/dist/core/rebase/types.d.ts.map +1 -1
- package/dist/core/rebase/types.js +1 -9
- package/dist/core/rebase/types.js.map +1 -1
- package/dist/core/rebase/utils.d.ts +0 -1
- package/dist/core/rebase/utils.d.ts.map +1 -1
- package/dist/core/rebase/utils.js +12 -7
- package/dist/core/rebase/utils.js.map +1 -1
- package/dist/core/schema-stored/multiplicity.d.ts +0 -1
- package/dist/core/schema-stored/multiplicity.d.ts.map +1 -1
- package/dist/core/schema-stored/multiplicity.js +0 -1
- package/dist/core/schema-stored/multiplicity.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +0 -7
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +0 -4
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.d.ts +0 -3
- package/dist/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.js.map +1 -1
- package/dist/core/schema-view/view.d.ts +0 -3
- package/dist/core/schema-view/view.d.ts.map +1 -1
- package/dist/core/schema-view/view.js +0 -1
- package/dist/core/schema-view/view.js.map +1 -1
- package/dist/core/tree/anchorSet.d.ts +0 -10
- package/dist/core/tree/anchorSet.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.js +1 -4
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/cursor.d.ts +1 -6
- package/dist/core/tree/cursor.d.ts.map +1 -1
- package/dist/core/tree/cursor.js +0 -2
- package/dist/core/tree/cursor.js.map +1 -1
- package/dist/core/tree/delta.d.ts +0 -11
- package/dist/core/tree/delta.d.ts.map +1 -1
- package/dist/core/tree/delta.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodec.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodec.js +3 -2
- package/dist/core/tree/detachedFieldIndexCodec.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexTypes.d.ts +0 -1
- package/dist/core/tree/detachedFieldIndexTypes.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexTypes.js.map +1 -1
- package/dist/core/tree/index.d.ts +1 -1
- package/dist/core/tree/index.d.ts.map +1 -1
- package/dist/core/tree/index.js +3 -1
- package/dist/core/tree/index.js.map +1 -1
- package/dist/core/tree/mapTree.d.ts +20 -4
- package/dist/core/tree/mapTree.d.ts.map +1 -1
- package/dist/core/tree/mapTree.js +29 -0
- package/dist/core/tree/mapTree.js.map +1 -1
- package/dist/core/tree/pathTree.d.ts +0 -11
- package/dist/core/tree/pathTree.d.ts.map +1 -1
- package/dist/core/tree/pathTree.js.map +1 -1
- package/dist/core/tree/treeTextFormat.d.ts.map +1 -1
- package/dist/core/tree/treeTextFormat.js +3 -2
- package/dist/core/tree/treeTextFormat.js.map +1 -1
- package/dist/core/tree/types.d.ts +0 -11
- package/dist/core/tree/types.d.ts.map +1 -1
- package/dist/core/tree/types.js +0 -4
- package/dist/core/tree/types.js.map +1 -1
- package/dist/core/tree/visitDelta.d.ts +0 -1
- package/dist/core/tree/visitDelta.d.ts.map +1 -1
- package/dist/core/tree/visitDelta.js +2 -2
- package/dist/core/tree/visitDelta.js.map +1 -1
- package/dist/core/tree/visitPath.d.ts +0 -2
- package/dist/core/tree/visitPath.d.ts.map +1 -1
- package/dist/core/tree/visitPath.js.map +1 -1
- package/dist/core/tree/visitorUtils.d.ts +0 -1
- package/dist/core/tree/visitorUtils.d.ts.map +1 -1
- package/dist/core/tree/visitorUtils.js.map +1 -1
- package/dist/domains/index.d.ts +1 -1
- package/dist/domains/index.d.ts.map +1 -1
- package/dist/domains/index.js +2 -1
- package/dist/domains/index.js.map +1 -1
- package/dist/domains/json/index.d.ts +1 -1
- package/dist/domains/json/index.d.ts.map +1 -1
- package/dist/domains/json/index.js +2 -1
- package/dist/domains/json/index.js.map +1 -1
- package/dist/domains/json/jsonCursor.d.ts +36 -2
- package/dist/domains/json/jsonCursor.d.ts.map +1 -1
- package/dist/domains/json/jsonCursor.js +76 -5
- package/dist/domains/json/jsonCursor.js.map +1 -1
- package/dist/domains/json/jsonDomainSchema.d.ts +13 -3
- package/dist/domains/json/jsonDomainSchema.d.ts.map +1 -1
- package/dist/domains/json/jsonDomainSchema.js +12 -4
- package/dist/domains/json/jsonDomainSchema.js.map +1 -1
- package/dist/domains/leafDomain.d.ts +0 -1
- package/dist/domains/leafDomain.d.ts.map +1 -1
- package/dist/domains/leafDomain.js +0 -1
- package/dist/domains/leafDomain.js.map +1 -1
- package/dist/domains/schemaBuilder.d.ts +1 -7
- package/dist/domains/schemaBuilder.d.ts.map +1 -1
- package/dist/domains/schemaBuilder.js +0 -10
- package/dist/domains/schemaBuilder.js.map +1 -1
- package/dist/events/events.d.ts +0 -4
- package/dist/events/events.d.ts.map +1 -1
- package/dist/events/events.js +0 -1
- package/dist/events/events.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.js +8 -3
- package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunk.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/chunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js +3 -3
- package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.js +7 -5
- package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +8 -5
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.js +5 -3
- package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +12 -24
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js +9 -19
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +0 -6
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +11 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultSchema.d.ts +0 -1
- package/dist/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultSchema.js +0 -1
- package/dist/feature-libraries/default-schema/defaultSchema.js.map +1 -1
- package/dist/feature-libraries/default-schema/index.d.ts +1 -1
- package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/index.js +2 -1
- package/dist/feature-libraries/default-schema/index.js.map +1 -1
- package/dist/feature-libraries/default-schema/schemaChecker.d.ts +6 -0
- package/dist/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/schemaChecker.js +6 -0
- package/dist/feature-libraries/default-schema/schemaChecker.js.map +1 -1
- package/dist/feature-libraries/editableTreeBinder.d.ts +0 -67
- package/dist/feature-libraries/editableTreeBinder.d.ts.map +1 -1
- package/dist/feature-libraries/editableTreeBinder.js +5 -24
- package/dist/feature-libraries/editableTreeBinder.js.map +1 -1
- package/dist/feature-libraries/fieldGenerator.d.ts +0 -3
- package/dist/feature-libraries/fieldGenerator.d.ts.map +1 -1
- package/dist/feature-libraries/fieldGenerator.js +0 -1
- package/dist/feature-libraries/fieldGenerator.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 -2
- package/dist/feature-libraries/flex-map-tree/index.js.map +1 -1
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts +57 -49
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.js +171 -168
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
- package/dist/feature-libraries/flex-tree/context.d.ts +0 -1
- package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/context.js.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +17 -282
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js +0 -4
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/dist/feature-libraries/flex-tree/index.d.ts +1 -1
- package/dist/feature-libraries/flex-tree/index.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/index.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.d.ts +9 -26
- package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +26 -99
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts +2 -10
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.js +3 -42
- package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/dist/feature-libraries/flex-tree/treeEvents.d.ts +0 -2
- package/dist/feature-libraries/flex-tree/treeEvents.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/treeEvents.js.map +1 -1
- package/dist/feature-libraries/flex-tree/utilities.d.ts +2 -1
- package/dist/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/utilities.js +4 -0
- package/dist/feature-libraries/flex-tree/utilities.js.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.js +2 -2
- package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +6 -8
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +7 -18
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/mapTreeCursor.d.ts +6 -2
- package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
- package/dist/feature-libraries/mapTreeCursor.js +9 -1
- package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
- package/dist/feature-libraries/memoizedIdRangeAllocator.d.ts +0 -4
- package/dist/feature-libraries/memoizedIdRangeAllocator.d.ts.map +1 -1
- package/dist/feature-libraries/memoizedIdRangeAllocator.js +0 -1
- package/dist/feature-libraries/memoizedIdRangeAllocator.js.map +1 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +0 -2
- package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.js +0 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
- package/dist/feature-libraries/modular-schema/discrepancies.d.ts +18 -0
- package/dist/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/discrepancies.js +105 -2
- package/dist/feature-libraries/modular-schema/discrepancies.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +0 -8
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.js +0 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKind.d.ts +1 -3
- package/dist/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKind.js +1 -2
- package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts +1 -2
- package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.js +57 -85
- package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js +5 -8
- package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindTypes.d.ts +3 -14
- package/dist/feature-libraries/modular-schema/genericFieldKindTypes.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindTypes.js +6 -0
- package/dist/feature-libraries/modular-schema/genericFieldKindTypes.js.map +1 -1
- package/dist/feature-libraries/modular-schema/index.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/index.js +2 -1
- package/dist/feature-libraries/modular-schema/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +39 -22
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +9 -8
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +192 -228
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +8 -14
- package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
- package/dist/feature-libraries/node-key/nodeKey.d.ts +0 -4
- package/dist/feature-libraries/node-key/nodeKey.d.ts.map +1 -1
- package/dist/feature-libraries/node-key/nodeKey.js +0 -2
- package/dist/feature-libraries/node-key/nodeKey.js.map +1 -1
- package/dist/feature-libraries/node-key/nodeKeyManager.d.ts +0 -1
- package/dist/feature-libraries/node-key/nodeKeyManager.d.ts.map +1 -1
- package/dist/feature-libraries/node-key/nodeKeyManager.js.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.js +1 -10
- package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +6 -6
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +7 -7
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
- package/dist/feature-libraries/schemaBuilderBase.d.ts +2 -28
- package/dist/feature-libraries/schemaBuilderBase.d.ts.map +1 -1
- package/dist/feature-libraries/schemaBuilderBase.js +1 -27
- package/dist/feature-libraries/schemaBuilderBase.js.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.js +24 -21
- package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV2.d.ts +3 -3
- package/dist/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV2.js +7 -6
- package/dist/feature-libraries/sequence-field/formatV2.js.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV3.d.ts +195 -0
- package/dist/feature-libraries/sequence-field/formatV3.d.ts.map +1 -0
- package/dist/feature-libraries/sequence-field/formatV3.js +23 -0
- package/dist/feature-libraries/sequence-field/formatV3.js.map +1 -0
- package/dist/feature-libraries/sequence-field/helperTypes.d.ts +11 -0
- package/dist/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/helperTypes.js.map +1 -1
- package/dist/feature-libraries/sequence-field/index.d.ts +1 -1
- package/dist/feature-libraries/sequence-field/index.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/index.js.map +1 -1
- package/dist/feature-libraries/sequence-field/invert.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/invert.js +21 -13
- package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
- package/dist/feature-libraries/sequence-field/markQueue.js +1 -1
- package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
- package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts +2 -2
- package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
- package/dist/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/rebase.js +24 -6
- package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
- package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/replaceRevisions.js +16 -3
- package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js +38 -4
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +4 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +54 -9
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +11 -0
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -0
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js +85 -0
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -0
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js +2 -0
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +4 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
- package/dist/feature-libraries/sequence-field/types.d.ts +23 -4
- package/dist/feature-libraries/sequence-field/types.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/types.js.map +1 -1
- package/dist/feature-libraries/sequence-field/utils.d.ts +5 -4
- package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/utils.js +70 -42
- package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
- package/dist/feature-libraries/storedToViewSchema.d.ts +0 -1
- package/dist/feature-libraries/storedToViewSchema.d.ts.map +1 -1
- package/dist/feature-libraries/storedToViewSchema.js +0 -1
- package/dist/feature-libraries/storedToViewSchema.js.map +1 -1
- package/dist/feature-libraries/treeCursorUtils.d.ts +0 -6
- package/dist/feature-libraries/treeCursorUtils.d.ts.map +1 -1
- package/dist/feature-libraries/treeCursorUtils.js +8 -6
- package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
- package/dist/feature-libraries/treeTextCursor.d.ts +0 -2
- package/dist/feature-libraries/treeTextCursor.d.ts.map +1 -1
- package/dist/feature-libraries/treeTextCursor.js +0 -2
- package/dist/feature-libraries/treeTextCursor.js.map +1 -1
- package/dist/feature-libraries/typed-schema/flexList.d.ts +0 -3
- package/dist/feature-libraries/typed-schema/flexList.d.ts.map +1 -1
- package/dist/feature-libraries/typed-schema/flexList.js.map +1 -1
- package/dist/feature-libraries/typed-schema/index.d.ts +1 -1
- package/dist/feature-libraries/typed-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/typed-schema/index.js +1 -3
- 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 +0 -4
- package/dist/feature-libraries/typed-schema/schemaCollection.js.map +1 -1
- package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts +2 -41
- package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
- package/dist/feature-libraries/typed-schema/typedTreeSchema.js +1 -40
- package/dist/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
- package/dist/feature-libraries/typed-schema/view.d.ts +0 -1
- package/dist/feature-libraries/typed-schema/view.d.ts.map +1 -1
- package/dist/feature-libraries/typed-schema/view.js.map +1 -1
- package/dist/index.d.ts +8 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +31 -90
- package/dist/index.js.map +1 -1
- package/dist/internalTypes.d.ts +1 -1
- package/dist/internalTypes.d.ts.map +1 -1
- package/dist/internalTypes.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/public.d.ts +3 -1
- package/dist/shared-tree/schematizeTree.d.ts +2 -11
- package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
- package/dist/shared-tree/schematizeTree.js +13 -2
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +4 -4
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +2 -2
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +4 -17
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +4 -8
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.js +4 -0
- package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js +2 -2
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts +0 -2
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/dist/shared-tree/treeApi.js +2 -2
- package/dist/shared-tree/treeApi.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +0 -5
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +5 -3
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree/treeView.d.ts +3 -6
- package/dist/shared-tree/treeView.d.ts.map +1 -1
- package/dist/shared-tree/treeView.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts.map +1 -1
- package/dist/shared-tree-core/branch.js +11 -6
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/shared-tree-core/defaultResubmitMachine.js +3 -3
- package/dist/shared-tree-core/defaultResubmitMachine.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js +1 -0
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormat.d.ts +2 -2
- package/dist/shared-tree-core/editManagerFormat.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormat.js +6 -1
- package/dist/shared-tree-core/editManagerFormat.js.map +1 -1
- package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js +1 -0
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +3 -1
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/simple-tree/api/create.d.ts +54 -0
- package/dist/simple-tree/api/create.d.ts.map +1 -0
- package/dist/simple-tree/api/create.js +99 -0
- package/dist/simple-tree/api/create.js.map +1 -0
- package/dist/simple-tree/api/index.d.ts +12 -0
- package/dist/simple-tree/api/index.d.ts.map +1 -0
- package/dist/simple-tree/api/index.js +28 -0
- package/dist/simple-tree/api/index.js.map +1 -0
- package/{lib/simple-tree → dist/simple-tree/api}/schemaCreationUtilities.d.ts +7 -4
- package/dist/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -0
- package/dist/simple-tree/{schemaCreationUtilities.js → api/schemaCreationUtilities.js} +1 -1
- package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -0
- package/dist/simple-tree/{schemaFactory.d.ts → api/schemaFactory.d.ts} +15 -14
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -0
- package/dist/simple-tree/{schemaFactory.js → api/schemaFactory.js} +10 -9
- package/dist/simple-tree/api/schemaFactory.js.map +1 -0
- package/{lib/simple-tree → dist/simple-tree/api}/schemaFactoryRecursive.d.ts +40 -7
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -0
- package/dist/simple-tree/{schemaFactoryRecursive.js → api/schemaFactoryRecursive.js} +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -0
- package/dist/simple-tree/api/testRecursiveDomain.d.ts +62 -0
- package/dist/simple-tree/api/testRecursiveDomain.d.ts.map +1 -0
- package/dist/simple-tree/api/testRecursiveDomain.js.map +1 -0
- package/{lib/simple-tree → dist/simple-tree/api}/tree.d.ts +111 -20
- package/dist/simple-tree/api/tree.d.ts.map +1 -0
- package/dist/simple-tree/api/tree.js +173 -0
- package/dist/simple-tree/api/tree.js.map +1 -0
- package/dist/simple-tree/{treeNodeApi.d.ts → api/treeNodeApi.d.ts} +6 -5
- package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -0
- package/dist/simple-tree/{treeNodeApi.js → api/treeNodeApi.js} +28 -20
- package/dist/simple-tree/api/treeNodeApi.js.map +1 -0
- package/dist/simple-tree/api/verboseTree.d.ts +136 -0
- package/dist/simple-tree/api/verboseTree.d.ts.map +1 -0
- package/dist/simple-tree/api/verboseTree.js +220 -0
- package/dist/simple-tree/api/verboseTree.js.map +1 -0
- package/dist/simple-tree/arrayNode.d.ts +3 -3
- package/dist/simple-tree/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/arrayNode.js +70 -69
- package/dist/simple-tree/arrayNode.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +10 -0
- package/dist/simple-tree/core/index.d.ts.map +1 -0
- package/dist/simple-tree/core/index.js +27 -0
- package/dist/simple-tree/core/index.js.map +1 -0
- package/{lib/simple-tree → dist/simple-tree/core}/schemaCaching.d.ts +2 -9
- package/dist/simple-tree/core/schemaCaching.d.ts.map +1 -0
- package/dist/simple-tree/{schemaCaching.js → core/schemaCaching.js} +2 -23
- package/dist/simple-tree/core/schemaCaching.js.map +1 -0
- package/dist/simple-tree/core/treeNodeKernel.d.ts +57 -0
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -0
- package/dist/simple-tree/{treeNodeKernel.js → core/treeNodeKernel.js} +49 -4
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -0
- package/dist/simple-tree/core/treeNodeSchema.d.ts +149 -0
- package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -0
- package/dist/simple-tree/core/treeNodeSchema.js +35 -0
- package/dist/simple-tree/core/treeNodeSchema.js.map +1 -0
- package/dist/simple-tree/{types.d.ts → core/types.d.ts} +23 -70
- package/dist/simple-tree/core/types.d.ts.map +1 -0
- package/dist/simple-tree/core/types.js +117 -0
- package/dist/simple-tree/core/types.js.map +1 -0
- package/dist/simple-tree/core/withType.d.ts +82 -0
- package/dist/simple-tree/core/withType.d.ts.map +1 -0
- package/dist/simple-tree/core/withType.js +39 -0
- package/dist/simple-tree/core/withType.js.map +1 -0
- package/dist/simple-tree/getJsonSchema.d.ts +55 -0
- package/dist/simple-tree/getJsonSchema.d.ts.map +1 -0
- package/dist/simple-tree/getJsonSchema.js +69 -0
- package/dist/simple-tree/getJsonSchema.js.map +1 -0
- package/dist/simple-tree/getSimpleFieldSchema.d.ts +14 -0
- package/dist/simple-tree/getSimpleFieldSchema.d.ts.map +1 -0
- package/dist/simple-tree/getSimpleFieldSchema.js +29 -0
- package/dist/simple-tree/getSimpleFieldSchema.js.map +1 -0
- package/dist/simple-tree/getSimpleSchema.d.ts +58 -0
- package/dist/simple-tree/getSimpleSchema.d.ts.map +1 -0
- package/dist/simple-tree/getSimpleSchema.js +68 -0
- package/dist/simple-tree/getSimpleSchema.js.map +1 -0
- package/dist/simple-tree/index.d.ts +12 -13
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +26 -23
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/jsonSchema.d.ts +206 -0
- package/dist/simple-tree/jsonSchema.d.ts.map +1 -0
- package/dist/{feature-libraries/schema-aware/index.js → simple-tree/jsonSchema.js} +1 -1
- package/dist/simple-tree/jsonSchema.js.map +1 -0
- package/dist/simple-tree/leafNodeSchema.d.ts +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js +3 -4
- package/dist/simple-tree/leafNodeSchema.js.map +1 -1
- package/dist/simple-tree/mapNode.d.ts +9 -3
- package/dist/simple-tree/mapNode.d.ts.map +1 -1
- package/dist/simple-tree/mapNode.js +33 -35
- package/dist/simple-tree/mapNode.js.map +1 -1
- package/dist/simple-tree/objectNode.d.ts +18 -16
- package/dist/simple-tree/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/objectNode.js +43 -44
- package/dist/simple-tree/objectNode.js.map +1 -1
- package/dist/simple-tree/objectNodeTypes.d.ts +38 -0
- package/dist/simple-tree/objectNodeTypes.d.ts.map +1 -0
- package/dist/simple-tree/objectNodeTypes.js +19 -0
- package/dist/simple-tree/objectNodeTypes.js.map +1 -0
- package/dist/simple-tree/proxies.d.ts +6 -25
- package/dist/simple-tree/proxies.d.ts.map +1 -1
- package/dist/simple-tree/proxies.js +50 -63
- package/dist/simple-tree/proxies.js.map +1 -1
- package/dist/simple-tree/proxyBinding.d.ts +45 -22
- package/dist/simple-tree/proxyBinding.d.ts.map +1 -1
- package/dist/simple-tree/proxyBinding.js +94 -59
- package/dist/simple-tree/proxyBinding.js.map +1 -1
- package/dist/simple-tree/schemaTypes.d.ts +10 -159
- package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
- package/dist/simple-tree/schemaTypes.js +11 -42
- package/dist/simple-tree/schemaTypes.js.map +1 -1
- package/dist/simple-tree/simpleSchema.d.ts +124 -0
- package/dist/simple-tree/simpleSchema.d.ts.map +1 -0
- package/dist/{feature-libraries/schema-aware/schemaAware.js → simple-tree/simpleSchema.js} +1 -1
- package/dist/simple-tree/simpleSchema.js.map +1 -0
- package/dist/simple-tree/simpleSchemaToJsonSchema.d.ts +12 -0
- package/dist/simple-tree/simpleSchemaToJsonSchema.d.ts.map +1 -0
- package/dist/simple-tree/simpleSchemaToJsonSchema.js +146 -0
- package/dist/simple-tree/simpleSchemaToJsonSchema.js.map +1 -0
- package/dist/simple-tree/toFlexSchema.d.ts +4 -12
- package/dist/simple-tree/toFlexSchema.d.ts.map +1 -1
- package/dist/simple-tree/toFlexSchema.js +42 -52
- package/dist/simple-tree/toFlexSchema.js.map +1 -1
- package/dist/simple-tree/toMapTree.d.ts +39 -39
- package/dist/simple-tree/toMapTree.d.ts.map +1 -1
- package/dist/simple-tree/toMapTree.js +227 -171
- package/dist/simple-tree/toMapTree.js.map +1 -1
- package/dist/simple-tree/treeNodeValid.d.ts +74 -0
- package/dist/simple-tree/treeNodeValid.d.ts.map +1 -0
- package/dist/simple-tree/{types.js → treeNodeValid.js} +18 -111
- package/dist/simple-tree/treeNodeValid.js.map +1 -0
- package/dist/simple-tree/typesUnsafe.d.ts +35 -4
- package/dist/simple-tree/typesUnsafe.d.ts.map +1 -1
- package/dist/simple-tree/typesUnsafe.js.map +1 -1
- package/dist/simple-tree/viewSchemaToSimpleSchema.d.ts +11 -0
- package/dist/simple-tree/viewSchemaToSimpleSchema.d.ts.map +1 -0
- package/dist/simple-tree/viewSchemaToSimpleSchema.js +171 -0
- package/dist/simple-tree/viewSchemaToSimpleSchema.js.map +1 -0
- package/dist/util/brand.d.ts +0 -3
- package/dist/util/brand.d.ts.map +1 -1
- package/dist/util/brand.js +1 -2
- package/dist/util/brand.js.map +1 -1
- package/dist/util/brandedMap.d.ts +0 -5
- package/dist/util/brandedMap.d.ts.map +1 -1
- package/dist/util/brandedMap.js +0 -1
- package/dist/util/brandedMap.js.map +1 -1
- package/dist/util/idAllocator.d.ts +0 -2
- package/dist/util/idAllocator.d.ts.map +1 -1
- package/dist/util/idAllocator.js +0 -1
- package/dist/util/idAllocator.js.map +1 -1
- package/dist/util/index.d.ts +2 -2
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +4 -2
- package/dist/util/index.js.map +1 -1
- package/dist/util/nestedMap.d.ts +5 -19
- package/dist/util/nestedMap.d.ts.map +1 -1
- package/dist/util/nestedMap.js +17 -17
- package/dist/util/nestedMap.js.map +1 -1
- package/dist/util/opaque.d.ts +0 -4
- package/dist/util/opaque.d.ts.map +1 -1
- package/dist/util/opaque.js +0 -2
- package/dist/util/opaque.js.map +1 -1
- package/dist/util/rangeMap.d.ts +0 -2
- package/dist/util/rangeMap.d.ts.map +1 -1
- package/dist/util/rangeMap.js +4 -3
- package/dist/util/rangeMap.js.map +1 -1
- package/dist/util/transactionResult.d.ts +0 -1
- package/dist/util/transactionResult.d.ts.map +1 -1
- package/dist/util/transactionResult.js +0 -1
- package/dist/util/transactionResult.js.map +1 -1
- package/dist/util/typeCheck.d.ts +2 -20
- package/dist/util/typeCheck.d.ts.map +1 -1
- package/dist/util/typeCheck.js.map +1 -1
- package/dist/util/typeCheckTests.d.ts +4 -4
- package/dist/util/typeCheckTests.d.ts.map +1 -1
- package/dist/util/typeCheckTests.js.map +1 -1
- package/dist/util/typeUtils.d.ts +0 -7
- package/dist/util/typeUtils.d.ts.map +1 -1
- package/dist/util/typeUtils.js.map +1 -1
- package/dist/util/utils.d.ts +6 -8
- package/dist/util/utils.d.ts.map +1 -1
- package/dist/util/utils.js +14 -5
- package/dist/util/utils.js.map +1 -1
- package/lib/beta.d.ts +3 -1
- package/lib/codec/discriminatedUnions.d.ts +11 -5
- package/lib/codec/discriminatedUnions.d.ts.map +1 -1
- package/lib/codec/discriminatedUnions.js.map +1 -1
- package/lib/codec/index.d.ts +1 -1
- package/lib/codec/index.d.ts.map +1 -1
- package/lib/codec/index.js +1 -1
- package/lib/codec/index.js.map +1 -1
- package/lib/core/forest/editableForest.d.ts +1 -5
- package/lib/core/forest/editableForest.d.ts.map +1 -1
- package/lib/core/forest/editableForest.js.map +1 -1
- package/lib/core/forest/forest.d.ts +0 -6
- package/lib/core/forest/forest.d.ts.map +1 -1
- package/lib/core/forest/forest.js +0 -2
- package/lib/core/forest/forest.js.map +1 -1
- package/lib/core/index.d.ts +2 -2
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +2 -2
- package/lib/core/index.js.map +1 -1
- package/lib/core/rebase/changeRebaser.d.ts +0 -4
- package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
- package/lib/core/rebase/changeRebaser.js.map +1 -1
- package/lib/core/rebase/index.d.ts +1 -1
- package/lib/core/rebase/index.d.ts.map +1 -1
- package/lib/core/rebase/index.js +1 -1
- package/lib/core/rebase/index.js.map +1 -1
- package/lib/core/rebase/types.d.ts +1 -8
- package/lib/core/rebase/types.d.ts.map +1 -1
- package/lib/core/rebase/types.js +1 -7
- package/lib/core/rebase/types.js.map +1 -1
- package/lib/core/rebase/utils.d.ts +0 -1
- package/lib/core/rebase/utils.d.ts.map +1 -1
- package/lib/core/rebase/utils.js +13 -8
- package/lib/core/rebase/utils.js.map +1 -1
- package/lib/core/schema-stored/multiplicity.d.ts +0 -1
- package/lib/core/schema-stored/multiplicity.d.ts.map +1 -1
- package/lib/core/schema-stored/multiplicity.js +0 -1
- package/lib/core/schema-stored/multiplicity.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +0 -7
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +0 -4
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.d.ts +0 -3
- package/lib/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.js.map +1 -1
- package/lib/core/schema-view/view.d.ts +0 -3
- package/lib/core/schema-view/view.d.ts.map +1 -1
- package/lib/core/schema-view/view.js +0 -1
- package/lib/core/schema-view/view.js.map +1 -1
- package/lib/core/tree/anchorSet.d.ts +0 -10
- package/lib/core/tree/anchorSet.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.js +1 -4
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/core/tree/cursor.d.ts +1 -6
- package/lib/core/tree/cursor.d.ts.map +1 -1
- package/lib/core/tree/cursor.js +0 -2
- package/lib/core/tree/cursor.js.map +1 -1
- package/lib/core/tree/delta.d.ts +0 -11
- package/lib/core/tree/delta.d.ts.map +1 -1
- package/lib/core/tree/delta.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodec.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodec.js +4 -3
- package/lib/core/tree/detachedFieldIndexCodec.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexTypes.d.ts +0 -1
- package/lib/core/tree/detachedFieldIndexTypes.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexTypes.js.map +1 -1
- package/lib/core/tree/index.d.ts +1 -1
- package/lib/core/tree/index.d.ts.map +1 -1
- package/lib/core/tree/index.js +1 -0
- package/lib/core/tree/index.js.map +1 -1
- package/lib/core/tree/mapTree.d.ts +20 -4
- package/lib/core/tree/mapTree.d.ts.map +1 -1
- package/lib/core/tree/mapTree.js +27 -1
- package/lib/core/tree/mapTree.js.map +1 -1
- package/lib/core/tree/pathTree.d.ts +0 -11
- package/lib/core/tree/pathTree.d.ts.map +1 -1
- package/lib/core/tree/pathTree.js.map +1 -1
- package/lib/core/tree/treeTextFormat.d.ts.map +1 -1
- package/lib/core/tree/treeTextFormat.js +3 -2
- package/lib/core/tree/treeTextFormat.js.map +1 -1
- package/lib/core/tree/types.d.ts +0 -11
- package/lib/core/tree/types.d.ts.map +1 -1
- package/lib/core/tree/types.js +0 -4
- package/lib/core/tree/types.js.map +1 -1
- package/lib/core/tree/visitDelta.d.ts +0 -1
- package/lib/core/tree/visitDelta.d.ts.map +1 -1
- package/lib/core/tree/visitDelta.js +2 -2
- package/lib/core/tree/visitDelta.js.map +1 -1
- package/lib/core/tree/visitPath.d.ts +0 -2
- package/lib/core/tree/visitPath.d.ts.map +1 -1
- package/lib/core/tree/visitPath.js.map +1 -1
- package/lib/core/tree/visitorUtils.d.ts +0 -1
- package/lib/core/tree/visitorUtils.d.ts.map +1 -1
- package/lib/core/tree/visitorUtils.js.map +1 -1
- package/lib/domains/index.d.ts +1 -1
- package/lib/domains/index.d.ts.map +1 -1
- package/lib/domains/index.js +1 -1
- package/lib/domains/index.js.map +1 -1
- package/lib/domains/json/index.d.ts +1 -1
- package/lib/domains/json/index.d.ts.map +1 -1
- package/lib/domains/json/index.js +1 -1
- package/lib/domains/json/index.js.map +1 -1
- package/lib/domains/json/jsonCursor.d.ts +36 -2
- package/lib/domains/json/jsonCursor.d.ts.map +1 -1
- package/lib/domains/json/jsonCursor.js +76 -5
- package/lib/domains/json/jsonCursor.js.map +1 -1
- package/lib/domains/json/jsonDomainSchema.d.ts +13 -3
- package/lib/domains/json/jsonDomainSchema.d.ts.map +1 -1
- package/lib/domains/json/jsonDomainSchema.js +9 -1
- package/lib/domains/json/jsonDomainSchema.js.map +1 -1
- package/lib/domains/leafDomain.d.ts +0 -1
- package/lib/domains/leafDomain.d.ts.map +1 -1
- package/lib/domains/leafDomain.js +0 -1
- package/lib/domains/leafDomain.js.map +1 -1
- package/lib/domains/schemaBuilder.d.ts +1 -7
- package/lib/domains/schemaBuilder.d.ts.map +1 -1
- package/lib/domains/schemaBuilder.js +1 -11
- package/lib/domains/schemaBuilder.js.map +1 -1
- package/lib/events/events.d.ts +0 -4
- package/lib/events/events.d.ts.map +1 -1
- package/lib/events/events.js +0 -1
- package/lib/events/events.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.js +9 -4
- package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunk.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/chunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js +4 -4
- package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.js +8 -6
- package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js +2 -2
- package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +9 -6
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js +6 -4
- package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +12 -24
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js +6 -16
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +0 -6
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js +11 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultSchema.d.ts +0 -1
- package/lib/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultSchema.js +0 -1
- package/lib/feature-libraries/default-schema/defaultSchema.js.map +1 -1
- package/lib/feature-libraries/default-schema/index.d.ts +1 -1
- package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/index.js +1 -1
- package/lib/feature-libraries/default-schema/index.js.map +1 -1
- package/lib/feature-libraries/default-schema/schemaChecker.d.ts +6 -0
- package/lib/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/schemaChecker.js +6 -0
- package/lib/feature-libraries/default-schema/schemaChecker.js.map +1 -1
- package/lib/feature-libraries/editableTreeBinder.d.ts +0 -67
- package/lib/feature-libraries/editableTreeBinder.d.ts.map +1 -1
- package/lib/feature-libraries/editableTreeBinder.js +6 -25
- package/lib/feature-libraries/editableTreeBinder.js.map +1 -1
- package/lib/feature-libraries/fieldGenerator.d.ts +0 -3
- package/lib/feature-libraries/fieldGenerator.d.ts.map +1 -1
- package/lib/feature-libraries/fieldGenerator.js +0 -1
- package/lib/feature-libraries/fieldGenerator.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 +57 -49
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.js +172 -168
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
- package/lib/feature-libraries/flex-tree/context.d.ts +0 -1
- package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/context.js.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +17 -282
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js +0 -4
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/lib/feature-libraries/flex-tree/index.d.ts +1 -1
- package/lib/feature-libraries/flex-tree/index.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/index.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.d.ts +9 -26
- package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +28 -101
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts +2 -10
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.js +4 -42
- package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/lib/feature-libraries/flex-tree/treeEvents.d.ts +0 -2
- package/lib/feature-libraries/flex-tree/treeEvents.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/treeEvents.js.map +1 -1
- package/lib/feature-libraries/flex-tree/utilities.d.ts +2 -1
- package/lib/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/utilities.js +4 -0
- package/lib/feature-libraries/flex-tree/utilities.js.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.js +3 -3
- package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +6 -8
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +5 -6
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/mapTreeCursor.d.ts +6 -2
- package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
- package/lib/feature-libraries/mapTreeCursor.js +7 -0
- package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
- package/lib/feature-libraries/memoizedIdRangeAllocator.d.ts +0 -4
- package/lib/feature-libraries/memoizedIdRangeAllocator.d.ts.map +1 -1
- package/lib/feature-libraries/memoizedIdRangeAllocator.js +0 -1
- package/lib/feature-libraries/memoizedIdRangeAllocator.js.map +1 -1
- package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +0 -2
- package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/crossFieldQueries.js +0 -1
- package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
- package/lib/feature-libraries/modular-schema/discrepancies.d.ts +18 -0
- package/lib/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/discrepancies.js +103 -1
- package/lib/feature-libraries/modular-schema/discrepancies.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +0 -8
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.js +0 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKind.d.ts +1 -3
- package/lib/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKind.js +1 -2
- package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts +1 -2
- package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.js +56 -83
- package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js +6 -9
- package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindTypes.d.ts +3 -14
- package/lib/feature-libraries/modular-schema/genericFieldKindTypes.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindTypes.js +4 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindTypes.js.map +1 -1
- package/lib/feature-libraries/modular-schema/index.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/index.js +1 -1
- package/lib/feature-libraries/modular-schema/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +42 -25
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +9 -8
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +169 -206
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +8 -14
- package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
- package/lib/feature-libraries/node-key/nodeKey.d.ts +0 -4
- package/lib/feature-libraries/node-key/nodeKey.d.ts.map +1 -1
- package/lib/feature-libraries/node-key/nodeKey.js +0 -2
- package/lib/feature-libraries/node-key/nodeKey.js.map +1 -1
- package/lib/feature-libraries/node-key/nodeKeyManager.d.ts +0 -1
- package/lib/feature-libraries/node-key/nodeKeyManager.d.ts.map +1 -1
- package/lib/feature-libraries/node-key/nodeKeyManager.js.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js +2 -11
- package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +6 -6
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +7 -7
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
- package/lib/feature-libraries/schemaBuilderBase.d.ts +2 -28
- package/lib/feature-libraries/schemaBuilderBase.d.ts.map +1 -1
- package/lib/feature-libraries/schemaBuilderBase.js +2 -28
- package/lib/feature-libraries/schemaBuilderBase.js.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.js +25 -22
- package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV2.d.ts +3 -3
- package/lib/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV2.js +3 -3
- package/lib/feature-libraries/sequence-field/formatV2.js.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV3.d.ts +195 -0
- package/lib/feature-libraries/sequence-field/formatV3.d.ts.map +1 -0
- package/lib/feature-libraries/sequence-field/formatV3.js +19 -0
- package/lib/feature-libraries/sequence-field/formatV3.js.map +1 -0
- package/lib/feature-libraries/sequence-field/helperTypes.d.ts +11 -0
- package/lib/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/helperTypes.js.map +1 -1
- package/lib/feature-libraries/sequence-field/index.d.ts +1 -1
- package/lib/feature-libraries/sequence-field/index.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/index.js.map +1 -1
- package/lib/feature-libraries/sequence-field/invert.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/invert.js +22 -14
- package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
- package/lib/feature-libraries/sequence-field/markQueue.js +2 -2
- package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
- package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts +2 -2
- package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
- package/lib/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/rebase.js +25 -7
- package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
- package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/replaceRevisions.js +16 -3
- package/lib/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js +40 -6
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +4 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +55 -11
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +11 -0
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -0
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js +81 -0
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -0
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js +2 -0
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js +5 -2
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
- package/lib/feature-libraries/sequence-field/types.d.ts +23 -4
- package/lib/feature-libraries/sequence-field/types.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/types.js.map +1 -1
- package/lib/feature-libraries/sequence-field/utils.d.ts +5 -4
- package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/utils.js +67 -41
- package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
- package/lib/feature-libraries/storedToViewSchema.d.ts +0 -1
- package/lib/feature-libraries/storedToViewSchema.d.ts.map +1 -1
- package/lib/feature-libraries/storedToViewSchema.js +0 -1
- package/lib/feature-libraries/storedToViewSchema.js.map +1 -1
- package/lib/feature-libraries/treeCursorUtils.d.ts +0 -6
- package/lib/feature-libraries/treeCursorUtils.d.ts.map +1 -1
- package/lib/feature-libraries/treeCursorUtils.js +9 -7
- package/lib/feature-libraries/treeCursorUtils.js.map +1 -1
- package/lib/feature-libraries/treeTextCursor.d.ts +0 -2
- package/lib/feature-libraries/treeTextCursor.d.ts.map +1 -1
- package/lib/feature-libraries/treeTextCursor.js +0 -2
- package/lib/feature-libraries/treeTextCursor.js.map +1 -1
- package/lib/feature-libraries/typed-schema/flexList.d.ts +0 -3
- package/lib/feature-libraries/typed-schema/flexList.d.ts.map +1 -1
- package/lib/feature-libraries/typed-schema/flexList.js.map +1 -1
- package/lib/feature-libraries/typed-schema/index.d.ts +1 -1
- package/lib/feature-libraries/typed-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/typed-schema/index.js +1 -1
- 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 +1 -5
- package/lib/feature-libraries/typed-schema/schemaCollection.js.map +1 -1
- package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts +2 -41
- package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
- package/lib/feature-libraries/typed-schema/typedTreeSchema.js +1 -38
- package/lib/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
- package/lib/feature-libraries/typed-schema/view.d.ts +0 -1
- package/lib/feature-libraries/typed-schema/view.d.ts.map +1 -1
- package/lib/feature-libraries/typed-schema/view.js.map +1 -1
- package/lib/index.d.ts +8 -9
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -9
- package/lib/index.js.map +1 -1
- package/lib/internalTypes.d.ts +1 -1
- package/lib/internalTypes.d.ts.map +1 -1
- package/lib/internalTypes.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/public.d.ts +3 -1
- package/lib/shared-tree/schematizeTree.d.ts +2 -11
- package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
- package/lib/shared-tree/schematizeTree.js +15 -4
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +4 -4
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +3 -3
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +4 -17
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +6 -10
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.js +4 -0
- package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js +3 -3
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts +0 -2
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/lib/shared-tree/treeApi.js +3 -3
- package/lib/shared-tree/treeApi.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +0 -5
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +6 -4
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree/treeView.d.ts +3 -6
- package/lib/shared-tree/treeView.d.ts.map +1 -1
- package/lib/shared-tree/treeView.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +12 -7
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/shared-tree-core/defaultResubmitMachine.js +4 -4
- package/lib/shared-tree-core/defaultResubmitMachine.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js +1 -0
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormat.d.ts +2 -2
- package/lib/shared-tree-core/editManagerFormat.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormat.js +6 -1
- package/lib/shared-tree-core/editManagerFormat.js.map +1 -1
- package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecs.js +1 -0
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +4 -2
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/simple-tree/api/create.d.ts +54 -0
- package/lib/simple-tree/api/create.d.ts.map +1 -0
- package/lib/simple-tree/api/create.js +92 -0
- package/lib/simple-tree/api/create.js.map +1 -0
- package/lib/simple-tree/api/index.d.ts +12 -0
- package/lib/simple-tree/api/index.d.ts.map +1 -0
- package/lib/simple-tree/api/index.js +13 -0
- package/lib/simple-tree/api/index.js.map +1 -0
- package/{dist/simple-tree → lib/simple-tree/api}/schemaCreationUtilities.d.ts +7 -4
- package/lib/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -0
- package/lib/simple-tree/{schemaCreationUtilities.js → api/schemaCreationUtilities.js} +1 -1
- package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -0
- package/lib/simple-tree/{schemaFactory.d.ts → api/schemaFactory.d.ts} +15 -14
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -0
- package/lib/simple-tree/{schemaFactory.js → api/schemaFactory.js} +9 -8
- package/lib/simple-tree/api/schemaFactory.js.map +1 -0
- package/{dist/simple-tree → lib/simple-tree/api}/schemaFactoryRecursive.d.ts +40 -7
- package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -0
- package/lib/simple-tree/{schemaFactoryRecursive.js → api/schemaFactoryRecursive.js} +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -0
- package/lib/simple-tree/api/testRecursiveDomain.d.ts +62 -0
- package/lib/simple-tree/api/testRecursiveDomain.d.ts.map +1 -0
- package/lib/simple-tree/api/testRecursiveDomain.js.map +1 -0
- package/{dist/simple-tree → lib/simple-tree/api}/tree.d.ts +111 -20
- package/lib/simple-tree/api/tree.d.ts.map +1 -0
- package/lib/simple-tree/api/tree.js +165 -0
- package/lib/simple-tree/api/tree.js.map +1 -0
- package/lib/simple-tree/{treeNodeApi.d.ts → api/treeNodeApi.d.ts} +6 -5
- package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -0
- package/lib/simple-tree/{treeNodeApi.js → api/treeNodeApi.js} +25 -17
- package/lib/simple-tree/api/treeNodeApi.js.map +1 -0
- package/lib/simple-tree/api/verboseTree.d.ts +136 -0
- package/lib/simple-tree/api/verboseTree.d.ts.map +1 -0
- package/lib/simple-tree/api/verboseTree.js +213 -0
- package/lib/simple-tree/api/verboseTree.js.map +1 -0
- package/lib/simple-tree/arrayNode.d.ts +3 -3
- package/lib/simple-tree/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/arrayNode.js +56 -53
- package/lib/simple-tree/arrayNode.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +10 -0
- package/lib/simple-tree/core/index.d.ts.map +1 -0
- package/lib/simple-tree/core/index.js +10 -0
- package/lib/simple-tree/core/index.js.map +1 -0
- package/{dist/simple-tree → lib/simple-tree/core}/schemaCaching.d.ts +2 -9
- package/lib/simple-tree/core/schemaCaching.d.ts.map +1 -0
- package/lib/simple-tree/{schemaCaching.js → core/schemaCaching.js} +1 -21
- package/lib/simple-tree/core/schemaCaching.js.map +1 -0
- package/lib/simple-tree/core/treeNodeKernel.d.ts +57 -0
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -0
- package/lib/simple-tree/{treeNodeKernel.js → core/treeNodeKernel.js} +45 -3
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -0
- package/lib/simple-tree/core/treeNodeSchema.d.ts +149 -0
- package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -0
- package/lib/simple-tree/core/treeNodeSchema.js +32 -0
- package/lib/simple-tree/core/treeNodeSchema.js.map +1 -0
- package/lib/simple-tree/{types.d.ts → core/types.d.ts} +23 -70
- package/lib/simple-tree/core/types.d.ts.map +1 -0
- package/lib/simple-tree/core/types.js +111 -0
- package/lib/simple-tree/core/types.js.map +1 -0
- package/lib/simple-tree/core/withType.d.ts +82 -0
- package/lib/simple-tree/core/withType.d.ts.map +1 -0
- package/lib/simple-tree/core/withType.js +36 -0
- package/lib/simple-tree/core/withType.js.map +1 -0
- package/lib/simple-tree/getJsonSchema.d.ts +55 -0
- package/lib/simple-tree/getJsonSchema.d.ts.map +1 -0
- package/lib/simple-tree/getJsonSchema.js +65 -0
- package/lib/simple-tree/getJsonSchema.js.map +1 -0
- package/lib/simple-tree/getSimpleFieldSchema.d.ts +14 -0
- package/lib/simple-tree/getSimpleFieldSchema.d.ts.map +1 -0
- package/lib/simple-tree/getSimpleFieldSchema.js +25 -0
- package/lib/simple-tree/getSimpleFieldSchema.js.map +1 -0
- package/lib/simple-tree/getSimpleSchema.d.ts +58 -0
- package/lib/simple-tree/getSimpleSchema.d.ts.map +1 -0
- package/lib/simple-tree/getSimpleSchema.js +64 -0
- package/lib/simple-tree/getSimpleSchema.js.map +1 -0
- package/lib/simple-tree/index.d.ts +12 -13
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +8 -11
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/jsonSchema.d.ts +206 -0
- package/lib/simple-tree/jsonSchema.d.ts.map +1 -0
- package/lib/simple-tree/{nodeKeys.js → jsonSchema.js} +1 -1
- package/lib/simple-tree/jsonSchema.js.map +1 -0
- package/lib/simple-tree/leafNodeSchema.d.ts +1 -1
- package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js +1 -2
- package/lib/simple-tree/leafNodeSchema.js.map +1 -1
- package/lib/simple-tree/mapNode.d.ts +9 -3
- package/lib/simple-tree/mapNode.d.ts.map +1 -1
- package/lib/simple-tree/mapNode.js +36 -36
- package/lib/simple-tree/mapNode.js.map +1 -1
- package/lib/simple-tree/objectNode.d.ts +18 -16
- package/lib/simple-tree/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/objectNode.js +36 -34
- package/lib/simple-tree/objectNode.js.map +1 -1
- package/lib/simple-tree/objectNodeTypes.d.ts +38 -0
- package/lib/simple-tree/objectNodeTypes.d.ts.map +1 -0
- package/lib/simple-tree/objectNodeTypes.js +15 -0
- package/lib/simple-tree/objectNodeTypes.js.map +1 -0
- package/lib/simple-tree/proxies.d.ts +6 -25
- package/lib/simple-tree/proxies.d.ts.map +1 -1
- package/lib/simple-tree/proxies.js +46 -57
- package/lib/simple-tree/proxies.js.map +1 -1
- package/lib/simple-tree/proxyBinding.d.ts +45 -22
- package/lib/simple-tree/proxyBinding.d.ts.map +1 -1
- package/lib/simple-tree/proxyBinding.js +89 -52
- package/lib/simple-tree/proxyBinding.js.map +1 -1
- package/lib/simple-tree/schemaTypes.d.ts +10 -159
- package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
- package/lib/simple-tree/schemaTypes.js +9 -41
- package/lib/simple-tree/schemaTypes.js.map +1 -1
- package/lib/simple-tree/simpleSchema.d.ts +124 -0
- package/lib/simple-tree/simpleSchema.d.ts.map +1 -0
- package/lib/{feature-libraries/schema-aware/schemaAware.js → simple-tree/simpleSchema.js} +1 -1
- package/lib/simple-tree/simpleSchema.js.map +1 -0
- package/lib/simple-tree/simpleSchemaToJsonSchema.d.ts +12 -0
- package/lib/simple-tree/simpleSchemaToJsonSchema.d.ts.map +1 -0
- package/lib/simple-tree/simpleSchemaToJsonSchema.js +142 -0
- package/lib/simple-tree/simpleSchemaToJsonSchema.js.map +1 -0
- package/lib/simple-tree/toFlexSchema.d.ts +4 -12
- package/lib/simple-tree/toFlexSchema.d.ts.map +1 -1
- package/lib/simple-tree/toFlexSchema.js +9 -18
- package/lib/simple-tree/toFlexSchema.js.map +1 -1
- package/lib/simple-tree/toMapTree.d.ts +39 -39
- package/lib/simple-tree/toMapTree.d.ts.map +1 -1
- package/lib/simple-tree/toMapTree.js +214 -158
- package/lib/simple-tree/toMapTree.js.map +1 -1
- package/lib/simple-tree/treeNodeValid.d.ts +74 -0
- package/lib/simple-tree/treeNodeValid.d.ts.map +1 -0
- package/lib/simple-tree/{types.js → treeNodeValid.js} +8 -98
- package/lib/simple-tree/treeNodeValid.js.map +1 -0
- package/lib/simple-tree/typesUnsafe.d.ts +35 -4
- package/lib/simple-tree/typesUnsafe.d.ts.map +1 -1
- package/lib/simple-tree/typesUnsafe.js.map +1 -1
- package/lib/simple-tree/viewSchemaToSimpleSchema.d.ts +11 -0
- package/lib/simple-tree/viewSchemaToSimpleSchema.d.ts.map +1 -0
- package/lib/simple-tree/viewSchemaToSimpleSchema.js +167 -0
- package/lib/simple-tree/viewSchemaToSimpleSchema.js.map +1 -0
- package/lib/util/brand.d.ts +0 -3
- package/lib/util/brand.d.ts.map +1 -1
- package/lib/util/brand.js +1 -2
- package/lib/util/brand.js.map +1 -1
- package/lib/util/brandedMap.d.ts +0 -5
- package/lib/util/brandedMap.d.ts.map +1 -1
- package/lib/util/brandedMap.js +0 -1
- package/lib/util/brandedMap.js.map +1 -1
- package/lib/util/idAllocator.d.ts +0 -2
- package/lib/util/idAllocator.d.ts.map +1 -1
- package/lib/util/idAllocator.js +0 -1
- package/lib/util/idAllocator.js.map +1 -1
- package/lib/util/index.d.ts +2 -2
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +2 -2
- package/lib/util/index.js.map +1 -1
- package/lib/util/nestedMap.d.ts +5 -19
- package/lib/util/nestedMap.d.ts.map +1 -1
- package/lib/util/nestedMap.js +15 -16
- package/lib/util/nestedMap.js.map +1 -1
- package/lib/util/opaque.d.ts +0 -4
- package/lib/util/opaque.d.ts.map +1 -1
- package/lib/util/opaque.js +0 -2
- package/lib/util/opaque.js.map +1 -1
- package/lib/util/rangeMap.d.ts +0 -2
- package/lib/util/rangeMap.d.ts.map +1 -1
- package/lib/util/rangeMap.js +4 -3
- package/lib/util/rangeMap.js.map +1 -1
- package/lib/util/transactionResult.d.ts +0 -1
- package/lib/util/transactionResult.d.ts.map +1 -1
- package/lib/util/transactionResult.js +0 -1
- package/lib/util/transactionResult.js.map +1 -1
- package/lib/util/typeCheck.d.ts +2 -20
- package/lib/util/typeCheck.d.ts.map +1 -1
- package/lib/util/typeCheck.js.map +1 -1
- package/lib/util/typeCheckTests.d.ts +4 -4
- package/lib/util/typeCheckTests.d.ts.map +1 -1
- package/lib/util/typeCheckTests.js.map +1 -1
- package/lib/util/typeUtils.d.ts +0 -7
- package/lib/util/typeUtils.d.ts.map +1 -1
- package/lib/util/typeUtils.js.map +1 -1
- package/lib/util/utils.d.ts +6 -8
- package/lib/util/utils.d.ts.map +1 -1
- package/lib/util/utils.js +12 -4
- package/lib/util/utils.js.map +1 -1
- package/package.json +36 -25
- package/src/codec/discriminatedUnions.ts +20 -10
- package/src/codec/index.ts +5 -1
- package/src/core/forest/README.md +4 -2
- package/src/core/forest/editableForest.ts +1 -6
- package/src/core/forest/forest.ts +0 -6
- package/src/core/index.ts +2 -2
- package/src/core/rebase/changeRebaser.ts +0 -4
- package/src/core/rebase/index.ts +0 -2
- package/src/core/rebase/types.ts +1 -23
- package/src/core/rebase/utils.ts +13 -11
- package/src/core/schema-stored/multiplicity.ts +0 -1
- package/src/core/schema-stored/schema.ts +0 -7
- package/src/core/schema-stored/storedSchemaRepository.ts +0 -3
- package/src/core/schema-view/view.ts +0 -3
- package/src/core/tree/anchorSet.ts +7 -17
- package/src/core/tree/cursor.ts +1 -6
- package/src/core/tree/delta.ts +0 -11
- package/src/core/tree/detachedFieldIndexCodec.ts +4 -3
- package/src/core/tree/detachedFieldIndexTypes.ts +0 -1
- package/src/core/tree/index.ts +1 -1
- package/src/core/tree/mapTree.ts +45 -4
- package/src/core/tree/pathTree.ts +0 -11
- package/src/core/tree/treeTextFormat.ts +3 -2
- package/src/core/tree/types.ts +0 -11
- package/src/core/tree/visitDelta.ts +2 -3
- package/src/core/tree/visitPath.ts +0 -2
- package/src/core/tree/visitorUtils.ts +0 -1
- package/src/domains/index.ts +3 -0
- package/src/domains/json/index.ts +7 -1
- package/src/domains/json/jsonCursor.ts +113 -6
- package/src/domains/json/jsonDomainSchema.ts +4 -5
- package/src/domains/leafDomain.ts +0 -1
- package/src/domains/schemaBuilder.ts +0 -22
- package/src/events/events.ts +0 -4
- package/src/feature-libraries/chunked-forest/README.md +9 -1
- package/src/feature-libraries/chunked-forest/basicChunk.ts +14 -9
- package/src/feature-libraries/chunked-forest/chunk.ts +1 -1
- package/src/feature-libraries/chunked-forest/chunkTree.ts +4 -4
- package/src/feature-libraries/chunked-forest/chunkedForest.ts +8 -6
- package/src/feature-libraries/chunked-forest/codec/chunkCodecUtilities.ts +2 -2
- package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +9 -6
- package/src/feature-libraries/chunked-forest/uniformChunk.ts +6 -4
- package/src/feature-libraries/default-schema/defaultEditBuilder.ts +18 -46
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +11 -6
- package/src/feature-libraries/default-schema/defaultSchema.ts +0 -1
- package/src/feature-libraries/default-schema/index.ts +1 -1
- package/src/feature-libraries/default-schema/schemaChecker.ts +6 -0
- package/src/feature-libraries/editableTreeBinder.ts +6 -78
- package/src/feature-libraries/fieldGenerator.ts +0 -3
- package/src/feature-libraries/flex-map-tree/index.ts +2 -1
- package/src/feature-libraries/flex-map-tree/mapTreeNode.ts +238 -267
- package/src/feature-libraries/flex-tree/context.ts +0 -1
- package/src/feature-libraries/flex-tree/flexTreeTypes.ts +27 -357
- package/src/feature-libraries/flex-tree/index.ts +0 -1
- package/src/feature-libraries/flex-tree/lazyField.ts +38 -208
- package/src/feature-libraries/flex-tree/lazyNode.ts +5 -66
- package/src/feature-libraries/flex-tree/treeEvents.ts +0 -2
- package/src/feature-libraries/flex-tree/utilities.ts +6 -1
- package/src/feature-libraries/forest-summary/codec.ts +3 -3
- package/src/feature-libraries/index.ts +5 -35
- package/src/feature-libraries/mapTreeCursor.ts +13 -4
- package/src/feature-libraries/memoizedIdRangeAllocator.ts +0 -4
- package/src/feature-libraries/modular-schema/crossFieldQueries.ts +0 -2
- package/src/feature-libraries/modular-schema/discrepancies.ts +117 -1
- package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +0 -8
- package/src/feature-libraries/modular-schema/fieldKind.ts +1 -3
- package/src/feature-libraries/modular-schema/genericFieldKind.ts +69 -92
- package/src/feature-libraries/modular-schema/genericFieldKindCodecs.ts +7 -14
- package/src/feature-libraries/modular-schema/genericFieldKindTypes.ts +6 -15
- package/src/feature-libraries/modular-schema/index.ts +2 -2
- package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +68 -34
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +330 -336
- package/src/feature-libraries/modular-schema/modularChangeTypes.ts +7 -14
- package/src/feature-libraries/node-key/nodeKey.ts +0 -4
- package/src/feature-libraries/node-key/nodeKeyManager.ts +0 -1
- package/src/feature-libraries/object-forest/objectForest.ts +1 -13
- package/src/feature-libraries/schemaBuilderBase.ts +1 -49
- package/src/feature-libraries/sequence-field/compose.ts +41 -20
- package/src/feature-libraries/sequence-field/formatV2.ts +3 -3
- package/src/feature-libraries/sequence-field/formatV3.ts +65 -0
- package/src/feature-libraries/sequence-field/helperTypes.ts +33 -0
- package/src/feature-libraries/sequence-field/index.ts +1 -0
- package/src/feature-libraries/sequence-field/invert.ts +28 -18
- package/src/feature-libraries/sequence-field/markQueue.ts +2 -2
- package/src/feature-libraries/sequence-field/moveEffectTable.ts +2 -2
- package/src/feature-libraries/sequence-field/rebase.ts +30 -13
- package/src/feature-libraries/sequence-field/replaceRevisions.ts +27 -3
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV1.ts +52 -7
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +92 -19
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +134 -0
- package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +2 -0
- package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +8 -2
- package/src/feature-libraries/sequence-field/types.ts +24 -4
- package/src/feature-libraries/sequence-field/utils.ts +78 -50
- package/src/feature-libraries/storedToViewSchema.ts +0 -1
- package/src/feature-libraries/treeCursorUtils.ts +11 -11
- package/src/feature-libraries/treeTextCursor.ts +0 -2
- package/src/feature-libraries/typed-schema/flexList.ts +0 -3
- package/src/feature-libraries/typed-schema/index.ts +0 -2
- package/src/feature-libraries/typed-schema/schemaCollection.ts +0 -5
- package/src/feature-libraries/typed-schema/typedTreeSchema.ts +2 -68
- package/src/feature-libraries/typed-schema/view.ts +0 -1
- package/src/index.ts +27 -245
- package/src/internalTypes.ts +1 -0
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/schematizeTree.ts +25 -21
- package/src/shared-tree/schematizingTreeView.ts +6 -6
- package/src/shared-tree/sharedTree.ts +8 -39
- package/src/shared-tree/sharedTreeChangeCodecs.ts +8 -0
- package/src/shared-tree/sharedTreeChangeFamily.ts +3 -3
- package/src/shared-tree/sharedTreeEditBuilder.ts +0 -2
- package/src/shared-tree/treeApi.ts +3 -3
- package/src/shared-tree/treeCheckout.ts +6 -8
- package/src/shared-tree/treeView.ts +3 -6
- package/src/shared-tree-core/branch.ts +20 -8
- package/src/shared-tree-core/defaultResubmitMachine.ts +4 -4
- package/src/shared-tree-core/editManagerCodecs.ts +1 -0
- package/src/shared-tree-core/editManagerFormat.ts +7 -2
- package/src/shared-tree-core/messageCodecs.ts +2 -1
- package/src/shared-tree-core/sharedTreeCore.ts +5 -3
- package/src/simple-tree/ProxyBinding.md +2 -0
- package/src/simple-tree/api/README.md +7 -0
- package/src/simple-tree/api/create.ts +179 -0
- package/src/simple-tree/api/index.ts +36 -0
- package/src/simple-tree/{schemaCreationUtilities.ts → api/schemaCreationUtilities.ts} +13 -5
- package/src/simple-tree/{schemaFactory.ts → api/schemaFactory.ts} +36 -34
- package/src/simple-tree/{schemaFactoryRecursive.ts → api/schemaFactoryRecursive.ts} +47 -10
- package/src/simple-tree/{testRecursiveDomain.ts → api/testRecursiveDomain.ts} +3 -1
- package/src/simple-tree/{tree.ts → api/tree.ts} +246 -34
- package/src/simple-tree/{treeNodeApi.ts → api/treeNodeApi.ts} +47 -36
- package/src/simple-tree/api/verboseTree.ts +415 -0
- package/src/simple-tree/arrayNode.ts +100 -98
- package/src/simple-tree/core/README.md +11 -0
- package/src/simple-tree/core/index.ts +33 -0
- package/src/simple-tree/{schemaCaching.ts → core/schemaCaching.ts} +3 -37
- package/src/simple-tree/{treeNodeKernel.ts → core/treeNodeKernel.ts} +55 -5
- package/src/simple-tree/core/treeNodeSchema.ts +184 -0
- package/src/simple-tree/core/types.ts +255 -0
- package/src/simple-tree/core/withType.ts +89 -0
- package/src/simple-tree/getJsonSchema.ts +70 -0
- package/src/simple-tree/getSimpleFieldSchema.ts +36 -0
- package/src/simple-tree/getSimpleSchema.ts +69 -0
- package/src/simple-tree/index.ts +58 -33
- package/src/simple-tree/jsonSchema.ts +230 -0
- package/src/simple-tree/leafNodeSchema.ts +6 -3
- package/src/simple-tree/mapNode.ts +56 -55
- package/src/simple-tree/objectNode.ts +66 -90
- package/src/simple-tree/objectNodeTypes.ts +68 -0
- package/src/simple-tree/proxies.ts +52 -68
- package/src/simple-tree/proxyBinding.ts +127 -72
- package/src/simple-tree/schemaTypes.ts +29 -194
- package/src/simple-tree/simpleSchema.ts +138 -0
- package/src/simple-tree/simpleSchemaToJsonSchema.ts +178 -0
- package/src/simple-tree/toFlexSchema.ts +9 -42
- package/src/simple-tree/toMapTree.ts +270 -296
- package/src/simple-tree/{types.ts → treeNodeValid.ts} +16 -232
- package/src/simple-tree/typesUnsafe.ts +51 -5
- package/src/simple-tree/viewSchemaToSimpleSchema.ts +209 -0
- package/src/util/brand.ts +1 -4
- package/src/util/brandedMap.ts +0 -5
- package/src/util/idAllocator.ts +0 -2
- package/src/util/index.ts +2 -0
- package/src/util/nestedMap.ts +23 -20
- package/src/util/opaque.ts +0 -4
- package/src/util/rangeMap.ts +5 -5
- package/src/util/transactionResult.ts +0 -1
- package/src/util/typeCheck.ts +2 -20
- package/src/util/typeCheckTests.ts +4 -4
- package/src/util/typeUtils.ts +0 -7
- package/src/util/utils.ts +13 -8
- package/tsconfig.json +0 -1
- package/dist/feature-libraries/contextuallyTyped.d.ts +0 -209
- package/dist/feature-libraries/contextuallyTyped.d.ts.map +0 -1
- package/dist/feature-libraries/contextuallyTyped.js +0 -328
- package/dist/feature-libraries/contextuallyTyped.js.map +0 -1
- package/dist/feature-libraries/schema-aware/index.d.ts +0 -6
- package/dist/feature-libraries/schema-aware/index.d.ts.map +0 -1
- package/dist/feature-libraries/schema-aware/index.js.map +0 -1
- package/dist/feature-libraries/schema-aware/schemaAware.d.ts +0 -76
- package/dist/feature-libraries/schema-aware/schemaAware.d.ts.map +0 -1
- package/dist/feature-libraries/schema-aware/schemaAware.js.map +0 -1
- package/dist/simple-tree/nodeKeys.d.ts +0 -41
- package/dist/simple-tree/nodeKeys.d.ts.map +0 -1
- package/dist/simple-tree/nodeKeys.js +0 -7
- package/dist/simple-tree/nodeKeys.js.map +0 -1
- package/dist/simple-tree/schemaCaching.d.ts.map +0 -1
- package/dist/simple-tree/schemaCaching.js.map +0 -1
- package/dist/simple-tree/schemaCreationUtilities.d.ts.map +0 -1
- package/dist/simple-tree/schemaCreationUtilities.js.map +0 -1
- package/dist/simple-tree/schemaFactory.d.ts.map +0 -1
- package/dist/simple-tree/schemaFactory.js.map +0 -1
- package/dist/simple-tree/schemaFactoryRecursive.d.ts.map +0 -1
- package/dist/simple-tree/schemaFactoryRecursive.js.map +0 -1
- package/dist/simple-tree/testRecursiveDomain.d.ts +0 -61
- package/dist/simple-tree/testRecursiveDomain.d.ts.map +0 -1
- package/dist/simple-tree/testRecursiveDomain.js.map +0 -1
- package/dist/simple-tree/tree.d.ts.map +0 -1
- package/dist/simple-tree/tree.js +0 -73
- package/dist/simple-tree/tree.js.map +0 -1
- package/dist/simple-tree/treeNodeApi.d.ts.map +0 -1
- package/dist/simple-tree/treeNodeApi.js.map +0 -1
- package/dist/simple-tree/treeNodeKernel.d.ts +0 -26
- package/dist/simple-tree/treeNodeKernel.d.ts.map +0 -1
- package/dist/simple-tree/treeNodeKernel.js.map +0 -1
- package/dist/simple-tree/types.d.ts.map +0 -1
- package/dist/simple-tree/types.js.map +0 -1
- package/lib/feature-libraries/contextuallyTyped.d.ts +0 -209
- package/lib/feature-libraries/contextuallyTyped.d.ts.map +0 -1
- package/lib/feature-libraries/contextuallyTyped.js +0 -311
- package/lib/feature-libraries/contextuallyTyped.js.map +0 -1
- package/lib/feature-libraries/schema-aware/index.d.ts +0 -6
- package/lib/feature-libraries/schema-aware/index.d.ts.map +0 -1
- package/lib/feature-libraries/schema-aware/index.js +0 -6
- package/lib/feature-libraries/schema-aware/index.js.map +0 -1
- package/lib/feature-libraries/schema-aware/schemaAware.d.ts +0 -76
- package/lib/feature-libraries/schema-aware/schemaAware.d.ts.map +0 -1
- package/lib/feature-libraries/schema-aware/schemaAware.js.map +0 -1
- package/lib/simple-tree/nodeKeys.d.ts +0 -41
- package/lib/simple-tree/nodeKeys.d.ts.map +0 -1
- package/lib/simple-tree/nodeKeys.js.map +0 -1
- package/lib/simple-tree/schemaCaching.d.ts.map +0 -1
- package/lib/simple-tree/schemaCaching.js.map +0 -1
- package/lib/simple-tree/schemaCreationUtilities.d.ts.map +0 -1
- package/lib/simple-tree/schemaCreationUtilities.js.map +0 -1
- package/lib/simple-tree/schemaFactory.d.ts.map +0 -1
- package/lib/simple-tree/schemaFactory.js.map +0 -1
- package/lib/simple-tree/schemaFactoryRecursive.d.ts.map +0 -1
- package/lib/simple-tree/schemaFactoryRecursive.js.map +0 -1
- package/lib/simple-tree/testRecursiveDomain.d.ts +0 -61
- package/lib/simple-tree/testRecursiveDomain.d.ts.map +0 -1
- package/lib/simple-tree/testRecursiveDomain.js.map +0 -1
- package/lib/simple-tree/tree.d.ts.map +0 -1
- package/lib/simple-tree/tree.js +0 -66
- package/lib/simple-tree/tree.js.map +0 -1
- package/lib/simple-tree/treeNodeApi.d.ts.map +0 -1
- package/lib/simple-tree/treeNodeApi.js.map +0 -1
- package/lib/simple-tree/treeNodeKernel.d.ts +0 -26
- package/lib/simple-tree/treeNodeKernel.d.ts.map +0 -1
- package/lib/simple-tree/treeNodeKernel.js.map +0 -1
- package/lib/simple-tree/types.d.ts.map +0 -1
- package/lib/simple-tree/types.js.map +0 -1
- package/src/feature-libraries/contextuallyTyped.ts +0 -582
- package/src/feature-libraries/schema-aware/README.md +0 -19
- package/src/feature-libraries/schema-aware/index.ts +0 -16
- package/src/feature-libraries/schema-aware/schemaAware.ts +0 -135
- package/src/simple-tree/nodeKeys.ts +0 -42
- /package/dist/simple-tree/{testRecursiveDomain.js → api/testRecursiveDomain.js} +0 -0
- /package/lib/simple-tree/{testRecursiveDomain.js → api/testRecursiveDomain.js} +0 -0
|
@@ -8,13 +8,11 @@ import { FieldKinds } from "../default-schema/index.js";
|
|
|
8
8
|
import type { FlexFieldKind, FullSchemaPolicy } from "../modular-schema/index.js";
|
|
9
9
|
import type { LazyItem } from "./flexList.js";
|
|
10
10
|
/**
|
|
11
|
-
* @internal
|
|
12
11
|
*/
|
|
13
12
|
export interface FlexObjectNodeFields {
|
|
14
13
|
readonly [key: string]: FlexFieldSchema;
|
|
15
14
|
}
|
|
16
15
|
/**
|
|
17
|
-
* @internal
|
|
18
16
|
*/
|
|
19
17
|
export type NormalizeObjectNodeFields<T extends FlexObjectNodeFields> = {
|
|
20
18
|
readonly [Property in keyof T]: NormalizeField<T[Property]>;
|
|
@@ -32,19 +30,17 @@ export type Unenforced<_DesiredExtendsConstraint> = unknown;
|
|
|
32
30
|
* T must extend TreeSchemaSpecification.
|
|
33
31
|
* This can not be enforced using TypeScript since doing so breaks recursive type support.
|
|
34
32
|
* See note on SchemaBuilder.fieldRecursive.
|
|
35
|
-
* @internal
|
|
36
33
|
*/
|
|
37
34
|
export declare abstract class TreeNodeSchemaBase<const out Name extends string = string, const out Specification = unknown> {
|
|
38
35
|
readonly builder: Named<string>;
|
|
39
36
|
readonly name: TreeNodeSchemaIdentifier<Name>;
|
|
40
37
|
readonly info: Specification;
|
|
41
38
|
readonly stored: TreeNodeStoredSchema;
|
|
42
|
-
protected _typeCheck
|
|
39
|
+
protected _typeCheck: MakeNominal;
|
|
43
40
|
protected constructor(builder: Named<string>, name: TreeNodeSchemaIdentifier<Name>, info: Specification, stored: TreeNodeStoredSchema);
|
|
44
41
|
abstract getFieldSchema(field: FieldKey): FlexFieldSchema;
|
|
45
42
|
}
|
|
46
43
|
/**
|
|
47
|
-
* @internal
|
|
48
44
|
*/
|
|
49
45
|
export declare class FlexMapNodeSchema<const out Name extends string = string, const out Specification extends Unenforced<FlexMapFieldSchema> = FlexMapFieldSchema> extends TreeNodeSchemaBase<Name, Specification> {
|
|
50
46
|
get mapFields(): FlexMapFieldSchema;
|
|
@@ -53,7 +49,6 @@ export declare class FlexMapNodeSchema<const out Name extends string = string, c
|
|
|
53
49
|
getFieldSchema(field: FieldKey): FlexMapFieldSchema;
|
|
54
50
|
}
|
|
55
51
|
/**
|
|
56
|
-
* @internal
|
|
57
52
|
*/
|
|
58
53
|
export declare class LeafNodeSchema<const out Name extends string = string, const out Specification extends Unenforced<ValueSchema> = ValueSchema> extends TreeNodeSchemaBase<Name, Specification> {
|
|
59
54
|
get leafValue(): ValueSchema;
|
|
@@ -62,7 +57,6 @@ export declare class LeafNodeSchema<const out Name extends string = string, cons
|
|
|
62
57
|
getFieldSchema(field: FieldKey): FlexFieldSchema;
|
|
63
58
|
}
|
|
64
59
|
/**
|
|
65
|
-
* @internal
|
|
66
60
|
*/
|
|
67
61
|
export declare class FlexObjectNodeSchema<const out Name extends string = string, const out Specification extends Unenforced<FlexObjectNodeFields> = FlexObjectNodeFields> extends TreeNodeSchemaBase<Name, Specification> {
|
|
68
62
|
readonly objectNodeFieldsObject: NormalizeObjectNodeFields<Assume<Specification, FlexObjectNodeFields>>;
|
|
@@ -74,17 +68,6 @@ export declare class FlexObjectNodeSchema<const out Name extends string = string
|
|
|
74
68
|
getFieldSchema(field: FieldKey): FlexFieldSchema;
|
|
75
69
|
}
|
|
76
70
|
/**
|
|
77
|
-
* TODO: remove or replace (or subclass) this with more specific types, like "List".
|
|
78
|
-
* @internal
|
|
79
|
-
*/
|
|
80
|
-
export declare class FlexFieldNodeSchema<Name extends string = string, Specification extends Unenforced<FlexFieldSchema> = FlexFieldSchema> extends TreeNodeSchemaBase<Name, Specification> {
|
|
81
|
-
protected _typeCheck2?: MakeNominal;
|
|
82
|
-
static create<const Name extends string, const Specification extends FlexFieldSchema>(builder: Named<string>, name: TreeNodeSchemaIdentifier<Name>, specification: Specification): FlexFieldNodeSchema<Name, Specification>;
|
|
83
|
-
private constructor();
|
|
84
|
-
getFieldSchema(field?: FieldKey): FlexFieldSchema;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* @internal
|
|
88
71
|
* @privateRemarks
|
|
89
72
|
* This could be an exhaustive union, or just the common base type.
|
|
90
73
|
* Using just the base type prevents exhaustive matching, which has both pros and cons.
|
|
@@ -94,41 +77,34 @@ export declare class FlexFieldNodeSchema<Name extends string = string, Specifica
|
|
|
94
77
|
export type FlexTreeNodeSchema = TreeNodeSchemaBase;
|
|
95
78
|
/**
|
|
96
79
|
* Convert FieldSchemaSpecification | undefined into TreeFieldSchema.
|
|
97
|
-
* @internal
|
|
98
80
|
*/
|
|
99
81
|
export type NormalizeField<T extends FlexFieldSchema | undefined> = T extends FlexFieldSchema ? T : FlexFieldSchema<typeof FieldKinds.forbidden, []>;
|
|
100
82
|
/**
|
|
101
83
|
* Allow any node (as long as it meets the schema for its own type).
|
|
102
|
-
* @internal
|
|
103
84
|
*/
|
|
104
85
|
export declare const Any: "Any";
|
|
105
86
|
/**
|
|
106
87
|
* Allow any node (as long as it meets the schema for its own type).
|
|
107
|
-
* @internal
|
|
108
88
|
*/
|
|
109
89
|
export type Any = typeof Any;
|
|
110
90
|
/**
|
|
111
91
|
* Tree type, but can be wrapped in a function to allow referring to types before they are declared.
|
|
112
92
|
* This makes recursive and co-recursive types possible.
|
|
113
|
-
* @internal
|
|
114
93
|
*/
|
|
115
94
|
export type LazyTreeNodeSchema = FlexTreeNodeSchema | (() => FlexTreeNodeSchema);
|
|
116
95
|
/**
|
|
117
96
|
* Types for use in fields.
|
|
118
97
|
*
|
|
119
98
|
* "Any" is boxed in an array to allow use as variadic parameter.
|
|
120
|
-
* @internal
|
|
121
99
|
*/
|
|
122
100
|
export type FlexAllowedTypes = readonly [Any] | readonly LazyItem<FlexTreeNodeSchema>[];
|
|
123
101
|
/**
|
|
124
102
|
* Checks if an {@link FlexAllowedTypes} is {@link (Any:type)}.
|
|
125
|
-
* @internal
|
|
126
103
|
*/
|
|
127
104
|
export declare function allowedTypesIsAny(t: FlexAllowedTypes): t is readonly [Any];
|
|
128
105
|
/**
|
|
129
106
|
* Subset of TreeFieldSchema thats legal in maps.
|
|
130
107
|
* This requires empty to be a valid value for the map.
|
|
131
|
-
* @internal
|
|
132
108
|
*/
|
|
133
109
|
export type FlexMapFieldSchema = FlexFieldSchema<typeof FieldKinds.optional | typeof FieldKinds.sequence>;
|
|
134
110
|
/**
|
|
@@ -144,7 +120,6 @@ export type FlexMapFieldSchema = FlexFieldSchema<typeof FieldKinds.optional | ty
|
|
|
144
120
|
* @typeParam TTypes - The types allowed by the field.
|
|
145
121
|
*
|
|
146
122
|
* @sealed
|
|
147
|
-
* @internal
|
|
148
123
|
*/
|
|
149
124
|
export declare class FlexFieldSchema<out TKind extends FlexFieldKind = FlexFieldKind, const out TTypes extends Unenforced<FlexAllowedTypes> = FlexAllowedTypes> {
|
|
150
125
|
readonly kind: TKind;
|
|
@@ -166,7 +141,7 @@ export declare class FlexFieldSchema<out TKind extends FlexFieldKind = FlexField
|
|
|
166
141
|
* Prefer {@link FlexFieldSchema.create} when possible.
|
|
167
142
|
*/
|
|
168
143
|
static createUnsafe<TKind extends FlexFieldKind, const Types extends Unenforced<FlexAllowedTypes>>(kind: TKind, allowedTypes: Types): FlexFieldSchema<TKind, Types>;
|
|
169
|
-
protected _typeCheck
|
|
144
|
+
protected _typeCheck: MakeNominal;
|
|
170
145
|
/**
|
|
171
146
|
* This is computed lazily since types can be recursive, which makes evaluating this have to happen after all the schema are defined.
|
|
172
147
|
*/
|
|
@@ -214,17 +189,14 @@ export declare class FlexFieldSchema<out TKind extends FlexFieldKind = FlexField
|
|
|
214
189
|
* @remarks
|
|
215
190
|
* See {@link TreeTypeSet} for a stored-schema compatible version using the {@link TreeNodeSchemaIdentifier}.
|
|
216
191
|
* See {@link FlexAllowedTypes} for a compile time optimized version.
|
|
217
|
-
* @internal
|
|
218
192
|
*/
|
|
219
193
|
export type AllowedTypeSet = Any | ReadonlySet<FlexTreeNodeSchema>;
|
|
220
194
|
/**
|
|
221
195
|
* Convert {@link FlexAllowedTypes} to {@link TreeTypeSet}.
|
|
222
|
-
* @internal
|
|
223
196
|
*/
|
|
224
197
|
export declare function allowedTypesSchemaSet(t: FlexAllowedTypes): AllowedTypeSet;
|
|
225
198
|
/**
|
|
226
199
|
* Convert {@link FlexAllowedTypes} to {@link TreeTypeSet}.
|
|
227
|
-
* @internal
|
|
228
200
|
*/
|
|
229
201
|
export declare function allowedTypesToTypeSet(t: FlexAllowedTypes): TreeTypeSet;
|
|
230
202
|
/**
|
|
@@ -234,8 +206,6 @@ export declare function allowedTypesToTypeSet(t: FlexAllowedTypes): TreeTypeSet;
|
|
|
234
206
|
* @remarks
|
|
235
207
|
* The type of the rootFieldSchema is used to implement SchemaAware APIs.
|
|
236
208
|
* Cases that do not require being compile time schema aware can omit the explicit type for it.
|
|
237
|
-
*
|
|
238
|
-
* @internal
|
|
239
209
|
*/
|
|
240
210
|
export interface FlexTreeSchema<out T extends FlexFieldSchema = FlexFieldSchema> extends SchemaCollection {
|
|
241
211
|
/**
|
|
@@ -261,7 +231,6 @@ export declare function intoStoredSchema(treeSchema: FlexTreeSchema): TreeStored
|
|
|
261
231
|
export declare function intoStoredSchemaCollection(treeSchema: SchemaCollection): StoredSchemaCollection;
|
|
262
232
|
/**
|
|
263
233
|
* Schema data that can be be used to view a document.
|
|
264
|
-
* @internal
|
|
265
234
|
*
|
|
266
235
|
* @privateRemarks
|
|
267
236
|
* It is convenient that this can be used as a StoredSchemaCollection with no conversion.
|
|
@@ -275,22 +244,14 @@ export interface SchemaCollection {
|
|
|
275
244
|
}
|
|
276
245
|
/**
|
|
277
246
|
* Checks if a {@link FlexTreeNodeSchema} is a {@link FlexMapNodeSchema}.
|
|
278
|
-
* @internal
|
|
279
247
|
*/
|
|
280
248
|
export declare function schemaIsMap(schema: FlexTreeNodeSchema): schema is FlexMapNodeSchema;
|
|
281
249
|
/**
|
|
282
250
|
* Checks if a {@link FlexTreeNodeSchema} is a {@link LeafNodeSchema}.
|
|
283
|
-
* @internal
|
|
284
251
|
*/
|
|
285
252
|
export declare function schemaIsLeaf(schema: FlexTreeNodeSchema): schema is LeafNodeSchema;
|
|
286
|
-
/**
|
|
287
|
-
* Checks if a {@link FlexTreeNodeSchema} is a {@link FlexFieldNodeSchema}.
|
|
288
|
-
* @internal
|
|
289
|
-
*/
|
|
290
|
-
export declare function schemaIsFieldNode(schema: FlexTreeNodeSchema): schema is FlexFieldNodeSchema;
|
|
291
253
|
/**
|
|
292
254
|
* Checks if a {@link FlexTreeNodeSchema} is a {@link FlexObjectNodeSchema}.
|
|
293
|
-
* @internal
|
|
294
255
|
*/
|
|
295
256
|
export declare function schemaIsObjectNode(schema: FlexTreeNodeSchema): schema is FlexObjectNodeSchema;
|
|
296
257
|
//# sourceMappingURL=typedTreeSchema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typedTreeSchema.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/typed-schema/typedTreeSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,KAAK,QAAQ,
|
|
1
|
+
{"version":3,"file":"typedTreeSchema.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/typed-schema/typedTreeSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,KAAK,QAAQ,EACb,KAAK,QAAQ,EAIb,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,WAAW,EAEhB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,KAAK,MAAM,EACX,KAAK,WAAW,EAChB,KAAK,KAAK,EAMV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,4BA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NodeStoredSchema, MapNodeStoredSchema, ObjectNodeStoredSchema, identifierFieldKindIdentifier, } from "../../core/index.js";
|
|
7
7
|
import { compareSets, mapIterable, oneFromSet, filterIterable, } from "../../util/index.js";
|
|
8
8
|
import { FieldKinds } from "../default-schema/index.js";
|
|
9
9
|
import { objectToMapTyped } from "./typeUtils.js";
|
|
@@ -13,7 +13,6 @@ import { objectToMapTyped } from "./typeUtils.js";
|
|
|
13
13
|
* T must extend TreeSchemaSpecification.
|
|
14
14
|
* This can not be enforced using TypeScript since doing so breaks recursive type support.
|
|
15
15
|
* See note on SchemaBuilder.fieldRecursive.
|
|
16
|
-
* @internal
|
|
17
16
|
*/
|
|
18
17
|
export class TreeNodeSchemaBase {
|
|
19
18
|
constructor(builder, name, info, stored) {
|
|
@@ -24,7 +23,6 @@ export class TreeNodeSchemaBase {
|
|
|
24
23
|
}
|
|
25
24
|
}
|
|
26
25
|
/**
|
|
27
|
-
* @internal
|
|
28
26
|
*/
|
|
29
27
|
export class FlexMapNodeSchema extends TreeNodeSchemaBase {
|
|
30
28
|
get mapFields() {
|
|
@@ -38,7 +36,6 @@ export class FlexMapNodeSchema extends TreeNodeSchemaBase {
|
|
|
38
36
|
}
|
|
39
37
|
}
|
|
40
38
|
/**
|
|
41
|
-
* @internal
|
|
42
39
|
*/
|
|
43
40
|
export class LeafNodeSchema extends TreeNodeSchemaBase {
|
|
44
41
|
get leafValue() {
|
|
@@ -52,7 +49,6 @@ export class LeafNodeSchema extends TreeNodeSchemaBase {
|
|
|
52
49
|
}
|
|
53
50
|
}
|
|
54
51
|
/**
|
|
55
|
-
* @internal
|
|
56
52
|
*/
|
|
57
53
|
export class FlexObjectNodeSchema extends TreeNodeSchemaBase {
|
|
58
54
|
static create(builder, name, specification) {
|
|
@@ -75,24 +71,6 @@ export class FlexObjectNodeSchema extends TreeNodeSchemaBase {
|
|
|
75
71
|
return this.objectNodeFields.get(field) ?? FlexFieldSchema.empty;
|
|
76
72
|
}
|
|
77
73
|
}
|
|
78
|
-
/**
|
|
79
|
-
* TODO: remove or replace (or subclass) this with more specific types, like "List".
|
|
80
|
-
* @internal
|
|
81
|
-
*/
|
|
82
|
-
export class FlexFieldNodeSchema extends TreeNodeSchemaBase {
|
|
83
|
-
static create(builder, name, specification) {
|
|
84
|
-
return new FlexFieldNodeSchema(builder, name, specification);
|
|
85
|
-
}
|
|
86
|
-
constructor(builder, name, info) {
|
|
87
|
-
const objectNodeFields = new Map([[EmptyKey, info.stored]]);
|
|
88
|
-
super(builder, name, info, new ObjectNodeStoredSchema(objectNodeFields));
|
|
89
|
-
}
|
|
90
|
-
getFieldSchema(field) {
|
|
91
|
-
return (field ?? EmptyKey) === EmptyKey
|
|
92
|
-
? this.info
|
|
93
|
-
: FlexFieldSchema.empty;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
74
|
function normalizeStructFields(fields) {
|
|
97
75
|
const out = {};
|
|
98
76
|
// eslint-disable-next-line no-restricted-syntax
|
|
@@ -113,12 +91,10 @@ function normalizeField(t) {
|
|
|
113
91
|
}
|
|
114
92
|
/**
|
|
115
93
|
* Allow any node (as long as it meets the schema for its own type).
|
|
116
|
-
* @internal
|
|
117
94
|
*/
|
|
118
95
|
export const Any = "Any";
|
|
119
96
|
/**
|
|
120
97
|
* Checks if an {@link FlexAllowedTypes} is {@link (Any:type)}.
|
|
121
|
-
* @internal
|
|
122
98
|
*/
|
|
123
99
|
export function allowedTypesIsAny(t) {
|
|
124
100
|
return t.length === 1 && t[0] === Any;
|
|
@@ -136,7 +112,6 @@ export function allowedTypesIsAny(t) {
|
|
|
136
112
|
* @typeParam TTypes - The types allowed by the field.
|
|
137
113
|
*
|
|
138
114
|
* @sealed
|
|
139
|
-
* @internal
|
|
140
115
|
*/
|
|
141
116
|
export class FlexFieldSchema {
|
|
142
117
|
/**
|
|
@@ -248,7 +223,6 @@ export class FlexFieldSchema {
|
|
|
248
223
|
FlexFieldSchema.empty = FlexFieldSchema.create(FieldKinds.forbidden, []);
|
|
249
224
|
/**
|
|
250
225
|
* Convert {@link FlexAllowedTypes} to {@link TreeTypeSet}.
|
|
251
|
-
* @internal
|
|
252
226
|
*/
|
|
253
227
|
export function allowedTypesSchemaSet(t) {
|
|
254
228
|
if (allowedTypesIsAny(t)) {
|
|
@@ -264,7 +238,6 @@ export function allowedTypesSchemaSet(t) {
|
|
|
264
238
|
}
|
|
265
239
|
/**
|
|
266
240
|
* Convert {@link FlexAllowedTypes} to {@link TreeTypeSet}.
|
|
267
|
-
* @internal
|
|
268
241
|
*/
|
|
269
242
|
export function allowedTypesToTypeSet(t) {
|
|
270
243
|
const list = allowedTypesSchemaSet(t);
|
|
@@ -297,28 +270,18 @@ export function intoStoredSchemaCollection(treeSchema) {
|
|
|
297
270
|
// These schema type narrowing functions are preferred over `instanceof` due to being easier to migrate to class based schema.
|
|
298
271
|
/**
|
|
299
272
|
* Checks if a {@link FlexTreeNodeSchema} is a {@link FlexMapNodeSchema}.
|
|
300
|
-
* @internal
|
|
301
273
|
*/
|
|
302
274
|
export function schemaIsMap(schema) {
|
|
303
275
|
return schema instanceof FlexMapNodeSchema;
|
|
304
276
|
}
|
|
305
277
|
/**
|
|
306
278
|
* Checks if a {@link FlexTreeNodeSchema} is a {@link LeafNodeSchema}.
|
|
307
|
-
* @internal
|
|
308
279
|
*/
|
|
309
280
|
export function schemaIsLeaf(schema) {
|
|
310
281
|
return schema instanceof LeafNodeSchema;
|
|
311
282
|
}
|
|
312
|
-
/**
|
|
313
|
-
* Checks if a {@link FlexTreeNodeSchema} is a {@link FlexFieldNodeSchema}.
|
|
314
|
-
* @internal
|
|
315
|
-
*/
|
|
316
|
-
export function schemaIsFieldNode(schema) {
|
|
317
|
-
return schema instanceof FlexFieldNodeSchema;
|
|
318
|
-
}
|
|
319
283
|
/**
|
|
320
284
|
* Checks if a {@link FlexTreeNodeSchema} is a {@link FlexObjectNodeSchema}.
|
|
321
|
-
* @internal
|
|
322
285
|
*/
|
|
323
286
|
export function schemaIsObjectNode(schema) {
|
|
324
287
|
return schema instanceof FlexObjectNodeSchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typedTreeSchema.js","sourceRoot":"","sources":["../../../src/feature-libraries/typed-schema/typedTreeSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAEnE,OAAO,EAEN,QAAQ,EAER,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EAQtB,6BAA6B,GAC7B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAIN,WAAW,EACX,WAAW,EACX,UAAU,EAEV,cAAc,GACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAIxD,OAAO,EAAoB,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AA0BpE,CAAC;AAED,CAAC;AAED;;;;;GAKG;AACH,MAAM,OAAgB,kBAAkB;IAKvC,YACiB,OAAsB,EACtB,IAAoC,EACpC,IAAmB,EACnB,MAA4B;QAH5B,YAAO,GAAP,OAAO,CAAe;QACtB,SAAI,GAAJ,IAAI,CAAgC;QACpC,SAAI,GAAJ,IAAI,CAAe;QACnB,WAAM,GAAN,MAAM,CAAsB;IAC1C,CAAC;CAEJ;AAED;;GAEG;AACH,MAAM,OAAO,iBAGX,SAAQ,kBAAuC;IAChD,IAAW,SAAS;QACnB,OAAO,IAAI,CAAC,IAA0B,CAAC;IACxC,CAAC;IAGM,MAAM,CAAC,MAAM,CAInB,OAAsB,EACtB,IAAoC,EACpC,aAA4B;QAE5B,OAAO,IAAI,iBAAiB,CAC3B,OAAO,EACP,IAAI,EACJ,aAAa,EACb,IAAI,mBAAmB,CAAC,aAAa,CAAC,MAAM,CAAC,CAC7C,CAAC;IACH,CAAC;IAEe,cAAc,CAAC,KAAe;QAC7C,OAAO,IAAI,CAAC,IAA0B,CAAC;IACxC,CAAC;CACD;AAED;;GAEG;AACH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oft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, Lazy } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype Adapters,\n\tEmptyKey,\n\ttype FieldKey,\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\ttype StoredSchemaCollection,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\ttype TreeTypeSet,\n\ttype ValueSchema,\n\tidentifierFieldKindIdentifier,\n} from \"../../core/index.js\";\nimport {\n\ttype Assume,\n\ttype MakeNominal,\n\ttype Named,\n\tcompareSets,\n\tmapIterable,\n\toneFromSet,\n\ttype requireAssignableTo,\n\tfilterIterable,\n} from \"../../util/index.js\";\nimport { FieldKinds } from \"../default-schema/index.js\";\nimport type { FlexFieldKind, FullSchemaPolicy } from \"../modular-schema/index.js\";\n\nimport type { LazyItem } from \"./flexList.js\";\nimport { type ObjectToMap, objectToMapTyped } from \"./typeUtils.js\";\n\n/**\n * @internal\n */\nexport interface FlexObjectNodeFields {\n\treadonly [key: string]: FlexFieldSchema;\n}\n\n/**\n * @internal\n */\nexport type NormalizeObjectNodeFields<T extends FlexObjectNodeFields> = {\n\treadonly [Property in keyof T]: NormalizeField<T[Property]>;\n};\n\n/**\n * A placeholder to use in {@link https://www.typescriptlang.org/docs/handbook/2/generics.html#generic-constraints | extends constraints} when using the real type breaks compilation of some recursive types due to {@link https://github.com/microsoft/TypeScript/issues/55758 | a design limitation of TypeScript}.\n *\n * These extends constraints only serve as documentation:\n * to avoid breaking compilation, this type has to not actually enforce anything, and thus is just `unknown`.\n * Therefore the type safety is the responsibility of the user of the API.\n * @public\n */\nexport type Unenforced<_DesiredExtendsConstraint> = unknown;\n\n{\n\ttype _check = requireAssignableTo<FlexTreeNodeSchema, Unenforced<FlexTreeNodeSchema>>;\n}\n\n/**\n * T must extend TreeSchemaSpecification.\n * This can not be enforced using TypeScript since doing so breaks recursive type support.\n * See note on SchemaBuilder.fieldRecursive.\n * @internal\n */\nexport abstract class TreeNodeSchemaBase<\n\tconst out Name extends string = string,\n\tconst out Specification = unknown,\n> {\n\tprotected _typeCheck?: MakeNominal;\n\tprotected constructor(\n\t\tpublic readonly builder: Named<string>,\n\t\tpublic readonly name: TreeNodeSchemaIdentifier<Name>,\n\t\tpublic readonly info: Specification,\n\t\tpublic readonly stored: TreeNodeStoredSchema,\n\t) {}\n\tpublic abstract getFieldSchema(field: FieldKey): FlexFieldSchema;\n}\n\n/**\n * @internal\n */\nexport class FlexMapNodeSchema<\n\tconst out Name extends string = string,\n\tconst out Specification extends Unenforced<FlexMapFieldSchema> = FlexMapFieldSchema,\n> extends TreeNodeSchemaBase<Name, Specification> {\n\tpublic get mapFields(): FlexMapFieldSchema {\n\t\treturn this.info as FlexMapFieldSchema;\n\t}\n\n\tprotected _typeCheck2?: MakeNominal;\n\tpublic static create<\n\t\tconst Name extends string,\n\t\tconst Specification extends FlexMapFieldSchema,\n\t>(\n\t\tbuilder: Named<string>,\n\t\tname: TreeNodeSchemaIdentifier<Name>,\n\t\tspecification: Specification,\n\t): FlexMapNodeSchema<Name, Specification> {\n\t\treturn new FlexMapNodeSchema(\n\t\t\tbuilder,\n\t\t\tname,\n\t\t\tspecification,\n\t\t\tnew MapNodeStoredSchema(specification.stored),\n\t\t);\n\t}\n\n\tpublic override getFieldSchema(field: FieldKey): FlexMapFieldSchema {\n\t\treturn this.info as FlexMapFieldSchema;\n\t}\n}\n\n/**\n * @internal\n */\nexport class LeafNodeSchema<\n\tconst out Name extends string = string,\n\tconst out Specification extends Unenforced<ValueSchema> = ValueSchema,\n> extends TreeNodeSchemaBase<Name, Specification> {\n\tpublic get leafValue(): ValueSchema {\n\t\treturn this.info as ValueSchema;\n\t}\n\n\tprotected _typeCheck2?: MakeNominal;\n\tpublic static create<const Name extends string, const Specification extends ValueSchema>(\n\t\tbuilder: Named<string>,\n\t\tname: TreeNodeSchemaIdentifier<Name>,\n\t\tspecification: Specification,\n\t): LeafNodeSchema<Name, Specification> {\n\t\treturn new LeafNodeSchema(\n\t\t\tbuilder,\n\t\t\tname,\n\t\t\tspecification,\n\t\t\tnew LeafNodeStoredSchema(specification),\n\t\t);\n\t}\n\n\tpublic override getFieldSchema(field: FieldKey): FlexFieldSchema {\n\t\treturn FlexFieldSchema.empty;\n\t}\n}\n\n/**\n * @internal\n */\nexport class FlexObjectNodeSchema<\n\tconst out Name extends string = string,\n\tconst out Specification extends Unenforced<FlexObjectNodeFields> = FlexObjectNodeFields,\n> extends TreeNodeSchemaBase<Name, Specification> {\n\tprotected _typeCheck2?: MakeNominal;\n\tpublic readonly identifierFieldKeys: readonly FieldKey[] = [];\n\n\tpublic static create<\n\t\tconst Name extends string,\n\t\tconst Specification extends FlexObjectNodeFields,\n\t>(\n\t\tbuilder: Named<string>,\n\t\tname: TreeNodeSchemaIdentifier<Name>,\n\t\tspecification: Specification,\n\t): FlexObjectNodeSchema<Name, Specification> {\n\t\tconst objectNodeFieldsObject: NormalizeObjectNodeFields<Specification> =\n\t\t\tnormalizeStructFields<Specification>(specification);\n\t\tconst objectNodeFields: ObjectToMap<\n\t\t\tNormalizeObjectNodeFields<Specification>,\n\t\t\tFieldKey,\n\t\t\tFlexFieldSchema\n\t\t> = objectToMapTyped(objectNodeFieldsObject);\n\t\treturn new FlexObjectNodeSchema(\n\t\t\tbuilder,\n\t\t\tname,\n\t\t\tspecification,\n\t\t\tobjectNodeFieldsObject,\n\t\t\tobjectNodeFields,\n\t\t);\n\t}\n\n\tprivate constructor(\n\t\tbuilder: Named<string>,\n\t\tname: TreeNodeSchemaIdentifier<Name>,\n\t\tinfo: Specification,\n\t\tpublic readonly objectNodeFieldsObject: NormalizeObjectNodeFields<\n\t\t\tAssume<Specification, FlexObjectNodeFields>\n\t\t>,\n\t\t// Allows reading fields through the normal map.\n\t\t// Stricter typing caused Specification to no longer be covariant, so has been removed.\n\t\tpublic readonly objectNodeFields: ReadonlyMap<FieldKey, FlexFieldSchema>,\n\t) {\n\t\tconst fields = mapIterable(objectNodeFields, ([k, v]) => [k, v.stored] as const);\n\t\tsuper(builder, name, info, new ObjectNodeStoredSchema(new Map(fields)));\n\t\tthis.identifierFieldKeys = Array.from(\n\t\t\tfilterIterable(\n\t\t\t\tobjectNodeFields.entries(),\n\t\t\t\t([k, f]) => f.kind.identifier === identifierFieldKindIdentifier,\n\t\t\t),\n\t\t\t([k]) => k,\n\t\t);\n\t}\n\n\tpublic override getFieldSchema(field: FieldKey): FlexFieldSchema {\n\t\treturn this.objectNodeFields.get(field) ?? FlexFieldSchema.empty;\n\t}\n}\n\n/**\n * TODO: remove or replace (or subclass) this with more specific types, like \"List\".\n * @internal\n */\nexport class FlexFieldNodeSchema<\n\tName extends string = string,\n\tSpecification extends Unenforced<FlexFieldSchema> = FlexFieldSchema,\n> extends TreeNodeSchemaBase<Name, Specification> {\n\tprotected _typeCheck2?: MakeNominal;\n\tpublic static create<const Name extends string, const Specification extends FlexFieldSchema>(\n\t\tbuilder: Named<string>,\n\t\tname: TreeNodeSchemaIdentifier<Name>,\n\t\tspecification: Specification,\n\t): FlexFieldNodeSchema<Name, Specification> {\n\t\treturn new FlexFieldNodeSchema(builder, name, specification);\n\t}\n\n\tprivate constructor(\n\t\tbuilder: Named<string>,\n\t\tname: TreeNodeSchemaIdentifier<Name>,\n\t\tinfo: Specification,\n\t) {\n\t\tconst objectNodeFields = new Map([[EmptyKey, (info as FlexFieldSchema).stored]]);\n\t\tsuper(builder, name, info, new ObjectNodeStoredSchema(objectNodeFields));\n\t}\n\n\tpublic override getFieldSchema(field?: FieldKey): FlexFieldSchema {\n\t\treturn (field ?? EmptyKey) === EmptyKey\n\t\t\t? (this.info as FlexFieldSchema)\n\t\t\t: FlexFieldSchema.empty;\n\t}\n}\n\n/**\n * @internal\n * @privateRemarks\n * This could be an exhaustive union, or just the common base type.\n * Using just the base type prevents exhaustive matching, which has both pros and cons.\n *\n * For now this is using just the base type since the union is causing issues with schema aware typing, likely due to it being a union and thus distributing over extends clauses.\n */\nexport type FlexTreeNodeSchema = TreeNodeSchemaBase;\n\n/**\n * Convert FieldSchemaSpecification | undefined into TreeFieldSchema.\n * @internal\n */\nexport type NormalizeField<T extends FlexFieldSchema | undefined> = T extends FlexFieldSchema\n\t? T\n\t: FlexFieldSchema<typeof FieldKinds.forbidden, []>;\n\nfunction normalizeStructFields<T extends FlexObjectNodeFields>(\n\tfields: T,\n): NormalizeObjectNodeFields<T> {\n\tconst out: Record<string, FlexFieldSchema> = {};\n\t// eslint-disable-next-line no-restricted-syntax\n\tfor (const key in fields) {\n\t\tif (Object.prototype.hasOwnProperty.call(fields, key)) {\n\t\t\tconst element = fields[key];\n\t\t\tout[key] = normalizeField(element);\n\t\t}\n\t}\n\treturn out as NormalizeObjectNodeFields<T>;\n}\n\nfunction normalizeField<T extends FlexFieldSchema | undefined>(t: T): NormalizeField<T> {\n\tif (t === undefined) {\n\t\treturn FlexFieldSchema.empty as unknown as NormalizeField<T>;\n\t}\n\n\tassert(t instanceof FlexFieldSchema, 0x6ae /* invalid TreeFieldSchema */);\n\treturn t as NormalizeField<T>;\n}\n\n/**\n * Allow any node (as long as it meets the schema for its own type).\n * @internal\n */\nexport const Any = \"Any\" as const;\n/**\n * Allow any node (as long as it meets the schema for its own type).\n * @internal\n */\nexport type Any = typeof Any;\n\n/**\n * Tree type, but can be wrapped in a function to allow referring to types before they are declared.\n * This makes recursive and co-recursive types possible.\n * @internal\n */\nexport type LazyTreeNodeSchema = FlexTreeNodeSchema | (() => FlexTreeNodeSchema);\n\n/**\n * Types for use in fields.\n *\n * \"Any\" is boxed in an array to allow use as variadic parameter.\n * @internal\n */\nexport type FlexAllowedTypes = readonly [Any] | readonly LazyItem<FlexTreeNodeSchema>[];\n\n/**\n * Checks if an {@link FlexAllowedTypes} is {@link (Any:type)}.\n * @internal\n */\nexport function allowedTypesIsAny(t: FlexAllowedTypes): t is readonly [Any] {\n\treturn t.length === 1 && t[0] === Any;\n}\n\n/**\n * Subset of TreeFieldSchema thats legal in maps.\n * This requires empty to be a valid value for the map.\n * @internal\n */\nexport type FlexMapFieldSchema = FlexFieldSchema<\n\ttypeof FieldKinds.optional | typeof FieldKinds.sequence\n>;\n\n/**\n * All policy for a specific field,\n * including functionality that does not have to be kept consistent across versions or deterministic.\n *\n * This can include policy for how to use this schema for \"view\" purposes, and well as how to expose editing APIs.\n *\n * @remarks\n * `Types` here must extend `AllowedTypes`, but this cannot be enforced with an \"extends\" clause: see {@link Unenforced} for details.\n *\n * @typeParam TKind - The kind of field.\n * @typeParam TTypes - The types allowed by the field.\n *\n * @sealed\n * @internal\n */\nexport class FlexFieldSchema<\n\tout TKind extends FlexFieldKind = FlexFieldKind,\n\tconst out TTypes extends Unenforced<FlexAllowedTypes> = FlexAllowedTypes,\n> {\n\t/**\n\t * Schema for a field which must always be empty.\n\t */\n\tpublic static readonly empty = FlexFieldSchema.create(FieldKinds.forbidden, []);\n\n\t/**\n\t * Constructs a TreeFieldSchema.\n\t * @privateRemarks\n\t * Alias for the constructor, but with extends clause for the `Types` parameter that {@link FlexFieldSchema} can not have (due to recursive type issues).\n\t */\n\tpublic static create<TKind extends FlexFieldKind, const Types extends FlexAllowedTypes>(\n\t\tkind: TKind,\n\t\tallowedTypes: Types,\n\t): FlexFieldSchema<TKind, Types> {\n\t\treturn new FlexFieldSchema(kind, allowedTypes);\n\t}\n\n\t/**\n\t * Constructs a TreeFieldSchema, but missing the extends clause which breaks most recursive types.\n\t * @remarks\n\t * `Types` here must extend `AllowedTypes`, but this cannot be enforced with an \"extends\" clause: see {@link Unenforced} for details.\n\t * Prefer {@link FlexFieldSchema.create} when possible.\n\t */\n\tpublic static createUnsafe<\n\t\tTKind extends FlexFieldKind,\n\t\tconst Types extends Unenforced<FlexAllowedTypes>,\n\t>(kind: TKind, allowedTypes: Types): FlexFieldSchema<TKind, Types> {\n\t\treturn new FlexFieldSchema(kind, allowedTypes);\n\t}\n\n\tprotected _typeCheck?: MakeNominal;\n\n\t/**\n\t * This is computed lazily since types can be recursive, which makes evaluating this have to happen after all the schema are defined.\n\t */\n\tprivate readonly lazyTypes: Lazy<{\n\t\tnames: TreeTypeSet;\n\t\tschema: AllowedTypeSet;\n\t\tmonomorphicChildType?: FlexTreeNodeSchema;\n\t}>;\n\n\t/**\n\t * @param kind - The {@link https://en.wikipedia.org/wiki/Kind_(type_theory) | kind} of this field.\n\t * Determine the multiplicity, viewing and editing APIs as well as the merge resolution policy.\n\t * @param allowedTypes - What types of tree nodes are allowed in this field.\n\t */\n\tprivate constructor(\n\t\tpublic readonly kind: TKind,\n\t\tpublic readonly allowedTypes: TTypes,\n\t) {\n\t\t// Since this class can't have the desired extends clause, do some extra runtime validation:\n\t\tassert(Array.isArray(allowedTypes), 0x7bc /* Invalid allowedTypes */);\n\t\tfor (const allowedType of allowedTypes) {\n\t\t\tif (allowedType === Any) {\n\t\t\t\tassert(allowedTypes.length === 1, 0x7bd /* Invalid Any in allowedTypes */);\n\t\t\t} else if (typeof allowedType !== \"function\") {\n\t\t\t\tassert(\n\t\t\t\t\tallowedType instanceof TreeNodeSchemaBase,\n\t\t\t\t\t0x7be /* Invalid entry in allowedTypes */,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tconst lazy = new Lazy(() => {\n\t\t\tconst input = this.allowedTypes as unknown as FlexAllowedTypes;\n\t\t\tconst schema = allowedTypesSchemaSet(input);\n\t\t\treturn {\n\t\t\t\tnames: allowedTypesToTypeSet(input),\n\t\t\t\tschema,\n\t\t\t\tmonomorphicChildType: schema !== Any ? oneFromSet(schema) : undefined,\n\t\t\t};\n\t\t});\n\n\t\tthis.lazyTypes = lazy;\n\n\t\tthis.stored = {\n\t\t\tkind: this.kind.identifier,\n\t\t\tget types() {\n\t\t\t\treturn lazy.value.names;\n\t\t\t},\n\t\t};\n\t}\n\n\tpublic readonly stored: TreeFieldStoredSchema;\n\n\t/**\n\t * Types which are allowed in this field (by {@link TreeNodeSchemaIdentifier}), in a format optimized for stored schema.\n\t * This is the same set of types in {@link FlexFieldSchema.allowedTypes}, just in a different format.\n\t */\n\tpublic get types(): TreeTypeSet {\n\t\treturn this.lazyTypes.value.names;\n\t}\n\n\t/**\n\t * Types which are allowed in this field.\n\t * This is the same set of types in {@link FlexFieldSchema.allowedTypes}, just as a set with laziness removed.\n\t * @privateRemarks\n\t * TODO:\n\t * 3 ways to access the allowed types are now exposed.\n\t * Reducing this and/or renaming the more friendly options to take the shorter name (`types`)\n\t * would be a good idea.\n\t */\n\tpublic get allowedTypeSet(): AllowedTypeSet {\n\t\treturn this.lazyTypes.value.schema;\n\t}\n\n\t/**\n\t * If exactly one type of child is allowed in this field, it is provided here.\n\t * @remarks\n\t * Some code paths (like unboxing and compressed tree encoding) special case schema with exactly one allowed type.\n\t * This field allows for simple and optimized handling of this case.\n\t */\n\tpublic get monomorphicChildType(): FlexTreeNodeSchema | undefined {\n\t\treturn this.lazyTypes.value.monomorphicChildType;\n\t}\n\n\t/**\n\t * Compare this schema to another.\n\t *\n\t * @returns true iff the schema are identical.\n\t */\n\tpublic equals(other: FlexFieldSchema): boolean {\n\t\tif (other.kind !== this.kind) {\n\t\t\treturn false;\n\t\t}\n\t\tif (other.types === undefined) {\n\t\t\treturn this.types === undefined;\n\t\t}\n\t\tif (this.types === undefined) {\n\t\t\treturn false;\n\t\t}\n\t\treturn compareSets({\n\t\t\ta: this.types,\n\t\t\tb: other.types,\n\t\t\taExtra: () => false,\n\t\t\tbExtra: () => false,\n\t\t});\n\t}\n}\n\n/**\n * Types for use in fields.\n * This representation is optimized for runtime use in view-schema.\n *\n * @remarks\n * See {@link TreeTypeSet} for a stored-schema compatible version using the {@link TreeNodeSchemaIdentifier}.\n * See {@link FlexAllowedTypes} for a compile time optimized version.\n * @internal\n */\nexport type AllowedTypeSet = Any | ReadonlySet<FlexTreeNodeSchema>;\n\n/**\n * Convert {@link FlexAllowedTypes} to {@link TreeTypeSet}.\n * @internal\n */\nexport function allowedTypesSchemaSet(t: FlexAllowedTypes): AllowedTypeSet {\n\tif (allowedTypesIsAny(t)) {\n\t\treturn Any;\n\t}\n\tconst list: FlexTreeNodeSchema[] = t.map((value: LazyItem<FlexTreeNodeSchema>) => {\n\t\tif (typeof value === \"function\") {\n\t\t\treturn value();\n\t\t}\n\t\treturn value;\n\t});\n\treturn new Set(list);\n}\n\n/**\n * Convert {@link FlexAllowedTypes} to {@link TreeTypeSet}.\n * @internal\n */\nexport function allowedTypesToTypeSet(t: FlexAllowedTypes): TreeTypeSet {\n\tconst list = allowedTypesSchemaSet(t);\n\tif (list === Any) {\n\t\treturn undefined;\n\t}\n\tconst names = Array.from(list, (type) => {\n\t\tassert(type instanceof TreeNodeSchemaBase, 0x7bf /* invalid allowed type */);\n\t\treturn type.name;\n\t});\n\treturn new Set(names);\n}\n\n/**\n * Schema data that can be be used to view a document.\n * Strongly typed over its rootFieldSchema.\n *\n * @remarks\n * The type of the rootFieldSchema is used to implement SchemaAware APIs.\n * Cases that do not require being compile time schema aware can omit the explicit type for it.\n *\n * @internal\n */\nexport interface FlexTreeSchema<out T extends FlexFieldSchema = FlexFieldSchema>\n\textends SchemaCollection {\n\t/**\n\t * Schema for the root field which contains the whole tree.\n\t */\n\treadonly rootFieldSchema: T;\n\t/**\n\t * Extra configuration for how this schema is handled at runtime.\n\t */\n\treadonly policy: FullSchemaPolicy;\n\t/**\n\t * Compatibility information how how to interact with content who's stored schema is not directly compatible with this schema.\n\t */\n\treadonly adapters: Adapters;\n}\n\n/**\n * Converts a {@link FlexTreeSchema} into a {@link TreeStoredSchema}.\n */\nexport function intoStoredSchema(treeSchema: FlexTreeSchema): TreeStoredSchema {\n\treturn {\n\t\trootFieldSchema: treeSchema.rootFieldSchema.stored,\n\t\t...intoStoredSchemaCollection(treeSchema),\n\t};\n}\n\n/**\n * Converts a {@link SchemaCollection} into a {@link StoredSchemaCollection}.\n */\nexport function intoStoredSchemaCollection(\n\ttreeSchema: SchemaCollection,\n): StoredSchemaCollection {\n\treturn {\n\t\tnodeSchema: new Map(\n\t\t\tmapIterable(treeSchema.nodeSchema.entries(), ([k, v]) => [k, v.stored]),\n\t\t),\n\t};\n}\n\n/**\n * Schema data that can be be used to view a document.\n * @internal\n *\n * @privateRemarks\n * It is convenient that this can be used as a StoredSchemaCollection with no conversion.\n * There there isn't a design requirement for this however, so this extends clause can be removed later if needed.\n */\nexport interface SchemaCollection {\n\t/**\n\t * {@inheritdoc SchemaCollection}\n\t */\n\treadonly nodeSchema: ReadonlyMap<TreeNodeSchemaIdentifier, FlexTreeNodeSchema>;\n}\n\n// These schema type narrowing functions are preferred over `instanceof` due to being easier to migrate to class based schema.\n\n/**\n * Checks if a {@link FlexTreeNodeSchema} is a {@link FlexMapNodeSchema}.\n * @internal\n */\nexport function schemaIsMap(schema: FlexTreeNodeSchema): schema is FlexMapNodeSchema {\n\treturn schema instanceof FlexMapNodeSchema;\n}\n\n/**\n * Checks if a {@link FlexTreeNodeSchema} is a {@link LeafNodeSchema}.\n * @internal\n */\nexport function schemaIsLeaf(schema: FlexTreeNodeSchema): schema is LeafNodeSchema {\n\treturn schema instanceof LeafNodeSchema;\n}\n\n/**\n * Checks if a {@link FlexTreeNodeSchema} is a {@link FlexFieldNodeSchema}.\n * @internal\n */\nexport function schemaIsFieldNode(schema: FlexTreeNodeSchema): schema is FlexFieldNodeSchema {\n\treturn schema instanceof FlexFieldNodeSchema;\n}\n\n/**\n * Checks if a {@link FlexTreeNodeSchema} is a {@link FlexObjectNodeSchema}.\n * @internal\n */\nexport function schemaIsObjectNode(\n\tschema: FlexTreeNodeSchema,\n): schema is FlexObjectNodeSchema {\n\treturn schema instanceof FlexObjectNodeSchema;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"typedTreeSchema.js","sourceRoot":"","sources":["../../../src/feature-libraries/typed-schema/typedTreeSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAA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,YAAY,CAAC,MAA0B;IACtD,OAAO,MAAM,YAAY,cAAc,CAAC;AACzC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CACjC,MAA0B;IAE1B,OAAO,MAAM,YAAY,oBAAoB,CAAC;AAC/C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, Lazy } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype Adapters,\n\ttype FieldKey,\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\ttype StoredSchemaCollection,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\ttype TreeTypeSet,\n\ttype ValueSchema,\n\tidentifierFieldKindIdentifier,\n} from \"../../core/index.js\";\nimport {\n\ttype Assume,\n\ttype MakeNominal,\n\ttype Named,\n\tcompareSets,\n\tmapIterable,\n\toneFromSet,\n\ttype requireAssignableTo,\n\tfilterIterable,\n} from \"../../util/index.js\";\nimport { FieldKinds } from \"../default-schema/index.js\";\nimport type { FlexFieldKind, FullSchemaPolicy } from \"../modular-schema/index.js\";\n\nimport type { LazyItem } from \"./flexList.js\";\nimport { type ObjectToMap, objectToMapTyped } from \"./typeUtils.js\";\n\n/**\n */\nexport interface FlexObjectNodeFields {\n\treadonly [key: string]: FlexFieldSchema;\n}\n\n/**\n */\nexport type NormalizeObjectNodeFields<T extends FlexObjectNodeFields> = {\n\treadonly [Property in keyof T]: NormalizeField<T[Property]>;\n};\n\n/**\n * A placeholder to use in {@link https://www.typescriptlang.org/docs/handbook/2/generics.html#generic-constraints | extends constraints} when using the real type breaks compilation of some recursive types due to {@link https://github.com/microsoft/TypeScript/issues/55758 | a design limitation of TypeScript}.\n *\n * These extends constraints only serve as documentation:\n * to avoid breaking compilation, this type has to not actually enforce anything, and thus is just `unknown`.\n * Therefore the type safety is the responsibility of the user of the API.\n * @public\n */\nexport type Unenforced<_DesiredExtendsConstraint> = unknown;\n\n{\n\ttype _check = requireAssignableTo<FlexTreeNodeSchema, Unenforced<FlexTreeNodeSchema>>;\n}\n\n/**\n * T must extend TreeSchemaSpecification.\n * This can not be enforced using TypeScript since doing so breaks recursive type support.\n * See note on SchemaBuilder.fieldRecursive.\n */\nexport abstract class TreeNodeSchemaBase<\n\tconst out Name extends string = string,\n\tconst out Specification = unknown,\n> {\n\tprotected _typeCheck!: MakeNominal;\n\tprotected constructor(\n\t\tpublic readonly builder: Named<string>,\n\t\tpublic readonly name: TreeNodeSchemaIdentifier<Name>,\n\t\tpublic readonly info: Specification,\n\t\tpublic readonly stored: TreeNodeStoredSchema,\n\t) {}\n\tpublic abstract getFieldSchema(field: FieldKey): FlexFieldSchema;\n}\n\n/**\n */\nexport class FlexMapNodeSchema<\n\tconst out Name extends string = string,\n\tconst out Specification extends Unenforced<FlexMapFieldSchema> = FlexMapFieldSchema,\n> extends TreeNodeSchemaBase<Name, Specification> {\n\tpublic get mapFields(): FlexMapFieldSchema {\n\t\treturn this.info as FlexMapFieldSchema;\n\t}\n\n\tprotected _typeCheck2?: MakeNominal;\n\tpublic static create<\n\t\tconst Name extends string,\n\t\tconst Specification extends FlexMapFieldSchema,\n\t>(\n\t\tbuilder: Named<string>,\n\t\tname: TreeNodeSchemaIdentifier<Name>,\n\t\tspecification: Specification,\n\t): FlexMapNodeSchema<Name, Specification> {\n\t\treturn new FlexMapNodeSchema(\n\t\t\tbuilder,\n\t\t\tname,\n\t\t\tspecification,\n\t\t\tnew MapNodeStoredSchema(specification.stored),\n\t\t);\n\t}\n\n\tpublic override getFieldSchema(field: FieldKey): FlexMapFieldSchema {\n\t\treturn this.info as FlexMapFieldSchema;\n\t}\n}\n\n/**\n */\nexport class LeafNodeSchema<\n\tconst out Name extends string = string,\n\tconst out Specification extends Unenforced<ValueSchema> = ValueSchema,\n> extends TreeNodeSchemaBase<Name, Specification> {\n\tpublic get leafValue(): ValueSchema {\n\t\treturn this.info as ValueSchema;\n\t}\n\n\tprotected _typeCheck2?: MakeNominal;\n\tpublic static create<const Name extends string, const Specification extends ValueSchema>(\n\t\tbuilder: Named<string>,\n\t\tname: TreeNodeSchemaIdentifier<Name>,\n\t\tspecification: Specification,\n\t): LeafNodeSchema<Name, Specification> {\n\t\treturn new LeafNodeSchema(\n\t\t\tbuilder,\n\t\t\tname,\n\t\t\tspecification,\n\t\t\tnew LeafNodeStoredSchema(specification),\n\t\t);\n\t}\n\n\tpublic override getFieldSchema(field: FieldKey): FlexFieldSchema {\n\t\treturn FlexFieldSchema.empty;\n\t}\n}\n\n/**\n */\nexport class FlexObjectNodeSchema<\n\tconst out Name extends string = string,\n\tconst out Specification extends Unenforced<FlexObjectNodeFields> = FlexObjectNodeFields,\n> extends TreeNodeSchemaBase<Name, Specification> {\n\tprotected _typeCheck2?: MakeNominal;\n\tpublic readonly identifierFieldKeys: readonly FieldKey[] = [];\n\n\tpublic static create<\n\t\tconst Name extends string,\n\t\tconst Specification extends FlexObjectNodeFields,\n\t>(\n\t\tbuilder: Named<string>,\n\t\tname: TreeNodeSchemaIdentifier<Name>,\n\t\tspecification: Specification,\n\t): FlexObjectNodeSchema<Name, Specification> {\n\t\tconst objectNodeFieldsObject: NormalizeObjectNodeFields<Specification> =\n\t\t\tnormalizeStructFields<Specification>(specification);\n\t\tconst objectNodeFields: ObjectToMap<\n\t\t\tNormalizeObjectNodeFields<Specification>,\n\t\t\tFieldKey,\n\t\t\tFlexFieldSchema\n\t\t> = objectToMapTyped(objectNodeFieldsObject);\n\t\treturn new FlexObjectNodeSchema(\n\t\t\tbuilder,\n\t\t\tname,\n\t\t\tspecification,\n\t\t\tobjectNodeFieldsObject,\n\t\t\tobjectNodeFields,\n\t\t);\n\t}\n\n\tprivate constructor(\n\t\tbuilder: Named<string>,\n\t\tname: TreeNodeSchemaIdentifier<Name>,\n\t\tinfo: Specification,\n\t\tpublic readonly objectNodeFieldsObject: NormalizeObjectNodeFields<\n\t\t\tAssume<Specification, FlexObjectNodeFields>\n\t\t>,\n\t\t// Allows reading fields through the normal map.\n\t\t// Stricter typing caused Specification to no longer be covariant, so has been removed.\n\t\tpublic readonly objectNodeFields: ReadonlyMap<FieldKey, FlexFieldSchema>,\n\t) {\n\t\tconst fields = mapIterable(objectNodeFields, ([k, v]) => [k, v.stored] as const);\n\t\tsuper(builder, name, info, new ObjectNodeStoredSchema(new Map(fields)));\n\t\tthis.identifierFieldKeys = Array.from(\n\t\t\tfilterIterable(\n\t\t\t\tobjectNodeFields.entries(),\n\t\t\t\t([k, f]) => f.kind.identifier === identifierFieldKindIdentifier,\n\t\t\t),\n\t\t\t([k]) => k,\n\t\t);\n\t}\n\n\tpublic override getFieldSchema(field: FieldKey): FlexFieldSchema {\n\t\treturn this.objectNodeFields.get(field) ?? FlexFieldSchema.empty;\n\t}\n}\n\n/**\n * @privateRemarks\n * This could be an exhaustive union, or just the common base type.\n * Using just the base type prevents exhaustive matching, which has both pros and cons.\n *\n * For now this is using just the base type since the union is causing issues with schema aware typing, likely due to it being a union and thus distributing over extends clauses.\n */\nexport type FlexTreeNodeSchema = TreeNodeSchemaBase;\n\n/**\n * Convert FieldSchemaSpecification | undefined into TreeFieldSchema.\n */\nexport type NormalizeField<T extends FlexFieldSchema | undefined> = T extends FlexFieldSchema\n\t? T\n\t: FlexFieldSchema<typeof FieldKinds.forbidden, []>;\n\nfunction normalizeStructFields<T extends FlexObjectNodeFields>(\n\tfields: T,\n): NormalizeObjectNodeFields<T> {\n\tconst out: Record<string, FlexFieldSchema> = {};\n\t// eslint-disable-next-line no-restricted-syntax\n\tfor (const key in fields) {\n\t\tif (Object.prototype.hasOwnProperty.call(fields, key)) {\n\t\t\tconst element = fields[key];\n\t\t\tout[key] = normalizeField(element);\n\t\t}\n\t}\n\treturn out as NormalizeObjectNodeFields<T>;\n}\n\nfunction normalizeField<T extends FlexFieldSchema | undefined>(t: T): NormalizeField<T> {\n\tif (t === undefined) {\n\t\treturn FlexFieldSchema.empty as unknown as NormalizeField<T>;\n\t}\n\n\tassert(t instanceof FlexFieldSchema, 0x6ae /* invalid TreeFieldSchema */);\n\treturn t as NormalizeField<T>;\n}\n\n/**\n * Allow any node (as long as it meets the schema for its own type).\n */\nexport const Any = \"Any\" as const;\n/**\n * Allow any node (as long as it meets the schema for its own type).\n */\nexport type Any = typeof Any;\n\n/**\n * Tree type, but can be wrapped in a function to allow referring to types before they are declared.\n * This makes recursive and co-recursive types possible.\n */\nexport type LazyTreeNodeSchema = FlexTreeNodeSchema | (() => FlexTreeNodeSchema);\n\n/**\n * Types for use in fields.\n *\n * \"Any\" is boxed in an array to allow use as variadic parameter.\n */\nexport type FlexAllowedTypes = readonly [Any] | readonly LazyItem<FlexTreeNodeSchema>[];\n\n/**\n * Checks if an {@link FlexAllowedTypes} is {@link (Any:type)}.\n */\nexport function allowedTypesIsAny(t: FlexAllowedTypes): t is readonly [Any] {\n\treturn t.length === 1 && t[0] === Any;\n}\n\n/**\n * Subset of TreeFieldSchema thats legal in maps.\n * This requires empty to be a valid value for the map.\n */\nexport type FlexMapFieldSchema = FlexFieldSchema<\n\ttypeof FieldKinds.optional | typeof FieldKinds.sequence\n>;\n\n/**\n * All policy for a specific field,\n * including functionality that does not have to be kept consistent across versions or deterministic.\n *\n * This can include policy for how to use this schema for \"view\" purposes, and well as how to expose editing APIs.\n *\n * @remarks\n * `Types` here must extend `AllowedTypes`, but this cannot be enforced with an \"extends\" clause: see {@link Unenforced} for details.\n *\n * @typeParam TKind - The kind of field.\n * @typeParam TTypes - The types allowed by the field.\n *\n * @sealed\n */\nexport class FlexFieldSchema<\n\tout TKind extends FlexFieldKind = FlexFieldKind,\n\tconst out TTypes extends Unenforced<FlexAllowedTypes> = FlexAllowedTypes,\n> {\n\t/**\n\t * Schema for a field which must always be empty.\n\t */\n\tpublic static readonly empty = FlexFieldSchema.create(FieldKinds.forbidden, []);\n\n\t/**\n\t * Constructs a TreeFieldSchema.\n\t * @privateRemarks\n\t * Alias for the constructor, but with extends clause for the `Types` parameter that {@link FlexFieldSchema} can not have (due to recursive type issues).\n\t */\n\tpublic static create<TKind extends FlexFieldKind, const Types extends FlexAllowedTypes>(\n\t\tkind: TKind,\n\t\tallowedTypes: Types,\n\t): FlexFieldSchema<TKind, Types> {\n\t\treturn new FlexFieldSchema(kind, allowedTypes);\n\t}\n\n\t/**\n\t * Constructs a TreeFieldSchema, but missing the extends clause which breaks most recursive types.\n\t * @remarks\n\t * `Types` here must extend `AllowedTypes`, but this cannot be enforced with an \"extends\" clause: see {@link Unenforced} for details.\n\t * Prefer {@link FlexFieldSchema.create} when possible.\n\t */\n\tpublic static createUnsafe<\n\t\tTKind extends FlexFieldKind,\n\t\tconst Types extends Unenforced<FlexAllowedTypes>,\n\t>(kind: TKind, allowedTypes: Types): FlexFieldSchema<TKind, Types> {\n\t\treturn new FlexFieldSchema(kind, allowedTypes);\n\t}\n\n\tprotected _typeCheck!: MakeNominal;\n\n\t/**\n\t * This is computed lazily since types can be recursive, which makes evaluating this have to happen after all the schema are defined.\n\t */\n\tprivate readonly lazyTypes: Lazy<{\n\t\tnames: TreeTypeSet;\n\t\tschema: AllowedTypeSet;\n\t\tmonomorphicChildType?: FlexTreeNodeSchema;\n\t}>;\n\n\t/**\n\t * @param kind - The {@link https://en.wikipedia.org/wiki/Kind_(type_theory) | kind} of this field.\n\t * Determine the multiplicity, viewing and editing APIs as well as the merge resolution policy.\n\t * @param allowedTypes - What types of tree nodes are allowed in this field.\n\t */\n\tprivate constructor(\n\t\tpublic readonly kind: TKind,\n\t\tpublic readonly allowedTypes: TTypes,\n\t) {\n\t\t// Since this class can't have the desired extends clause, do some extra runtime validation:\n\t\tassert(Array.isArray(allowedTypes), 0x7bc /* Invalid allowedTypes */);\n\t\tfor (const allowedType of allowedTypes) {\n\t\t\tif (allowedType === Any) {\n\t\t\t\tassert(allowedTypes.length === 1, 0x7bd /* Invalid Any in allowedTypes */);\n\t\t\t} else if (typeof allowedType !== \"function\") {\n\t\t\t\tassert(\n\t\t\t\t\tallowedType instanceof TreeNodeSchemaBase,\n\t\t\t\t\t0x7be /* Invalid entry in allowedTypes */,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tconst lazy = new Lazy(() => {\n\t\t\tconst input = this.allowedTypes as unknown as FlexAllowedTypes;\n\t\t\tconst schema = allowedTypesSchemaSet(input);\n\t\t\treturn {\n\t\t\t\tnames: allowedTypesToTypeSet(input),\n\t\t\t\tschema,\n\t\t\t\tmonomorphicChildType: schema !== Any ? oneFromSet(schema) : undefined,\n\t\t\t};\n\t\t});\n\n\t\tthis.lazyTypes = lazy;\n\n\t\tthis.stored = {\n\t\t\tkind: this.kind.identifier,\n\t\t\tget types() {\n\t\t\t\treturn lazy.value.names;\n\t\t\t},\n\t\t};\n\t}\n\n\tpublic readonly stored: TreeFieldStoredSchema;\n\n\t/**\n\t * Types which are allowed in this field (by {@link TreeNodeSchemaIdentifier}), in a format optimized for stored schema.\n\t * This is the same set of types in {@link FlexFieldSchema.allowedTypes}, just in a different format.\n\t */\n\tpublic get types(): TreeTypeSet {\n\t\treturn this.lazyTypes.value.names;\n\t}\n\n\t/**\n\t * Types which are allowed in this field.\n\t * This is the same set of types in {@link FlexFieldSchema.allowedTypes}, just as a set with laziness removed.\n\t * @privateRemarks\n\t * TODO:\n\t * 3 ways to access the allowed types are now exposed.\n\t * Reducing this and/or renaming the more friendly options to take the shorter name (`types`)\n\t * would be a good idea.\n\t */\n\tpublic get allowedTypeSet(): AllowedTypeSet {\n\t\treturn this.lazyTypes.value.schema;\n\t}\n\n\t/**\n\t * If exactly one type of child is allowed in this field, it is provided here.\n\t * @remarks\n\t * Some code paths (like unboxing and compressed tree encoding) special case schema with exactly one allowed type.\n\t * This field allows for simple and optimized handling of this case.\n\t */\n\tpublic get monomorphicChildType(): FlexTreeNodeSchema | undefined {\n\t\treturn this.lazyTypes.value.monomorphicChildType;\n\t}\n\n\t/**\n\t * Compare this schema to another.\n\t *\n\t * @returns true iff the schema are identical.\n\t */\n\tpublic equals(other: FlexFieldSchema): boolean {\n\t\tif (other.kind !== this.kind) {\n\t\t\treturn false;\n\t\t}\n\t\tif (other.types === undefined) {\n\t\t\treturn this.types === undefined;\n\t\t}\n\t\tif (this.types === undefined) {\n\t\t\treturn false;\n\t\t}\n\t\treturn compareSets({\n\t\t\ta: this.types,\n\t\t\tb: other.types,\n\t\t\taExtra: () => false,\n\t\t\tbExtra: () => false,\n\t\t});\n\t}\n}\n\n/**\n * Types for use in fields.\n * This representation is optimized for runtime use in view-schema.\n *\n * @remarks\n * See {@link TreeTypeSet} for a stored-schema compatible version using the {@link TreeNodeSchemaIdentifier}.\n * See {@link FlexAllowedTypes} for a compile time optimized version.\n */\nexport type AllowedTypeSet = Any | ReadonlySet<FlexTreeNodeSchema>;\n\n/**\n * Convert {@link FlexAllowedTypes} to {@link TreeTypeSet}.\n */\nexport function allowedTypesSchemaSet(t: FlexAllowedTypes): AllowedTypeSet {\n\tif (allowedTypesIsAny(t)) {\n\t\treturn Any;\n\t}\n\tconst list: FlexTreeNodeSchema[] = t.map((value: LazyItem<FlexTreeNodeSchema>) => {\n\t\tif (typeof value === \"function\") {\n\t\t\treturn value();\n\t\t}\n\t\treturn value;\n\t});\n\treturn new Set(list);\n}\n\n/**\n * Convert {@link FlexAllowedTypes} to {@link TreeTypeSet}.\n */\nexport function allowedTypesToTypeSet(t: FlexAllowedTypes): TreeTypeSet {\n\tconst list = allowedTypesSchemaSet(t);\n\tif (list === Any) {\n\t\treturn undefined;\n\t}\n\tconst names = Array.from(list, (type) => {\n\t\tassert(type instanceof TreeNodeSchemaBase, 0x7bf /* invalid allowed type */);\n\t\treturn type.name;\n\t});\n\treturn new Set(names);\n}\n\n/**\n * Schema data that can be be used to view a document.\n * Strongly typed over its rootFieldSchema.\n *\n * @remarks\n * The type of the rootFieldSchema is used to implement SchemaAware APIs.\n * Cases that do not require being compile time schema aware can omit the explicit type for it.\n */\nexport interface FlexTreeSchema<out T extends FlexFieldSchema = FlexFieldSchema>\n\textends SchemaCollection {\n\t/**\n\t * Schema for the root field which contains the whole tree.\n\t */\n\treadonly rootFieldSchema: T;\n\t/**\n\t * Extra configuration for how this schema is handled at runtime.\n\t */\n\treadonly policy: FullSchemaPolicy;\n\t/**\n\t * Compatibility information how how to interact with content who's stored schema is not directly compatible with this schema.\n\t */\n\treadonly adapters: Adapters;\n}\n\n/**\n * Converts a {@link FlexTreeSchema} into a {@link TreeStoredSchema}.\n */\nexport function intoStoredSchema(treeSchema: FlexTreeSchema): TreeStoredSchema {\n\treturn {\n\t\trootFieldSchema: treeSchema.rootFieldSchema.stored,\n\t\t...intoStoredSchemaCollection(treeSchema),\n\t};\n}\n\n/**\n * Converts a {@link SchemaCollection} into a {@link StoredSchemaCollection}.\n */\nexport function intoStoredSchemaCollection(\n\ttreeSchema: SchemaCollection,\n): StoredSchemaCollection {\n\treturn {\n\t\tnodeSchema: new Map(\n\t\t\tmapIterable(treeSchema.nodeSchema.entries(), ([k, v]) => [k, v.stored]),\n\t\t),\n\t};\n}\n\n/**\n * Schema data that can be be used to view a document.\n *\n * @privateRemarks\n * It is convenient that this can be used as a StoredSchemaCollection with no conversion.\n * There there isn't a design requirement for this however, so this extends clause can be removed later if needed.\n */\nexport interface SchemaCollection {\n\t/**\n\t * {@inheritdoc SchemaCollection}\n\t */\n\treadonly nodeSchema: ReadonlyMap<TreeNodeSchemaIdentifier, FlexTreeNodeSchema>;\n}\n\n// These schema type narrowing functions are preferred over `instanceof` due to being easier to migrate to class based schema.\n\n/**\n * Checks if a {@link FlexTreeNodeSchema} is a {@link FlexMapNodeSchema}.\n */\nexport function schemaIsMap(schema: FlexTreeNodeSchema): schema is FlexMapNodeSchema {\n\treturn schema instanceof FlexMapNodeSchema;\n}\n\n/**\n * Checks if a {@link FlexTreeNodeSchema} is a {@link LeafNodeSchema}.\n */\nexport function schemaIsLeaf(schema: FlexTreeNodeSchema): schema is LeafNodeSchema {\n\treturn schema instanceof LeafNodeSchema;\n}\n\n/**\n * Checks if a {@link FlexTreeNodeSchema} is a {@link FlexObjectNodeSchema}.\n */\nexport function schemaIsObjectNode(\n\tschema: FlexTreeNodeSchema,\n): schema is FlexObjectNodeSchema {\n\treturn schema instanceof FlexObjectNodeSchema;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/typed-schema/view.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,iBAAiB,EACjB,KAAK,QAAQ,EACb,aAAa,EAIb,KAAK,gBAAgB,EACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,KAAK,EAAQ,MAAM,qBAAqB,CAAC;AACvD,OAAO,EACN,KAAK,gBAAgB,EAGrB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACN,KAAK,eAAe,EACpB,KAAK,cAAc,EAEnB,MAAM,sBAAsB,CAAC;AAE9B;;GAEG;AACH,qBAAa,UAAU,CAAC,GAAG,CAAC,OAAO,SAAS,eAAe,GAAG,eAAe;aAM3D,MAAM,EAAE,gBAAgB;aACxB,QAAQ,EAAE,QAAQ;aAClB,MAAM,EAAE,cAAc,CAAC,OAAO,CAAC;IAPhD;;OAEG;IACH,SAAgB,YAAY,EAAE,gBAAgB,CAAC;gBAE9B,MAAM,EAAE,gBAAgB,EACxB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,cAAc,CAAC,OAAO,CAAC;IAKhD;;;;;;;;;OASG;IACI,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,GAAG;QACpD,IAAI,EAAE,aAAa,CAAC;QACpB,KAAK,EAAE,aAAa,CAAC;QACrB,gCAAgC,EAAE,aAAa,CAAC;KAChD;IA6CD;;;;OAIG;IACI,SAAS,CAAC,MAAM,EAAE,gBAAgB,GAAG,iBAAiB;IAgC7D;;OAEG;IACH,OAAO,CAAC,UAAU;IAelB,OAAO,CAAC,SAAS;CAIjB;AAED
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/typed-schema/view.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,iBAAiB,EACjB,KAAK,QAAQ,EACb,aAAa,EAIb,KAAK,gBAAgB,EACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,KAAK,EAAQ,MAAM,qBAAqB,CAAC;AACvD,OAAO,EACN,KAAK,gBAAgB,EAGrB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACN,KAAK,eAAe,EACpB,KAAK,cAAc,EAEnB,MAAM,sBAAsB,CAAC;AAE9B;;GAEG;AACH,qBAAa,UAAU,CAAC,GAAG,CAAC,OAAO,SAAS,eAAe,GAAG,eAAe;aAM3D,MAAM,EAAE,gBAAgB;aACxB,QAAQ,EAAE,QAAQ;aAClB,MAAM,EAAE,cAAc,CAAC,OAAO,CAAC;IAPhD;;OAEG;IACH,SAAgB,YAAY,EAAE,gBAAgB,CAAC;gBAE9B,MAAM,EAAE,gBAAgB,EACxB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,cAAc,CAAC,OAAO,CAAC;IAKhD;;;;;;;;;OASG;IACI,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,GAAG;QACpD,IAAI,EAAE,aAAa,CAAC;QACpB,KAAK,EAAE,aAAa,CAAC;QACrB,gCAAgC,EAAE,aAAa,CAAC;KAChD;IA6CD;;;;OAIG;IACI,SAAS,CAAC,MAAM,EAAE,gBAAgB,GAAG,iBAAiB;IAgC7D;;OAEG;IACH,OAAO,CAAC,UAAU;IAelB,OAAO,CAAC,SAAS;CAIjB;AAED;;GAEG;AACH,MAAM,WAAW,OAAO;IACvB,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAChC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.js","sourceRoot":"","sources":["../../../src/feature-libraries/typ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,CAAC;QAED,iEAAiE;QACjE,OAAO,IAAI,iBAAiB,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;IAED;;OAEG;IACK,UAAU,CAAC,QAA+B;QACjD,IAAI,QAAQ,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YAClC,MAAM,KAAK,GAAkC,IAAI,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YACrE,KAAK,MAAM,WAAW,IAAI,IAAI,CAAC,QAAQ,EAAE,IAAI,IAAI,EAAE,EAAE,CAAC;gBACrD,IAAI,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;oBAClC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;oBAChC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;gBAC/B,CAAC;YACF,CAAC;YAED,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;QACvC,CAAC;QACD,OAAO,QAAQ,CAAC;IACjB,CAAC;IAEO,SAAS,CAAC,QAA8B;QAC/C,sDAAsD;QACtD,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tAdaptedViewSchema,\n\ttype Adapters,\n\tCompatibility,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n} from \"../../core/index.js\";\nimport { type Named, fail } from \"../../util/index.js\";\nimport {\n\ttype FullSchemaPolicy,\n\tallowsRepoSuperset,\n\tisNeverTree,\n} from \"../modular-schema/index.js\";\n\nimport {\n\ttype FlexFieldSchema,\n\ttype FlexTreeSchema,\n\tintoStoredSchema,\n} from \"./typedTreeSchema.js\";\n\n/**\n * A collection of View information for schema, including policy.\n */\nexport class ViewSchema<out TSchema extends FlexFieldSchema = FlexFieldSchema> {\n\t/**\n\t * Cached conversion of `schema` into a stored schema.\n\t */\n\tpublic readonly storedSchema: TreeStoredSchema;\n\tpublic constructor(\n\t\tpublic readonly policy: FullSchemaPolicy,\n\t\tpublic readonly adapters: Adapters,\n\t\tpublic readonly schema: FlexTreeSchema<TSchema>,\n\t) {\n\t\tthis.storedSchema = intoStoredSchema(schema);\n\t}\n\n\t/**\n\t * Determines the compatibility of a stored document\n\t * (based on its stored schema) with a viewer (based on its view schema).\n\t *\n\t * Adapters can be provided to handle differences between the two schema.\n\t * Adapters should only use to types in the `view` SchemaRepository.\n\t *\n\t * TODO: this API violates the parse don't validate design philosophy.\n\t * It should be wrapped with (or replaced by) a parse style API.\n\t */\n\tpublic checkCompatibility(stored: TreeStoredSchema): {\n\t\tread: Compatibility;\n\t\twrite: Compatibility;\n\t\twriteAllowingStoredSchemaUpdates: Compatibility;\n\t} {\n\t\t// TODO: support adapters\n\t\t// const adapted = this.adaptRepo(stored);\n\n\t\tconst read = allowsRepoSuperset(this.policy, stored, this.storedSchema)\n\t\t\t? Compatibility.Compatible\n\t\t\t: // TODO: support adapters\n\t\t\t\t// : allowsRepoSuperset(this.policy, adapted.adaptedForViewSchema, this.storedSchema)\n\t\t\t\t// ? Compatibility.RequiresAdapters\n\t\t\t\tCompatibility.Incompatible;\n\t\t// TODO: Extract subset of adapters that are valid to use on stored\n\t\t// TODO: separate adapters from schema updates\n\t\tconst write = allowsRepoSuperset(this.policy, this.storedSchema, stored)\n\t\t\t? Compatibility.Compatible\n\t\t\t: // TODO: support adapters\n\t\t\t\t// : allowsRepoSuperset(this.policy, this.storedSchema, adapted.adaptedForViewSchema)\n\t\t\t\t// TODO: IThis assumes adapters are bidirectional.\n\t\t\t\t// Compatibility.RequiresAdapters\n\t\t\t\tCompatibility.Incompatible;\n\n\t\t// TODO: compute this properly (and maybe include the set of schema changes needed for it?).\n\t\t// Maybe updates would happen lazily when needed to store data?\n\t\t// When willingness to updates can avoid need for some adapters,\n\t\t// how should it be decided if the adapter should be used to avoid the update?\n\t\t// TODO: is this case actually bi-variant, making this correct if we did it for each schema independently?\n\t\tlet writeAllowingStoredSchemaUpdates =\n\t\t\t// TODO: This should consider just the updates needed\n\t\t\t// (ex: when view covers a subset of stored after stored has a update to that subset).\n\t\t\tallowsRepoSuperset(this.policy, stored, this.storedSchema)\n\t\t\t\t? Compatibility.Compatible\n\t\t\t\t: // TODO: this assumes adapters can translate in both directions. In general this will not be true.\n\t\t\t\t\t// TODO: this also assumes that schema updates to the adapted repo would translate to\n\t\t\t\t\t// updates on the stored schema, which is also likely untrue.\n\t\t\t\t\t// // TODO: support adapters\n\t\t\t\t\t// allowsRepoSuperset(this.policy, adapted.adaptedForViewSchema, this.storedSchema)\n\t\t\t\t\t// ? Compatibility.RequiresAdapters // Requires schema updates. TODO: consider adapters that can update writes.\n\t\t\t\t\tCompatibility.Incompatible;\n\n\t\t// Since the above does not consider partial updates,\n\t\t// we can improve the tolerance a bit by considering the op-op update:\n\t\twriteAllowingStoredSchemaUpdates = Math.max(writeAllowingStoredSchemaUpdates, write);\n\n\t\treturn { read, write, writeAllowingStoredSchemaUpdates };\n\t}\n\n\t/**\n\t * Compute a schema that `original` could be viewed as using adapters as needed.\n\t *\n\t * TODO: have a way for callers to get invalidated on schema updates.\n\t */\n\tpublic adaptRepo(stored: TreeStoredSchema): AdaptedViewSchema {\n\t\t// Sanity check on adapters:\n\t\t// it's probably a bug it they use the never types,\n\t\t// since there never is a reason to have a never type as an adapter input,\n\t\t// and its impossible for an adapter to be correctly implemented if its output type is never\n\t\t// (unless its input is also never).\n\t\tfor (const adapter of this.adapters?.tree ?? []) {\n\t\t\tif (\n\t\t\t\tisNeverTree(\n\t\t\t\t\tthis.policy,\n\t\t\t\t\tthis.storedSchema,\n\t\t\t\t\tthis.storedSchema.nodeSchema.get(adapter.output),\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tfail(\"tree adapter for stored adapter.output should not be never\");\n\t\t\t}\n\t\t}\n\n\t\tconst adapted = {\n\t\t\trootFieldSchema: this.adaptField(stored.rootFieldSchema),\n\t\t\tnodeSchema: new Map<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>(),\n\t\t};\n\n\t\tfor (const [key, schema] of stored.nodeSchema) {\n\t\t\tconst adapatedTree = this.adaptTree(schema);\n\t\t\tadapted.nodeSchema.set(key, adapatedTree);\n\t\t}\n\n\t\t// TODO: subset these adapters to the ones that were needed/used.\n\t\treturn new AdaptedViewSchema(this.adapters, adapted);\n\t}\n\n\t/**\n\t * Adapt original such that it allows member types which can be adapted to its specified types.\n\t */\n\tprivate adaptField(original: TreeFieldStoredSchema): TreeFieldStoredSchema {\n\t\tif (original.types !== undefined) {\n\t\t\tconst types: Set<TreeNodeSchemaIdentifier> = new Set(original.types);\n\t\t\tfor (const treeAdapter of this.adapters?.tree ?? []) {\n\t\t\t\tif (types.has(treeAdapter.input)) {\n\t\t\t\t\ttypes.delete(treeAdapter.input);\n\t\t\t\t\ttypes.add(treeAdapter.output);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn { kind: original.kind, types };\n\t\t}\n\t\treturn original;\n\t}\n\n\tprivate adaptTree(original: TreeNodeStoredSchema): TreeNodeStoredSchema {\n\t\t// TODO: support adapters like missing field adapters.\n\t\treturn original;\n\t}\n}\n\n/**\n * Record where a schema came from for error reporting purposes.\n
|
|
1
|
+
{"version":3,"file":"view.js","sourceRoot":"","sources":["../../../src/feature-libraries/typed-schema/view.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,iBAAiB,EAEjB,aAAa,GAKb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAc,IAAI,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAEN,kBAAkB,EAClB,WAAW,GACX,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAGN,gBAAgB,GAChB,MAAM,sBAAsB,CAAC;AAE9B;;GAEG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AM,WAAW,IAAI,IAAI,CAAC,QAAQ,EAAE,IAAI,IAAI,EAAE,EAAE,CAAC;gBACrD,IAAI,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;oBAClC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;oBAChC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;gBAC/B,CAAC;YACF,CAAC;YAED,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;QACvC,CAAC;QACD,OAAO,QAAQ,CAAC;IACjB,CAAC;IAEO,SAAS,CAAC,QAA8B;QAC/C,sDAAsD;QACtD,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tAdaptedViewSchema,\n\ttype Adapters,\n\tCompatibility,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n} from \"../../core/index.js\";\nimport { type Named, fail } from \"../../util/index.js\";\nimport {\n\ttype FullSchemaPolicy,\n\tallowsRepoSuperset,\n\tisNeverTree,\n} from \"../modular-schema/index.js\";\n\nimport {\n\ttype FlexFieldSchema,\n\ttype FlexTreeSchema,\n\tintoStoredSchema,\n} from \"./typedTreeSchema.js\";\n\n/**\n * A collection of View information for schema, including policy.\n */\nexport class ViewSchema<out TSchema extends FlexFieldSchema = FlexFieldSchema> {\n\t/**\n\t * Cached conversion of `schema` into a stored schema.\n\t */\n\tpublic readonly storedSchema: TreeStoredSchema;\n\tpublic constructor(\n\t\tpublic readonly policy: FullSchemaPolicy,\n\t\tpublic readonly adapters: Adapters,\n\t\tpublic readonly schema: FlexTreeSchema<TSchema>,\n\t) {\n\t\tthis.storedSchema = intoStoredSchema(schema);\n\t}\n\n\t/**\n\t * Determines the compatibility of a stored document\n\t * (based on its stored schema) with a viewer (based on its view schema).\n\t *\n\t * Adapters can be provided to handle differences between the two schema.\n\t * Adapters should only use to types in the `view` SchemaRepository.\n\t *\n\t * TODO: this API violates the parse don't validate design philosophy.\n\t * It should be wrapped with (or replaced by) a parse style API.\n\t */\n\tpublic checkCompatibility(stored: TreeStoredSchema): {\n\t\tread: Compatibility;\n\t\twrite: Compatibility;\n\t\twriteAllowingStoredSchemaUpdates: Compatibility;\n\t} {\n\t\t// TODO: support adapters\n\t\t// const adapted = this.adaptRepo(stored);\n\n\t\tconst read = allowsRepoSuperset(this.policy, stored, this.storedSchema)\n\t\t\t? Compatibility.Compatible\n\t\t\t: // TODO: support adapters\n\t\t\t\t// : allowsRepoSuperset(this.policy, adapted.adaptedForViewSchema, this.storedSchema)\n\t\t\t\t// ? Compatibility.RequiresAdapters\n\t\t\t\tCompatibility.Incompatible;\n\t\t// TODO: Extract subset of adapters that are valid to use on stored\n\t\t// TODO: separate adapters from schema updates\n\t\tconst write = allowsRepoSuperset(this.policy, this.storedSchema, stored)\n\t\t\t? Compatibility.Compatible\n\t\t\t: // TODO: support adapters\n\t\t\t\t// : allowsRepoSuperset(this.policy, this.storedSchema, adapted.adaptedForViewSchema)\n\t\t\t\t// TODO: IThis assumes adapters are bidirectional.\n\t\t\t\t// Compatibility.RequiresAdapters\n\t\t\t\tCompatibility.Incompatible;\n\n\t\t// TODO: compute this properly (and maybe include the set of schema changes needed for it?).\n\t\t// Maybe updates would happen lazily when needed to store data?\n\t\t// When willingness to updates can avoid need for some adapters,\n\t\t// how should it be decided if the adapter should be used to avoid the update?\n\t\t// TODO: is this case actually bi-variant, making this correct if we did it for each schema independently?\n\t\tlet writeAllowingStoredSchemaUpdates =\n\t\t\t// TODO: This should consider just the updates needed\n\t\t\t// (ex: when view covers a subset of stored after stored has a update to that subset).\n\t\t\tallowsRepoSuperset(this.policy, stored, this.storedSchema)\n\t\t\t\t? Compatibility.Compatible\n\t\t\t\t: // TODO: this assumes adapters can translate in both directions. In general this will not be true.\n\t\t\t\t\t// TODO: this also assumes that schema updates to the adapted repo would translate to\n\t\t\t\t\t// updates on the stored schema, which is also likely untrue.\n\t\t\t\t\t// // TODO: support adapters\n\t\t\t\t\t// allowsRepoSuperset(this.policy, adapted.adaptedForViewSchema, this.storedSchema)\n\t\t\t\t\t// ? Compatibility.RequiresAdapters // Requires schema updates. TODO: consider adapters that can update writes.\n\t\t\t\t\tCompatibility.Incompatible;\n\n\t\t// Since the above does not consider partial updates,\n\t\t// we can improve the tolerance a bit by considering the op-op update:\n\t\twriteAllowingStoredSchemaUpdates = Math.max(writeAllowingStoredSchemaUpdates, write);\n\n\t\treturn { read, write, writeAllowingStoredSchemaUpdates };\n\t}\n\n\t/**\n\t * Compute a schema that `original` could be viewed as using adapters as needed.\n\t *\n\t * TODO: have a way for callers to get invalidated on schema updates.\n\t */\n\tpublic adaptRepo(stored: TreeStoredSchema): AdaptedViewSchema {\n\t\t// Sanity check on adapters:\n\t\t// it's probably a bug it they use the never types,\n\t\t// since there never is a reason to have a never type as an adapter input,\n\t\t// and its impossible for an adapter to be correctly implemented if its output type is never\n\t\t// (unless its input is also never).\n\t\tfor (const adapter of this.adapters?.tree ?? []) {\n\t\t\tif (\n\t\t\t\tisNeverTree(\n\t\t\t\t\tthis.policy,\n\t\t\t\t\tthis.storedSchema,\n\t\t\t\t\tthis.storedSchema.nodeSchema.get(adapter.output),\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tfail(\"tree adapter for stored adapter.output should not be never\");\n\t\t\t}\n\t\t}\n\n\t\tconst adapted = {\n\t\t\trootFieldSchema: this.adaptField(stored.rootFieldSchema),\n\t\t\tnodeSchema: new Map<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>(),\n\t\t};\n\n\t\tfor (const [key, schema] of stored.nodeSchema) {\n\t\t\tconst adapatedTree = this.adaptTree(schema);\n\t\t\tadapted.nodeSchema.set(key, adapatedTree);\n\t\t}\n\n\t\t// TODO: subset these adapters to the ones that were needed/used.\n\t\treturn new AdaptedViewSchema(this.adapters, adapted);\n\t}\n\n\t/**\n\t * Adapt original such that it allows member types which can be adapted to its specified types.\n\t */\n\tprivate adaptField(original: TreeFieldStoredSchema): TreeFieldStoredSchema {\n\t\tif (original.types !== undefined) {\n\t\t\tconst types: Set<TreeNodeSchemaIdentifier> = new Set(original.types);\n\t\t\tfor (const treeAdapter of this.adapters?.tree ?? []) {\n\t\t\t\tif (types.has(treeAdapter.input)) {\n\t\t\t\t\ttypes.delete(treeAdapter.input);\n\t\t\t\t\ttypes.add(treeAdapter.output);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn { kind: original.kind, types };\n\t\t}\n\t\treturn original;\n\t}\n\n\tprivate adaptTree(original: TreeNodeStoredSchema): TreeNodeStoredSchema {\n\t\t// TODO: support adapters like missing field adapters.\n\t\treturn original;\n\t}\n}\n\n/**\n * Record where a schema came from for error reporting purposes.\n */\nexport interface Sourced {\n\treadonly builder: Named<string>;\n}\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -2,19 +2,17 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export { EmptyKey, type FieldKey, type
|
|
6
|
-
export { type Brand
|
|
7
|
-
export { type Listeners, type IsListener, type Listenable, type Off,
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export { type
|
|
11
|
-
export { TreeArrayNode, type Unhydrated, IterableTreeArrayContent, TreeNode, type ITree, type TreeNodeSchema, TreeViewConfiguration, type ITreeViewConfiguration, type ITreeConfigurationOptions, type TreeView, type TreeViewEvents, SchemaFactory, type ImplicitFieldSchema, type TreeFieldFromImplicitField, type TreeChangeEvents, type NodeFromSchema, type TreeMapNode, type InsertableTreeNodeFromImplicitAllowedTypes, type TreeLeafValue, FieldKind, FieldSchema, type ImplicitAllowedTypes, type InsertableTreeFieldFromImplicitField, type InsertableTypedNode, NodeKind, type TreeObjectNode, type TreeNodeFromImplicitAllowedTypes, type TreeNodeSchemaClass, type SchemaCompatibilityStatus, type FieldProps, type InternalTreeNode, type TreeNodeApi, type TreeNodeSchemaCore, type AllowedTypes, type WithType, type TreeObjectNodeUnsafe, type InsertableTreeNodeFromImplicitAllowedTypesUnsafe, type TreeArrayNodeUnsafe, type TreeMapNodeUnsafe, type InsertableObjectFromSchemaRecordUnsafe, type InsertableTreeFieldFromImplicitFieldUnsafe, type FieldSchemaUnsafe, type ValidateRecursiveSchema, adaptEnum, enumFromStrings, singletonSchema, typedObjectValues, test_RecursiveObject, test_RecursiveObject_base, test_RecursiveObjectPojoMode, } from "./simple-tree/index.js";
|
|
5
|
+
export { EmptyKey, type FieldKey, type TreeValue, type FieldMapObject, type NodeData, type GenericTreeNode, type JsonableTree, type GenericFieldsNode, type TreeNodeSchemaIdentifier, type TreeFieldStoredSchema, ValueSchema, TreeNodeStoredSchema, type FieldKindIdentifier, type TreeTypeSet, type TreeStoredSchema, type Revertible, CommitKind, RevertibleStatus, type CommitMetadata, type StoredSchemaCollection, type ErasedTreeNodeSchemaDataFormat, ObjectNodeStoredSchema, MapNodeStoredSchema, LeafNodeStoredSchema, } from "./core/index.js";
|
|
6
|
+
export { type Brand } from "./util/index.js";
|
|
7
|
+
export { type Listeners, type IsListener, type Listenable, type Off, } from "./events/index.js";
|
|
8
|
+
export { type LazyItem, TreeStatus, type Unenforced, TreeCompressionStrategy, } from "./feature-libraries/index.js";
|
|
9
|
+
export { type ISharedTree, type SharedTreeOptions, ForestType, type SharedTreeContentSnapshot, type RevertibleFactory, type SharedTreeFormatOptions, SharedTreeFormatVersion, Tree, type TransactionConstraint, type NodeInDocumentConstraint, type RunTransaction, rollback, } from "./shared-tree/index.js";
|
|
10
|
+
export { TreeArrayNode, type Unhydrated, IterableTreeArrayContent, TreeNode, type ITree, type TreeNodeSchema, TreeViewConfiguration, type ITreeViewConfiguration, type ITreeConfigurationOptions, type TreeView, type TreeViewEvents, SchemaFactory, type ImplicitFieldSchema, type TreeFieldFromImplicitField, type TreeChangeEvents, type NodeFromSchema, type TreeMapNode, type InsertableTreeNodeFromImplicitAllowedTypes, type TreeLeafValue, FieldKind, FieldSchema, type ImplicitAllowedTypes, type InsertableTreeFieldFromImplicitField, type InsertableTypedNode, NodeKind, type TreeObjectNode, type TreeNodeFromImplicitAllowedTypes, type TreeNodeSchemaClass, type SchemaCompatibilityStatus, type FieldProps, type InternalTreeNode, type WithType, type TreeNodeApi, type TreeNodeSchemaCore, type AllowedTypes, type TreeObjectNodeUnsafe, type InsertableTreeNodeFromImplicitAllowedTypesUnsafe, type TreeArrayNodeUnsafe, type TreeMapNodeUnsafe, type InsertableObjectFromSchemaRecordUnsafe, type InsertableTreeFieldFromImplicitFieldUnsafe, type FieldSchemaUnsafe, type typeSchemaSymbol, type ValidateRecursiveSchema, type FixRecursiveArraySchema, adaptEnum, enumFromStrings, singletonSchema, typedObjectValues, type EmptyObject, test_RecursiveObject, test_RecursiveObject_base, test_RecursiveObjectPojoMode, type JsonTreeSchema, type JsonSchemaId, type JsonNodeSchema, type JsonNodeSchemaBase, type JsonLeafNodeSchema, type JsonMapNodeSchema, type JsonArrayNodeSchema, type JsonObjectNodeSchema, type JsonFieldSchema, type JsonSchemaRef, type JsonRefPath, type JsonSchemaType, type JsonLeafSchemaType, getJsonSchema, } from "./simple-tree/index.js";
|
|
12
11
|
export { SharedTree, configuredSharedTree } from "./treeFactory.js";
|
|
13
12
|
export type { ICodecOptions, JsonValidator, SchemaValidationFunction } from "./codec/index.js";
|
|
14
13
|
export { noopValidator } from "./codec/index.js";
|
|
15
14
|
export { typeboxValidator } from "./external-utilities/index.js";
|
|
16
|
-
export { type
|
|
17
|
-
export { type NormalizeField, type NormalizeAllowedTypes, type FlexTreeTypedFieldInner, type FlexTreeUnboxFieldInner, type FlexTreeObjectNodeFields, type FlexTreeUnboxField, type FlexTreeUnboxNode, type FlexTreeUnboxNodeUnion, type IsArrayOfOne, type FlexibleNodeSubSequence, flexTreeMarker, FlexTreeEntityKind, type NodeKeyManager, type CollectOptions, type TypedFields, type UnbrandedName, type EmptyObject, type Required, type Optional, type Identifier, type Forbidden, type Sequence, } from "./feature-libraries/index.js";
|
|
15
|
+
export { type Covariant, BrandedType, type RestrictiveReadonlyRecord, type MakeNominal, } from "./util/index.js";
|
|
18
16
|
import * as InternalTypes from "./internalTypes.js";
|
|
19
17
|
export {
|
|
20
18
|
/**
|
|
@@ -22,4 +20,5 @@ export {
|
|
|
22
20
|
* They are used internally to implement API aspects, but are not intended for use by external consumers.
|
|
23
21
|
*/
|
|
24
22
|
InternalTypes, };
|
|
23
|
+
export type { MapNodeInsertableData } from "./simple-tree/index.js";
|
|
25
24
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,QAAQ,EACR,KAAK,QAAQ,EACb,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,QAAQ,EACR,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,WAAW,EACX,oBAAoB,EACpB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,UAAU,EACV,gBAAgB,EAChB,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,8BAA8B,EACnC,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,GACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,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