@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
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { type FieldKey, type ITreeCursorSynchronous, type MapTree, type Value } from "../core/index.js";
|
|
6
|
-
import type { TreeDataContext } from "./fieldGenerator.js";
|
|
7
|
-
import type { FlexFieldKind } from "./modular-schema/index.js";
|
|
8
|
-
import type { AllowedTypesToFlexInsertableTree, InsertableFlexField, InsertableFlexNode } from "./schema-aware/index.js";
|
|
9
|
-
import { type AllowedTypeSet, type FlexAllowedTypes, type FlexFieldSchema, type FlexTreeNodeSchema, type FlexTreeSchema } from "./typed-schema/index.js";
|
|
10
|
-
/**
|
|
11
|
-
* This library defines a tree data format that can infer its types from context.
|
|
12
|
-
* It can only be used when the schema is known.
|
|
13
|
-
* The format is optimized for ergonomics when the developer knows the schema,
|
|
14
|
-
* and needs to declare or navigate trees.
|
|
15
|
-
*
|
|
16
|
-
* The format defined here is very tolerant to optimize for flexibility of expressing trees:
|
|
17
|
-
* APIs exposing data in this format should likely further constrain what is allowed.
|
|
18
|
-
* For example guarantee which fields and nodes should be inlined, and that types will be required everywhere.
|
|
19
|
-
*
|
|
20
|
-
* This is from Flex tree one which has been deleted and should no longer be used!
|
|
21
|
-
*/
|
|
22
|
-
/**
|
|
23
|
-
* Check if NewFieldContent is made of {@link ITreeCursor}s.
|
|
24
|
-
*
|
|
25
|
-
* Useful when APIs want to take in tree data in multiple formats, including cursors.
|
|
26
|
-
*/
|
|
27
|
-
export declare function areCursors(data: NewFieldContent): data is ITreeCursorSynchronous | readonly ITreeCursorSynchronous[];
|
|
28
|
-
/**
|
|
29
|
-
* A symbol for the name of the type of a tree in contexts where string keys are already in use for fields.
|
|
30
|
-
* See {@link TreeNodeSchemaIdentifier}.
|
|
31
|
-
* @internal
|
|
32
|
-
*/
|
|
33
|
-
export declare const typeNameSymbol: unique symbol;
|
|
34
|
-
/**
|
|
35
|
-
* A symbol for the value of a tree node in contexts where string keys are already in use for fields.
|
|
36
|
-
* @internal
|
|
37
|
-
*/
|
|
38
|
-
export declare const valueSymbol: unique symbol;
|
|
39
|
-
export declare function getFieldKind(fieldSchema: FlexFieldSchema): FlexFieldKind;
|
|
40
|
-
/**
|
|
41
|
-
* @returns all allowed child types for `typeSet`.
|
|
42
|
-
*/
|
|
43
|
-
export declare function getAllowedTypes(schemaData: FlexTreeSchema, typeSet: AllowedTypeSet): ReadonlySet<FlexTreeNodeSchema>;
|
|
44
|
-
/**
|
|
45
|
-
* @returns all types, for which the data is schema-compatible.
|
|
46
|
-
*/
|
|
47
|
-
export declare function getPossibleTypes(context: FlexTreeSchema, typeSet: AllowedTypeSet, data: ContextuallyTypedNodeData): FlexTreeNodeSchema[];
|
|
48
|
-
/**
|
|
49
|
-
* A symbol used to define a {@link MarkedArrayLike} interface.
|
|
50
|
-
* @internal
|
|
51
|
-
*/
|
|
52
|
-
export declare const arrayLikeMarkerSymbol: unique symbol;
|
|
53
|
-
/**
|
|
54
|
-
* Can be used to mark a type which works like an array, but is not compatible with `Array.isArray`.
|
|
55
|
-
* @internal
|
|
56
|
-
*/
|
|
57
|
-
export interface MarkedArrayLike<TGet, TSet extends TGet = TGet> extends ArrayLikeMut<TGet, TSet> {
|
|
58
|
-
readonly [arrayLikeMarkerSymbol]: true;
|
|
59
|
-
[Symbol.iterator](): IterableIterator<TGet>;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Can be used to mark a type which works like an array, but is not compatible with `Array.isArray`.
|
|
63
|
-
* @internal
|
|
64
|
-
*/
|
|
65
|
-
export interface ReadonlyMarkedArrayLike<T> extends ArrayLike<T> {
|
|
66
|
-
readonly [arrayLikeMarkerSymbol]: true;
|
|
67
|
-
[Symbol.iterator](): IterableIterator<T>;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* `ArrayLike` numeric indexed access, but writable.
|
|
71
|
-
*
|
|
72
|
-
* @remarks
|
|
73
|
-
* Note that due to language limitations, this also allows reading as TSet.
|
|
74
|
-
* This is why `TSet extends TGet` is required.
|
|
75
|
-
*
|
|
76
|
-
* See https://github.com/microsoft/TypeScript/issues/43826.
|
|
77
|
-
* @internal
|
|
78
|
-
*/
|
|
79
|
-
export interface ArrayLikeMut<TGet, TSet extends TGet = TGet> extends ArrayLike<TGet> {
|
|
80
|
-
[n: number]: TSet;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Content of a tree which needs external schema information to interpret.
|
|
84
|
-
*
|
|
85
|
-
* This format is intended for concise authoring of tree literals when the schema is statically known.
|
|
86
|
-
*
|
|
87
|
-
* Once schema aware APIs are implemented, they can be used to provide schema specific subsets of this type.
|
|
88
|
-
* @internal
|
|
89
|
-
*/
|
|
90
|
-
export type ContextuallyTypedNodeData = ContextuallyTypedNodeDataObject | number | string | boolean | null | readonly ContextuallyTypedNodeData[] | MarkedArrayLike<ContextuallyTypedNodeData>;
|
|
91
|
-
/**
|
|
92
|
-
* Content of a field which needs external schema information to interpret.
|
|
93
|
-
*
|
|
94
|
-
* This format is intended for concise authoring of tree literals when the schema is statically known.
|
|
95
|
-
*
|
|
96
|
-
* Once schema aware APIs are implemented, they can be used to provide schema specific subsets of this type.
|
|
97
|
-
* @internal
|
|
98
|
-
*/
|
|
99
|
-
export type ContextuallyTypedFieldData = ContextuallyTypedNodeData | undefined;
|
|
100
|
-
/**
|
|
101
|
-
* Checks the type of a `ContextuallyTypedNodeData`.
|
|
102
|
-
*/
|
|
103
|
-
export declare function isArrayLike(data: ContextuallyTypedFieldData): data is readonly ContextuallyTypedNodeData[] | ReadonlyMarkedArrayLike<ContextuallyTypedNodeData>;
|
|
104
|
-
/**
|
|
105
|
-
* Checks the type of a `ContextuallyTypedNodeData`.
|
|
106
|
-
* @internal
|
|
107
|
-
*/
|
|
108
|
-
export declare function isContextuallyTypedNodeDataObject(data: ContextuallyTypedNodeData | undefined): data is ContextuallyTypedNodeDataObject;
|
|
109
|
-
/**
|
|
110
|
-
* Object case of {@link ContextuallyTypedNodeData}.
|
|
111
|
-
* @internal
|
|
112
|
-
*/
|
|
113
|
-
export interface ContextuallyTypedNodeDataObject {
|
|
114
|
-
/**
|
|
115
|
-
* Value stored on this node.
|
|
116
|
-
*/
|
|
117
|
-
readonly [valueSymbol]?: Value;
|
|
118
|
-
/**
|
|
119
|
-
* The type of the node.
|
|
120
|
-
* If this node is well-formed, it must follow this schema.
|
|
121
|
-
*/
|
|
122
|
-
readonly [typeNameSymbol]?: string;
|
|
123
|
-
/**
|
|
124
|
-
* Fields of this node, indexed by their field keys.
|
|
125
|
-
*
|
|
126
|
-
* Allow explicit undefined for compatibility with FlexTree, and type-safety on read.
|
|
127
|
-
*/
|
|
128
|
-
[key: FieldKey]: ContextuallyTypedFieldData;
|
|
129
|
-
/**
|
|
130
|
-
* Fields of this node, indexed by their field keys as strings.
|
|
131
|
-
*
|
|
132
|
-
* Allow unbranded field keys as a convenience for literals.
|
|
133
|
-
*/
|
|
134
|
-
[key: string]: ContextuallyTypedFieldData;
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Construct a tree from ContextuallyTypedNodeData.
|
|
138
|
-
*
|
|
139
|
-
* TODO: this should probably be refactored into a `try` function which either returns a Cursor or a SchemaError with a path to the error.
|
|
140
|
-
* @returns a cursor in Nodes mode for a single node containing the provided data.
|
|
141
|
-
* @internal
|
|
142
|
-
*/
|
|
143
|
-
export declare function cursorFromContextualData(context: TreeDataContext, typeSet: AllowedTypeSet, data: ContextuallyTypedNodeData): ITreeCursorSynchronous;
|
|
144
|
-
/**
|
|
145
|
-
* Strongly typed {@link cursorFromContextualData} for a TreeNodeSchema.
|
|
146
|
-
* @returns a cursor in Nodes mode for a single node containing the provided data.
|
|
147
|
-
* @internal
|
|
148
|
-
*/
|
|
149
|
-
export declare function cursorForTypedTreeData<T extends FlexTreeNodeSchema>(context: TreeDataContext, schema: T, data: InsertableFlexNode<T>): ITreeCursorSynchronous;
|
|
150
|
-
/**
|
|
151
|
-
* Strongly typed {@link cursorFromContextualData} for AllowedTypes.
|
|
152
|
-
* @returns a cursor in Nodes mode for a single node containing the provided data.
|
|
153
|
-
* @internal
|
|
154
|
-
*/
|
|
155
|
-
export declare function cursorForTypedData<T extends FlexAllowedTypes>(context: TreeDataContext, schema: T, data: AllowedTypesToFlexInsertableTree<T>): ITreeCursorSynchronous;
|
|
156
|
-
/**
|
|
157
|
-
* Construct a tree from ContextuallyTypedNodeData.
|
|
158
|
-
* Returns a cursor in Field mode.
|
|
159
|
-
*
|
|
160
|
-
* TODO: this should probably be refactored into a `try` function which either returns a Cursor or a SchemaError with a path to the error.
|
|
161
|
-
*/
|
|
162
|
-
export declare function cursorsFromContextualData(context: TreeDataContext, field: FlexFieldSchema, data: ContextuallyTypedNodeData | undefined): ITreeCursorSynchronous;
|
|
163
|
-
/**
|
|
164
|
-
* Strongly typed {@link cursorsFromContextualData} for a TreeFieldSchema
|
|
165
|
-
* @internal
|
|
166
|
-
*/
|
|
167
|
-
export declare function cursorsForTypedFieldData<T extends FlexFieldSchema>(context: TreeDataContext, schema: T, data: InsertableFlexField<T>): ITreeCursorSynchronous;
|
|
168
|
-
/**
|
|
169
|
-
* Construct a MapTree from ContextuallyTypedNodeData.
|
|
170
|
-
*
|
|
171
|
-
* TODO: this should probably be refactored into a `try` function which either returns a MapTree or a SchemaError with a path to the error.
|
|
172
|
-
* TODO: test suite.
|
|
173
|
-
*
|
|
174
|
-
* @remarks
|
|
175
|
-
* This version is only exported as a more testable entry point than `cursorFromContextualData` which keeps the use of `MapTree` as an implementation detail.
|
|
176
|
-
* This should not be reexported from the parent module.
|
|
177
|
-
*/
|
|
178
|
-
export declare function applyTypesFromContext(context: TreeDataContext, typeSet: AllowedTypeSet, data: ContextuallyTypedNodeData): MapTree;
|
|
179
|
-
/**
|
|
180
|
-
* Construct a MapTree from ContextuallyTypedNodeData.
|
|
181
|
-
*
|
|
182
|
-
* TODO: this should probably be refactored into a `try` function which either returns a MapTree or a SchemaError with a path to the error.
|
|
183
|
-
* TODO: test suite.
|
|
184
|
-
*
|
|
185
|
-
* @remarks
|
|
186
|
-
* This version is only exported as a more testable entry point than `cursorsFromContextualData` which keeps the use of `MapTree` as an implementation detail.
|
|
187
|
-
* This should not be reexported from the parent module.
|
|
188
|
-
*/
|
|
189
|
-
export declare function applyFieldTypesFromContext(context: TreeDataContext, field: FlexFieldSchema, data: ContextuallyTypedFieldData): MapTree[];
|
|
190
|
-
/**
|
|
191
|
-
* Content to use for a field.
|
|
192
|
-
*
|
|
193
|
-
* When used, this content will be deeply copied into the tree, and must comply with the schema.
|
|
194
|
-
*
|
|
195
|
-
* The content must follow the {@link Multiplicity} of the {@link FlexFieldKind}:
|
|
196
|
-
* - use a single cursor for an `optional` or `value` field;
|
|
197
|
-
* - use array of cursors for a `sequence` field;
|
|
198
|
-
*
|
|
199
|
-
* TODO: this should allow a field cursor instead of an array of cursors.
|
|
200
|
-
* TODO: Make this generic so a variant of this type that allows placeholders for detached sequences to consume.
|
|
201
|
-
* @internal
|
|
202
|
-
*/
|
|
203
|
-
export type NewFieldContent = ITreeCursorSynchronous | readonly ITreeCursorSynchronous[] | ContextuallyTypedFieldData;
|
|
204
|
-
/**
|
|
205
|
-
* Convert NewFieldContent into ITreeCursorSynchronous.
|
|
206
|
-
* The returned cursor will be in Field mode.
|
|
207
|
-
*/
|
|
208
|
-
export declare function normalizeNewFieldContent(context: TreeDataContext, schema: FlexFieldSchema, content: NewFieldContent): ITreeCursorSynchronous;
|
|
209
|
-
//# sourceMappingURL=contextuallyTyped.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contextuallyTyped.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/contextuallyTyped.ts"],"names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AAI,EAAE,0BAA0B,GAC9B,OAAO,EAAE,CAqBX;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,eAAe,GACxB,sBAAsB,GACtB,SAAS,sBAAsB,EAAE,GACjC,0BAA0B,CAAC;AAE9B;;;GAGG;AACH,wBAAgB,wBAAwB,CACvC,OAAO,EAAE,eAAe,EACxB,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,eAAe,GACtB,sBAAsB,CAmBxB"}
|
|
@@ -1,311 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { assert } from "@fluidframework/core-utils/internal";
|
|
6
|
-
import { EmptyKey, isCursor, Multiplicity, } from "../core/index.js";
|
|
7
|
-
import { fail, isReadonlyArray } from "../util/index.js";
|
|
8
|
-
// TODO:
|
|
9
|
-
// This module currently is assuming use of default-field-kinds.
|
|
10
|
-
// The field kinds should instead come from a view schema registry thats provided somewhere.
|
|
11
|
-
import { fieldKinds } from "./default-schema/index.js";
|
|
12
|
-
import { cursorForMapTreeField, cursorForMapTreeNode, mapTreeFromCursor, } from "./mapTreeCursor.js";
|
|
13
|
-
import { Any, FlexFieldNodeSchema, FlexMapNodeSchema, FlexObjectNodeSchema, LeafNodeSchema, allowedTypesSchemaSet, } from "./typed-schema/index.js";
|
|
14
|
-
import { allowsValue, isTreeValue } from "./valueUtilities.js";
|
|
15
|
-
/**
|
|
16
|
-
* This library defines a tree data format that can infer its types from context.
|
|
17
|
-
* It can only be used when the schema is known.
|
|
18
|
-
* The format is optimized for ergonomics when the developer knows the schema,
|
|
19
|
-
* and needs to declare or navigate trees.
|
|
20
|
-
*
|
|
21
|
-
* The format defined here is very tolerant to optimize for flexibility of expressing trees:
|
|
22
|
-
* APIs exposing data in this format should likely further constrain what is allowed.
|
|
23
|
-
* For example guarantee which fields and nodes should be inlined, and that types will be required everywhere.
|
|
24
|
-
*
|
|
25
|
-
* This is from Flex tree one which has been deleted and should no longer be used!
|
|
26
|
-
*/
|
|
27
|
-
/**
|
|
28
|
-
* Check if NewFieldContent is made of {@link ITreeCursor}s.
|
|
29
|
-
*
|
|
30
|
-
* Useful when APIs want to take in tree data in multiple formats, including cursors.
|
|
31
|
-
*/
|
|
32
|
-
export function areCursors(data) {
|
|
33
|
-
if (isCursor(data)) {
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
if (Array.isArray(data) && data.length >= 0 && isCursor(data[0])) {
|
|
37
|
-
return true;
|
|
38
|
-
}
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* String which identifies this code.
|
|
43
|
-
* Targeted at developers: can be used for symbol strings, or other developer targeted strings,
|
|
44
|
-
* like error messages.
|
|
45
|
-
*/
|
|
46
|
-
const scope = "contextuallyTyped";
|
|
47
|
-
/**
|
|
48
|
-
* A symbol for the name of the type of a tree in contexts where string keys are already in use for fields.
|
|
49
|
-
* See {@link TreeNodeSchemaIdentifier}.
|
|
50
|
-
* @internal
|
|
51
|
-
*/
|
|
52
|
-
export const typeNameSymbol = Symbol(`${scope}:typeName`);
|
|
53
|
-
/**
|
|
54
|
-
* A symbol for the value of a tree node in contexts where string keys are already in use for fields.
|
|
55
|
-
* @internal
|
|
56
|
-
*/
|
|
57
|
-
export const valueSymbol = Symbol(`${scope}:value`);
|
|
58
|
-
export function getFieldKind(fieldSchema) {
|
|
59
|
-
// TODO:
|
|
60
|
-
// This module currently is assuming use of defaultFieldKinds.
|
|
61
|
-
// The field kinds should instead come from a view schema registry thats provided somewhere.
|
|
62
|
-
return fieldKinds.get(fieldSchema.kind.identifier) ?? fail("missing field kind");
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* @returns all allowed child types for `typeSet`.
|
|
66
|
-
*/
|
|
67
|
-
export function getAllowedTypes(schemaData, typeSet) {
|
|
68
|
-
// TODO: Performance: avoid the `Any` case being frequent, possibly with caching in the caller of `getPossibleChildTypes`.
|
|
69
|
-
return typeSet === Any ? new Set(schemaData.nodeSchema.values()) : typeSet;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* @returns all types, for which the data is schema-compatible.
|
|
73
|
-
*/
|
|
74
|
-
export function getPossibleTypes(context, typeSet, data) {
|
|
75
|
-
// All types allowed by schema
|
|
76
|
-
const allowedTypes = getAllowedTypes(context, typeSet);
|
|
77
|
-
const possibleTypes = [];
|
|
78
|
-
for (const allowed of allowedTypes) {
|
|
79
|
-
if (shallowCompatibilityTest(allowed, data)) {
|
|
80
|
-
possibleTypes.push(allowed);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return possibleTypes;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* A symbol used to define a {@link MarkedArrayLike} interface.
|
|
87
|
-
* @internal
|
|
88
|
-
*/
|
|
89
|
-
export const arrayLikeMarkerSymbol = Symbol("flex-tree:arrayLikeMarker");
|
|
90
|
-
/**
|
|
91
|
-
* Checks the type of a `ContextuallyTypedNodeData`.
|
|
92
|
-
*/
|
|
93
|
-
export function isArrayLike(data) {
|
|
94
|
-
if (typeof data !== "object" || data === null) {
|
|
95
|
-
return false;
|
|
96
|
-
}
|
|
97
|
-
return (data[arrayLikeMarkerSymbol] ===
|
|
98
|
-
true || Array.isArray(data));
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Checks the type of a `ContextuallyTypedNodeData`.
|
|
102
|
-
* @internal
|
|
103
|
-
*/
|
|
104
|
-
export function isContextuallyTypedNodeDataObject(data) {
|
|
105
|
-
return !(isTreeValue(data) || isArrayLike(data));
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Checks if data might be schema-compatible.
|
|
109
|
-
*
|
|
110
|
-
* @returns false if `data` is incompatible with `type` based on a cheap/shallow check.
|
|
111
|
-
*
|
|
112
|
-
* Note that this may return true for cases where data is incompatible, but it must not return false in cases where the data is compatible.
|
|
113
|
-
*/
|
|
114
|
-
function shallowCompatibilityTest(schema, data) {
|
|
115
|
-
assert(!areCursors(data), 0x6b1 /* cursors cannot be used as contextually typed data. */);
|
|
116
|
-
assert(data !== undefined, 0x6b2 /* undefined cannot be used as contextually typed data. Use ContextuallyTypedFieldData. */);
|
|
117
|
-
if (schema instanceof LeafNodeSchema) {
|
|
118
|
-
// Reject objects with no value from being leaf nodes.
|
|
119
|
-
// Note that if allowing IFluidHandles without wrapping them in a leaf node object,
|
|
120
|
-
// this (or the above isPrimitiveValue) would have to change.
|
|
121
|
-
if (isTreeValue(data)) {
|
|
122
|
-
return allowsValue(schema.leafValue, data);
|
|
123
|
-
}
|
|
124
|
-
if (data[valueSymbol] === undefined) {
|
|
125
|
-
return false;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
if (isTreeValue(data)) {
|
|
129
|
-
return false;
|
|
130
|
-
}
|
|
131
|
-
if (isArrayLike(data)) {
|
|
132
|
-
if (schema instanceof FlexFieldNodeSchema) {
|
|
133
|
-
const field = schema.getFieldSchema();
|
|
134
|
-
return field.kind.multiplicity === Multiplicity.Sequence;
|
|
135
|
-
}
|
|
136
|
-
else {
|
|
137
|
-
return false;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
if (data[typeNameSymbol] !== undefined) {
|
|
141
|
-
return data[typeNameSymbol] === schema.name;
|
|
142
|
-
}
|
|
143
|
-
// For now, consider all not explicitly typed objects shallow compatible.
|
|
144
|
-
// This will require explicit differentiation in polymorphic cases rather than automatic structural differentiation.
|
|
145
|
-
return true;
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Construct a tree from ContextuallyTypedNodeData.
|
|
149
|
-
*
|
|
150
|
-
* TODO: this should probably be refactored into a `try` function which either returns a Cursor or a SchemaError with a path to the error.
|
|
151
|
-
* @returns a cursor in Nodes mode for a single node containing the provided data.
|
|
152
|
-
* @internal
|
|
153
|
-
*/
|
|
154
|
-
export function cursorFromContextualData(context, typeSet, data) {
|
|
155
|
-
const mapTree = applyTypesFromContext(context, typeSet, data);
|
|
156
|
-
return cursorForMapTreeNode(mapTree);
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Strongly typed {@link cursorFromContextualData} for a TreeNodeSchema.
|
|
160
|
-
* @returns a cursor in Nodes mode for a single node containing the provided data.
|
|
161
|
-
* @internal
|
|
162
|
-
*/
|
|
163
|
-
export function cursorForTypedTreeData(context, schema, data) {
|
|
164
|
-
return cursorFromContextualData(context, new Set([schema]), data);
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* Strongly typed {@link cursorFromContextualData} for AllowedTypes.
|
|
168
|
-
* @returns a cursor in Nodes mode for a single node containing the provided data.
|
|
169
|
-
* @internal
|
|
170
|
-
*/
|
|
171
|
-
export function cursorForTypedData(context, schema, data) {
|
|
172
|
-
return cursorFromContextualData(context, allowedTypesSchemaSet(schema), data);
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* Construct a tree from ContextuallyTypedNodeData.
|
|
176
|
-
* Returns a cursor in Field mode.
|
|
177
|
-
*
|
|
178
|
-
* TODO: this should probably be refactored into a `try` function which either returns a Cursor or a SchemaError with a path to the error.
|
|
179
|
-
*/
|
|
180
|
-
export function cursorsFromContextualData(context, field, data) {
|
|
181
|
-
const mapTrees = applyFieldTypesFromContext(context, field, data);
|
|
182
|
-
return cursorForMapTreeField(mapTrees);
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* Strongly typed {@link cursorsFromContextualData} for a TreeFieldSchema
|
|
186
|
-
* @internal
|
|
187
|
-
*/
|
|
188
|
-
export function cursorsForTypedFieldData(context, schema, data) {
|
|
189
|
-
return cursorsFromContextualData(context, schema, data);
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* Construct a MapTree from ContextuallyTypedNodeData.
|
|
193
|
-
*
|
|
194
|
-
* TODO: this should probably be refactored into a `try` function which either returns a MapTree or a SchemaError with a path to the error.
|
|
195
|
-
* TODO: test suite.
|
|
196
|
-
*
|
|
197
|
-
* @remarks
|
|
198
|
-
* This version is only exported as a more testable entry point than `cursorFromContextualData` which keeps the use of `MapTree` as an implementation detail.
|
|
199
|
-
* This should not be reexported from the parent module.
|
|
200
|
-
*/
|
|
201
|
-
export function applyTypesFromContext(context, typeSet, data) {
|
|
202
|
-
const possibleTypes = getPossibleTypes(context.schema, typeSet, data);
|
|
203
|
-
assert(possibleTypes.length !== 0, 0x4d4 /* data incompatible with all types allowed by the schema */);
|
|
204
|
-
assert(possibleTypes.length === 1, 0x4d5 /* data compatible with more than one type allowed by the schema */);
|
|
205
|
-
const schema = possibleTypes[0];
|
|
206
|
-
if (schema instanceof LeafNodeSchema) {
|
|
207
|
-
const value = isTreeValue(data)
|
|
208
|
-
? data
|
|
209
|
-
: data[valueSymbol];
|
|
210
|
-
assert(allowsValue(schema.leafValue, value), 0x4d3 /* unsupported schema for provided primitive */);
|
|
211
|
-
return { value, type: schema.name, fields: new Map() };
|
|
212
|
-
}
|
|
213
|
-
assert(!isTreeValue(data), 0x880 /* leaf value for non leaf */);
|
|
214
|
-
if (schema instanceof FlexFieldNodeSchema) {
|
|
215
|
-
if (isArrayLike(data)) {
|
|
216
|
-
const children = applyFieldTypesFromContext(context, schema.getFieldSchema(), data);
|
|
217
|
-
return {
|
|
218
|
-
value: undefined,
|
|
219
|
-
type: schema.name,
|
|
220
|
-
fields: new Map(children.length > 0 ? [[EmptyKey, children]] : []),
|
|
221
|
-
};
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
assert(!isArrayLike(data), 0x881 /* array for non field node */);
|
|
225
|
-
if (schema instanceof FlexMapNodeSchema ||
|
|
226
|
-
schema instanceof FlexObjectNodeSchema ||
|
|
227
|
-
schema instanceof FlexFieldNodeSchema) {
|
|
228
|
-
const fields = new Map();
|
|
229
|
-
for (const key of fieldKeysFromData(data)) {
|
|
230
|
-
assert(!fields.has(key), 0x6b3 /* Keys should not be duplicated */);
|
|
231
|
-
const childSchema = schema.getFieldSchema(key);
|
|
232
|
-
const children = applyFieldTypesFromContext(context, childSchema, data[key]);
|
|
233
|
-
if (children.length > 0) {
|
|
234
|
-
fields.set(key, children);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
if (schema instanceof FlexObjectNodeSchema) {
|
|
238
|
-
for (const key of schema.objectNodeFields.keys()) {
|
|
239
|
-
if (data[key] === undefined) {
|
|
240
|
-
setFieldForKey(key, context, schema, fields);
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
const value = data[valueSymbol];
|
|
245
|
-
assert(value === undefined, 0x4d7 /* provided value not permitted by the schema */);
|
|
246
|
-
return { value, type: schema.name, fields };
|
|
247
|
-
}
|
|
248
|
-
else {
|
|
249
|
-
fail("unexpected node kind");
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
function setFieldForKey(key, context, schema, fields) {
|
|
253
|
-
const requiredFieldSchema = schema.getFieldSchema(key);
|
|
254
|
-
const multiplicity = getFieldKind(requiredFieldSchema).multiplicity;
|
|
255
|
-
if (multiplicity === Multiplicity.Single && context.fieldSource !== undefined) {
|
|
256
|
-
const fieldGenerator = context.fieldSource(key, requiredFieldSchema.stored);
|
|
257
|
-
if (fieldGenerator !== undefined) {
|
|
258
|
-
const children = fieldGenerator();
|
|
259
|
-
fields.set(key, children);
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
function fieldKeysFromData(data) {
|
|
264
|
-
const keys = Reflect.ownKeys(data).filter((key) => typeof key === "string");
|
|
265
|
-
return keys;
|
|
266
|
-
}
|
|
267
|
-
/**
|
|
268
|
-
* Construct a MapTree from ContextuallyTypedNodeData.
|
|
269
|
-
*
|
|
270
|
-
* TODO: this should probably be refactored into a `try` function which either returns a MapTree or a SchemaError with a path to the error.
|
|
271
|
-
* TODO: test suite.
|
|
272
|
-
*
|
|
273
|
-
* @remarks
|
|
274
|
-
* This version is only exported as a more testable entry point than `cursorsFromContextualData` which keeps the use of `MapTree` as an implementation detail.
|
|
275
|
-
* This should not be reexported from the parent module.
|
|
276
|
-
*/
|
|
277
|
-
export function applyFieldTypesFromContext(context, field, data) {
|
|
278
|
-
const multiplicity = getFieldKind(field).multiplicity;
|
|
279
|
-
if (data === undefined) {
|
|
280
|
-
assert(multiplicity === Multiplicity.Forbidden || multiplicity === Multiplicity.Optional, 0x4d8 /* `undefined` provided for a field that does not support `undefined` */);
|
|
281
|
-
return [];
|
|
282
|
-
}
|
|
283
|
-
if (multiplicity === Multiplicity.Sequence) {
|
|
284
|
-
assert(isArrayLike(data), 0x4d9 /* expected array for a sequence field */);
|
|
285
|
-
const children = Array.from(data, (child) => applyTypesFromContext(context, field.allowedTypeSet, child));
|
|
286
|
-
return children;
|
|
287
|
-
}
|
|
288
|
-
assert(multiplicity === Multiplicity.Single || multiplicity === Multiplicity.Optional, 0x4da /* single value provided for an unsupported field */);
|
|
289
|
-
return [applyTypesFromContext(context, field.allowedTypeSet, data)];
|
|
290
|
-
}
|
|
291
|
-
/**
|
|
292
|
-
* Convert NewFieldContent into ITreeCursorSynchronous.
|
|
293
|
-
* The returned cursor will be in Field mode.
|
|
294
|
-
*/
|
|
295
|
-
export function normalizeNewFieldContent(context, schema, content) {
|
|
296
|
-
if (areCursors(content)) {
|
|
297
|
-
if (isReadonlyArray(content)) {
|
|
298
|
-
assert(getFieldKind(schema).multiplicity === Multiplicity.Sequence || content.length === 1, 0x6b8 /* non-sequence fields can not be provided content that is multiple cursors */);
|
|
299
|
-
// TODO: is there a better way to get a field cursor from an array of node cursors?
|
|
300
|
-
const mapTrees = content.map((c) => mapTreeFromCursor(c));
|
|
301
|
-
return cursorForMapTreeField(mapTrees);
|
|
302
|
-
}
|
|
303
|
-
if (content.mode === 1 /* CursorLocationType.Fields */) {
|
|
304
|
-
return content;
|
|
305
|
-
}
|
|
306
|
-
// TODO: is there a better way to get a field cursor from a node cursor?
|
|
307
|
-
return cursorForMapTreeField([mapTreeFromCursor(content)]);
|
|
308
|
-
}
|
|
309
|
-
return cursorsFromContextualData(context, schema, content);
|
|
310
|
-
}
|
|
311
|
-
//# sourceMappingURL=contextuallyTyped.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contextuallyTyped.js","sourceRoot":"","sources":["../../src/feature-libraries/contextuallyTyped.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAE7D,OAAO,EAEN,QAAQ,EAKR,QAAQ,EACR,YAAY,GACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEzD,QAAQ;AACR,gEAAgE;AAChE,4FAA4F;AAC5F,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD,OAAO,EACN,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,GACjB,MAAM,oBAAoB,CAAC;AAO5B,OAAO,EAEN,GAAG,EAEH,mBAAmB,EAEnB,iBAAiB,EACjB,oBAAoB,EAGpB,cAAc,EACd,qBAAqB,GACrB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAE/D;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH,MAAM,UAAU,UAAU,CACzB,IAAqB;IAErB,IAAI,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAClE,OAAO,IAAI,CAAC;IACb,CAAC;IAED,OAAO,KAAK,CAAC;AACd,CAAC;AAED;;;;GAIG;AACH,MAAM,KAAK,GAAG,mBAAmB,CAAC;AAElC;;;;GA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C;QACD,wEAAwE;QACxE,OAAO,qBAAqB,CAAC,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC5D,CAAC;IAED,OAAO,yBAAyB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAC5D,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tCursorLocationType,\n\tEmptyKey,\n\ttype FieldKey,\n\ttype ITreeCursorSynchronous,\n\ttype MapTree,\n\ttype Value,\n\tisCursor,\n\tMultiplicity,\n} from \"../core/index.js\";\nimport { fail, isReadonlyArray } from \"../util/index.js\";\n\n// TODO:\n// This module currently is assuming use of default-field-kinds.\n// The field kinds should instead come from a view schema registry thats provided somewhere.\nimport { fieldKinds } from \"./default-schema/index.js\";\nimport type { TreeDataContext } from \"./fieldGenerator.js\";\nimport {\n\tcursorForMapTreeField,\n\tcursorForMapTreeNode,\n\tmapTreeFromCursor,\n} from \"./mapTreeCursor.js\";\nimport type { FlexFieldKind } from \"./modular-schema/index.js\";\nimport type {\n\tAllowedTypesToFlexInsertableTree,\n\tInsertableFlexField,\n\tInsertableFlexNode,\n} from \"./schema-aware/index.js\";\nimport {\n\ttype AllowedTypeSet,\n\tAny,\n\ttype FlexAllowedTypes,\n\tFlexFieldNodeSchema,\n\ttype FlexFieldSchema,\n\tFlexMapNodeSchema,\n\tFlexObjectNodeSchema,\n\ttype FlexTreeNodeSchema,\n\ttype FlexTreeSchema,\n\tLeafNodeSchema,\n\tallowedTypesSchemaSet,\n} from \"./typed-schema/index.js\";\nimport { allowsValue, isTreeValue } from \"./valueUtilities.js\";\n\n/**\n * This library defines a tree data format that can infer its types from context.\n * It can only be used when the schema is known.\n * The format is optimized for ergonomics when the developer knows the schema,\n * and needs to declare or navigate trees.\n *\n * The format defined here is very tolerant to optimize for flexibility of expressing trees:\n * APIs exposing data in this format should likely further constrain what is allowed.\n * For example guarantee which fields and nodes should be inlined, and that types will be required everywhere.\n *\n * This is from Flex tree one which has been deleted and should no longer be used!\n */\n\n/**\n * Check if NewFieldContent is made of {@link ITreeCursor}s.\n *\n * Useful when APIs want to take in tree data in multiple formats, including cursors.\n */\nexport function areCursors(\n\tdata: NewFieldContent,\n): data is ITreeCursorSynchronous | readonly ITreeCursorSynchronous[] {\n\tif (isCursor(data)) {\n\t\treturn true;\n\t}\n\n\tif (Array.isArray(data) && data.length >= 0 && isCursor(data[0])) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * String which identifies this code.\n * Targeted at developers: can be used for symbol strings, or other developer targeted strings,\n * like error messages.\n */\nconst scope = \"contextuallyTyped\";\n\n/**\n * A symbol for the name of the type of a tree in contexts where string keys are already in use for fields.\n * See {@link TreeNodeSchemaIdentifier}.\n * @internal\n */\nexport const typeNameSymbol: unique symbol = Symbol(`${scope}:typeName`);\n\n/**\n * A symbol for the value of a tree node in contexts where string keys are already in use for fields.\n * @internal\n */\nexport const valueSymbol: unique symbol = Symbol(`${scope}:value`);\n\nexport function getFieldKind(fieldSchema: FlexFieldSchema): FlexFieldKind {\n\t// TODO:\n\t// This module currently is assuming use of defaultFieldKinds.\n\t// The field kinds should instead come from a view schema registry thats provided somewhere.\n\treturn fieldKinds.get(fieldSchema.kind.identifier) ?? fail(\"missing field kind\");\n}\n\n/**\n * @returns all allowed child types for `typeSet`.\n */\nexport function getAllowedTypes(\n\tschemaData: FlexTreeSchema,\n\ttypeSet: AllowedTypeSet,\n): ReadonlySet<FlexTreeNodeSchema> {\n\t// TODO: Performance: avoid the `Any` case being frequent, possibly with caching in the caller of `getPossibleChildTypes`.\n\treturn typeSet === Any ? new Set(schemaData.nodeSchema.values()) : typeSet;\n}\n\n/**\n * @returns all types, for which the data is schema-compatible.\n */\nexport function getPossibleTypes(\n\tcontext: FlexTreeSchema,\n\ttypeSet: AllowedTypeSet,\n\tdata: ContextuallyTypedNodeData,\n): FlexTreeNodeSchema[] {\n\t// All types allowed by schema\n\tconst allowedTypes = getAllowedTypes(context, typeSet);\n\n\tconst possibleTypes: FlexTreeNodeSchema[] = [];\n\tfor (const allowed of allowedTypes) {\n\t\tif (shallowCompatibilityTest(allowed, data)) {\n\t\t\tpossibleTypes.push(allowed);\n\t\t}\n\t}\n\treturn possibleTypes;\n}\n\n/**\n * A symbol used to define a {@link MarkedArrayLike} interface.\n * @internal\n */\nexport const arrayLikeMarkerSymbol: unique symbol = Symbol(\"flex-tree:arrayLikeMarker\");\n\n/**\n * Can be used to mark a type which works like an array, but is not compatible with `Array.isArray`.\n * @internal\n */\nexport interface MarkedArrayLike<TGet, TSet extends TGet = TGet>\n\textends ArrayLikeMut<TGet, TSet> {\n\treadonly [arrayLikeMarkerSymbol]: true;\n\t[Symbol.iterator](): IterableIterator<TGet>;\n}\n\n/**\n * Can be used to mark a type which works like an array, but is not compatible with `Array.isArray`.\n * @internal\n */\nexport interface ReadonlyMarkedArrayLike<T> extends ArrayLike<T> {\n\treadonly [arrayLikeMarkerSymbol]: true;\n\t[Symbol.iterator](): IterableIterator<T>;\n}\n\n/**\n * `ArrayLike` numeric indexed access, but writable.\n *\n * @remarks\n * Note that due to language limitations, this also allows reading as TSet.\n * This is why `TSet extends TGet` is required.\n *\n * See https://github.com/microsoft/TypeScript/issues/43826.\n * @internal\n */\nexport interface ArrayLikeMut<TGet, TSet extends TGet = TGet> extends ArrayLike<TGet> {\n\t[n: number]: TSet;\n}\n\n/**\n * Content of a tree which needs external schema information to interpret.\n *\n * This format is intended for concise authoring of tree literals when the schema is statically known.\n *\n * Once schema aware APIs are implemented, they can be used to provide schema specific subsets of this type.\n * @internal\n */\nexport type ContextuallyTypedNodeData =\n\t| ContextuallyTypedNodeDataObject\n\t| number\n\t| string\n\t| boolean\n\t// eslint-disable-next-line @rushstack/no-new-null\n\t| null\n\t| readonly ContextuallyTypedNodeData[]\n\t| MarkedArrayLike<ContextuallyTypedNodeData>;\n\n/**\n * Content of a field which needs external schema information to interpret.\n *\n * This format is intended for concise authoring of tree literals when the schema is statically known.\n *\n * Once schema aware APIs are implemented, they can be used to provide schema specific subsets of this type.\n * @internal\n */\nexport type ContextuallyTypedFieldData = ContextuallyTypedNodeData | undefined;\n\n/**\n * Checks the type of a `ContextuallyTypedNodeData`.\n */\nexport function isArrayLike(\n\tdata: ContextuallyTypedFieldData,\n): data is\n\t| readonly ContextuallyTypedNodeData[]\n\t| ReadonlyMarkedArrayLike<ContextuallyTypedNodeData> {\n\tif (typeof data !== \"object\" || data === null) {\n\t\treturn false;\n\t}\n\treturn (\n\t\t(data as Partial<MarkedArrayLike<ContextuallyTypedNodeData>>)[arrayLikeMarkerSymbol] ===\n\t\t\ttrue || Array.isArray(data)\n\t);\n}\n\n/**\n * Checks the type of a `ContextuallyTypedNodeData`.\n * @internal\n */\nexport function isContextuallyTypedNodeDataObject(\n\tdata: ContextuallyTypedNodeData | undefined,\n): data is ContextuallyTypedNodeDataObject {\n\treturn !(isTreeValue(data) || isArrayLike(data));\n}\n\n/**\n * Object case of {@link ContextuallyTypedNodeData}.\n * @internal\n */\nexport interface ContextuallyTypedNodeDataObject {\n\t/**\n\t * Value stored on this node.\n\t */\n\treadonly [valueSymbol]?: Value;\n\n\t/**\n\t * The type of the node.\n\t * If this node is well-formed, it must follow this schema.\n\t */\n\treadonly [typeNameSymbol]?: string;\n\n\t/**\n\t * Fields of this node, indexed by their field keys.\n\t *\n\t * Allow explicit undefined for compatibility with FlexTree, and type-safety on read.\n\t */\n\t// TODO: make sure explicit undefined is actually handled correctly.\n\t[key: FieldKey]: ContextuallyTypedFieldData;\n\n\t/**\n\t * Fields of this node, indexed by their field keys as strings.\n\t *\n\t * Allow unbranded field keys as a convenience for literals.\n\t */\n\t[key: string]: ContextuallyTypedFieldData;\n}\n\n/**\n * Checks if data might be schema-compatible.\n *\n * @returns false if `data` is incompatible with `type` based on a cheap/shallow check.\n *\n * Note that this may return true for cases where data is incompatible, but it must not return false in cases where the data is compatible.\n */\nfunction shallowCompatibilityTest(\n\tschema: FlexTreeNodeSchema,\n\tdata: ContextuallyTypedNodeData,\n): boolean {\n\tassert(!areCursors(data), 0x6b1 /* cursors cannot be used as contextually typed data. */);\n\tassert(\n\t\tdata !== undefined,\n\t\t0x6b2 /* undefined cannot be used as contextually typed data. Use ContextuallyTypedFieldData. */,\n\t);\n\n\tif (schema instanceof LeafNodeSchema) {\n\t\t// Reject objects with no value from being leaf nodes.\n\t\t// Note that if allowing IFluidHandles without wrapping them in a leaf node object,\n\t\t// this (or the above isPrimitiveValue) would have to change.\n\n\t\tif (isTreeValue(data)) {\n\t\t\treturn allowsValue(schema.leafValue, data);\n\t\t}\n\t\tif ((data as ContextuallyTypedNodeDataObject)[valueSymbol] === undefined) {\n\t\t\treturn false;\n\t\t}\n\t}\n\tif (isTreeValue(data)) {\n\t\treturn false;\n\t}\n\tif (isArrayLike(data)) {\n\t\tif (schema instanceof FlexFieldNodeSchema) {\n\t\t\tconst field = schema.getFieldSchema();\n\t\t\treturn field.kind.multiplicity === Multiplicity.Sequence;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\tif (data[typeNameSymbol] !== undefined) {\n\t\treturn data[typeNameSymbol] === schema.name;\n\t}\n\t// For now, consider all not explicitly typed objects shallow compatible.\n\t// This will require explicit differentiation in polymorphic cases rather than automatic structural differentiation.\n\n\treturn true;\n}\n\n/**\n * Construct a tree from ContextuallyTypedNodeData.\n *\n * TODO: this should probably be refactored into a `try` function which either returns a Cursor or a SchemaError with a path to the error.\n * @returns a cursor in Nodes mode for a single node containing the provided data.\n * @internal\n */\nexport function cursorFromContextualData(\n\tcontext: TreeDataContext,\n\ttypeSet: AllowedTypeSet,\n\tdata: ContextuallyTypedNodeData,\n): ITreeCursorSynchronous {\n\tconst mapTree = applyTypesFromContext(context, typeSet, data);\n\treturn cursorForMapTreeNode(mapTree);\n}\n\n/**\n * Strongly typed {@link cursorFromContextualData} for a TreeNodeSchema.\n * @returns a cursor in Nodes mode for a single node containing the provided data.\n * @internal\n */\nexport function cursorForTypedTreeData<T extends FlexTreeNodeSchema>(\n\tcontext: TreeDataContext,\n\tschema: T,\n\tdata: InsertableFlexNode<T>,\n): ITreeCursorSynchronous {\n\treturn cursorFromContextualData(\n\t\tcontext,\n\t\tnew Set([schema]),\n\t\tdata as ContextuallyTypedNodeData,\n\t);\n}\n\n/**\n * Strongly typed {@link cursorFromContextualData} for AllowedTypes.\n * @returns a cursor in Nodes mode for a single node containing the provided data.\n * @internal\n */\nexport function cursorForTypedData<T extends FlexAllowedTypes>(\n\tcontext: TreeDataContext,\n\tschema: T,\n\tdata: AllowedTypesToFlexInsertableTree<T>,\n): ITreeCursorSynchronous {\n\treturn cursorFromContextualData(\n\t\tcontext,\n\t\tallowedTypesSchemaSet(schema),\n\t\tdata as unknown as ContextuallyTypedNodeData,\n\t);\n}\n\n/**\n * Construct a tree from ContextuallyTypedNodeData.\n * Returns a cursor in Field mode.\n *\n * TODO: this should probably be refactored into a `try` function which either returns a Cursor or a SchemaError with a path to the error.\n */\nexport function cursorsFromContextualData(\n\tcontext: TreeDataContext,\n\tfield: FlexFieldSchema,\n\tdata: ContextuallyTypedNodeData | undefined,\n): ITreeCursorSynchronous {\n\tconst mapTrees = applyFieldTypesFromContext(context, field, data);\n\treturn cursorForMapTreeField(mapTrees);\n}\n\n/**\n * Strongly typed {@link cursorsFromContextualData} for a TreeFieldSchema\n * @internal\n */\nexport function cursorsForTypedFieldData<T extends FlexFieldSchema>(\n\tcontext: TreeDataContext,\n\tschema: T,\n\tdata: InsertableFlexField<T>,\n): ITreeCursorSynchronous {\n\treturn cursorsFromContextualData(context, schema, data as ContextuallyTypedNodeData);\n}\n\n/**\n * Construct a MapTree from ContextuallyTypedNodeData.\n *\n * TODO: this should probably be refactored into a `try` function which either returns a MapTree or a SchemaError with a path to the error.\n * TODO: test suite.\n *\n * @remarks\n * This version is only exported as a more testable entry point than `cursorFromContextualData` which keeps the use of `MapTree` as an implementation detail.\n * This should not be reexported from the parent module.\n */\nexport function applyTypesFromContext(\n\tcontext: TreeDataContext,\n\ttypeSet: AllowedTypeSet,\n\tdata: ContextuallyTypedNodeData,\n): MapTree {\n\tconst possibleTypes: FlexTreeNodeSchema[] = getPossibleTypes(context.schema, typeSet, data);\n\n\tassert(\n\t\tpossibleTypes.length !== 0,\n\t\t0x4d4 /* data incompatible with all types allowed by the schema */,\n\t);\n\tassert(\n\t\tpossibleTypes.length === 1,\n\t\t0x4d5 /* data compatible with more than one type allowed by the schema */,\n\t);\n\n\tconst schema = possibleTypes[0];\n\n\tif (schema instanceof LeafNodeSchema) {\n\t\tconst value = isTreeValue(data)\n\t\t\t? data\n\t\t\t: (data as ContextuallyTypedNodeDataObject)[valueSymbol];\n\n\t\tassert(\n\t\t\tallowsValue(schema.leafValue, value),\n\t\t\t0x4d3 /* unsupported schema for provided primitive */,\n\t\t);\n\t\treturn { value, type: schema.name, fields: new Map() };\n\t}\n\tassert(!isTreeValue(data), 0x880 /* leaf value for non leaf */);\n\tif (schema instanceof FlexFieldNodeSchema) {\n\t\tif (isArrayLike(data)) {\n\t\t\tconst children = applyFieldTypesFromContext(context, schema.getFieldSchema(), data);\n\t\t\treturn {\n\t\t\t\tvalue: undefined,\n\t\t\t\ttype: schema.name,\n\t\t\t\tfields: new Map(children.length > 0 ? [[EmptyKey, children]] : []),\n\t\t\t};\n\t\t}\n\t}\n\tassert(!isArrayLike(data), 0x881 /* array for non field node */);\n\tif (\n\t\tschema instanceof FlexMapNodeSchema ||\n\t\tschema instanceof FlexObjectNodeSchema ||\n\t\tschema instanceof FlexFieldNodeSchema\n\t) {\n\t\tconst fields: Map<FieldKey, MapTree[]> = new Map();\n\t\tfor (const key of fieldKeysFromData(data)) {\n\t\t\tassert(!fields.has(key), 0x6b3 /* Keys should not be duplicated */);\n\t\t\tconst childSchema = schema.getFieldSchema(key);\n\t\t\tconst children = applyFieldTypesFromContext(context, childSchema, data[key]);\n\n\t\t\tif (children.length > 0) {\n\t\t\t\tfields.set(key, children);\n\t\t\t}\n\t\t}\n\n\t\tif (schema instanceof FlexObjectNodeSchema) {\n\t\t\tfor (const key of schema.objectNodeFields.keys()) {\n\t\t\t\tif (data[key] === undefined) {\n\t\t\t\t\tsetFieldForKey(key, context, schema, fields);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst value = data[valueSymbol];\n\t\tassert(value === undefined, 0x4d7 /* provided value not permitted by the schema */);\n\t\treturn { value, type: schema.name, fields };\n\t} else {\n\t\tfail(\"unexpected node kind\");\n\t}\n}\n\nfunction setFieldForKey(\n\tkey: FieldKey,\n\tcontext: TreeDataContext,\n\tschema: FlexTreeNodeSchema,\n\tfields: Map<FieldKey, MapTree[]>,\n): void {\n\tconst requiredFieldSchema = schema.getFieldSchema(key);\n\tconst multiplicity = getFieldKind(requiredFieldSchema).multiplicity;\n\tif (multiplicity === Multiplicity.Single && context.fieldSource !== undefined) {\n\t\tconst fieldGenerator = context.fieldSource(key, requiredFieldSchema.stored);\n\t\tif (fieldGenerator !== undefined) {\n\t\t\tconst children = fieldGenerator();\n\t\t\tfields.set(key, children);\n\t\t}\n\t}\n}\n\nfunction fieldKeysFromData(data: ContextuallyTypedNodeDataObject): FieldKey[] {\n\tconst keys: (string | symbol)[] = Reflect.ownKeys(data).filter(\n\t\t(key) => typeof key === \"string\",\n\t);\n\treturn keys as FieldKey[];\n}\n\n/**\n * Construct a MapTree from ContextuallyTypedNodeData.\n *\n * TODO: this should probably be refactored into a `try` function which either returns a MapTree or a SchemaError with a path to the error.\n * TODO: test suite.\n *\n * @remarks\n * This version is only exported as a more testable entry point than `cursorsFromContextualData` which keeps the use of `MapTree` as an implementation detail.\n * This should not be reexported from the parent module.\n */\nexport function applyFieldTypesFromContext(\n\tcontext: TreeDataContext,\n\tfield: FlexFieldSchema,\n\tdata: ContextuallyTypedFieldData,\n): MapTree[] {\n\tconst multiplicity = getFieldKind(field).multiplicity;\n\tif (data === undefined) {\n\t\tassert(\n\t\t\tmultiplicity === Multiplicity.Forbidden || multiplicity === Multiplicity.Optional,\n\t\t\t0x4d8 /* `undefined` provided for a field that does not support `undefined` */,\n\t\t);\n\t\treturn [];\n\t}\n\tif (multiplicity === Multiplicity.Sequence) {\n\t\tassert(isArrayLike(data), 0x4d9 /* expected array for a sequence field */);\n\t\tconst children = Array.from(data, (child) =>\n\t\t\tapplyTypesFromContext(context, field.allowedTypeSet, child),\n\t\t);\n\t\treturn children;\n\t}\n\tassert(\n\t\tmultiplicity === Multiplicity.Single || multiplicity === Multiplicity.Optional,\n\t\t0x4da /* single value provided for an unsupported field */,\n\t);\n\treturn [applyTypesFromContext(context, field.allowedTypeSet, data)];\n}\n\n/**\n * Content to use for a field.\n *\n * When used, this content will be deeply copied into the tree, and must comply with the schema.\n *\n * The content must follow the {@link Multiplicity} of the {@link FlexFieldKind}:\n * - use a single cursor for an `optional` or `value` field;\n * - use array of cursors for a `sequence` field;\n *\n * TODO: this should allow a field cursor instead of an array of cursors.\n * TODO: Make this generic so a variant of this type that allows placeholders for detached sequences to consume.\n * @internal\n */\nexport type NewFieldContent =\n\t| ITreeCursorSynchronous\n\t| readonly ITreeCursorSynchronous[]\n\t| ContextuallyTypedFieldData;\n\n/**\n * Convert NewFieldContent into ITreeCursorSynchronous.\n * The returned cursor will be in Field mode.\n */\nexport function normalizeNewFieldContent(\n\tcontext: TreeDataContext,\n\tschema: FlexFieldSchema,\n\tcontent: NewFieldContent,\n): ITreeCursorSynchronous {\n\tif (areCursors(content)) {\n\t\tif (isReadonlyArray(content)) {\n\t\t\tassert(\n\t\t\t\tgetFieldKind(schema).multiplicity === Multiplicity.Sequence || content.length === 1,\n\t\t\t\t0x6b8 /* non-sequence fields can not be provided content that is multiple cursors */,\n\t\t\t);\n\t\t\t// TODO: is there a better way to get a field cursor from an array of node cursors?\n\t\t\tconst mapTrees = content.map((c) => mapTreeFromCursor(c));\n\t\t\treturn cursorForMapTreeField(mapTrees);\n\t\t}\n\t\tif (content.mode === CursorLocationType.Fields) {\n\t\t\treturn content;\n\t\t}\n\t\t// TODO: is there a better way to get a field cursor from a node cursor?\n\t\treturn cursorForMapTreeField([mapTreeFromCursor(content)]);\n\t}\n\n\treturn cursorsFromContextualData(context, schema, content);\n}\n"]}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
export type { InsertableFlexNode, InsertableFlexField, AllowedTypesToFlexInsertableTree, ApplyMultiplicity, CollectOptions, TypedFields, UnbrandedName, EmptyObject, } from "./schemaAware.js";
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-aware/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EACX,kBAAkB,EAClB,mBAAmB,EACnB,gCAAgC,EAChC,iBAAiB,EAEjB,cAAc,EACd,WAAW,EACX,aAAa,EACb,WAAW,GACX,MAAM,kBAAkB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-aware/index.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type {\n\tInsertableFlexNode,\n\tInsertableFlexField,\n\tAllowedTypesToFlexInsertableTree,\n\tApplyMultiplicity,\n\t// Internal\n\tCollectOptions,\n\tTypedFields,\n\tUnbrandedName,\n\tEmptyObject,\n} from \"./schemaAware.js\";\n"]}
|