@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flexTreeTypes.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/flexTreeTypes.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kDAO6B;AAyB7B;;;GAGG;AACU,QAAA,YAAY,GAAG,IAAA,qBAAU,GAAgB,CAAC;AAEvD;;;GAGG;AACU,QAAA,cAAc,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAEvD,SAAgB,gBAAgB,CAAC,CAAU;IAC1C,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,sBAAc,IAAI,CAAC,CAAC;AACnE,CAAC;AAFD,4CAEC;AAED,SAAgB,cAAc,CAAC,CAAU;IACxC,OAAO,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,sBAAc,CAAC,KAAK,kBAAkB,CAAC,IAAI,CAAC;AAC7E,CAAC;AAFD,wCAEC;AAED;;GAEG;AACH,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC7B,2DAAI,CAAA;IACJ,6DAAK,CAAA;AACN,CAAC,EAHW,kBAAkB,kCAAlB,kBAAkB,QAG7B;AA6CD;;;GAGG;AACH,IAAY,UAoBX;AApBD,WAAY,UAAU;IACrB;;OAEG;IACH,uDAAc,CAAA;IAEd;;OAEG;IACH,iDAAW,CAAA;IAEX;;OAEG;IACH,iDAAW,CAAA;IAEX;;OAEG;IACH,yCAAO,CAAA;AACR,CAAC,EApBW,UAAU,0BAAV,UAAU,QAoBrB;AA6aD;;;GAGG;AACU,QAAA,oCAAoC,GAAG;IACnD,YAAY;IACZ,aAAa;IACb,SAAS;IACT,IAAI;IACJ,aAAa;IACb,QAAQ;IACR,aAAa;IACb,MAAM;IACN,OAAO;IACP,eAAe;IACf,UAAU;IACV,UAAU;CACD,CAAC;AAEX;;;;;;GAMG;AACU,QAAA,2CAA2C,GAAG;IAC1D,KAAK;IACL,OAAO;IACP,OAAO;IACP,OAAO;CACE,CAAC;AAggBX,aAAa","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\ttype AnchorNode,\n\ttype FieldKey,\n\ttype FieldUpPath,\n\ttype ITreeCursorSynchronous,\n\ttype TreeValue,\n\tanchorSlot,\n} from \"../../core/index.js\";\nimport type { Assume, FlattenKeys } from \"../../util/index.js\";\nimport type { FieldKinds, SequenceFieldEditBuilder } from \"../default-schema/index.js\";\nimport type { FlexFieldKind } from \"../modular-schema/index.js\";\nimport type {\n\tAllowedTypesToFlexInsertableTree,\n\tInsertableFlexField,\n} from \"../schema-aware/index.js\";\nimport type {\n\tAny,\n\tFlexAllowedTypes,\n\tFlexFieldNodeSchema,\n\tFlexFieldSchema,\n\tFlexList,\n\tFlexListToUnion,\n\tFlexMapNodeSchema,\n\tFlexObjectNodeFields,\n\tFlexObjectNodeSchema,\n\tFlexTreeNodeSchema,\n\tLazyItem,\n\tLeafNodeSchema,\n} from \"../typed-schema/index.js\";\n\nimport type { FlexTreeContext } from \"./context.js\";\n\n/**\n * An anchor slot which records the {@link FlexTreeNode} associated with that anchor, if there is one.\n * @remarks This always points to a \"real\" {@link FlexTreeNode} (i.e. a `LazyTreeNode`), never to a \"raw\" node.\n */\nexport const flexTreeSlot = anchorSlot<FlexTreeNode>();\n\n/**\n * Indicates that an object is a flex tree.\n * @internal\n */\nexport const flexTreeMarker = Symbol(\"flexTreeMarker\");\n\nexport function isFlexTreeEntity(t: unknown): t is FlexTreeEntity {\n\treturn typeof t === \"object\" && t !== null && flexTreeMarker in t;\n}\n\nexport function isFlexTreeNode(t: unknown): t is FlexTreeNode {\n\treturn isFlexTreeEntity(t) && t[flexTreeMarker] === FlexTreeEntityKind.Node;\n}\n\n/**\n * @internal\n */\nexport enum FlexTreeEntityKind {\n\tNode,\n\tField,\n}\n\n/**\n * Part of a tree.\n * Iterates over children.\n *\n * @privateRemarks\n * This exists mainly as a place to share common members between nodes and fields.\n * It is not expected to be useful or common to write code which handles this type directly.\n * If this assumption turns out to be false, and generically processing `UntypedEntity`s is useful,\n * then this interface should probably be extended with some down casting functionality (like `is`).\n *\n * TODO:\n * Design and document iterator invalidation rules and ordering rules.\n * Providing a custom iterator type with place anchor semantics would be a good approach.\n *\n * @internal\n */\nexport interface FlexTreeEntity<out TSchema = unknown> {\n\t/**\n\t * Indicates that an object is a specific kind of flex tree FlexTreeEntity.\n\t * This makes it possible to both down cast FlexTreeEntities safely as well as validate if an object is or is not a FlexTreeEntity.\n\t */\n\treadonly [flexTreeMarker]: FlexTreeEntityKind;\n\n\t/**\n\t * Schema for this entity.\n\t * If well-formed, it must follow this schema.\n\t */\n\treadonly schema: TSchema;\n\n\t/**\n\t * A common context of a \"forest\" of FlexTrees.\n\t */\n\treadonly context: FlexTreeContext;\n\n\t/**\n\t * Iterate through all nodes/fields in this field/node.\n\t *\n\t * @remarks\n\t * No mutations to the current view of the shared tree are permitted during iteration.\n\t */\n\tboxedIterator(): IterableIterator<FlexTreeEntity>;\n}\n\n/**\n * Status of the tree that a particular node belongs to.\n * @public\n */\nexport enum TreeStatus {\n\t/**\n\t * Is parented under the root field.\n\t */\n\tInDocument = 0,\n\n\t/**\n\t * Is not parented under the root field, but can be added back to the original document tree.\n\t */\n\tRemoved = 1,\n\n\t/**\n\t * Is removed and cannot be added back to the original document tree.\n\t */\n\tDeleted = 2,\n\n\t/**\n\t * Is created but has not yet been inserted into the tree.\n\t */\n\tNew = 3,\n}\n\n/**\n * Generic tree node API.\n *\n * Nodes are (shallowly) immutable and have a logical identity, a type and either a value or fields under string keys.\n *\n * This \"logical identity\" is exposed as the object identity: if a node is moved within a document,\n * the same {@link FlexTreeNode} instance will be used in the new location.\n * Similarly, edits applied to a node's sub-tree concurrently with the move of the node will still be applied to its subtree in its new location.\n *\n *\n * @remarks\n * Down-casting (via {@link FlexTreeNode#is}) is required to access Schema-Aware APIs, including editing.\n * All content in the tree is accessible without down-casting, but if the schema is known,\n * the schema aware API may be more ergonomic.\n * All editing is actually done via {@link FlexTreeField}s: the nodes are immutable other than that they contain mutable fields.\n *\n * @internal\n */\nexport interface FlexTreeNode extends FlexTreeEntity<FlexTreeNodeSchema> {\n\treadonly [flexTreeMarker]: FlexTreeEntityKind.Node;\n\n\t/**\n\t * Value stored on this node.\n\t */\n\treadonly value?: TreeValue;\n\n\t/**\n\t * Gets a field of this node, if it is not empty.\n\t */\n\ttryGetField(key: FieldKey): undefined | FlexTreeField;\n\n\t/**\n\t * Get the field for `key`.\n\t * @param key - which entry to look up.\n\t *\n\t * @remarks\n\t * All fields implicitly exist, so `getBoxed` can be called with any key and will always return a field.\n\t * Even if the field is empty, it will still be returned, and can be edited to insert content if allowed by the field kind.\n\t * See {@link FlexTreeNode.tryGetField} for a variant that does not allocate afield in the empty case.\n\t */\n\tgetBoxed(key: FieldKey): FlexTreeField;\n\n\t/**\n\t * The field this tree is in, and the index within that field.\n\t */\n\treadonly parentField: { readonly parent: FlexTreeField; readonly index: number };\n\n\t/**\n\t * Type guard for narrowing / down-casting to a specific schema.\n\t */\n\tis<TSchema extends FlexTreeNodeSchema>(schema: TSchema): this is FlexTreeTypedNode<TSchema>;\n\n\tboxedIterator(): IterableIterator<FlexTreeField>;\n\n\t/**\n\t * The anchor node associated with this node\n\t *\n\t * @remarks\n\t * The ref count keeping this alive is owned by the FlexTreeNode:\n\t * if holding onto this anchor for longer than the FlexTreeNode might be alive,\n\t * a separate Anchor (and thus ref count) must be allocated to keep it alive.\n\t */\n\treadonly anchorNode: AnchorNode;\n}\n\n/**\n * A collaboratively editable collection of nodes within a {@link FlexTreeEntity}.\n *\n * Fields are inherently part of their parent, and thus cannot be moved.\n * Instead their content can be moved, deleted or created.\n *\n * Editing operations are only valid on trees with the {@link TreeStatus#InDocument} `TreeStatus`.\n *\n * @remarks\n * Fields are used wherever an editable collection of nodes is required.\n * This is required in two places:\n * 1. To hold the children of non-leaf {@link FlexTreeNode}s.\n * 2. As the root of a {@link FlexTreeEntity}.\n *\n * Down-casting (via {@link FlexTreeField.is}) is required to access Schema-Aware APIs, including editing.\n * All content in the tree is accessible without down-casting, but if the schema is known,\n * the schema aware API may be more ergonomic.\n *\n * @internal\n */\nexport interface FlexTreeField extends FlexTreeEntity<FlexFieldSchema> {\n\treadonly [flexTreeMarker]: FlexTreeEntityKind.Field;\n\n\t/**\n\t * The number of nodes in this field\n\t */\n\treadonly length: number;\n\n\t/**\n\t * The `FieldKey` this field is under.\n\t * Defines what part of its parent this field makes up.\n\t */\n\treadonly key: FieldKey;\n\n\t/**\n\t * The node which has this field on it under `fieldKey`.\n\t * `undefined` iff this field is a detached field.\n\t */\n\treadonly parent?: FlexTreeNode;\n\n\t/**\n\t * Type guard for narrowing / down-casting to a specific schema.\n\t */\n\tis<TSchema extends FlexFieldSchema>(schema: TSchema): this is FlexTreeTypedField<TSchema>;\n\n\tboxedIterator(): IterableIterator<FlexTreeNode>;\n\n\t/**\n\t * Gets a node of this field by its index without unboxing.\n\t * @param index - Zero-based index of the item to retrieve. Negative values are interpreted from the end of the sequence.\n\t *\n\t * @returns The element in the sequence matching the given index. Always returns undefined if index \\< -sequence.length\n\t * or index \\>= sequence.length.\n\t *\n\t * @remarks\n\t * Semantics match {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at | Array.at}.\n\t */\n\tboxedAt(index: number): FlexTreeNode | undefined;\n}\n\n// #region Node Kinds\n\n/**\n * A {@link FlexTreeNode} that behaves like a `Map<string, Field>` for a specific `Field` type.\n *\n * @remarks\n * Unlike TypeScript Map type, {@link FlexTreeMapNode.get} always provides a reference to any field looked up, even if it has never been set.\n *\n * This means that, for example, a `MapNode` of {@link FlexTreeSequenceField} fields will return an empty sequence when a previously unused key is looked up,\n * and that sequence can be used to insert new items into the field.\n * Additionally empty fields (those containing no nodes) are not distinguished from fields which do not exist.\n * This differs from JavaScript Maps which have a subtle distinction between storing undefined as a value in the map and deleting an entry from the map.\n *\n * @internal\n */\nexport interface FlexTreeMapNode<in out TSchema extends FlexMapNodeSchema>\n\textends FlexTreeNode {\n\treadonly schema: TSchema;\n\n\t/**\n\t * The number of elements in the map.\n\t *\n\t * @remarks\n\t * All fields under a map implicitly exist, but `size` will count only the fields which contain one or more nodes.\n\t */\n\treadonly size: number;\n\n\t/**\n\t * Checks whether a value exists for the given key.\n\t * @param key - Which map entry to look up.\n\t *\n\t * @remarks\n\t * All fields under a map implicitly exist, but `has` will only return true if there are one or more nodes present in the given field.\n\t */\n\thas(key: string): boolean;\n\n\t/**\n\t * Get the value associated with `key`.\n\t * @param key - which map entry to look up.\n\t */\n\tget(key: string): FlexTreeUnboxField<TSchema[\"info\"]>;\n\n\t/**\n\t * Get the field for `key`.\n\t * @param key - which map entry to look up.\n\t *\n\t * @remarks\n\t * All fields under a map implicitly exist, so `get` can be called with any key and will always return a field.\n\t * Even if the field is empty, it will still be returned, and can be edited to insert content into the map.\n\t */\n\tgetBoxed(key: string): FlexTreeTypedField<TSchema[\"info\"]>;\n\n\t/**\n\t * Returns an iterable of keys in the map.\n\t *\n\t * @remarks\n\t * All fields under a map implicitly exist, but `keys` will yield only the keys of fields which contain one or more nodes.\n\t *\n\t * No guarantees are made regarding the order of the keys returned.\n\t */\n\tkeys(): IterableIterator<FieldKey>;\n\n\t/**\n\t * Returns an iterable of values in the map.\n\t *\n\t * @remarks\n\t * All fields under a map implicitly exist, but `values` will yield only the fields containing one or more nodes.\n\t *\n\t * No guarantees are made regarding the order of the values returned.\n\t */\n\tvalues(): IterableIterator<FlexTreeUnboxField<TSchema[\"info\"], \"notEmpty\">>;\n\n\t/**\n\t * Returns an iterable of key, value pairs for every entry in the map.\n\t *\n\t * @remarks\n\t * All fields under a map implicitly exist, but `entries` will yield only the entries whose fields contain one or more nodes.\n\t *\n\t * This iteration provided by `entries()` is equivalent to that provided by direct iteration of the {@link FlexTreeMapNode} (a.k.a. `[Symbol.Iterator]()`).\n\t *\n\t * No guarantees are made regarding the order of the entries returned.\n\t */\n\tentries(): IterableIterator<[FieldKey, FlexTreeUnboxField<TSchema[\"info\"], \"notEmpty\">]>;\n\n\t/**\n\t * Executes a provided function once per each key/value pair in the map.\n\t * @param callbackFn - The function to run for each map entry\n\t * @param thisArg - If present, `callbackFn` will be bound to `thisArg`\n\t *\n\t * @privateRemarks\n\t * TODO: This should run over fields in insertion order if we want to match the javascript foreach spec.\n\t */\n\tforEach(\n\t\tcallbackFn: (\n\t\t\tvalue: FlexTreeUnboxField<TSchema[\"info\"], \"notEmpty\">,\n\t\t\tkey: FieldKey,\n\t\t\tmap: FlexTreeMapNode<TSchema>,\n\t\t) => void,\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tthisArg?: any,\n\t): void;\n\n\t/**\n\t * Adds or updates an entry in the map with a specified `key` and a `value`.\n\t *\n\t * @param key - The key of the element to add to the map.\n\t * @param value - The value of the element to add to the map.\n\t */\n\tset(key: string, value: FlexibleFieldContent<TSchema[\"info\"]>): void;\n\n\t/**\n\t * Removes the specified element from this map by its `key`.\n\t *\n\t * @remarks\n\t * Note: unlike JavaScript's Map API, this method does not return a flag indicating whether or not the value was\n\t * deleted.\n\t *\n\t * @privateRemarks\n\t * Regarding the choice to not return a boolean: Since this data structure is distributed in nature, it isn't\n\t * possible to tell whether or not the item was deleted as a result of this method call. Returning a \"best guess\"\n\t * is more likely to create issues / promote bad usage patterns than offer useful information.\n\t *\n\t * @param key - The key of the element to remove from the map.\n\t */\n\tdelete(key: string): void;\n\n\t/**\n\t * Iterate through all fields in the map.\n\t *\n\t * @remarks\n\t * No mutations to the current view of the shared tree are permitted during iteration.\n\t * To iterate over the unboxed values of the map, use `Symbol.Iterator()`.\n\t */\n\tboxedIterator(): IterableIterator<FlexTreeTypedField<TSchema[\"info\"]>>;\n\n\t[Symbol.iterator](): IterableIterator<\n\t\t[FieldKey, FlexTreeUnboxField<TSchema[\"info\"], \"notEmpty\">]\n\t>;\n}\n\n/**\n * A {@link FlexTreeNode} that wraps a single {@link FlexTreeField} (which is placed under the {@link EmptyKey}).\n *\n * @remarks\n * A FieldNode is mostly identical to a struct node with a single field using the {@link EmptyKey}, but provides access to it via a field named \"content\".\n *\n * There are several use-cases where it makes sense to use a field node.\n * Here are a few:\n * - When it's necessary to differentiate between an empty sequence, and no sequence.\n * One case where this is needed is encoding Json.\n * - When polymorphism over {@link FlexFieldSchema} (and not just a union of {@link FlexAllowedTypes}) is required.\n * For example when encoding a schema for a type like\n * `Foo[] | Bar[]`, `Foo | Foo[]` or `Optional<Foo> | Optional<Bar>` (Where `Optional` is the Optional field kind, not TypeScript's `Optional`).\n * Since this schema system only allows `|` of {@link FlexTreeNodeSchema} (and only when declaring a {@link FlexFieldSchema}), see {@link SchemaBuilderBase.field},\n * these aggregate types are most simply expressed by creating fieldNodes for the terms like `Foo[]`, and `Optional<Foo>`.\n * Note that these are distinct from types like `(Foo | Bar)[]` and `Optional<Foo | Bar>` which can be expressed as single fields without extra nodes.\n * - When a distinct merge identity is desired for a field.\n * For example, if the application wants to be able to have an optional node or a sequence which it can pass around, edit and observe changes to,\n * in some cases (like when the content is moved to a different parent) this can be more flexible if a field node is introduced\n * to create a separate logical entity (node) which wraps the field.\n * This can even be useful with value fields to wrap terminal nodes if a stable merge\n * - When a field (such as a {@link FlexTreeSequenceField}) is desired in a location where {@link FlexTreeNode}s are required\n * (like the member of a union or the child of another {@link FlexTreeField}).\n * This can is typically just a different perspective on one of the above cases.\n * For example:\n * `Sequence<Foo> | Sequence<Bar>` or `OptionalField<Sequence<Foo>>` can't be expressed as simple fields\n * (unlike `Sequence<Foo | Bar>` or `OptionalField<Foo>` which can be done as simple fields).\n * Instead {@link FlexTreeFieldNode}s can be use to achieve something similar, more like:\n * `FieldNode<Sequence<Foo>> | FieldNode<Sequence<Bar>>` or `OptionalField<FieldNode<Sequence<Foo>>>`.\n *\n * @privateRemarks\n * FieldNodes do not unbox to their content, so in schema aware APIs which do unboxing, the FieldNode will NOT be skipped over.\n * This is a change from the old behavior to simplify unboxing and prevent cases where arbitrary deep chains of field nodes could unbox omitting information about the tree depth.\n * @internal\n */\nexport interface FlexTreeFieldNode<in out TSchema extends FlexFieldNodeSchema>\n\textends FlexTreeNode {\n\treadonly schema: TSchema;\n\n\t/**\n\t * The content this field node wraps.\n\t */\n\treadonly content: FlexTreeUnboxField<TSchema[\"info\"]>;\n}\n\n/**\n * A {@link FlexTreeNode} that behaves like an \"object\" or \"struct\", providing properties to access its fields.\n *\n * ObjectNodes consist of a finite collection of fields, each with their own (distinct) key and {@link FlexFieldSchema}.\n *\n * @remarks\n * ObjectNodes require complex typing, and have been split into two parts for implementation purposes.\n * See {@link FlexTreeObjectNodeTyped} for the schema aware extensions to this that provide access to the fields.\n *\n * These \"Objects\" resemble \"Structs\" from a wide variety of programming languages\n * (Including Algol 68, C, Go, Rust, C# etc.).\n * ObjectNodes also somewhat resemble JavaScript objects: this analogy is less precise (objects don't have a fixed schema for example),\n * but for consistency with other systems in the JavaScript ecosystem (like JSON) is \"ObjectNodes\" nodes are named \"Objects\".\n *\n * Another common name for this abstraction is [record](https://en.wikipedia.org/wiki/Record_(computer_science)).\n * The name \"Record\" is avoided (in favor of Object) here because it has less precise connotations for most TypeScript developers.\n * For example, TypeScript has a built in `Record` type, but it requires all of the fields to have the same type,\n * putting its semantics half way between this library's \"Object\" schema and {@link FlexTreeMapNode}.\n *\n * @internal\n */\nexport interface FlexTreeObjectNode extends FlexTreeNode {\n\treadonly schema: FlexObjectNodeSchema;\n}\n\n/**\n * Leaf holding a value.\n *\n * @remarks\n * Leaves are immutable and have no children.\n * Leaf unboxes its content, so in schema aware APIs which do unboxing, the Leaf itself will be skipped over and its value will be returned directly.\n * @internal\n */\nexport interface FlexTreeLeafNode<in out TSchema extends LeafNodeSchema> extends FlexTreeNode {\n\treadonly schema: TSchema;\n\n\t/**\n\t * Value stored on this node.\n\t */\n\treadonly value: TreeValue<TSchema[\"info\"]>;\n}\n\n/**\n * An {@link FlexTreeObjectNode} with schema aware accessors for its fields.\n *\n * @privateRemarks\n *\n * The corresponding implementation logic for this lives in `LazyTree.ts` under `buildStructClass`.\n * If you change the signature here, you will need to update that logic to match.\n *\n * @internal\n */\nexport type FlexTreeObjectNodeTyped<TSchema extends FlexObjectNodeSchema> =\n\tFlexObjectNodeSchema extends TSchema\n\t\t? FlexTreeObjectNode\n\t\t: FlexTreeObjectNode & FlexTreeObjectNodeFields<TSchema[\"info\"]>;\n\n/**\n * Properties to access an object node's fields. See {@link FlexTreeObjectNodeTyped}.\n *\n * @privateRemarks\n * TODO: Support custom field keys.\n * @internal\n */\nexport type FlexTreeObjectNodeFields<TFields extends FlexObjectNodeFields> =\n\tFlexTreeObjectNodeFieldsInner<\n\t\tFlattenKeys<\n\t\t\t{\n\t\t\t\t// When the key does not need to be escaped, map it from the input TFields in a way that doesn't break navigate to declaration\n\t\t\t\t[key in keyof TFields as key extends PropertyNameFromFieldKey<key & string>\n\t\t\t\t\t? key\n\t\t\t\t\t: never]: TFields[key];\n\t\t\t} & {\n\t\t\t\t[key in keyof TFields as key extends PropertyNameFromFieldKey<key & string>\n\t\t\t\t\t? never\n\t\t\t\t\t: PropertyNameFromFieldKey<key & string>]: TFields[key];\n\t\t\t}\n\t\t>\n\t>;\n\n/**\n * Properties to access an object node's fields. See {@link FlexTreeObjectNodeTyped}.\n *\n * @privateRemarks\n * TODO: Do we keep assignment operator + \"setFoo\" methods, or just use methods?\n * Inconsistency in the API experience could confusing for consumers.\n *\n * @internal\n */\nexport type FlexTreeObjectNodeFieldsInner<TFields extends FlexObjectNodeFields> = FlattenKeys<\n\t{\n\t\t// boxed fields (TODO: maybe remove these when same as non-boxed version?)\n\t\treadonly [key in keyof TFields as `boxed${Capitalize<key & string>}`]: FlexTreeTypedField<\n\t\t\tTFields[key]\n\t\t>;\n\t} & {\n\t\t// Add getter only (make property readonly) when the field is **not** of a kind that has a logical set operation.\n\t\t// If we could map to getters and setters separately, we would preferably do that, but we can't.\n\t\t// See https://github.com/microsoft/TypeScript/issues/43826 for more details on this limitation.\n\t\treadonly [key in keyof TFields as TFields[key][\"kind\"] extends AssignableFieldKinds\n\t\t\t? never\n\t\t\t: key]: FlexTreeUnboxField<TFields[key]>;\n\t} & {\n\t\t// Add setter (make property writable) when the field is of a kind that has a logical set operation.\n\t\t// If we could map to getters and setters separately, we would preferably do that, but we can't.\n\t\t// See https://github.com/microsoft/TypeScript/issues/43826 for more details on this limitation.\n\t\t-readonly [key in keyof TFields as TFields[key][\"kind\"] extends AssignableFieldKinds\n\t\t\t? key\n\t\t\t: never]: FlexTreeUnboxField<TFields[key]>;\n\t} & {\n\t\t// Setter method (when the field is of a kind that has a logical set operation).\n\t\treadonly [key in keyof TFields as TFields[key][\"kind\"] extends AssignableFieldKinds\n\t\t\t? `set${Capitalize<key & string>}`\n\t\t\t: never]: (content: FlexibleFieldContent<TFields[key]>) => void;\n\t}\n>;\n\n/**\n * Reserved object node field property names to avoid collisions with the rest of the object node API.\n * @internal\n */\nexport const reservedObjectNodeFieldPropertyNames = [\n\t\"anchorNode\",\n\t\"constructor\",\n\t\"context\",\n\t\"is\",\n\t\"parentField\",\n\t\"schema\",\n\t\"tryGetField\",\n\t\"type\",\n\t\"value\",\n\t\"boxedIterator\",\n\t\"iterator\",\n\t\"getBoxed\",\n] as const;\n\n/**\n * Reserved object node field property names prefixes.\n * These are reserved to avoid collisions with properties derived from field other field names.\n *\n * Field names starting with these must be followed by a lowercase letter, or be escaped.\n * @internal\n */\nexport const reservedObjectNodeFieldPropertyNamePrefixes = [\n\t\"set\",\n\t\"boxed\",\n\t\"field\",\n\t\"Field\",\n] as const;\n\n/**\n * {@link reservedObjectNodeFieldPropertyNamePrefixes} as a type union.\n * @internal\n */\nexport type ReservedObjectNodeFieldPropertyNames =\n\t(typeof reservedObjectNodeFieldPropertyNames)[number];\n\n/**\n * {@link reservedObjectNodeFieldPropertyNamePrefixes} as a type union.\n * @internal\n */\nexport type ReservedObjectNodeFieldPropertyNamePrefixes =\n\t(typeof reservedObjectNodeFieldPropertyNamePrefixes)[number];\n\n/**\n * Convert an object node's field key into an escaped string usable as a property name.\n *\n * @privateRemarks\n * TODO:\n * Collisions are still possible.\n * For example fields named \"foo\" and \"Foo\" would both produce a setter \"setFoo\".\n * Consider naming schemes to avoid this, ensure that there is a good workaround for these cases.\n * Another approach would be to support custom field names (separate from keys),\n * and do the escaping (if needed) when creating the flex tree schema (both when manually creating them and when doing so automatically):\n * this would enable better intellisense for escaped fields, as well as allow the feature of custom field property names.\n *\n * @internal\n */\nexport type PropertyNameFromFieldKey<T extends string> =\n\tT extends ReservedObjectNodeFieldPropertyNames\n\t\t? `field${Capitalize<T>}`\n\t\t: T extends `${ReservedObjectNodeFieldPropertyNamePrefixes}${Capitalize<string>}`\n\t\t\t? `field${Capitalize<T>}`\n\t\t\t: T;\n\n/**\n * Field kinds that allow value assignment.\n *\n * @internal\n */\nexport type AssignableFieldKinds = typeof FieldKinds.optional | typeof FieldKinds.required;\n\n// #endregion\n\n// #region Field Kinds\n\n/**\n * Strongly typed tree literals for inserting as the content of a field.\n *\n * If a cursor is provided, it must be in Fields mode.\n * @internal\n */\nexport type FlexibleFieldContent<TSchema extends FlexFieldSchema> =\n\t| InsertableFlexField<TSchema>\n\t| ITreeCursorSynchronous;\n\n/**\n * Strongly typed tree literals for inserting as a node.\n *\n * If a cursor is provided, it must be in Nodes mode.\n * @internal\n */\nexport type FlexibleNodeContent<TTypes extends FlexAllowedTypes> =\n\t| AllowedTypesToFlexInsertableTree<TTypes>\n\t| ITreeCursorSynchronous;\n\n/**\n * Strongly typed tree literals for inserting a subsequence of nodes.\n *\n * Used to insert a batch of 0 or more nodes into some location in a {@link FlexTreeSequenceField}.\n *\n * If a cursor is provided, it must be in Fields mode.\n * @internal\n */\nexport type FlexibleNodeSubSequence<TTypes extends FlexAllowedTypes> =\n\t| Iterable<AllowedTypesToFlexInsertableTree<TTypes>>\n\t| ITreeCursorSynchronous;\n\n/**\n * Type to ensures two types overlap in at least one way.\n * It evaluates to the input type if this is true, and never otherwise.\n * Examples:\n * CheckTypesOverlap\\<number | boolean, number | object\\> = number | boolean\n * CheckTypesOverlap\\<number | boolean, string | object\\> = never\n * @internal\n */\nexport type CheckTypesOverlap<T, TCheck> = [Extract<T, TCheck> extends never ? never : T][0];\n\n/**\n * {@link FlexTreeField} that stores a sequence of children.\n *\n * Sequence fields can contain an ordered sequence any number of {@link FlexTreeNode}s which must be of the {@link FlexAllowedTypes} from the {@link FlexFieldSchema}).\n *\n * @remarks\n * Allows for concurrent editing based on index, adjusting the locations of indexes as needed so they apply to the same logical place in the sequence when rebased and merged.\n *\n * Edits to sequence fields are anchored relative to their surroundings, so concurrent edits can result in the indexes of nodes and edits getting shifted.\n * To hold onto locations in sequence across an edit, use anchors.\n *\n * @privateRemarks\n * TODO:\n * Add anchor API that can actually hold onto locations in a sequence.\n * Currently only nodes can be held onto with anchors, and this does not replicate the behavior implemented for editing.\n * @internal\n */\nexport interface FlexTreeSequenceField<in out TTypes extends FlexAllowedTypes>\n\textends FlexTreeField {\n\t/**\n\t * Gets a node of this field by its index with unboxing.\n\t * @param index - Zero-based index of the item to retrieve. Negative values are interpreted from the end of the sequence.\n\t *\n\t * @returns The element in the sequence matching the given index. Always returns undefined if index \\< -sequence.length\n\t * or index \\>= array.length.\n\t *\n\t * @remarks\n\t * Semantics match {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at | Array.at}.\n\t */\n\tat(index: number): FlexTreeUnboxNodeUnion<TTypes> | undefined;\n\n\t/**\n\t * {@inheritdoc FlexTreeField.boxedAt}\n\t */\n\tboxedAt(index: number): FlexTreeTypedNodeUnion<TTypes> | undefined;\n\n\t/**\n\t * Calls the provided callback function on each child of this sequence, and returns an array that contains the results.\n\t * @param callbackfn - A function that accepts the child and its index.\n\t */\n\tmap<U>(callbackfn: (value: FlexTreeUnboxNodeUnion<TTypes>, index: number) => U): U[];\n\n\t/**\n\t * Calls the provided callback function on each child of this sequence, and returns an array that contains the results.\n\t * @param callbackfn - A function that accepts the child and its index.\n\t */\n\tmapBoxed<U>(callbackfn: (value: FlexTreeTypedNodeUnion<TTypes>, index: number) => U): U[];\n\n\treadonly length: number;\n\n\t/**\n\t * Get an editor for this sequence.\n\t */\n\tsequenceEditor(): SequenceFieldEditBuilder;\n\n\t/*\n\t * TODO:\n\t * Remove these editing methods and replace their use with use of `sequenceEditor`.\n\t * These editing methods replicate the API exposed by simple-tree, but using flex-tree types.\n\t * As these methods just re-abstract the lower level SequenceFieldEditBuilder API, they add little value.\n\t * Migrating the logic implementing them to simple-tree (and having it just use `sequenceEditor` directly)\n\t * avoids duplicating the API surface (and documentation), as well as makes it simpler to implement the desired user facing validation and errors\n\t * since simple-tree becomes responsible for all the validation and can produce usage errors in terms of the public package API.\n\t */\n\t// #region Editing Methods\n\n\t/**\n\t * Inserts new item(s) at a specified location.\n\t * @param index - The index at which to insert `value`.\n\t * @param value - The content to insert.\n\t * @throws Throws if `index` is not in the range [0, `list.length`).\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tinsertAt(index: number, value: FlexibleNodeSubSequence<TTypes>): void;\n\n\t/**\n\t * Inserts new item(s) at the start of the sequence.\n\t * @param value - The content to insert.\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tinsertAtStart(value: FlexibleNodeSubSequence<TTypes>): void;\n\n\t/**\n\t * Inserts new item(s) at the end of the sequence.\n\t * @param value - The content to insert.\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tinsertAtEnd(value: FlexibleNodeSubSequence<TTypes>): void;\n\n\t/**\n\t * Removes the item at the specified location.\n\t * @param index - The index at which to remove the item.\n\t * @throws Throws if `index` is not in the range [0, `list.length`).\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tremoveAt(index: number): void;\n\n\t/**\n\t * Moves the specified item to the start of the sequence.\n\t * @param sourceIndex - The index of the item to move.\n\t * @throws Throws if `sourceIndex` is not in the range [0, `list.length`).\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveToStart(sourceIndex: number): void;\n\n\t/**\n\t * Moves the specified item to the start of the sequence.\n\t * @param sourceIndex - The index of the item to move.\n\t * @param source - The source sequence to move the item out of.\n\t * @throws Throws if `sourceIndex` is not in the range [0, `list.length`).\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveToStart(sourceIndex: number, source: FlexTreeSequenceField<FlexAllowedTypes>): void;\n\n\t/**\n\t * Moves the specified item to the end of the sequence.\n\t * @param sourceIndex - The index of the item to move.\n\t * @throws Throws if `sourceIndex` is not in the range [0, `list.length`).\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveToEnd(sourceIndex: number): void;\n\n\t/**\n\t * Moves the specified item to the end of the sequence.\n\t * @param sourceIndex - The index of the item to move.\n\t * @param source - The source sequence to move the item out of.\n\t * @throws Throws if `sourceIndex` is not in the range [0, `list.length`).\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveToEnd(sourceIndex: number, source: FlexTreeSequenceField<FlexAllowedTypes>): void;\n\n\t/**\n\t * Moves the specified item to the desired location in the sequence.\n\t * @param index - The index to move the item to.\n\t * This is based on the state of the sequence before moving the source item.\n\t * @param sourceIndex - The index of the item to move.\n\t * @throws Throws if any of the input indices are not in the range [0, `list.length`).\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveToIndex(index: number, sourceIndex: number): void;\n\n\t/**\n\t * Moves the specified item to the desired location in the sequence.\n\t * @param index - The index to move the item to.\n\t * @param sourceIndex - The index of the item to move.\n\t * @param source - The source sequence to move the item out of.\n\t * @throws Throws if any of the input indices are not in the range [0, `list.length`).\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveToIndex(\n\t\tindex: number,\n\t\tsourceIndex: number,\n\t\tsource: FlexTreeSequenceField<FlexAllowedTypes>,\n\t): void;\n\n\t/**\n\t * Moves the specified items to the start of the sequence.\n\t * @param sourceStart - The starting index of the range to move (inclusive).\n\t * @param sourceEnd - The ending index of the range to move (exclusive)\n\t * @throws Throws if either of the input indices are not in the range [0, `list.length`) or if `sourceStart` is greater than `sourceEnd`.\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveRangeToStart(sourceStart: number, sourceEnd: number): void;\n\n\t/**\n\t * Moves the specified items to the start of the sequence.\n\t * @param sourceStart - The starting index of the range to move (inclusive).\n\t * @param sourceEnd - The ending index of the range to move (exclusive)\n\t * @param source - The source sequence to move items out of.\n\t * @throws Throws if the types of any of the items being moved are not allowed in the destination sequence,\n\t * if either of the input indices are not in the range [0, `list.length`) or if `sourceStart` is greater than `sourceEnd`.\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveRangeToStart(\n\t\tsourceStart: number,\n\t\tsourceEnd: number,\n\t\tsource: FlexTreeSequenceField<FlexAllowedTypes>,\n\t): void;\n\n\t/**\n\t * Moves the specified items to the end of the sequence.\n\t * @param sourceStart - The starting index of the range to move (inclusive).\n\t * @param sourceEnd - The ending index of the range to move (exclusive)\n\t * @throws Throws if either of the input indices are not in the range [0, `list.length`) or if `sourceStart` is greater than `sourceEnd`.\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveRangeToEnd(sourceStart: number, sourceEnd: number): void;\n\n\t/**\n\t * Moves the specified items to the end of the sequence.\n\t * @param sourceStart - The starting index of the range to move (inclusive).\n\t * @param sourceEnd - The ending index of the range to move (exclusive)\n\t * @param source - The source sequence to move items out of.\n\t * @throws Throws if the types of any of the items being moved are not allowed in the destination sequence,\n\t * if either of the input indices are not in the range [0, `list.length`) or if `sourceStart` is greater than `sourceEnd`.\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveRangeToEnd(\n\t\tsourceStart: number,\n\t\tsourceEnd: number,\n\t\tsource: FlexTreeSequenceField<FlexAllowedTypes>,\n\t): void;\n\n\t/**\n\t * Moves the specified items to the desired location within the sequence.\n\t * @param index - The index to move the items to.\n\t * This is based on the state of the sequence before moving the source items.\n\t * @param sourceStart - The starting index of the range to move (inclusive).\n\t * @param sourceEnd - The ending index of the range to move (exclusive)\n\t * @throws Throws if any of the input indices are not in the range [0, `list.length`) or if `sourceStart` is greater than `sourceEnd`.\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveRangeToIndex(index: number, sourceStart: number, sourceEnd: number): void;\n\n\t/**\n\t * Moves the specified items to the desired location within the sequence.\n\t * @param index - The index to move the items to.\n\t * @param sourceStart - The starting index of the range to move (inclusive).\n\t * @param sourceEnd - The ending index of the range to move (exclusive)\n\t * @param source - The source sequence to move items out of.\n\t * @throws Throws if the types of any of the items being moved are not allowed in the destination sequence,\n\t * if any of the input indices are not in the range [0, `list.length`) or if `sourceStart` is greater than `sourceEnd`.\n\t * @deprecated Migrate to using simple-tree layer editing APIs, or directly use the field editors.\n\t */\n\tmoveRangeToIndex(\n\t\tindex: number,\n\t\tsourceStart: number,\n\t\tsourceEnd: number,\n\t\t// FlexTreeSequenceField is invariant over its schema so any is required here.\n\t\t// This use of any can be removed by migrating off this deprecated API and deleting it.\n\t\t// If kept, this function should be fixed by making it generic and constraining it to fields which are safe to move content from.\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tsource: FlexTreeSequenceField<any>,\n\t): void;\n\n\t// #endregion\n\n\tboxedIterator(): IterableIterator<FlexTreeTypedNodeUnion<TTypes>>;\n\n\t/**\n\t * Gets the FieldUpPath of a field.\n\t */\n\tgetFieldPath(): FieldUpPath;\n\n\t[Symbol.iterator](): IterableIterator<FlexTreeUnboxNodeUnion<TTypes>>;\n}\n\n/**\n * Field that stores exactly one child.\n *\n * @remarks\n * Unboxes its content, so in schema aware APIs which do unboxing, the RequiredField itself will be skipped over and its content will be returned directly.\n * @internal\n */\nexport interface FlexTreeRequiredField<in out TTypes extends FlexAllowedTypes>\n\textends FlexTreeField {\n\tget content(): FlexTreeUnboxNodeUnion<TTypes>;\n\tset content(content: FlexibleNodeContent<TTypes>);\n}\n\n/**\n * Field that stores zero or one child.\n *\n * @remarks\n * Unboxes its content, so in schema aware APIs which do unboxing, the OptionalField itself will be skipped over and its content will be returned directly.\n *\n * @privateRemarks\n * TODO: Document merge semitics\n * TODO: Allow Optional fields to be used with last write wins OR first write wins merge resolution.\n * TODO:\n * Better centralize the documentation about what kinds of merge semantics are available for field kinds.\n * Maybe link editor?\n * @internal\n */\nexport interface FlexTreeOptionalField<in out TTypes extends FlexAllowedTypes>\n\textends FlexTreeField {\n\tget content(): FlexTreeUnboxNodeUnion<TTypes> | undefined;\n\tset content(newContent: FlexibleNodeContent<TTypes> | undefined);\n}\n\n// #endregion\n\n// #region Typed\n\n/**\n * Schema aware specialization of {@link FlexTreeField}.\n * @internal\n */\nexport type FlexTreeTypedField<TSchema extends FlexFieldSchema> = FlexTreeTypedFieldInner<\n\tTSchema[\"kind\"],\n\tTSchema[\"allowedTypes\"]\n>;\n\n/**\n * Helper for implementing {@link FlexTreeTypedField}.\n * @internal\n */\nexport type FlexTreeTypedFieldInner<\n\tKind extends FlexFieldKind,\n\tTypes extends FlexAllowedTypes,\n> = Kind extends typeof FieldKinds.sequence\n\t? FlexTreeSequenceField<Types>\n\t: Kind extends typeof FieldKinds.required\n\t\t? FlexTreeRequiredField<Types>\n\t\t: Kind extends typeof FieldKinds.optional\n\t\t\t? FlexTreeOptionalField<Types>\n\t\t\t: FlexTreeField;\n\n/**\n * Schema aware specialization of {@link FlexTreeNode} for a given {@link FlexAllowedTypes}.\n * @internal\n */\nexport type FlexTreeTypedNodeUnion<T extends FlexAllowedTypes> =\n\tT extends FlexList<FlexTreeNodeSchema>\n\t\t? FlexTreeTypedNode<Assume<FlexListToUnion<T>, FlexTreeNodeSchema>>\n\t\t: FlexTreeNode;\n\n/**\n * Schema aware specialization of {@link FlexTreeNode} for a given {@link FlexTreeNodeSchema}.\n * @internal\n */\nexport type FlexTreeTypedNode<TSchema extends FlexTreeNodeSchema> =\n\tTSchema extends LeafNodeSchema\n\t\t? FlexTreeLeafNode<TSchema>\n\t\t: TSchema extends FlexMapNodeSchema\n\t\t\t? FlexTreeMapNode<TSchema>\n\t\t\t: TSchema extends FlexFieldNodeSchema\n\t\t\t\t? FlexTreeFieldNode<TSchema>\n\t\t\t\t: TSchema extends FlexObjectNodeSchema\n\t\t\t\t\t? FlexTreeObjectNodeTyped<TSchema>\n\t\t\t\t\t: FlexTreeNode;\n\n// #endregion\n\n// #region Unbox\n\n/**\n * Schema aware unboxed field.\n * @remarks\n * Unboxes fields to their content if appropriate for the kind.\n * Recursively unboxes that content (then its content etc.) as well if the node union does unboxing.\n * @internal\n */\nexport type FlexTreeUnboxField<\n\tTSchema extends FlexFieldSchema,\n\t// If \"notEmpty\", then optional fields will unbox to their content (not their content | undefined)\n\tEmptiness extends \"maybeEmpty\" | \"notEmpty\" = \"maybeEmpty\",\n> = FlexTreeUnboxFieldInner<TSchema[\"kind\"], TSchema[\"allowedTypes\"], Emptiness>;\n\n/**\n * Helper for implementing FlexTreeUnboxField.\n * @internal\n */\nexport type FlexTreeUnboxFieldInner<\n\tKind extends FlexFieldKind,\n\tTTypes extends FlexAllowedTypes,\n\tEmptiness extends \"maybeEmpty\" | \"notEmpty\",\n> = Kind extends typeof FieldKinds.sequence\n\t? FlexTreeSequenceField<TTypes>\n\t: Kind extends typeof FieldKinds.required\n\t\t? FlexTreeUnboxNodeUnion<TTypes>\n\t\t: Kind extends typeof FieldKinds.optional\n\t\t\t? FlexTreeUnboxNodeUnion<TTypes> | (Emptiness extends \"notEmpty\" ? never : undefined)\n\t\t\t: // TODO: forbidden\n\t\t\t\tunknown;\n\n/**\n * Schema aware unboxed union of tree types.\n * @remarks\n * Unboxes when not polymorphic.\n * Recursively unboxes that content as well if the node kind does unboxing.\n * @internal\n */\nexport type FlexTreeUnboxNodeUnion<TTypes extends FlexAllowedTypes> = TTypes extends readonly [\n\tLazyItem<infer InnerType>,\n]\n\t? InnerType extends FlexTreeNodeSchema\n\t\t? FlexTreeUnboxNode<InnerType>\n\t\t: InnerType extends Any\n\t\t\t? FlexTreeNode\n\t\t\t: // This case should not occur. If the result ever ends up unknown, look at places like this to debug.\n\t\t\t\tunknown\n\t: boolean extends IsArrayOfOne<TTypes>\n\t\t? FlexTreeUnknownUnboxed // Unknown if this will unbox. This should mainly happen when TTypes is AllowedTypes.\n\t\t: FlexTreeTypedNodeUnion<TTypes>; // Known to not be a single type, so known not to unbox.\n\n/**\n * `true` if T is known to be an array of one item.\n * `false` if T is known not to be an array of one item.\n * `boolean` if it is unknown if T is an array of one item or not.\n * @internal\n */\nexport type IsArrayOfOne<T extends readonly unknown[]> = T[\"length\"] extends 1\n\t? true\n\t: 1 extends T[\"length\"]\n\t\t? boolean\n\t\t: false;\n\n/**\n * Schema aware unboxed tree type.\n * @remarks\n * Unboxes if the node kind does unboxing.\n * Recursively unboxes that content as well if it does unboxing.\n * @internal\n */\nexport type FlexTreeUnboxNode<TSchema extends FlexTreeNodeSchema> =\n\tTSchema extends LeafNodeSchema\n\t\t? TreeValue<TSchema[\"info\"]>\n\t\t: TSchema extends FlexMapNodeSchema\n\t\t\t? FlexTreeMapNode<TSchema>\n\t\t\t: TSchema extends FlexFieldNodeSchema\n\t\t\t\t? FlexTreeFieldNode<TSchema>\n\t\t\t\t: TSchema extends FlexObjectNodeSchema\n\t\t\t\t\t? FlexTreeObjectNodeTyped<TSchema>\n\t\t\t\t\t: FlexTreeUnknownUnboxed;\n\n/**\n * Unboxed tree type for unknown schema cases.\n * @internal\n */\nexport type FlexTreeUnknownUnboxed = TreeValue | FlexTreeNode;\n\n// #endregion\n"]}
|
|
1
|
+
{"version":3,"file":"flexTreeTypes.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/flexTreeTypes.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kDAO6B;AAyB7B;;;GAGG;AACU,QAAA,YAAY,GAAG,IAAA,qBAAU,GAAgB,CAAC;AAEvD;;GAEG;AACU,QAAA,cAAc,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAEvD,SAAgB,gBAAgB,CAAC,CAAU;IAC1C,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,sBAAc,IAAI,CAAC,CAAC;AACnE,CAAC;AAFD,4CAEC;AAED,SAAgB,cAAc,CAAC,CAAU;IACxC,OAAO,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,sBAAc,CAAC,KAAK,kBAAkB,CAAC,IAAI,CAAC;AAC7E,CAAC;AAFD,wCAEC;AAED;GACG;AACH,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC7B,2DAAI,CAAA;IACJ,6DAAK,CAAA;AACN,CAAC,EAHW,kBAAkB,kCAAlB,kBAAkB,QAG7B;AA4CD;;;GAGG;AACH,IAAY,UAoBX;AApBD,WAAY,UAAU;IACrB;;OAEG;IACH,uDAAc,CAAA;IAEd;;OAEG;IACH,iDAAW,CAAA;IAEX;;OAEG;IACH,iDAAW,CAAA;IAEX;;OAEG;IACH,yCAAO,CAAA;AACR,CAAC,EApBW,UAAU,0BAAV,UAAU,QAoBrB;AAmUD;;GAEG;AACU,QAAA,oCAAoC,GAAG;IACnD,YAAY;IACZ,aAAa;IACb,SAAS;IACT,IAAI;IACJ,aAAa;IACb,QAAQ;IACR,aAAa;IACb,MAAM;IACN,OAAO;IACP,eAAe;IACf,UAAU;IACV,UAAU;CACD,CAAC;AAEX;;;;;GAKG;AACU,QAAA,2CAA2C,GAAG;IAC1D,KAAK;IACL,OAAO;IACP,OAAO;IACP,OAAO;CACE,CAAC;AAqSX,aAAa","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\ttype AnchorNode,\n\ttype ExclusiveMapTree,\n\ttype FieldKey,\n\ttype FieldUpPath,\n\ttype TreeValue,\n\tanchorSlot,\n} from \"../../core/index.js\";\nimport type { Assume, FlattenKeys } from \"../../util/index.js\";\nimport type {\n\tFieldKinds,\n\tSequenceFieldEditBuilder,\n\tValueFieldEditBuilder,\n\tOptionalFieldEditBuilder,\n} from \"../default-schema/index.js\";\nimport type { FlexFieldKind } from \"../modular-schema/index.js\";\nimport type {\n\tAny,\n\tFlexAllowedTypes,\n\tFlexFieldSchema,\n\tFlexList,\n\tFlexListToUnion,\n\tFlexMapNodeSchema,\n\tFlexObjectNodeFields,\n\tFlexObjectNodeSchema,\n\tFlexTreeNodeSchema,\n\tLazyItem,\n\tLeafNodeSchema,\n} from \"../typed-schema/index.js\";\n\nimport type { FlexTreeContext } from \"./context.js\";\n\n/**\n * An anchor slot which records the {@link FlexTreeNode} associated with that anchor, if there is one.\n * @remarks This always points to a \"real\" {@link FlexTreeNode} (i.e. a `LazyTreeNode`), never to a \"raw\" node.\n */\nexport const flexTreeSlot = anchorSlot<FlexTreeNode>();\n\n/**\n * Indicates that an object is a flex tree.\n */\nexport const flexTreeMarker = Symbol(\"flexTreeMarker\");\n\nexport function isFlexTreeEntity(t: unknown): t is FlexTreeEntity {\n\treturn typeof t === \"object\" && t !== null && flexTreeMarker in t;\n}\n\nexport function isFlexTreeNode(t: unknown): t is FlexTreeNode {\n\treturn isFlexTreeEntity(t) && t[flexTreeMarker] === FlexTreeEntityKind.Node;\n}\n\n/**\n */\nexport enum FlexTreeEntityKind {\n\tNode,\n\tField,\n}\n\n/**\n * Part of a tree.\n * Iterates over children.\n *\n * @privateRemarks\n * This exists mainly as a place to share common members between nodes and fields.\n * It is not expected to be useful or common to write code which handles this type directly.\n * If this assumption turns out to be false, and generically processing `UntypedEntity`s is useful,\n * then this interface should probably be extended with some down casting functionality (like `is`).\n *\n * TODO:\n * Design and document iterator invalidation rules and ordering rules.\n * Providing a custom iterator type with place anchor semantics would be a good approach.\n */\nexport interface FlexTreeEntity<out TSchema = unknown> {\n\t/**\n\t * Indicates that an object is a specific kind of flex tree FlexTreeEntity.\n\t * This makes it possible to both down cast FlexTreeEntities safely as well as validate if an object is or is not a FlexTreeEntity.\n\t */\n\treadonly [flexTreeMarker]: FlexTreeEntityKind;\n\n\t/**\n\t * Schema for this entity.\n\t * If well-formed, it must follow this schema.\n\t */\n\treadonly schema: TSchema;\n\n\t/**\n\t * A common context of a \"forest\" of FlexTrees.\n\t * @remarks This is `undefined` for unhydrated nodes or fields that have not yet been inserted into the tree.\n\t */\n\treadonly context?: FlexTreeContext;\n\n\t/**\n\t * Iterate through all nodes/fields in this field/node.\n\t *\n\t * @remarks\n\t * No mutations to the current view of the shared tree are permitted during iteration.\n\t */\n\tboxedIterator(): IterableIterator<FlexTreeEntity>;\n}\n\n/**\n * Status of the tree that a particular node belongs to.\n * @public\n */\nexport enum TreeStatus {\n\t/**\n\t * Is parented under the root field.\n\t */\n\tInDocument = 0,\n\n\t/**\n\t * Is not parented under the root field, but can be added back to the original document tree.\n\t */\n\tRemoved = 1,\n\n\t/**\n\t * Is removed and cannot be added back to the original document tree.\n\t */\n\tDeleted = 2,\n\n\t/**\n\t * Is created but has not yet been inserted into the tree.\n\t */\n\tNew = 3,\n}\n\n/**\n * Generic tree node API.\n *\n * Nodes are (shallowly) immutable and have a logical identity, a type and either a value or fields under string keys.\n *\n * This \"logical identity\" is exposed as the object identity: if a node is moved within a document,\n * the same {@link FlexTreeNode} instance will be used in the new location.\n * Similarly, edits applied to a node's sub-tree concurrently with the move of the node will still be applied to its subtree in its new location.\n *\n *\n * @remarks\n * Down-casting (via {@link FlexTreeNode#is}) is required to access Schema-Aware APIs, including editing.\n * All content in the tree is accessible without down-casting, but if the schema is known,\n * the schema aware API may be more ergonomic.\n * All editing is actually done via {@link FlexTreeField}s: the nodes are immutable other than that they contain mutable fields.\n */\nexport interface FlexTreeNode extends FlexTreeEntity<FlexTreeNodeSchema> {\n\treadonly [flexTreeMarker]: FlexTreeEntityKind.Node;\n\n\t/**\n\t * Value stored on this node.\n\t */\n\treadonly value?: TreeValue;\n\n\t/**\n\t * Gets a field of this node, if it is not empty.\n\t */\n\ttryGetField(key: FieldKey): undefined | FlexTreeField;\n\n\t/**\n\t * Get the field for `key`.\n\t * @param key - which entry to look up.\n\t *\n\t * @remarks\n\t * All fields implicitly exist, so `getBoxed` can be called with any key and will always return a field.\n\t * Even if the field is empty, it will still be returned, and can be edited to insert content if allowed by the field kind.\n\t * See {@link FlexTreeNode.tryGetField} for a variant that does not allocate afield in the empty case.\n\t */\n\tgetBoxed(key: FieldKey): FlexTreeField;\n\n\t/**\n\t * The field this tree is in, and the index within that field.\n\t */\n\treadonly parentField: { readonly parent: FlexTreeField; readonly index: number };\n\n\t/**\n\t * Type guard for narrowing / down-casting to a specific schema.\n\t */\n\tis<TSchema extends FlexTreeNodeSchema>(schema: TSchema): this is FlexTreeTypedNode<TSchema>;\n\n\tboxedIterator(): IterableIterator<FlexTreeField>;\n\n\t/**\n\t * The anchor node associated with this node\n\t *\n\t * @remarks\n\t * The ref count keeping this alive is owned by the FlexTreeNode:\n\t * if holding onto this anchor for longer than the FlexTreeNode might be alive,\n\t * a separate Anchor (and thus ref count) must be allocated to keep it alive.\n\t */\n\treadonly anchorNode: AnchorNode;\n}\n\n/**\n * A collaboratively editable collection of nodes within a {@link FlexTreeEntity}.\n *\n * Fields are inherently part of their parent, and thus cannot be moved.\n * Instead their content can be moved, deleted or created.\n *\n * Editing operations are only valid on trees with the {@link TreeStatus#InDocument} `TreeStatus`.\n *\n * @remarks\n * Fields are used wherever an editable collection of nodes is required.\n * This is required in two places:\n * 1. To hold the children of non-leaf {@link FlexTreeNode}s.\n * 2. As the root of a {@link FlexTreeEntity}.\n *\n * Down-casting (via {@link FlexTreeField.is}) is required to access Schema-Aware APIs, including editing.\n * All content in the tree is accessible without down-casting, but if the schema is known,\n * the schema aware API may be more ergonomic.\n */\nexport interface FlexTreeField extends FlexTreeEntity<FlexFieldSchema> {\n\treadonly [flexTreeMarker]: FlexTreeEntityKind.Field;\n\n\t/**\n\t * The number of nodes in this field\n\t */\n\treadonly length: number;\n\n\t/**\n\t * The `FieldKey` this field is under.\n\t * Defines what part of its parent this field makes up.\n\t */\n\treadonly key: FieldKey;\n\n\t/**\n\t * The node which has this field on it under `fieldKey`.\n\t * `undefined` iff this field is a detached field.\n\t */\n\treadonly parent?: FlexTreeNode;\n\n\t/**\n\t * Type guard for narrowing / down-casting to a specific schema.\n\t */\n\tis<TSchema extends FlexFieldSchema>(schema: TSchema): this is FlexTreeTypedField<TSchema>;\n\n\tboxedIterator(): IterableIterator<FlexTreeNode>;\n\n\t/**\n\t * Gets a node of this field by its index without unboxing.\n\t * @param index - Zero-based index of the item to retrieve. Negative values are interpreted from the end of the sequence.\n\t *\n\t * @returns The element in the sequence matching the given index. Always returns undefined if index \\< -sequence.length\n\t * or index \\>= sequence.length.\n\t *\n\t * @remarks\n\t * Semantics match {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at | Array.at}.\n\t */\n\tboxedAt(index: number): FlexTreeNode | undefined;\n}\n\n// #region Node Kinds\n\n/**\n * A {@link FlexTreeNode} that behaves like a `Map<string, Field>` for a specific `Field` type.\n *\n * @remarks\n * Unlike TypeScript Map type, {@link FlexTreeMapNode.get} always provides a reference to any field looked up, even if it has never been set.\n *\n * This means that, for example, a `MapNode` of {@link FlexTreeSequenceField} fields will return an empty sequence when a previously unused key is looked up,\n * and that sequence can be used to insert new items into the field.\n * Additionally empty fields (those containing no nodes) are not distinguished from fields which do not exist.\n * This differs from JavaScript Maps which have a subtle distinction between storing undefined as a value in the map and deleting an entry from the map.\n */\nexport interface FlexTreeMapNode<in out TSchema extends FlexMapNodeSchema>\n\textends FlexTreeNode {\n\treadonly schema: TSchema;\n\n\t/**\n\t * Get the field for `key`.\n\t * @param key - which map entry to look up.\n\t *\n\t * @remarks\n\t * All fields under a map implicitly exist, so `get` can be called with any key and will always return a field.\n\t * Even if the field is empty, it will still be returned, and can be edited to insert content into the map.\n\t */\n\tgetBoxed(key: string): FlexTreeTypedField<TSchema[\"info\"]>;\n\n\t/**\n\t * Returns an iterable of keys in the map.\n\t *\n\t * @remarks\n\t * All fields under a map implicitly exist, but `keys` will yield only the keys of fields which contain one or more nodes.\n\t *\n\t * No guarantees are made regarding the order of the keys returned.\n\t */\n\tkeys(): IterableIterator<FieldKey>;\n\n\t/**\n\t * Returns an iterable of values in the map.\n\t *\n\t * @remarks\n\t * All fields under a map implicitly exist, but `values` will yield only the fields containing one or more nodes.\n\t *\n\t * No guarantees are made regarding the order of the values returned.\n\t */\n\tvalues(): IterableIterator<FlexTreeUnboxField<TSchema[\"info\"], \"notEmpty\">>;\n\n\t/**\n\t * Returns an iterable of key, value pairs for every entry in the map.\n\t *\n\t * @remarks\n\t * All fields under a map implicitly exist, but `entries` will yield only the entries whose fields contain one or more nodes.\n\t *\n\t * This iteration provided by `entries()` is equivalent to that provided by direct iteration of the {@link FlexTreeMapNode} (a.k.a. `[Symbol.Iterator]()`).\n\t *\n\t * No guarantees are made regarding the order of the entries returned.\n\t */\n\tentries(): IterableIterator<[FieldKey, FlexTreeUnboxField<TSchema[\"info\"], \"notEmpty\">]>;\n\n\t/**\n\t * Executes a provided function once per each key/value pair in the map.\n\t * @param callbackFn - The function to run for each map entry\n\t * @param thisArg - If present, `callbackFn` will be bound to `thisArg`\n\t *\n\t * @privateRemarks\n\t * TODO: This should run over fields in insertion order if we want to match the javascript foreach spec.\n\t */\n\tforEach(\n\t\tcallbackFn: (\n\t\t\tvalue: FlexTreeUnboxField<TSchema[\"info\"], \"notEmpty\">,\n\t\t\tkey: FieldKey,\n\t\t\tmap: FlexTreeMapNode<TSchema>,\n\t\t) => void,\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tthisArg?: any,\n\t): void;\n\n\t/**\n\t * Iterate through all fields in the map.\n\t *\n\t * @remarks\n\t * No mutations to the current view of the shared tree are permitted during iteration.\n\t * To iterate over the unboxed values of the map, use `Symbol.Iterator()`.\n\t */\n\tboxedIterator(): IterableIterator<FlexTreeTypedField<TSchema[\"info\"]>>;\n\n\t[Symbol.iterator](): IterableIterator<\n\t\t[FieldKey, FlexTreeUnboxField<TSchema[\"info\"], \"notEmpty\">]\n\t>;\n}\n\n/**\n * A {@link FlexTreeNode} that behaves like an \"object\" or \"struct\", providing properties to access its fields.\n *\n * ObjectNodes consist of a finite collection of fields, each with their own (distinct) key and {@link FlexFieldSchema}.\n *\n * @remarks\n * ObjectNodes require complex typing, and have been split into two parts for implementation purposes.\n * See {@link FlexTreeObjectNodeTyped} for the schema aware extensions to this that provide access to the fields.\n *\n * These \"Objects\" resemble \"Structs\" from a wide variety of programming languages\n * (Including Algol 68, C, Go, Rust, C# etc.).\n * ObjectNodes also somewhat resemble JavaScript objects: this analogy is less precise (objects don't have a fixed schema for example),\n * but for consistency with other systems in the JavaScript ecosystem (like JSON) is \"ObjectNodes\" nodes are named \"Objects\".\n *\n * Another common name for this abstraction is [record](https://en.wikipedia.org/wiki/Record_(computer_science)).\n * The name \"Record\" is avoided (in favor of Object) here because it has less precise connotations for most TypeScript developers.\n * For example, TypeScript has a built in `Record` type, but it requires all of the fields to have the same type,\n * putting its semantics half way between this library's \"Object\" schema and {@link FlexTreeMapNode}.\n */\nexport interface FlexTreeObjectNode extends FlexTreeNode {\n\treadonly schema: FlexObjectNodeSchema;\n}\n\n/**\n * Leaf holding a value.\n *\n * @remarks\n * Leaves are immutable and have no children.\n * Leaf unboxes its content, so in schema aware APIs which do unboxing, the Leaf itself will be skipped over and its value will be returned directly.\n */\nexport interface FlexTreeLeafNode<in out TSchema extends LeafNodeSchema> extends FlexTreeNode {\n\treadonly schema: TSchema;\n\n\t/**\n\t * Value stored on this node.\n\t */\n\treadonly value: TreeValue<TSchema[\"info\"]>;\n}\n\n/**\n * An {@link FlexTreeObjectNode} with schema aware accessors for its fields.\n *\n * @privateRemarks\n *\n * The corresponding implementation logic for this lives in `LazyTree.ts` under `buildStructClass`.\n * If you change the signature here, you will need to update that logic to match.\n */\nexport type FlexTreeObjectNodeTyped<TSchema extends FlexObjectNodeSchema> =\n\tFlexObjectNodeSchema extends TSchema\n\t\t? FlexTreeObjectNode\n\t\t: FlexTreeObjectNode & FlexTreeObjectNodeFields<TSchema[\"info\"]>;\n\n/**\n * Properties to access an object node's fields. See {@link FlexTreeObjectNodeTyped}.\n *\n * @privateRemarks\n * TODO: Support custom field keys.\n */\nexport type FlexTreeObjectNodeFields<TFields extends FlexObjectNodeFields> =\n\tFlexTreeObjectNodeFieldsInner<\n\t\tFlattenKeys<\n\t\t\t{\n\t\t\t\t// When the key does not need to be escaped, map it from the input TFields in a way that doesn't break navigate to declaration\n\t\t\t\t[key in keyof TFields as key extends PropertyNameFromFieldKey<key & string>\n\t\t\t\t\t? key\n\t\t\t\t\t: never]: TFields[key];\n\t\t\t} & {\n\t\t\t\t[key in keyof TFields as key extends PropertyNameFromFieldKey<key & string>\n\t\t\t\t\t? never\n\t\t\t\t\t: PropertyNameFromFieldKey<key & string>]: TFields[key];\n\t\t\t}\n\t\t>\n\t>;\n\n/**\n * Properties to access an object node's fields. See {@link FlexTreeObjectNodeTyped}.\n *\n * @privateRemarks\n * TODO: Do we keep assignment operator + \"setFoo\" methods, or just use methods?\n * Inconsistency in the API experience could confusing for consumers.\n */\nexport type FlexTreeObjectNodeFieldsInner<TFields extends FlexObjectNodeFields> = FlattenKeys<\n\t{\n\t\t// boxed fields (TODO: maybe remove these when same as non-boxed version?)\n\t\treadonly [key in keyof TFields as `boxed${Capitalize<key & string>}`]: FlexTreeTypedField<\n\t\t\tTFields[key]\n\t\t>;\n\t} & {\n\t\t// Add getter only (make property readonly) when the field is **not** of a kind that has a logical set operation.\n\t\t// If we could map to getters and setters separately, we would preferably do that, but we can't.\n\t\t// See https://github.com/microsoft/TypeScript/issues/43826 for more details on this limitation.\n\t\treadonly [key in keyof TFields as TFields[key][\"kind\"] extends AssignableFieldKinds\n\t\t\t? never\n\t\t\t: key]: FlexTreeUnboxField<TFields[key]>;\n\t} & {\n\t\t// Add setter (make property writable) when the field is of a kind that has a logical set operation.\n\t\t// If we could map to getters and setters separately, we would preferably do that, but we can't.\n\t\t// See https://github.com/microsoft/TypeScript/issues/43826 for more details on this limitation.\n\t\t-readonly [key in keyof TFields as TFields[key][\"kind\"] extends AssignableFieldKinds\n\t\t\t? key\n\t\t\t: never]: FlexTreeUnboxField<TFields[key]>;\n\t} & {\n\t\t// Setter method (when the field is of a kind that has a logical set operation).\n\t\treadonly [key in keyof TFields as TFields[key][\"kind\"] extends AssignableFieldKinds\n\t\t\t? `set${Capitalize<key & string>}`\n\t\t\t: never]: (content: FlexibleNodeContent) => void;\n\t}\n>;\n\n/**\n * Reserved object node field property names to avoid collisions with the rest of the object node API.\n */\nexport const reservedObjectNodeFieldPropertyNames = [\n\t\"anchorNode\",\n\t\"constructor\",\n\t\"context\",\n\t\"is\",\n\t\"parentField\",\n\t\"schema\",\n\t\"tryGetField\",\n\t\"type\",\n\t\"value\",\n\t\"boxedIterator\",\n\t\"iterator\",\n\t\"getBoxed\",\n] as const;\n\n/**\n * Reserved object node field property names prefixes.\n * These are reserved to avoid collisions with properties derived from field other field names.\n *\n * Field names starting with these must be followed by a lowercase letter, or be escaped.\n */\nexport const reservedObjectNodeFieldPropertyNamePrefixes = [\n\t\"set\",\n\t\"boxed\",\n\t\"field\",\n\t\"Field\",\n] as const;\n\n/**\n * {@link reservedObjectNodeFieldPropertyNamePrefixes} as a type union.\n */\nexport type ReservedObjectNodeFieldPropertyNames =\n\t(typeof reservedObjectNodeFieldPropertyNames)[number];\n\n/**\n * {@link reservedObjectNodeFieldPropertyNamePrefixes} as a type union.\n */\nexport type ReservedObjectNodeFieldPropertyNamePrefixes =\n\t(typeof reservedObjectNodeFieldPropertyNamePrefixes)[number];\n\n/**\n * Convert an object node's field key into an escaped string usable as a property name.\n *\n * @privateRemarks\n * TODO:\n * Collisions are still possible.\n * For example fields named \"foo\" and \"Foo\" would both produce a setter \"setFoo\".\n * Consider naming schemes to avoid this, ensure that there is a good workaround for these cases.\n * Another approach would be to support custom field names (separate from keys),\n * and do the escaping (if needed) when creating the flex tree schema (both when manually creating them and when doing so automatically):\n * this would enable better intellisense for escaped fields, as well as allow the feature of custom field property names.\n */\nexport type PropertyNameFromFieldKey<T extends string> =\n\tT extends ReservedObjectNodeFieldPropertyNames\n\t\t? `field${Capitalize<T>}`\n\t\t: T extends `${ReservedObjectNodeFieldPropertyNamePrefixes}${Capitalize<string>}`\n\t\t\t? `field${Capitalize<T>}`\n\t\t\t: T;\n\n/**\n * Field kinds that allow value assignment.\n */\nexport type AssignableFieldKinds = typeof FieldKinds.optional | typeof FieldKinds.required;\n\n// #endregion\n\n// #region Field Kinds\n\n/**\n * Typed tree for inserting as the content of a field.\n */\nexport type FlexibleFieldContent = ExclusiveMapTree[];\n\n/**\n * Tree for inserting as a node.\n */\nexport type FlexibleNodeContent = ExclusiveMapTree;\n\n/**\n * Tree for inserting a subsequence of nodes.\n *\n * Used to insert a batch of 0 or more nodes into some location in a {@link FlexTreeSequenceField}.\n */\nexport type FlexibleNodeSubSequence = ExclusiveMapTree[];\n\n/**\n * Type to ensures two types overlap in at least one way.\n * It evaluates to the input type if this is true, and never otherwise.\n * Examples:\n * CheckTypesOverlap\\<number | boolean, number | object\\> = number | boolean\n * CheckTypesOverlap\\<number | boolean, string | object\\> = never\n */\nexport type CheckTypesOverlap<T, TCheck> = [Extract<T, TCheck> extends never ? never : T][0];\n\n/**\n * {@link FlexTreeField} that stores a sequence of children.\n *\n * Sequence fields can contain an ordered sequence any number of {@link FlexTreeNode}s which must be of the {@link FlexAllowedTypes} from the {@link FlexFieldSchema}).\n *\n * @remarks\n * Allows for concurrent editing based on index, adjusting the locations of indexes as needed so they apply to the same logical place in the sequence when rebased and merged.\n *\n * Edits to sequence fields are anchored relative to their surroundings, so concurrent edits can result in the indexes of nodes and edits getting shifted.\n * To hold onto locations in sequence across an edit, use anchors.\n *\n * @privateRemarks\n * TODO:\n * Add anchor API that can actually hold onto locations in a sequence.\n * Currently only nodes can be held onto with anchors, and this does not replicate the behavior implemented for editing.\n */\nexport interface FlexTreeSequenceField<in out TTypes extends FlexAllowedTypes>\n\textends FlexTreeField {\n\t/**\n\t * Gets a node of this field by its index with unboxing.\n\t * @param index - Zero-based index of the item to retrieve. Negative values are interpreted from the end of the sequence.\n\t *\n\t * @returns The element in the sequence matching the given index. Always returns undefined if index \\< -sequence.length\n\t * or index \\>= array.length.\n\t *\n\t * @remarks\n\t * Semantics match {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at | Array.at}.\n\t */\n\tat(index: number): FlexTreeUnboxNodeUnion<TTypes> | undefined;\n\n\t/**\n\t * {@inheritdoc FlexTreeField.boxedAt}\n\t */\n\tboxedAt(index: number): FlexTreeTypedNodeUnion<TTypes> | undefined;\n\n\t/**\n\t * Calls the provided callback function on each child of this sequence, and returns an array that contains the results.\n\t * @param callbackfn - A function that accepts the child and its index.\n\t */\n\tmap<U>(callbackfn: (value: FlexTreeUnboxNodeUnion<TTypes>, index: number) => U): U[];\n\n\t/**\n\t * Calls the provided callback function on each child of this sequence, and returns an array that contains the results.\n\t * @param callbackfn - A function that accepts the child and its index.\n\t */\n\tmapBoxed<U>(callbackfn: (value: FlexTreeTypedNodeUnion<TTypes>, index: number) => U): U[];\n\n\treadonly length: number;\n\n\t/**\n\t * Get an editor for this sequence.\n\t */\n\treadonly editor: SequenceFieldEditBuilder<FlexibleFieldContent>;\n\n\tboxedIterator(): IterableIterator<FlexTreeTypedNodeUnion<TTypes>>;\n\n\t/**\n\t * Gets the FieldUpPath of a field.\n\t */\n\tgetFieldPath(): FieldUpPath;\n\n\t[Symbol.iterator](): IterableIterator<FlexTreeUnboxNodeUnion<TTypes>>;\n}\n\n/**\n * Field that stores exactly one child.\n *\n * @remarks\n * Unboxes its content, so in schema aware APIs which do unboxing, the RequiredField itself will be skipped over and its content will be returned directly.\n */\nexport interface FlexTreeRequiredField<in out TTypes extends FlexAllowedTypes>\n\textends FlexTreeField {\n\tget content(): FlexTreeUnboxNodeUnion<TTypes>;\n\n\treadonly editor: ValueFieldEditBuilder<FlexibleNodeContent>;\n}\n\n/**\n * Field that stores zero or one child.\n *\n * @remarks\n * Unboxes its content, so in schema aware APIs which do unboxing, the OptionalField itself will be skipped over and its content will be returned directly.\n *\n * @privateRemarks\n * TODO: Document merge semitics\n * TODO: Allow Optional fields to be used with last write wins OR first write wins merge resolution.\n * TODO:\n * Better centralize the documentation about what kinds of merge semantics are available for field kinds.\n * Maybe link editor?\n */\nexport interface FlexTreeOptionalField<in out TTypes extends FlexAllowedTypes>\n\textends FlexTreeField {\n\tget content(): FlexTreeUnboxNodeUnion<TTypes> | undefined;\n\n\treadonly editor: OptionalFieldEditBuilder<FlexibleNodeContent>;\n}\n\n// #endregion\n\n// #region Typed\n\n/**\n * Schema aware specialization of {@link FlexTreeField}.\n */\nexport type FlexTreeTypedField<TSchema extends FlexFieldSchema> = FlexTreeTypedFieldInner<\n\tTSchema[\"kind\"],\n\tTSchema[\"allowedTypes\"]\n>;\n\n/**\n * Helper for implementing {@link FlexTreeTypedField}.\n */\nexport type FlexTreeTypedFieldInner<\n\tKind extends FlexFieldKind,\n\tTypes extends FlexAllowedTypes,\n> = Kind extends typeof FieldKinds.sequence\n\t? FlexTreeSequenceField<Types>\n\t: Kind extends typeof FieldKinds.required\n\t\t? FlexTreeRequiredField<Types>\n\t\t: Kind extends typeof FieldKinds.optional\n\t\t\t? FlexTreeOptionalField<Types>\n\t\t\t: FlexTreeField;\n\n/**\n * Schema aware specialization of {@link FlexTreeNode} for a given {@link FlexAllowedTypes}.\n */\nexport type FlexTreeTypedNodeUnion<T extends FlexAllowedTypes> =\n\tT extends FlexList<FlexTreeNodeSchema>\n\t\t? FlexTreeTypedNode<Assume<FlexListToUnion<T>, FlexTreeNodeSchema>>\n\t\t: FlexTreeNode;\n\n/**\n * Schema aware specialization of {@link FlexTreeNode} for a given {@link FlexTreeNodeSchema}.\n */\nexport type FlexTreeTypedNode<TSchema extends FlexTreeNodeSchema> =\n\tTSchema extends LeafNodeSchema\n\t\t? FlexTreeLeafNode<TSchema>\n\t\t: TSchema extends FlexMapNodeSchema\n\t\t\t? FlexTreeMapNode<TSchema>\n\t\t\t: TSchema extends FlexObjectNodeSchema\n\t\t\t\t? FlexTreeObjectNodeTyped<TSchema>\n\t\t\t\t: FlexTreeNode;\n\n// #endregion\n\n// #region Unbox\n\n/**\n * Schema aware unboxed field.\n * @remarks\n * Unboxes fields to their content if appropriate for the kind.\n * Recursively unboxes that content (then its content etc.) as well if the node union does unboxing.\n */\nexport type FlexTreeUnboxField<\n\tTSchema extends FlexFieldSchema,\n\t// If \"notEmpty\", then optional fields will unbox to their content (not their content | undefined)\n\tEmptiness extends \"maybeEmpty\" | \"notEmpty\" = \"maybeEmpty\",\n> = FlexTreeUnboxFieldInner<TSchema[\"kind\"], TSchema[\"allowedTypes\"], Emptiness>;\n\n/**\n * Helper for implementing FlexTreeUnboxField.\n */\nexport type FlexTreeUnboxFieldInner<\n\tKind extends FlexFieldKind,\n\tTTypes extends FlexAllowedTypes,\n\tEmptiness extends \"maybeEmpty\" | \"notEmpty\",\n> = Kind extends typeof FieldKinds.sequence\n\t? FlexTreeSequenceField<TTypes>\n\t: Kind extends typeof FieldKinds.required\n\t\t? FlexTreeUnboxNodeUnion<TTypes>\n\t\t: Kind extends typeof FieldKinds.optional\n\t\t\t? FlexTreeUnboxNodeUnion<TTypes> | (Emptiness extends \"notEmpty\" ? never : undefined)\n\t\t\t: // TODO: forbidden\n\t\t\t\tunknown;\n\n/**\n * Schema aware unboxed union of tree types.\n * @remarks\n * Unboxes when not polymorphic.\n * Recursively unboxes that content as well if the node kind does unboxing.\n */\nexport type FlexTreeUnboxNodeUnion<TTypes extends FlexAllowedTypes> = TTypes extends readonly [\n\tLazyItem<infer InnerType>,\n]\n\t? InnerType extends FlexTreeNodeSchema\n\t\t? FlexTreeUnboxNode<InnerType>\n\t\t: InnerType extends Any\n\t\t\t? FlexTreeNode\n\t\t\t: // This case should not occur. If the result ever ends up unknown, look at places like this to debug.\n\t\t\t\tunknown\n\t: boolean extends IsArrayOfOne<TTypes>\n\t\t? FlexTreeUnknownUnboxed // Unknown if this will unbox. This should mainly happen when TTypes is AllowedTypes.\n\t\t: FlexTreeTypedNodeUnion<TTypes>; // Known to not be a single type, so known not to unbox.\n\n/**\n * `true` if T is known to be an array of one item.\n * `false` if T is known not to be an array of one item.\n * `boolean` if it is unknown if T is an array of one item or not.\n */\nexport type IsArrayOfOne<T extends readonly unknown[]> = T[\"length\"] extends 1\n\t? true\n\t: 1 extends T[\"length\"]\n\t\t? boolean\n\t\t: false;\n\n/**\n * Schema aware unboxed tree type.\n * @remarks\n * Unboxes if the node kind does unboxing.\n * Recursively unboxes that content as well if it does unboxing.\n */\nexport type FlexTreeUnboxNode<TSchema extends FlexTreeNodeSchema> =\n\tTSchema extends LeafNodeSchema\n\t\t? TreeValue<TSchema[\"info\"]>\n\t\t: TSchema extends FlexMapNodeSchema\n\t\t\t? FlexTreeMapNode<TSchema>\n\t\t\t: TSchema extends FlexObjectNodeSchema\n\t\t\t\t? FlexTreeObjectNodeTyped<TSchema>\n\t\t\t\t: FlexTreeUnknownUnboxed;\n\n/**\n * Unboxed tree type for unknown schema cases.\n */\nexport type FlexTreeUnknownUnboxed = TreeValue | FlexTreeNode;\n\n// #endregion\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export { type FlexTreeField, type FlexTreeNode, type FlexTreeEntity, type FlexTreeTypedField, type
|
|
5
|
+
export { type FlexTreeField, type FlexTreeNode, type FlexTreeEntity, type FlexTreeTypedField, type FlexibleFieldContent, type FlexibleNodeContent, type FlexTreeLeafNode, type FlexTreeMapNode, type FlexTreeOptionalField, type FlexTreeRequiredField, type FlexTreeSequenceField, type FlexTreeObjectNode, type FlexTreeObjectNodeTyped, type AssignableFieldKinds, type FlexTreeTypedNode, type FlexTreeTypedNodeUnion, type CheckTypesOverlap, TreeStatus, type FlexTreeUnknownUnboxed, type FlexTreeUnboxField, flexTreeMarker, FlexTreeEntityKind, isFlexTreeNode, type PropertyNameFromFieldKey, type ReservedObjectNodeFieldPropertyNames, type ReservedObjectNodeFieldPropertyNamePrefixes, reservedObjectNodeFieldPropertyNames, reservedObjectNodeFieldPropertyNamePrefixes, type FlexTreeObjectNodeFieldsInner, flexTreeSlot, } from "./flexTreeTypes.js";
|
|
6
6
|
export { visitBipartiteIterableTree, Skip, visitBipartiteIterableTreeWithState, visitIterableTree, visitIterableTreeWithState, } from "./navigation.js";
|
|
7
7
|
export { getTreeContext, type FlexTreeContext, Context, ContextSlot } from "./context.js";
|
|
8
8
|
export { type FlexTreeNodeEvents } from "./treeEvents.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,UAAU,EACV,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,KAAK,wBAAwB,EAC7B,KAAK,oCAAoC,EACzC,KAAK,2CAA2C,EAChD,oCAAoC,EACpC,2CAA2C,EAC3C,KAAK,6BAA6B,EAClC,YAAY,GACZ,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACN,0BAA0B,EAC1B,IAAI,EACJ,mCAAmC,EACnC,iBAAiB,EACjB,0BAA0B,GAC1B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,cAAc,EAAE,KAAK,eAAe,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE1F,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAG1D,YAAY,EACX,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,EACjB,sBAAsB,EACtB,YAAY,EACZ,uBAAuB,GACvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACN,4BAA4B,EAC5B,aAAa,EACb,UAAU,GACV,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEhE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uDA+B4B;AAb3B,8GAAA,UAAU,OAAA;AAGV,kHAAA,cAAc,OAAA;AACd,sHAAA,kBAAkB,OAAA;AAClB,kHAAA,cAAc,OAAA;AAId,wIAAA,oCAAoC,OAAA;AACpC,+IAAA,2CAA2C,OAAA;AAE3C,gHAAA,YAAY,OAAA;AAGb,iDAMyB;AALxB,2HAAA,0BAA0B,OAAA;AAC1B,qGAAA,IAAI,OAAA;AACJ,oIAAA,mCAAmC,OAAA;AACnC,kHAAA,iBAAiB,OAAA;AACjB,2HAAA,0BAA0B,OAAA;AAG3B,2CAA0F;AAAjF,4GAAA,cAAc,OAAA;AAAwB,qGAAA,OAAO,OAAA;AAAE,yGAAA,WAAW,OAAA;AAenE,iDAIyB;AAHxB,6HAAA,4BAA4B,OAAA;AAC5B,8GAAA,aAAa,OAAA;AACb,2GAAA,UAAU,OAAA;AAGX,+CAAgE;AAAvD,kHAAA,kBAAkB,OAAA;AAAE,0GAAA,UAAU,OAAA;AAEvC,+CAA2D;AAAlD,yHAAA,yBAAyB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\ttype FlexTreeEntity,\n\ttype FlexTreeTypedField,\n\ttype FlexibleFieldContent,\n\ttype FlexibleNodeContent,\n\ttype FlexTreeLeafNode,\n\ttype FlexTreeMapNode,\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\ttype FlexTreeObjectNode,\n\ttype FlexTreeObjectNodeTyped,\n\ttype AssignableFieldKinds,\n\ttype FlexTreeTypedNode,\n\ttype FlexTreeTypedNodeUnion,\n\ttype CheckTypesOverlap,\n\tTreeStatus,\n\ttype FlexTreeUnknownUnboxed,\n\ttype FlexTreeUnboxField,\n\tflexTreeMarker,\n\tFlexTreeEntityKind,\n\tisFlexTreeNode,\n\ttype PropertyNameFromFieldKey,\n\ttype ReservedObjectNodeFieldPropertyNames,\n\ttype ReservedObjectNodeFieldPropertyNamePrefixes,\n\treservedObjectNodeFieldPropertyNames,\n\treservedObjectNodeFieldPropertyNamePrefixes,\n\ttype FlexTreeObjectNodeFieldsInner,\n\tflexTreeSlot,\n} from \"./flexTreeTypes.js\";\n\nexport {\n\tvisitBipartiteIterableTree,\n\tSkip,\n\tvisitBipartiteIterableTreeWithState,\n\tvisitIterableTree,\n\tvisitIterableTreeWithState,\n} from \"./navigation.js\";\n\nexport { getTreeContext, type FlexTreeContext, Context, ContextSlot } from \"./context.js\";\n\nexport { type FlexTreeNodeEvents } from \"./treeEvents.js\";\n\n// Below here are things that are used by the above, but not part of the desired API surface.\nexport type {\n\tFlexTreeTypedFieldInner,\n\tFlexTreeUnboxFieldInner,\n\tFlexTreeObjectNodeFields,\n\tFlexTreeUnboxNode,\n\tFlexTreeUnboxNodeUnion,\n\tIsArrayOfOne,\n\tFlexibleNodeSubSequence,\n} from \"./flexTreeTypes.js\";\n\nexport {\n\tassertFlexTreeEntityNotFreed,\n\tisFreedSymbol,\n\tLazyEntity,\n} from \"./lazyEntity.js\";\n\nexport { getSchemaAndPolicy, indexForAt } from \"./utilities.js\";\n\nexport { treeStatusFromAnchorCache } from \"./utilities.js\";\n"]}
|
|
@@ -2,17 +2,16 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { type FieldAnchor, type FieldKey, type FieldUpPath, type ITreeSubscriptionCursor, type TreeNavigationResult } from "../../core/index.js";
|
|
6
|
-
import { FieldKinds, type SequenceFieldEditBuilder } from "../default-schema/index.js";
|
|
5
|
+
import { type ExclusiveMapTree, type FieldAnchor, type FieldKey, type FieldUpPath, type ITreeSubscriptionCursor, type TreeNavigationResult } from "../../core/index.js";
|
|
6
|
+
import { FieldKinds, type OptionalFieldEditBuilder, type SequenceFieldEditBuilder, type ValueFieldEditBuilder } from "../default-schema/index.js";
|
|
7
7
|
import type { FlexFieldKind } from "../modular-schema/index.js";
|
|
8
8
|
import type { FlexAllowedTypes, FlexFieldSchema } from "../typed-schema/index.js";
|
|
9
9
|
import type { Context } from "./context.js";
|
|
10
|
-
import { FlexTreeEntityKind, type FlexTreeField, type FlexTreeNode, type FlexTreeOptionalField, type FlexTreeRequiredField, type FlexTreeSequenceField, type FlexTreeTypedField, type FlexTreeTypedNodeUnion, type FlexTreeUnboxNodeUnion,
|
|
10
|
+
import { FlexTreeEntityKind, type FlexTreeField, type FlexTreeNode, type FlexTreeOptionalField, type FlexTreeRequiredField, type FlexTreeSequenceField, type FlexTreeTypedField, type FlexTreeTypedNodeUnion, type FlexTreeUnboxNodeUnion, flexTreeMarker } from "./flexTreeTypes.js";
|
|
11
11
|
import { LazyEntity, forgetAnchorSymbol, tryMoveCursorToAnchorSymbol } from "./lazyEntity.js";
|
|
12
12
|
export declare function makeField(context: Context, schema: FlexFieldSchema, cursor: ITreeSubscriptionCursor): FlexTreeField;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
15
|
-
* the nodes of {@link EditableField} by means of the cursors.
|
|
14
|
+
* Base type for fields implementing {@link FlexTreeField} using cursors.
|
|
16
15
|
*/
|
|
17
16
|
export declare abstract class LazyField<out TKind extends FlexFieldKind, TTypes extends FlexAllowedTypes> extends LazyEntity<FlexFieldSchema<TKind, TTypes>, FieldAnchor> implements FlexTreeField {
|
|
18
17
|
get [flexTreeMarker](): FlexTreeEntityKind.Field;
|
|
@@ -45,44 +44,28 @@ export declare class LazySequence<TTypes extends FlexAllowedTypes> extends LazyF
|
|
|
45
44
|
constructor(context: Context, schema: FlexFieldSchema<typeof FieldKinds.sequence, TTypes>, cursor: ITreeSubscriptionCursor, fieldAnchor: FieldAnchor);
|
|
46
45
|
at(index: number): FlexTreeUnboxNodeUnion<TTypes> | undefined;
|
|
47
46
|
get asArray(): readonly FlexTreeUnboxNodeUnion<TTypes>[];
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
insertAtStart(value: FlexibleNodeSubSequence<TTypes>): void;
|
|
51
|
-
insertAtEnd(value: FlexibleNodeSubSequence<TTypes>): void;
|
|
52
|
-
removeAt(index: number): void;
|
|
53
|
-
moveToStart(sourceIndex: number): void;
|
|
54
|
-
moveToStart(sourceIndex: number, source: FlexTreeSequenceField<FlexAllowedTypes>): void;
|
|
55
|
-
moveToEnd(sourceIndex: number): void;
|
|
56
|
-
moveToEnd(sourceIndex: number, source: FlexTreeSequenceField<FlexAllowedTypes>): void;
|
|
57
|
-
moveToIndex(index: number, sourceIndex: number): void;
|
|
58
|
-
moveToIndex(index: number, sourceIndex: number, source: FlexTreeSequenceField<FlexAllowedTypes>): void;
|
|
59
|
-
moveRangeToStart(sourceStart: number, sourceEnd: number): void;
|
|
60
|
-
moveRangeToStart(sourceStart: number, sourceEnd: number, source: FlexTreeSequenceField<FlexAllowedTypes>): void;
|
|
61
|
-
moveRangeToEnd(sourceStart: number, sourceEnd: number): void;
|
|
62
|
-
moveRangeToEnd(sourceStart: number, sourceEnd: number, source: FlexTreeSequenceField<FlexAllowedTypes>): void;
|
|
63
|
-
moveRangeToIndex(index: number, sourceStart: number, sourceEnd: number): void;
|
|
64
|
-
moveRangeToIndex(index: number, sourceStart: number, sourceEnd: number, source: FlexTreeSequenceField<FlexAllowedTypes>): void;
|
|
65
|
-
private _moveRangeToIndex;
|
|
47
|
+
editor: SequenceFieldEditBuilder<ExclusiveMapTree[]>;
|
|
48
|
+
private sequenceEditor;
|
|
66
49
|
}
|
|
67
50
|
export declare class ReadonlyLazyValueField<TTypes extends FlexAllowedTypes> extends LazyField<typeof FieldKinds.required, TTypes> implements FlexTreeRequiredField<TTypes> {
|
|
68
51
|
constructor(context: Context, schema: FlexFieldSchema<typeof FieldKinds.required, TTypes>, cursor: ITreeSubscriptionCursor, fieldAnchor: FieldAnchor);
|
|
52
|
+
editor: ValueFieldEditBuilder<ExclusiveMapTree>;
|
|
69
53
|
get content(): FlexTreeUnboxNodeUnion<TTypes>;
|
|
70
|
-
set content(newContent: FlexibleNodeContent<TTypes>);
|
|
71
54
|
}
|
|
72
55
|
export declare class LazyValueField<TTypes extends FlexAllowedTypes> extends ReadonlyLazyValueField<TTypes> implements FlexTreeRequiredField<TTypes> {
|
|
73
56
|
constructor(context: Context, schema: FlexFieldSchema<typeof FieldKinds.required, TTypes>, cursor: ITreeSubscriptionCursor, fieldAnchor: FieldAnchor);
|
|
57
|
+
editor: ValueFieldEditBuilder<ExclusiveMapTree>;
|
|
74
58
|
private valueFieldEditor;
|
|
75
59
|
get content(): FlexTreeUnboxNodeUnion<TTypes>;
|
|
76
|
-
set content(newContent: FlexibleNodeContent<TTypes>);
|
|
77
60
|
}
|
|
78
61
|
export declare class LazyIdentifierField<TTypes extends FlexAllowedTypes> extends ReadonlyLazyValueField<TTypes> implements FlexTreeRequiredField<TTypes> {
|
|
79
62
|
constructor(context: Context, schema: FlexFieldSchema<typeof FieldKinds.required, TTypes>, cursor: ITreeSubscriptionCursor, fieldAnchor: FieldAnchor);
|
|
80
63
|
}
|
|
81
64
|
export declare class LazyOptionalField<TTypes extends FlexAllowedTypes> extends LazyField<typeof FieldKinds.optional, TTypes> implements FlexTreeOptionalField<TTypes> {
|
|
82
65
|
constructor(context: Context, schema: FlexFieldSchema<typeof FieldKinds.optional, TTypes>, cursor: ITreeSubscriptionCursor, fieldAnchor: FieldAnchor);
|
|
66
|
+
editor: OptionalFieldEditBuilder<ExclusiveMapTree>;
|
|
83
67
|
private optionalEditor;
|
|
84
68
|
get content(): FlexTreeUnboxNodeUnion<TTypes> | undefined;
|
|
85
|
-
set content(newContent: FlexibleNodeContent<TTypes> | undefined);
|
|
86
69
|
}
|
|
87
70
|
export declare class LazyForbiddenField<TTypes extends FlexAllowedTypes> extends LazyField<typeof FieldKinds.forbidden, TTypes> {
|
|
88
71
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazyField.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/lazyField.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAEN,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,WAAW,EAEhB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,
|
|
1
|
+
{"version":3,"file":"lazyField.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/lazyField.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAEN,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,WAAW,EAEhB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EAIzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACN,UAAU,EACV,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAElF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EACN,kBAAkB,EAClB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAE3B,cAAc,EAEd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,UAAU,EAGV,kBAAkB,EAElB,2BAA2B,EAC3B,MAAM,iBAAiB,CAAC;AAuBzB,wBAAgB,SAAS,CACxB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,uBAAuB,GAC7B,aAAa,CA2Cf;AAED;;GAEG;AACH,8BAAsB,SAAS,CAC7B,GAAG,CAAC,KAAK,SAAS,aAAa,EAC/B,MAAM,SAAS,gBAAgB,CAEhC,SAAQ,UAAU,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,WAAW,CAC9D,YAAW,aAAa;IAExB,IAAW,CAAC,cAAc,CAAC,IAAI,kBAAkB,CAAC,KAAK,CAEtD;IACD,SAAgB,GAAG,EAAE,QAAQ,CAAC;IAE9B;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAa;gBAG7C,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,EACtC,MAAM,EAAE,uBAAuB,EAC/B,WAAW,EAAE,WAAW;IAiBlB,EAAE,CAAC,OAAO,SAAS,eAAe,EACxC,MAAM,EAAE,OAAO,GACb,IAAI,IAAI,kBAAkB,CAAC,OAAO,CAAC;IAStC,IAAW,MAAM,IAAI,YAAY,GAAG,SAAS,CAU5C;cAEkB,CAAC,2BAA2B,CAAC,CAC/C,MAAM,EAAE,uBAAuB,GAC7B,oBAAoB;cAIJ,CAAC,kBAAkB,CAAC,IAAI,IAAI;IAM/C,IAAW,MAAM,IAAI,MAAM,CAE1B;IAEM,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,sBAAsB,CAAC,MAAM,CAAC;IAMtD,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,sBAAsB,CAAC,MAAM,CAAC,GAAG,SAAS;IAYlE,GAAG,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,KAAK,EAAE,sBAAsB,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC,GAAG,CAAC,EAAE;IAIpF,QAAQ,CAAC,CAAC,EAChB,UAAU,EAAE,CAAC,KAAK,EAAE,sBAAsB,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC,GACrE,CAAC,EAAE;IAIC,aAAa,IAAI,gBAAgB,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAOjE,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,gBAAgB,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAMrE,YAAY,IAAI,WAAW;IAIlC;;;OAGG;IACI,sBAAsB,IAAI,WAAW;CAe5C;AAED,qBAAa,YAAY,CAAC,MAAM,SAAS,gBAAgB,CACxD,SAAQ,SAAS,CAAC,OAAO,UAAU,CAAC,QAAQ,EAAE,MAAM,CACpD,YAAW,qBAAqB,CAAC,MAAM,CAAC;gBAGvC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,eAAe,CAAC,OAAO,UAAU,CAAC,QAAQ,EAAE,MAAM,CAAC,EAC3D,MAAM,EAAE,uBAAuB,EAC/B,WAAW,EAAE,WAAW;IAKlB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,sBAAsB,CAAC,MAAM,CAAC,GAAG,SAAS;IAWpE,IAAW,OAAO,IAAI,SAAS,sBAAsB,CAAC,MAAM,CAAC,EAAE,CAE9D;IAEM,MAAM,EAAE,wBAAwB,CAAC,gBAAgB,EAAE,CAAC,CAOzD;IAEF,OAAO,CAAC,cAAc;CAItB;AAED,qBAAa,sBAAsB,CAAC,MAAM,SAAS,gBAAgB,CAClE,SAAQ,SAAS,CAAC,OAAO,UAAU,CAAC,QAAQ,EAAE,MAAM,CACpD,YAAW,qBAAqB,CAAC,MAAM,CAAC;gBAGvC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,eAAe,CAAC,OAAO,UAAU,CAAC,QAAQ,EAAE,MAAM,CAAC,EAC3D,MAAM,EAAE,uBAAuB,EAC/B,WAAW,EAAE,WAAW;IAKlB,MAAM,EAAE,qBAAqB,CAAC,gBAAgB,CAAC,CAIpD;IAEF,IAAW,OAAO,IAAI,sBAAsB,CAAC,MAAM,CAAC,CAEnD;CACD;AAED,qBAAa,cAAc,CAAC,MAAM,SAAS,gBAAgB,CAC1D,SAAQ,sBAAsB,CAAC,MAAM,CACrC,YAAW,qBAAqB,CAAC,MAAM,CAAC;gBAGvC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,eAAe,CAAC,OAAO,UAAU,CAAC,QAAQ,EAAE,MAAM,CAAC,EAC3D,MAAM,EAAE,uBAAuB,EAC/B,WAAW,EAAE,WAAW;IAKT,MAAM,EAAE,qBAAqB,CAAC,gBAAgB,CAAC,CAI7D;IAEF,OAAO,CAAC,gBAAgB;IAMxB,IAAoB,OAAO,IAAI,sBAAsB,CAAC,MAAM,CAAC,CAE5D;CACD;AAED,qBAAa,mBAAmB,CAAC,MAAM,SAAS,gBAAgB,CAC/D,SAAQ,sBAAsB,CAAC,MAAM,CACrC,YAAW,qBAAqB,CAAC,MAAM,CAAC;gBAGvC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,eAAe,CAAC,OAAO,UAAU,CAAC,QAAQ,EAAE,MAAM,CAAC,EAC3D,MAAM,EAAE,uBAAuB,EAC/B,WAAW,EAAE,WAAW;CAIzB;AAED,qBAAa,iBAAiB,CAAC,MAAM,SAAS,gBAAgB,CAC7D,SAAQ,SAAS,CAAC,OAAO,UAAU,CAAC,QAAQ,EAAE,MAAM,CACpD,YAAW,qBAAqB,CAAC,MAAM,CAAC;gBAGvC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,eAAe,CAAC,OAAO,UAAU,CAAC,QAAQ,EAAE,MAAM,CAAC,EAC3D,MAAM,EAAE,uBAAuB,EAC/B,WAAW,EAAE,WAAW;IAKlB,MAAM,EAAE,wBAAwB,CAAC,gBAAgB,CAAC,CAOvD;IAEF,OAAO,CAAC,cAAc;IAMtB,IAAW,OAAO,IAAI,sBAAsB,CAAC,MAAM,CAAC,GAAG,SAAS,CAE/D;CACD;AAED,qBAAa,kBAAkB,CAAC,MAAM,SAAS,gBAAgB,CAAE,SAAQ,SAAS,CACjF,OAAO,UAAU,CAAC,SAAS,EAC3B,MAAM,CACN;CAAG"}
|
|
@@ -8,16 +8,14 @@ exports.LazyForbiddenField = exports.LazyOptionalField = exports.LazyIdentifierF
|
|
|
8
8
|
const internal_1 = require("@fluidframework/core-utils/internal");
|
|
9
9
|
const index_js_1 = require("../../core/index.js");
|
|
10
10
|
const index_js_2 = require("../../util/index.js");
|
|
11
|
-
// TODO: stop depending on contextuallyTyped
|
|
12
|
-
const contextuallyTyped_js_1 = require("../contextuallyTyped.js");
|
|
13
11
|
const index_js_3 = require("../default-schema/index.js");
|
|
14
|
-
const mapTreeCursor_js_1 = require("../mapTreeCursor.js");
|
|
15
12
|
const flexTreeTypes_js_1 = require("./flexTreeTypes.js");
|
|
16
13
|
const lazyEntity_js_1 = require("./lazyEntity.js");
|
|
17
14
|
const lazyNode_js_1 = require("./lazyNode.js");
|
|
18
15
|
const unboxed_js_1 = require("./unboxed.js");
|
|
19
16
|
const utilities_js_1 = require("./utilities.js");
|
|
20
17
|
const internal_2 = require("@fluidframework/telemetry-utils/internal");
|
|
18
|
+
const mapTreeCursor_js_1 = require("../mapTreeCursor.js");
|
|
21
19
|
/**
|
|
22
20
|
* Reuse fields.
|
|
23
21
|
* Since field currently own cursors and register themselves for disposal when the node hit end of life,
|
|
@@ -63,8 +61,7 @@ function makeField(context, schema, cursor) {
|
|
|
63
61
|
}
|
|
64
62
|
exports.makeField = makeField;
|
|
65
63
|
/**
|
|
66
|
-
*
|
|
67
|
-
* the nodes of {@link EditableField} by means of the cursors.
|
|
64
|
+
* Base type for fields implementing {@link FlexTreeField} using cursors.
|
|
68
65
|
*/
|
|
69
66
|
class LazyField extends lazyEntity_js_1.LazyEntity {
|
|
70
67
|
get [flexTreeTypes_js_1.flexTreeMarker]() {
|
|
@@ -157,6 +154,14 @@ exports.LazyField = LazyField;
|
|
|
157
154
|
class LazySequence extends LazyField {
|
|
158
155
|
constructor(context, schema, cursor, fieldAnchor) {
|
|
159
156
|
super(context, schema, cursor, fieldAnchor);
|
|
157
|
+
this.editor = {
|
|
158
|
+
insert: (index, newContent) => {
|
|
159
|
+
this.sequenceEditor().insert(index, (0, mapTreeCursor_js_1.cursorForMapTreeField)(newContent));
|
|
160
|
+
},
|
|
161
|
+
remove: (index, count) => {
|
|
162
|
+
this.sequenceEditor().remove(index, count);
|
|
163
|
+
},
|
|
164
|
+
};
|
|
160
165
|
}
|
|
161
166
|
at(index) {
|
|
162
167
|
const finalIndex = (0, utilities_js_1.indexForAt)(index, this.length);
|
|
@@ -170,81 +175,32 @@ class LazySequence extends LazyField {
|
|
|
170
175
|
}
|
|
171
176
|
sequenceEditor() {
|
|
172
177
|
const fieldPath = this.getFieldPathForEditing();
|
|
173
|
-
|
|
174
|
-
return fieldEditor;
|
|
175
|
-
}
|
|
176
|
-
insertAt(index, value) {
|
|
177
|
-
(0, index_js_2.assertValidIndex)(index, this, true);
|
|
178
|
-
const content = (0, index_js_1.isCursor)(value)
|
|
179
|
-
? prepareFieldCursorForInsert(value)
|
|
180
|
-
: (0, mapTreeCursor_js_1.cursorForMapTreeField)(Array.from(value, (item) => (0, contextuallyTyped_js_1.applyTypesFromContext)(this.context, this.schema.allowedTypeSet, item)));
|
|
181
|
-
const fieldEditor = this.sequenceEditor();
|
|
182
|
-
fieldEditor.insert(index, content);
|
|
183
|
-
}
|
|
184
|
-
insertAtStart(value) {
|
|
185
|
-
this.insertAt(0, value);
|
|
186
|
-
}
|
|
187
|
-
insertAtEnd(value) {
|
|
188
|
-
this.insertAt(this.length, value);
|
|
189
|
-
}
|
|
190
|
-
removeAt(index) {
|
|
191
|
-
const fieldEditor = this.sequenceEditor();
|
|
192
|
-
fieldEditor.remove(index, 1);
|
|
193
|
-
}
|
|
194
|
-
moveToStart(sourceIndex, source) {
|
|
195
|
-
this._moveRangeToIndex(0, sourceIndex, sourceIndex + 1, source);
|
|
196
|
-
}
|
|
197
|
-
moveToEnd(sourceIndex, source) {
|
|
198
|
-
this._moveRangeToIndex(this.length, sourceIndex, sourceIndex + 1, source);
|
|
199
|
-
}
|
|
200
|
-
moveToIndex(index, sourceIndex, source) {
|
|
201
|
-
this._moveRangeToIndex(index, sourceIndex, sourceIndex + 1, source);
|
|
202
|
-
}
|
|
203
|
-
moveRangeToStart(sourceStart, sourceEnd, source) {
|
|
204
|
-
this._moveRangeToIndex(0, sourceStart, sourceEnd, source);
|
|
205
|
-
}
|
|
206
|
-
moveRangeToEnd(sourceStart, sourceEnd, source) {
|
|
207
|
-
this._moveRangeToIndex(this.length, sourceStart, sourceEnd, source);
|
|
208
|
-
}
|
|
209
|
-
moveRangeToIndex(index, sourceStart, sourceEnd, source) {
|
|
210
|
-
this._moveRangeToIndex(index, sourceStart, sourceEnd, source);
|
|
211
|
-
}
|
|
212
|
-
_moveRangeToIndex(index, sourceStart, sourceEnd, source) {
|
|
213
|
-
const sourceField = source ?? this;
|
|
214
|
-
// TODO: determine support for move across different sequence types
|
|
215
|
-
(0, internal_1.assert)(sourceField instanceof LazySequence, 0x7b1 /* Unsupported sequence implementation. */);
|
|
216
|
-
(0, index_js_2.assertValidRangeIndices)(sourceStart, sourceEnd, sourceField);
|
|
217
|
-
if (this.schema.types !== undefined && sourceField !== this) {
|
|
218
|
-
for (let i = sourceStart; i < sourceEnd; i++) {
|
|
219
|
-
const sourceNode = sourceField.boxedAt(sourceStart) ?? (0, index_js_2.fail)("impossible out of bounds index");
|
|
220
|
-
if (!this.schema.types.has(sourceNode.schema.name)) {
|
|
221
|
-
throw new Error("Type in source sequence is not allowed in destination.");
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
const movedCount = sourceEnd - sourceStart;
|
|
226
|
-
(0, index_js_2.assertValidIndex)(index, this, true);
|
|
227
|
-
const sourceFieldPath = sourceField.getFieldPath();
|
|
228
|
-
const destinationFieldPath = this.getFieldPath();
|
|
229
|
-
this.context.checkout.editor.move(sourceFieldPath, sourceStart, movedCount, destinationFieldPath, index);
|
|
178
|
+
return this.context.checkout.editor.sequenceField(fieldPath);
|
|
230
179
|
}
|
|
231
180
|
}
|
|
232
181
|
exports.LazySequence = LazySequence;
|
|
233
182
|
class ReadonlyLazyValueField extends LazyField {
|
|
234
183
|
constructor(context, schema, cursor, fieldAnchor) {
|
|
235
184
|
super(context, schema, cursor, fieldAnchor);
|
|
185
|
+
this.editor = {
|
|
186
|
+
set: (newContent) => {
|
|
187
|
+
(0, internal_1.assert)(false, 0xa0c /* Unexpected set of readonly field */);
|
|
188
|
+
},
|
|
189
|
+
};
|
|
236
190
|
}
|
|
237
191
|
get content() {
|
|
238
192
|
return this.atIndex(0);
|
|
239
193
|
}
|
|
240
|
-
set content(newContent) {
|
|
241
|
-
(0, index_js_2.fail)("cannot set content in readonly field");
|
|
242
|
-
}
|
|
243
194
|
}
|
|
244
195
|
exports.ReadonlyLazyValueField = ReadonlyLazyValueField;
|
|
245
196
|
class LazyValueField extends ReadonlyLazyValueField {
|
|
246
197
|
constructor(context, schema, cursor, fieldAnchor) {
|
|
247
198
|
super(context, schema, cursor, fieldAnchor);
|
|
199
|
+
this.editor = {
|
|
200
|
+
set: (newContent) => {
|
|
201
|
+
this.valueFieldEditor().set((0, mapTreeCursor_js_1.cursorForMapTreeNode)(newContent));
|
|
202
|
+
},
|
|
203
|
+
};
|
|
248
204
|
}
|
|
249
205
|
valueFieldEditor() {
|
|
250
206
|
const fieldPath = this.getFieldPathForEditing();
|
|
@@ -254,14 +210,6 @@ class LazyValueField extends ReadonlyLazyValueField {
|
|
|
254
210
|
get content() {
|
|
255
211
|
return this.atIndex(0);
|
|
256
212
|
}
|
|
257
|
-
set content(newContent) {
|
|
258
|
-
const content = (0, index_js_1.isCursor)(newContent)
|
|
259
|
-
? prepareNodeCursorForInsert(newContent)
|
|
260
|
-
: [(0, contextuallyTyped_js_1.cursorFromContextualData)(this.context, this.schema.allowedTypeSet, newContent)];
|
|
261
|
-
const fieldEditor = this.valueFieldEditor();
|
|
262
|
-
(0, internal_1.assert)(content.length === 1, 0x780 /* value field content should normalize to one item */);
|
|
263
|
-
fieldEditor.set(content[0]);
|
|
264
|
-
}
|
|
265
213
|
}
|
|
266
214
|
exports.LazyValueField = LazyValueField;
|
|
267
215
|
class LazyIdentifierField extends ReadonlyLazyValueField {
|
|
@@ -273,6 +221,11 @@ exports.LazyIdentifierField = LazyIdentifierField;
|
|
|
273
221
|
class LazyOptionalField extends LazyField {
|
|
274
222
|
constructor(context, schema, cursor, fieldAnchor) {
|
|
275
223
|
super(context, schema, cursor, fieldAnchor);
|
|
224
|
+
this.editor = {
|
|
225
|
+
set: (newContent, wasEmpty) => {
|
|
226
|
+
this.optionalEditor().set(newContent !== undefined ? (0, mapTreeCursor_js_1.cursorForMapTreeNode)(newContent) : newContent, wasEmpty);
|
|
227
|
+
},
|
|
228
|
+
};
|
|
276
229
|
}
|
|
277
230
|
optionalEditor() {
|
|
278
231
|
const fieldPath = this.getFieldPathForEditing();
|
|
@@ -282,16 +235,6 @@ class LazyOptionalField extends LazyField {
|
|
|
282
235
|
get content() {
|
|
283
236
|
return this.length === 0 ? undefined : this.atIndex(0);
|
|
284
237
|
}
|
|
285
|
-
set content(newContent) {
|
|
286
|
-
const content = newContent === undefined
|
|
287
|
-
? []
|
|
288
|
-
: (0, index_js_1.isCursor)(newContent)
|
|
289
|
-
? prepareNodeCursorForInsert(newContent)
|
|
290
|
-
: [(0, contextuallyTyped_js_1.cursorFromContextualData)(this.context, this.schema.allowedTypeSet, newContent)];
|
|
291
|
-
const fieldEditor = this.optionalEditor();
|
|
292
|
-
(0, internal_1.assert)(content.length <= 1, 0x781 /* optional field content should normalize at most one item */);
|
|
293
|
-
fieldEditor.set(content.length === 0 ? undefined : content[0], this.length === 0);
|
|
294
|
-
}
|
|
295
238
|
}
|
|
296
239
|
exports.LazyOptionalField = LazyOptionalField;
|
|
297
240
|
class LazyForbiddenField extends LazyField {
|
|
@@ -305,20 +248,4 @@ const builderList = [
|
|
|
305
248
|
[index_js_3.FieldKinds.identifier, LazyIdentifierField],
|
|
306
249
|
];
|
|
307
250
|
const kindToClass = new Map(builderList);
|
|
308
|
-
/**
|
|
309
|
-
* Prepare a fields cursor (holding a sequence of nodes) for inserting.
|
|
310
|
-
*/
|
|
311
|
-
function prepareFieldCursorForInsert(cursor) {
|
|
312
|
-
// TODO: optionally validate content against schema.
|
|
313
|
-
(0, internal_1.assert)(cursor.mode === 1 /* CursorLocationType.Fields */, 0x8cb /* should be in fields mode */);
|
|
314
|
-
return cursor;
|
|
315
|
-
}
|
|
316
|
-
/**
|
|
317
|
-
* Prepare a node cursor (holding a single node) for inserting.
|
|
318
|
-
*/
|
|
319
|
-
function prepareNodeCursorForInsert(cursor) {
|
|
320
|
-
// TODO: optionally validate content against schema.
|
|
321
|
-
(0, internal_1.assert)(cursor.mode === 0 /* CursorLocationType.Nodes */, 0x805 /* should be in nodes mode */);
|
|
322
|
-
return [cursor];
|
|
323
|
-
}
|
|
324
251
|
//# sourceMappingURL=lazyField.js.map
|