@fluidframework/tree 2.0.0-dev-rc.5.0.0.271045 → 2.0.0-dev-rc.5.0.0.271717
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/.eslintrc.cjs +5 -0
- package/api-report/tree.alpha.api.md +10 -21
- package/api-report/tree.beta.api.md +10 -21
- package/api-report/tree.public.api.md +10 -21
- package/dist/beta.d.ts +0 -1
- package/dist/codec/codec.d.ts +2 -2
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +0 -1
- package/dist/codec/codec.js.map +1 -1
- package/dist/codec/discriminatedUnions.d.ts +2 -2
- package/dist/codec/discriminatedUnions.d.ts.map +1 -1
- package/dist/codec/discriminatedUnions.js +0 -1
- package/dist/codec/discriminatedUnions.js.map +1 -1
- package/dist/codec/noopValidator.d.ts +1 -1
- package/dist/codec/noopValidator.d.ts.map +1 -1
- package/dist/codec/noopValidator.js.map +1 -1
- package/dist/codec/versioned/codec.d.ts +3 -3
- package/dist/codec/versioned/codec.d.ts.map +1 -1
- package/dist/codec/versioned/codec.js.map +1 -1
- package/dist/codec/versioned/format.d.ts +1 -1
- package/dist/codec/versioned/format.d.ts.map +1 -1
- package/dist/codec/versioned/format.js.map +1 -1
- package/dist/core/change-family/changeFamily.d.ts +5 -5
- package/dist/core/change-family/changeFamily.d.ts.map +1 -1
- package/dist/core/change-family/changeFamily.js.map +1 -1
- package/dist/core/change-family/editBuilder.d.ts +1 -1
- package/dist/core/change-family/editBuilder.d.ts.map +1 -1
- package/dist/core/change-family/editBuilder.js +0 -2
- package/dist/core/change-family/editBuilder.js.map +1 -1
- package/dist/core/forest/editableForest.d.ts +5 -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 +3 -3
- package/dist/core/forest/forest.d.ts.map +1 -1
- package/dist/core/forest/forest.js.map +1 -1
- package/dist/core/rebase/changeRebaser.d.ts +1 -1
- package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
- package/dist/core/rebase/changeRebaser.js.map +1 -1
- package/dist/core/rebase/revisionTagCodec.d.ts +4 -4
- package/dist/core/rebase/revisionTagCodec.d.ts.map +1 -1
- package/dist/core/rebase/revisionTagCodec.js +0 -2
- package/dist/core/rebase/revisionTagCodec.js.map +1 -1
- package/dist/core/rebase/types.d.ts +3 -3
- package/dist/core/rebase/types.d.ts.map +1 -1
- package/dist/core/rebase/types.js.map +1 -1
- package/dist/core/rebase/utils.d.ts +2 -2
- package/dist/core/rebase/utils.d.ts.map +1 -1
- package/dist/core/rebase/utils.js.map +1 -1
- package/dist/core/schema-stored/format.d.ts +2 -2
- package/dist/core/schema-stored/format.d.ts.map +1 -1
- package/dist/core/schema-stored/format.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +3 -3
- 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 +3 -3
- package/dist/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.js +1 -3
- package/dist/core/schema-stored/storedSchemaRepository.js.map +1 -1
- package/dist/core/schema-view/view.d.ts +1 -1
- package/dist/core/schema-view/view.d.ts.map +1 -1
- package/dist/core/schema-view/view.js +0 -2
- package/dist/core/schema-view/view.js.map +1 -1
- package/dist/core/tree/anchorSet.d.ts +56 -18
- package/dist/core/tree/anchorSet.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.js +97 -52
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/cursor.d.ts +3 -3
- package/dist/core/tree/cursor.d.ts.map +1 -1
- package/dist/core/tree/cursor.js.map +1 -1
- package/dist/core/tree/delta.d.ts +3 -3
- package/dist/core/tree/delta.d.ts.map +1 -1
- package/dist/core/tree/delta.js.map +1 -1
- package/dist/core/tree/deltaUtil.d.ts +2 -2
- package/dist/core/tree/deltaUtil.d.ts.map +1 -1
- package/dist/core/tree/deltaUtil.js.map +1 -1
- package/dist/core/tree/detachedFieldIndex.d.ts +7 -7
- package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndex.js +2 -8
- package/dist/core/tree/detachedFieldIndex.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodec.d.ts +4 -4
- package/dist/core/tree/detachedFieldIndexCodec.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodec.js +0 -3
- package/dist/core/tree/detachedFieldIndexCodec.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormat.d.ts +2 -2
- package/dist/core/tree/detachedFieldIndexFormat.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormat.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexTypes.d.ts +3 -3
- package/dist/core/tree/detachedFieldIndexTypes.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexTypes.js.map +1 -1
- package/dist/core/tree/mapTree.d.ts +2 -2
- package/dist/core/tree/mapTree.d.ts.map +1 -1
- package/dist/core/tree/mapTree.js.map +1 -1
- package/dist/core/tree/pathTree.d.ts +3 -3
- package/dist/core/tree/pathTree.d.ts.map +1 -1
- package/dist/core/tree/pathTree.js.map +1 -1
- package/dist/core/tree/persistedTreeTextFormat.d.ts +1 -1
- package/dist/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
- package/dist/core/tree/persistedTreeTextFormat.js.map +1 -1
- package/dist/core/tree/sparseTree.d.ts +2 -2
- package/dist/core/tree/sparseTree.d.ts.map +1 -1
- package/dist/core/tree/sparseTree.js +11 -15
- package/dist/core/tree/sparseTree.js.map +1 -1
- package/dist/core/tree/treeTextFormat.d.ts +2 -2
- package/dist/core/tree/treeTextFormat.d.ts.map +1 -1
- package/dist/core/tree/treeTextFormat.js.map +1 -1
- package/dist/core/tree/types.d.ts +3 -3
- package/dist/core/tree/types.d.ts.map +1 -1
- package/dist/core/tree/types.js +0 -1
- package/dist/core/tree/types.js.map +1 -1
- package/dist/core/tree/visitDelta.d.ts +5 -5
- package/dist/core/tree/visitDelta.d.ts.map +1 -1
- package/dist/core/tree/visitDelta.js.map +1 -1
- package/dist/core/tree/visitPath.d.ts +2 -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 +7 -7
- package/dist/core/tree/visitorUtils.d.ts.map +1 -1
- package/dist/core/tree/visitorUtils.js.map +1 -1
- package/dist/domains/json/jsonCursor.d.ts +2 -2
- package/dist/domains/json/jsonCursor.d.ts.map +1 -1
- package/dist/domains/json/jsonCursor.js.map +1 -1
- package/dist/domains/json/jsonDomainSchema.js.map +1 -1
- package/dist/domains/schemaBuilder.d.ts +2 -2
- package/dist/domains/schemaBuilder.d.ts.map +1 -1
- package/dist/domains/schemaBuilder.js +70 -70
- package/dist/domains/schemaBuilder.js.map +1 -1
- package/dist/events/events.js +1 -2
- package/dist/events/events.js.map +1 -1
- package/dist/feature-libraries/changeAtomIdCodec.d.ts +2 -2
- package/dist/feature-libraries/changeAtomIdCodec.d.ts.map +1 -1
- package/dist/feature-libraries/changeAtomIdCodec.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.d.ts +2 -2
- package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.js +1 -14
- package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunk.d.ts +2 -2
- 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.d.ts +4 -4
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js +6 -13
- package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts +4 -4
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.js +2 -9
- package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts +3 -3
- package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js +3 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +17 -7
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +6 -11
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +8 -8
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js +2 -5
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +3 -3
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +0 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +6 -5
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +4 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +7 -7
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +13 -25
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/fieldBatch.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/fieldBatch.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/fieldBatch.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/formatGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.d.ts +5 -5
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.js +5 -8
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncoding.d.ts +6 -6
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncoding.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncoding.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +2 -2
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/emptyChunk.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/emptyChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/emptyChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/sequenceChunk.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/sequenceChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/sequenceChunk.js +0 -1
- package/dist/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts +2 -2
- package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.js +5 -40
- package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/dist/feature-libraries/contextuallyTyped.d.ts +5 -5
- package/dist/feature-libraries/contextuallyTyped.d.ts.map +1 -1
- package/dist/feature-libraries/contextuallyTyped.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +3 -3
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js +0 -2
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +3 -3
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultSchema.d.ts +1 -1
- package/dist/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultSchema.js.map +1 -1
- package/dist/feature-libraries/default-schema/noChangeCodecs.d.ts +2 -2
- package/dist/feature-libraries/default-schema/noChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/noChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/deltaUtils.d.ts +1 -1
- package/dist/feature-libraries/deltaUtils.d.ts.map +1 -1
- package/dist/feature-libraries/deltaUtils.js.map +1 -1
- package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts +4 -4
- package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/detachedFieldIndexSummarizer.js +1 -2
- package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
- package/dist/feature-libraries/editableTreeBinder.d.ts +3 -3
- package/dist/feature-libraries/editableTreeBinder.d.ts.map +1 -1
- package/dist/feature-libraries/editableTreeBinder.js +12 -13
- package/dist/feature-libraries/editableTreeBinder.js.map +1 -1
- package/dist/feature-libraries/fieldGenerator.d.ts +2 -2
- package/dist/feature-libraries/fieldGenerator.d.ts.map +1 -1
- package/dist/feature-libraries/fieldGenerator.js.map +1 -1
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts +5 -5
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.js +11 -12
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
- package/dist/feature-libraries/flex-tree/context.d.ts +8 -8
- package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/context.js +3 -7
- package/dist/feature-libraries/flex-tree/context.js.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +9 -9
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- 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 +1 -4
- package/dist/feature-libraries/flex-tree/index.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyEntity.d.ts +4 -4
- package/dist/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyEntity.js +22 -13
- package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.d.ts +6 -6
- package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +0 -6
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts +5 -5
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.js +19 -13
- package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/dist/feature-libraries/flex-tree/treeEvents.d.ts +1 -13
- package/dist/feature-libraries/flex-tree/treeEvents.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/treeEvents.js +0 -31
- package/dist/feature-libraries/flex-tree/treeEvents.js.map +1 -1
- package/dist/feature-libraries/flex-tree/unboxed.d.ts +5 -5
- package/dist/feature-libraries/flex-tree/unboxed.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/unboxed.js.map +1 -1
- package/dist/feature-libraries/flex-tree/utilities.d.ts +1 -1
- package/dist/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/utilities.js.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.d.ts +3 -3
- package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +7 -7
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +1 -6
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/forest-summary/format.d.ts +1 -1
- package/dist/feature-libraries/forest-summary/format.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/format.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +1 -1
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +1 -3
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/mapTreeCursor.d.ts +2 -2
- package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
- package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
- package/dist/feature-libraries/memoizedIdRangeAllocator.d.ts +1 -1
- package/dist/feature-libraries/memoizedIdRangeAllocator.d.ts.map +1 -1
- package/dist/feature-libraries/memoizedIdRangeAllocator.js.map +1 -1
- package/dist/feature-libraries/mitigatedChangeFamily.d.ts +1 -1
- package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +7 -7
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKind.d.ts +1 -1
- package/dist/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKind.js +0 -2
- package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKindConfiguration.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.d.ts +3 -3
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js +0 -3
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts +4 -4
- package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindFormat.d.ts +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindFormat.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindFormat.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindTypes.d.ts +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindTypes.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindTypes.js.map +1 -1
- package/dist/feature-libraries/modular-schema/isNeverTree.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +5 -5
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +2 -0
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +6 -6
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +2 -5
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts +3 -3
- package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormat.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +3 -3
- 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/mockNodeKeyManager.d.ts +2 -2
- package/dist/feature-libraries/node-key/mockNodeKeyManager.d.ts.map +1 -1
- package/dist/feature-libraries/node-key/mockNodeKeyManager.js +4 -2
- package/dist/feature-libraries/node-key/mockNodeKeyManager.js.map +1 -1
- package/dist/feature-libraries/node-key/nodeKey.d.ts +3 -3
- package/dist/feature-libraries/node-key/nodeKey.d.ts.map +1 -1
- package/dist/feature-libraries/node-key/nodeKey.js.map +1 -1
- package/dist/feature-libraries/node-key/nodeKeyIndex.d.ts +4 -4
- package/dist/feature-libraries/node-key/nodeKeyIndex.d.ts.map +1 -1
- package/dist/feature-libraries/node-key/nodeKeyIndex.js +0 -3
- package/dist/feature-libraries/node-key/nodeKeyIndex.js.map +1 -1
- package/dist/feature-libraries/node-key/nodeKeyManager.d.ts +1 -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 +2 -2
- package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.js +28 -23
- package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.d.ts +3 -3
- package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.js +3 -1
- package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +2 -2
- package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV1.d.ts +3 -3
- package/dist/feature-libraries/optional-field/optionalFieldCodecV1.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV1.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +3 -3
- package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts +2 -2
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-aware/schemaAware.d.ts +4 -4
- package/dist/feature-libraries/schema-aware/schemaAware.d.ts.map +1 -1
- package/dist/feature-libraries/schema-aware/schemaAware.js +0 -2
- package/dist/feature-libraries/schema-aware/schemaAware.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +2 -2
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeTypes.d.ts +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeTypes.js.map +1 -1
- package/dist/feature-libraries/schema-index/codec.d.ts +2 -2
- package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/feature-libraries/schema-index/format.d.ts +1 -1
- package/dist/feature-libraries/schema-index/format.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/format.js.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +7 -7
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.js +1 -5
- package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/dist/feature-libraries/schemaBuilder.d.ts +2 -2
- package/dist/feature-libraries/schemaBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/schemaBuilder.js.map +1 -1
- package/dist/feature-libraries/schemaBuilderBase.d.ts +4 -4
- package/dist/feature-libraries/schemaBuilderBase.d.ts.map +1 -1
- package/dist/feature-libraries/schemaBuilderBase.js +3 -14
- package/dist/feature-libraries/schemaBuilderBase.js.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.d.ts +5 -5
- package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.js +0 -6
- package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV1.d.ts +1 -1
- package/dist/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV1.js.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV2.d.ts +1 -1
- package/dist/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV2.js.map +1 -1
- package/dist/feature-libraries/sequence-field/helperTypes.d.ts +1 -1
- 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/invert.d.ts +3 -3
- package/dist/feature-libraries/sequence-field/invert.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
- package/dist/feature-libraries/sequence-field/markListFactory.d.ts +1 -1
- package/dist/feature-libraries/sequence-field/markListFactory.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/markListFactory.js +4 -3
- package/dist/feature-libraries/sequence-field/markListFactory.js.map +1 -1
- package/dist/feature-libraries/sequence-field/markQueue.d.ts +2 -2
- package/dist/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/markQueue.js +2 -4
- package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
- package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts +5 -5
- 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/prune.d.ts +2 -2
- package/dist/feature-libraries/sequence-field/prune.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/prune.js.map +1 -1
- package/dist/feature-libraries/sequence-field/rebase.d.ts +3 -3
- package/dist/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/rebase.js +0 -6
- package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
- package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +3 -3
- package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -1
- package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts +2 -2
- package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts +3 -3
- package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldChangeRebaser.d.ts +2 -2
- package/dist/feature-libraries/sequence-field/sequenceFieldChangeRebaser.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldChangeRebaser.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +5 -5
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +5 -5
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +4 -4
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +3 -3
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +3 -3
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
- package/dist/feature-libraries/sequence-field/types.d.ts +2 -2
- 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 -5
- package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
- package/dist/feature-libraries/storedToViewSchema.d.ts +2 -2
- package/dist/feature-libraries/storedToViewSchema.d.ts.map +1 -1
- package/dist/feature-libraries/storedToViewSchema.js.map +1 -1
- package/dist/feature-libraries/treeCursorUtils.d.ts +1 -1
- package/dist/feature-libraries/treeCursorUtils.d.ts.map +1 -1
- package/dist/feature-libraries/treeCursorUtils.js +9 -13
- package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
- package/dist/feature-libraries/treeTextCursor.d.ts +2 -2
- package/dist/feature-libraries/treeTextCursor.d.ts.map +1 -1
- package/dist/feature-libraries/treeTextCursor.js.map +1 -1
- package/dist/feature-libraries/typed-schema/schemaCollection.d.ts +3 -3
- package/dist/feature-libraries/typed-schema/schemaCollection.d.ts.map +1 -1
- package/dist/feature-libraries/typed-schema/schemaCollection.js.map +1 -1
- package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts +4 -4
- package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
- package/dist/feature-libraries/typed-schema/typedTreeSchema.js +4 -23
- package/dist/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
- package/dist/feature-libraries/typed-schema/view.d.ts +4 -4
- package/dist/feature-libraries/typed-schema/view.d.ts.map +1 -1
- package/dist/feature-libraries/typed-schema/view.js +0 -7
- package/dist/feature-libraries/typed-schema/view.js.map +1 -1
- package/dist/feature-libraries/valueUtilities.d.ts +2 -2
- package/dist/feature-libraries/valueUtilities.d.ts.map +1 -1
- package/dist/feature-libraries/valueUtilities.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.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 +0 -1
- package/dist/shared-tree/schematizeTree.d.ts +3 -3
- package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
- 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 +10 -27
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +15 -11
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +13 -10
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +4 -4
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.d.ts +3 -3
- package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.js +11 -14
- package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts +4 -4
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js +3 -5
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFormat.d.ts +1 -1
- package/dist/shared-tree/sharedTreeChangeFormat.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFormat.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeTypes.d.ts +1 -1
- package/dist/shared-tree/sharedTreeChangeTypes.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeTypes.js.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts +3 -3
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.js +0 -2
- package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/dist/shared-tree/treeApi.d.ts +1 -1
- package/dist/shared-tree/treeApi.d.ts.map +1 -1
- package/dist/shared-tree/treeApi.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +7 -7
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +11 -22
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree/treeView.d.ts +3 -3
- package/dist/shared-tree/treeView.d.ts.map +1 -1
- package/dist/shared-tree/treeView.js +0 -6
- package/dist/shared-tree/treeView.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts +2 -2
- package/dist/shared-tree-core/branch.d.ts.map +1 -1
- package/dist/shared-tree-core/branch.js +25 -31
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/shared-tree-core/branchCommitEnricher.d.ts +2 -2
- package/dist/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
- package/dist/shared-tree-core/branchCommitEnricher.js +9 -12
- package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
- package/dist/shared-tree-core/changeEnricher.d.ts +1 -1
- package/dist/shared-tree-core/changeEnricher.d.ts.map +1 -1
- package/dist/shared-tree-core/changeEnricher.js.map +1 -1
- package/dist/shared-tree-core/defaultResubmitMachine.d.ts +2 -2
- package/dist/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
- package/dist/shared-tree-core/defaultResubmitMachine.js +19 -21
- package/dist/shared-tree-core/defaultResubmitMachine.js.map +1 -1
- package/dist/shared-tree-core/editManager.d.ts +3 -3
- package/dist/shared-tree-core/editManager.d.ts.map +1 -1
- package/dist/shared-tree-core/editManager.js +37 -53
- package/dist/shared-tree-core/editManager.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts +5 -5
- package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormat.d.ts +4 -4
- package/dist/shared-tree-core/editManagerFormat.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormat.js.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.d.ts +9 -9
- package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.js +1 -5
- package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/dist/shared-tree-core/messageCodecs.d.ts +5 -5
- package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/messageFormat.d.ts +4 -4
- package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormat.js.map +1 -1
- package/dist/shared-tree-core/messageTypes.d.ts +2 -2
- package/dist/shared-tree-core/messageTypes.d.ts.map +1 -1
- package/dist/shared-tree-core/messageTypes.js.map +1 -1
- package/dist/shared-tree-core/resubmitMachine.d.ts +1 -1
- package/dist/shared-tree-core/resubmitMachine.d.ts.map +1 -1
- package/dist/shared-tree-core/resubmitMachine.js.map +1 -1
- package/dist/shared-tree-core/sequenceIdUtils.d.ts +1 -1
- package/dist/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
- package/dist/shared-tree-core/sequenceIdUtils.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts +10 -10
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +7 -24
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/shared-tree-core/transactionEnricher.d.ts +2 -2
- package/dist/shared-tree-core/transactionEnricher.d.ts.map +1 -1
- package/dist/shared-tree-core/transactionEnricher.js +1 -3
- package/dist/shared-tree-core/transactionEnricher.js.map +1 -1
- package/dist/shared-tree-core/transactionStack.d.ts +1 -1
- package/dist/shared-tree-core/transactionStack.d.ts.map +1 -1
- package/dist/shared-tree-core/transactionStack.js +3 -1
- package/dist/shared-tree-core/transactionStack.js.map +1 -1
- package/dist/simple-tree/arrayNode.d.ts +2 -2
- package/dist/simple-tree/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/arrayNode.js +34 -26
- package/dist/simple-tree/arrayNode.js.map +1 -1
- 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 +2 -4
- package/dist/simple-tree/leafNodeSchema.js.map +1 -1
- package/dist/simple-tree/mapNode.d.ts +2 -2
- package/dist/simple-tree/mapNode.d.ts.map +1 -1
- package/dist/simple-tree/mapNode.js +5 -5
- package/dist/simple-tree/mapNode.js.map +1 -1
- package/dist/simple-tree/nodeKeys.d.ts +2 -2
- package/dist/simple-tree/nodeKeys.d.ts.map +1 -1
- package/dist/simple-tree/nodeKeys.js.map +1 -1
- package/dist/simple-tree/objectNode.d.ts +5 -5
- package/dist/simple-tree/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/objectNode.js +6 -6
- package/dist/simple-tree/objectNode.js.map +1 -1
- package/dist/simple-tree/proxies.d.ts +4 -4
- package/dist/simple-tree/proxies.d.ts.map +1 -1
- package/dist/simple-tree/proxies.js +6 -4
- package/dist/simple-tree/proxies.js.map +1 -1
- package/dist/simple-tree/proxyBinding.d.ts +6 -6
- package/dist/simple-tree/proxyBinding.d.ts.map +1 -1
- package/dist/simple-tree/proxyBinding.js.map +1 -1
- package/dist/simple-tree/schemaCaching.d.ts +2 -2
- package/dist/simple-tree/schemaCaching.d.ts.map +1 -1
- package/dist/simple-tree/schemaCaching.js.map +1 -1
- package/dist/simple-tree/schemaCreationUtilities.d.ts +5 -5
- package/dist/simple-tree/schemaCreationUtilities.d.ts.map +1 -1
- package/dist/simple-tree/schemaCreationUtilities.js.map +1 -1
- package/dist/simple-tree/schemaFactory.d.ts +25 -12
- package/dist/simple-tree/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/schemaFactory.js +65 -53
- package/dist/simple-tree/schemaFactory.js.map +1 -1
- package/dist/simple-tree/schemaFactoryRecursive.d.ts +6 -6
- package/dist/simple-tree/schemaFactoryRecursive.d.ts.map +1 -1
- package/dist/simple-tree/schemaFactoryRecursive.js.map +1 -1
- package/dist/simple-tree/schemaTypes.d.ts +6 -6
- package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
- package/dist/simple-tree/schemaTypes.js +3 -12
- package/dist/simple-tree/schemaTypes.js.map +1 -1
- package/dist/simple-tree/testRecursiveDomain.d.ts +1 -1
- package/dist/simple-tree/testRecursiveDomain.d.ts.map +1 -1
- package/dist/simple-tree/testRecursiveDomain.js.map +1 -1
- package/dist/simple-tree/toFlexSchema.d.ts +4 -4
- package/dist/simple-tree/toFlexSchema.d.ts.map +1 -1
- package/dist/simple-tree/toFlexSchema.js.map +1 -1
- package/dist/simple-tree/toMapTree.d.ts +2 -2
- package/dist/simple-tree/toMapTree.d.ts.map +1 -1
- package/dist/simple-tree/toMapTree.js.map +1 -1
- package/dist/simple-tree/tree.d.ts +6 -27
- package/dist/simple-tree/tree.d.ts.map +1 -1
- package/dist/simple-tree/tree.js +0 -21
- package/dist/simple-tree/tree.js.map +1 -1
- package/dist/simple-tree/treeNodeApi.d.ts +30 -27
- package/dist/simple-tree/treeNodeApi.d.ts.map +1 -1
- package/dist/simple-tree/treeNodeApi.js +8 -3
- package/dist/simple-tree/treeNodeApi.js.map +1 -1
- package/dist/simple-tree/types.d.ts +29 -9
- package/dist/simple-tree/types.d.ts.map +1 -1
- package/dist/simple-tree/types.js +79 -54
- package/dist/simple-tree/types.js.map +1 -1
- package/dist/simple-tree/typesUnsafe.d.ts +5 -5
- package/dist/simple-tree/typesUnsafe.d.ts.map +1 -1
- package/dist/simple-tree/typesUnsafe.js.map +1 -1
- package/dist/treeFactory.d.ts +5 -5
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +10 -9
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/brand.js +0 -1
- package/dist/util/brand.js.map +1 -1
- package/dist/util/brandedMap.d.ts +1 -1
- package/dist/util/brandedMap.d.ts.map +1 -1
- package/dist/util/brandedMap.js.map +1 -1
- package/dist/util/nestedMap.d.ts +1 -1
- package/dist/util/nestedMap.d.ts.map +1 -1
- package/dist/util/nestedMap.js +4 -2
- package/dist/util/nestedMap.js.map +1 -1
- package/dist/util/nestedSet.d.ts +1 -1
- package/dist/util/nestedSet.d.ts.map +1 -1
- package/dist/util/nestedSet.js.map +1 -1
- package/dist/util/offsetList.js +4 -2
- package/dist/util/offsetList.js.map +1 -1
- package/dist/util/referenceCounting.js +0 -1
- package/dist/util/referenceCounting.js.map +1 -1
- package/dist/util/stackyIterator.js +2 -3
- package/dist/util/stackyIterator.js.map +1 -1
- package/dist/util/typeboxBrand.d.ts +1 -1
- package/dist/util/typeboxBrand.d.ts.map +1 -1
- package/dist/util/typeboxBrand.js.map +1 -1
- package/lib/beta.d.ts +0 -1
- package/lib/codec/codec.d.ts +2 -2
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +0 -1
- package/lib/codec/codec.js.map +1 -1
- package/lib/codec/discriminatedUnions.d.ts +2 -2
- package/lib/codec/discriminatedUnions.d.ts.map +1 -1
- package/lib/codec/discriminatedUnions.js +0 -1
- package/lib/codec/discriminatedUnions.js.map +1 -1
- package/lib/codec/noopValidator.d.ts +1 -1
- package/lib/codec/noopValidator.d.ts.map +1 -1
- package/lib/codec/noopValidator.js.map +1 -1
- package/lib/codec/versioned/codec.d.ts +3 -3
- package/lib/codec/versioned/codec.d.ts.map +1 -1
- package/lib/codec/versioned/codec.js.map +1 -1
- package/lib/codec/versioned/format.d.ts +1 -1
- package/lib/codec/versioned/format.d.ts.map +1 -1
- package/lib/codec/versioned/format.js.map +1 -1
- package/lib/core/change-family/changeFamily.d.ts +5 -5
- package/lib/core/change-family/changeFamily.d.ts.map +1 -1
- package/lib/core/change-family/changeFamily.js.map +1 -1
- package/lib/core/change-family/editBuilder.d.ts +1 -1
- package/lib/core/change-family/editBuilder.d.ts.map +1 -1
- package/lib/core/change-family/editBuilder.js +0 -2
- package/lib/core/change-family/editBuilder.js.map +1 -1
- package/lib/core/forest/editableForest.d.ts +5 -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 +3 -3
- package/lib/core/forest/forest.d.ts.map +1 -1
- package/lib/core/forest/forest.js.map +1 -1
- package/lib/core/rebase/changeRebaser.d.ts +1 -1
- package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
- package/lib/core/rebase/changeRebaser.js.map +1 -1
- package/lib/core/rebase/revisionTagCodec.d.ts +4 -4
- package/lib/core/rebase/revisionTagCodec.d.ts.map +1 -1
- package/lib/core/rebase/revisionTagCodec.js +0 -2
- package/lib/core/rebase/revisionTagCodec.js.map +1 -1
- package/lib/core/rebase/types.d.ts +3 -3
- package/lib/core/rebase/types.d.ts.map +1 -1
- package/lib/core/rebase/types.js.map +1 -1
- package/lib/core/rebase/utils.d.ts +2 -2
- package/lib/core/rebase/utils.d.ts.map +1 -1
- package/lib/core/rebase/utils.js.map +1 -1
- package/lib/core/schema-stored/format.d.ts +2 -2
- package/lib/core/schema-stored/format.d.ts.map +1 -1
- package/lib/core/schema-stored/format.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +3 -3
- 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 +3 -3
- package/lib/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.js +1 -3
- package/lib/core/schema-stored/storedSchemaRepository.js.map +1 -1
- package/lib/core/schema-view/view.d.ts +1 -1
- package/lib/core/schema-view/view.d.ts.map +1 -1
- package/lib/core/schema-view/view.js +0 -2
- package/lib/core/schema-view/view.js.map +1 -1
- package/lib/core/tree/anchorSet.d.ts +56 -18
- package/lib/core/tree/anchorSet.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.js +97 -52
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/core/tree/cursor.d.ts +3 -3
- package/lib/core/tree/cursor.d.ts.map +1 -1
- package/lib/core/tree/cursor.js.map +1 -1
- package/lib/core/tree/delta.d.ts +3 -3
- package/lib/core/tree/delta.d.ts.map +1 -1
- package/lib/core/tree/delta.js.map +1 -1
- package/lib/core/tree/deltaUtil.d.ts +2 -2
- package/lib/core/tree/deltaUtil.d.ts.map +1 -1
- package/lib/core/tree/deltaUtil.js.map +1 -1
- package/lib/core/tree/detachedFieldIndex.d.ts +7 -7
- package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndex.js +2 -8
- package/lib/core/tree/detachedFieldIndex.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodec.d.ts +4 -4
- package/lib/core/tree/detachedFieldIndexCodec.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodec.js +1 -4
- package/lib/core/tree/detachedFieldIndexCodec.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormat.d.ts +2 -2
- package/lib/core/tree/detachedFieldIndexFormat.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormat.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexTypes.d.ts +3 -3
- package/lib/core/tree/detachedFieldIndexTypes.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexTypes.js.map +1 -1
- package/lib/core/tree/mapTree.d.ts +2 -2
- package/lib/core/tree/mapTree.d.ts.map +1 -1
- package/lib/core/tree/mapTree.js.map +1 -1
- package/lib/core/tree/pathTree.d.ts +3 -3
- package/lib/core/tree/pathTree.d.ts.map +1 -1
- package/lib/core/tree/pathTree.js.map +1 -1
- package/lib/core/tree/persistedTreeTextFormat.d.ts +1 -1
- package/lib/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
- package/lib/core/tree/persistedTreeTextFormat.js.map +1 -1
- package/lib/core/tree/sparseTree.d.ts +2 -2
- package/lib/core/tree/sparseTree.d.ts.map +1 -1
- package/lib/core/tree/sparseTree.js +11 -15
- package/lib/core/tree/sparseTree.js.map +1 -1
- package/lib/core/tree/treeTextFormat.d.ts +2 -2
- package/lib/core/tree/treeTextFormat.d.ts.map +1 -1
- package/lib/core/tree/treeTextFormat.js.map +1 -1
- package/lib/core/tree/types.d.ts +3 -3
- package/lib/core/tree/types.d.ts.map +1 -1
- package/lib/core/tree/types.js +1 -2
- package/lib/core/tree/types.js.map +1 -1
- package/lib/core/tree/visitDelta.d.ts +5 -5
- package/lib/core/tree/visitDelta.d.ts.map +1 -1
- package/lib/core/tree/visitDelta.js.map +1 -1
- package/lib/core/tree/visitPath.d.ts +2 -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 +7 -7
- package/lib/core/tree/visitorUtils.d.ts.map +1 -1
- package/lib/core/tree/visitorUtils.js.map +1 -1
- package/lib/domains/json/jsonCursor.d.ts +2 -2
- package/lib/domains/json/jsonCursor.d.ts.map +1 -1
- package/lib/domains/json/jsonCursor.js.map +1 -1
- package/lib/domains/json/jsonDomainSchema.js.map +1 -1
- package/lib/domains/schemaBuilder.d.ts +2 -2
- package/lib/domains/schemaBuilder.d.ts.map +1 -1
- package/lib/domains/schemaBuilder.js +70 -70
- package/lib/domains/schemaBuilder.js.map +1 -1
- package/lib/events/events.js +1 -2
- package/lib/events/events.js.map +1 -1
- package/lib/feature-libraries/changeAtomIdCodec.d.ts +2 -2
- package/lib/feature-libraries/changeAtomIdCodec.d.ts.map +1 -1
- package/lib/feature-libraries/changeAtomIdCodec.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.d.ts +2 -2
- package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.js +1 -14
- package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunk.d.ts +2 -2
- 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.d.ts +4 -4
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js +6 -13
- package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts +4 -4
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.js +2 -9
- package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts +3 -3
- package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js +3 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +17 -7
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +6 -11
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +8 -8
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js +3 -6
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +3 -3
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js +0 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +6 -5
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +5 -2
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +7 -7
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +13 -25
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/fieldBatch.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/fieldBatch.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/fieldBatch.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/formatGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.d.ts +5 -5
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.js +5 -8
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncoding.d.ts +6 -6
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncoding.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncoding.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +2 -2
- package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js +1 -1
- package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/emptyChunk.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/emptyChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/emptyChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/sequenceChunk.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/sequenceChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/sequenceChunk.js +0 -1
- package/lib/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts +2 -2
- package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js +5 -40
- package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/lib/feature-libraries/contextuallyTyped.d.ts +5 -5
- package/lib/feature-libraries/contextuallyTyped.d.ts.map +1 -1
- package/lib/feature-libraries/contextuallyTyped.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +3 -3
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js +0 -2
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +3 -3
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultSchema.d.ts +1 -1
- package/lib/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultSchema.js.map +1 -1
- package/lib/feature-libraries/default-schema/noChangeCodecs.d.ts +2 -2
- package/lib/feature-libraries/default-schema/noChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/noChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/deltaUtils.d.ts +1 -1
- package/lib/feature-libraries/deltaUtils.d.ts.map +1 -1
- package/lib/feature-libraries/deltaUtils.js +1 -1
- package/lib/feature-libraries/deltaUtils.js.map +1 -1
- package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts +4 -4
- package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/detachedFieldIndexSummarizer.js +1 -2
- package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
- package/lib/feature-libraries/editableTreeBinder.d.ts +3 -3
- package/lib/feature-libraries/editableTreeBinder.d.ts.map +1 -1
- package/lib/feature-libraries/editableTreeBinder.js +12 -13
- package/lib/feature-libraries/editableTreeBinder.js.map +1 -1
- package/lib/feature-libraries/fieldGenerator.d.ts +2 -2
- package/lib/feature-libraries/fieldGenerator.d.ts.map +1 -1
- package/lib/feature-libraries/fieldGenerator.js.map +1 -1
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts +5 -5
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.js +11 -12
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
- package/lib/feature-libraries/flex-tree/context.d.ts +8 -8
- package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/context.js +3 -7
- package/lib/feature-libraries/flex-tree/context.js.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +9 -9
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- 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 +0 -1
- package/lib/feature-libraries/flex-tree/index.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyEntity.d.ts +4 -4
- package/lib/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyEntity.js +23 -14
- package/lib/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.d.ts +6 -6
- package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +0 -6
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts +5 -5
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.js +19 -13
- package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/lib/feature-libraries/flex-tree/treeEvents.d.ts +1 -13
- package/lib/feature-libraries/flex-tree/treeEvents.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/treeEvents.js +1 -28
- package/lib/feature-libraries/flex-tree/treeEvents.js.map +1 -1
- package/lib/feature-libraries/flex-tree/unboxed.d.ts +5 -5
- package/lib/feature-libraries/flex-tree/unboxed.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/unboxed.js.map +1 -1
- package/lib/feature-libraries/flex-tree/utilities.d.ts +1 -1
- package/lib/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/utilities.js.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.d.ts +3 -3
- package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.js +1 -1
- package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +7 -7
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +1 -6
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/forest-summary/format.d.ts +1 -1
- package/lib/feature-libraries/forest-summary/format.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/format.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +1 -1
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +1 -1
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/mapTreeCursor.d.ts +2 -2
- package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
- package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
- package/lib/feature-libraries/memoizedIdRangeAllocator.d.ts +1 -1
- package/lib/feature-libraries/memoizedIdRangeAllocator.d.ts.map +1 -1
- package/lib/feature-libraries/memoizedIdRangeAllocator.js.map +1 -1
- package/lib/feature-libraries/mitigatedChangeFamily.d.ts +1 -1
- package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +7 -7
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKind.d.ts +1 -1
- package/lib/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKind.js +0 -2
- package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKindConfiguration.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.d.ts +3 -3
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js +0 -3
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts +4 -4
- package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindFormat.d.ts +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindFormat.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindFormat.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindTypes.d.ts +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindTypes.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindTypes.js.map +1 -1
- package/lib/feature-libraries/modular-schema/isNeverTree.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +5 -5
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +2 -0
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +6 -6
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +2 -5
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts +3 -3
- package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormat.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +3 -3
- 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/mockNodeKeyManager.d.ts +2 -2
- package/lib/feature-libraries/node-key/mockNodeKeyManager.d.ts.map +1 -1
- package/lib/feature-libraries/node-key/mockNodeKeyManager.js +4 -2
- package/lib/feature-libraries/node-key/mockNodeKeyManager.js.map +1 -1
- package/lib/feature-libraries/node-key/nodeKey.d.ts +3 -3
- package/lib/feature-libraries/node-key/nodeKey.d.ts.map +1 -1
- package/lib/feature-libraries/node-key/nodeKey.js.map +1 -1
- package/lib/feature-libraries/node-key/nodeKeyIndex.d.ts +4 -4
- package/lib/feature-libraries/node-key/nodeKeyIndex.d.ts.map +1 -1
- package/lib/feature-libraries/node-key/nodeKeyIndex.js +0 -3
- package/lib/feature-libraries/node-key/nodeKeyIndex.js.map +1 -1
- package/lib/feature-libraries/node-key/nodeKeyManager.d.ts +1 -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 +2 -2
- package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js +28 -23
- package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalField.d.ts +3 -3
- package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalField.js +3 -1
- package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +2 -2
- package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV1.d.ts +3 -3
- package/lib/feature-libraries/optional-field/optionalFieldCodecV1.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV1.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +3 -3
- package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts +2 -2
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
- package/lib/feature-libraries/schema-aware/schemaAware.d.ts +4 -4
- package/lib/feature-libraries/schema-aware/schemaAware.d.ts.map +1 -1
- package/lib/feature-libraries/schema-aware/schemaAware.js +1 -2
- package/lib/feature-libraries/schema-aware/schemaAware.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +2 -2
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeTypes.d.ts +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeTypes.js.map +1 -1
- package/lib/feature-libraries/schema-index/codec.d.ts +2 -2
- package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/codec.js +1 -1
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/feature-libraries/schema-index/format.d.ts +1 -1
- package/lib/feature-libraries/schema-index/format.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/format.js.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +7 -7
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.js +2 -6
- package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/lib/feature-libraries/schemaBuilder.d.ts +2 -2
- package/lib/feature-libraries/schemaBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/schemaBuilder.js.map +1 -1
- package/lib/feature-libraries/schemaBuilderBase.d.ts +4 -4
- package/lib/feature-libraries/schemaBuilderBase.d.ts.map +1 -1
- package/lib/feature-libraries/schemaBuilderBase.js +3 -14
- package/lib/feature-libraries/schemaBuilderBase.js.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.d.ts +5 -5
- package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.js +0 -6
- package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV1.d.ts +1 -1
- package/lib/feature-libraries/sequence-field/formatV1.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV1.js.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV2.d.ts +1 -1
- package/lib/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV2.js.map +1 -1
- package/lib/feature-libraries/sequence-field/helperTypes.d.ts +1 -1
- 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/invert.d.ts +3 -3
- package/lib/feature-libraries/sequence-field/invert.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
- package/lib/feature-libraries/sequence-field/markListFactory.d.ts +1 -1
- package/lib/feature-libraries/sequence-field/markListFactory.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/markListFactory.js +4 -3
- package/lib/feature-libraries/sequence-field/markListFactory.js.map +1 -1
- package/lib/feature-libraries/sequence-field/markQueue.d.ts +2 -2
- package/lib/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/markQueue.js +2 -4
- package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
- package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts +5 -5
- 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/prune.d.ts +2 -2
- package/lib/feature-libraries/sequence-field/prune.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/prune.js.map +1 -1
- package/lib/feature-libraries/sequence-field/rebase.d.ts +3 -3
- package/lib/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/rebase.js +0 -6
- package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
- package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +3 -3
- package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -1
- package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts +2 -2
- package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts +3 -3
- package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldChangeRebaser.d.ts +2 -2
- package/lib/feature-libraries/sequence-field/sequenceFieldChangeRebaser.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldChangeRebaser.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +5 -5
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +5 -5
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +4 -4
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +3 -3
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +3 -3
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
- package/lib/feature-libraries/sequence-field/types.d.ts +2 -2
- 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 -5
- package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
- package/lib/feature-libraries/storedToViewSchema.d.ts +2 -2
- package/lib/feature-libraries/storedToViewSchema.d.ts.map +1 -1
- package/lib/feature-libraries/storedToViewSchema.js.map +1 -1
- package/lib/feature-libraries/treeCursorUtils.d.ts +1 -1
- package/lib/feature-libraries/treeCursorUtils.d.ts.map +1 -1
- package/lib/feature-libraries/treeCursorUtils.js +9 -13
- package/lib/feature-libraries/treeCursorUtils.js.map +1 -1
- package/lib/feature-libraries/treeTextCursor.d.ts +2 -2
- package/lib/feature-libraries/treeTextCursor.d.ts.map +1 -1
- package/lib/feature-libraries/treeTextCursor.js +1 -1
- package/lib/feature-libraries/treeTextCursor.js.map +1 -1
- package/lib/feature-libraries/typed-schema/schemaCollection.d.ts +3 -3
- package/lib/feature-libraries/typed-schema/schemaCollection.d.ts.map +1 -1
- package/lib/feature-libraries/typed-schema/schemaCollection.js +1 -1
- package/lib/feature-libraries/typed-schema/schemaCollection.js.map +1 -1
- package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts +4 -4
- package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
- package/lib/feature-libraries/typed-schema/typedTreeSchema.js +4 -23
- package/lib/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
- package/lib/feature-libraries/typed-schema/view.d.ts +4 -4
- package/lib/feature-libraries/typed-schema/view.d.ts.map +1 -1
- package/lib/feature-libraries/typed-schema/view.js +0 -7
- package/lib/feature-libraries/typed-schema/view.js.map +1 -1
- package/lib/feature-libraries/valueUtilities.d.ts +2 -2
- package/lib/feature-libraries/valueUtilities.d.ts.map +1 -1
- package/lib/feature-libraries/valueUtilities.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.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 +0 -1
- package/lib/shared-tree/schematizeTree.d.ts +3 -3
- package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
- 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 +11 -28
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +15 -11
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +14 -11
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +4 -4
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.js +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.d.ts +3 -3
- package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.js +11 -14
- package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts +4 -4
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js +4 -6
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFormat.d.ts +1 -1
- package/lib/shared-tree/sharedTreeChangeFormat.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFormat.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeTypes.d.ts +1 -1
- package/lib/shared-tree/sharedTreeChangeTypes.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeTypes.js.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts +3 -3
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.js +0 -2
- package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/lib/shared-tree/treeApi.d.ts +1 -1
- package/lib/shared-tree/treeApi.d.ts.map +1 -1
- package/lib/shared-tree/treeApi.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +7 -7
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +12 -23
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree/treeView.d.ts +3 -3
- package/lib/shared-tree/treeView.d.ts.map +1 -1
- package/lib/shared-tree/treeView.js +0 -6
- package/lib/shared-tree/treeView.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts +2 -2
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +25 -31
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/shared-tree-core/branchCommitEnricher.d.ts +2 -2
- package/lib/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
- package/lib/shared-tree-core/branchCommitEnricher.js +9 -12
- package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
- package/lib/shared-tree-core/changeEnricher.d.ts +1 -1
- package/lib/shared-tree-core/changeEnricher.d.ts.map +1 -1
- package/lib/shared-tree-core/changeEnricher.js.map +1 -1
- package/lib/shared-tree-core/defaultResubmitMachine.d.ts +2 -2
- package/lib/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
- package/lib/shared-tree-core/defaultResubmitMachine.js +19 -21
- package/lib/shared-tree-core/defaultResubmitMachine.js.map +1 -1
- package/lib/shared-tree-core/editManager.d.ts +3 -3
- package/lib/shared-tree-core/editManager.d.ts.map +1 -1
- package/lib/shared-tree-core/editManager.js +37 -53
- package/lib/shared-tree-core/editManager.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts +5 -5
- package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormat.d.ts +4 -4
- package/lib/shared-tree-core/editManagerFormat.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormat.js.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.d.ts +9 -9
- package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.js +1 -5
- package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/lib/shared-tree-core/messageCodecs.d.ts +5 -5
- package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/messageFormat.d.ts +4 -4
- package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormat.js.map +1 -1
- package/lib/shared-tree-core/messageTypes.d.ts +2 -2
- package/lib/shared-tree-core/messageTypes.d.ts.map +1 -1
- package/lib/shared-tree-core/messageTypes.js.map +1 -1
- package/lib/shared-tree-core/resubmitMachine.d.ts +1 -1
- package/lib/shared-tree-core/resubmitMachine.d.ts.map +1 -1
- package/lib/shared-tree-core/resubmitMachine.js.map +1 -1
- package/lib/shared-tree-core/sequenceIdUtils.d.ts +1 -1
- package/lib/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
- package/lib/shared-tree-core/sequenceIdUtils.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts +10 -10
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +7 -24
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/shared-tree-core/transactionEnricher.d.ts +2 -2
- package/lib/shared-tree-core/transactionEnricher.d.ts.map +1 -1
- package/lib/shared-tree-core/transactionEnricher.js +1 -3
- package/lib/shared-tree-core/transactionEnricher.js.map +1 -1
- package/lib/shared-tree-core/transactionStack.d.ts +1 -1
- package/lib/shared-tree-core/transactionStack.d.ts.map +1 -1
- package/lib/shared-tree-core/transactionStack.js +3 -1
- package/lib/shared-tree-core/transactionStack.js.map +1 -1
- package/lib/simple-tree/arrayNode.d.ts +2 -2
- package/lib/simple-tree/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/arrayNode.js +35 -27
- package/lib/simple-tree/arrayNode.js.map +1 -1
- 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 +2 -4
- package/lib/simple-tree/leafNodeSchema.js.map +1 -1
- package/lib/simple-tree/mapNode.d.ts +2 -2
- package/lib/simple-tree/mapNode.d.ts.map +1 -1
- package/lib/simple-tree/mapNode.js +5 -5
- package/lib/simple-tree/mapNode.js.map +1 -1
- package/lib/simple-tree/nodeKeys.d.ts +2 -2
- package/lib/simple-tree/nodeKeys.d.ts.map +1 -1
- package/lib/simple-tree/nodeKeys.js.map +1 -1
- package/lib/simple-tree/objectNode.d.ts +5 -5
- package/lib/simple-tree/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/objectNode.js +6 -6
- package/lib/simple-tree/objectNode.js.map +1 -1
- package/lib/simple-tree/proxies.d.ts +4 -4
- package/lib/simple-tree/proxies.d.ts.map +1 -1
- package/lib/simple-tree/proxies.js +7 -5
- package/lib/simple-tree/proxies.js.map +1 -1
- package/lib/simple-tree/proxyBinding.d.ts +6 -6
- package/lib/simple-tree/proxyBinding.d.ts.map +1 -1
- package/lib/simple-tree/proxyBinding.js.map +1 -1
- package/lib/simple-tree/schemaCaching.d.ts +2 -2
- package/lib/simple-tree/schemaCaching.d.ts.map +1 -1
- package/lib/simple-tree/schemaCaching.js.map +1 -1
- package/lib/simple-tree/schemaCreationUtilities.d.ts +5 -5
- package/lib/simple-tree/schemaCreationUtilities.d.ts.map +1 -1
- package/lib/simple-tree/schemaCreationUtilities.js.map +1 -1
- package/lib/simple-tree/schemaFactory.d.ts +25 -12
- package/lib/simple-tree/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/schemaFactory.js +66 -54
- package/lib/simple-tree/schemaFactory.js.map +1 -1
- package/lib/simple-tree/schemaFactoryRecursive.d.ts +6 -6
- package/lib/simple-tree/schemaFactoryRecursive.d.ts.map +1 -1
- package/lib/simple-tree/schemaFactoryRecursive.js +1 -1
- package/lib/simple-tree/schemaFactoryRecursive.js.map +1 -1
- package/lib/simple-tree/schemaTypes.d.ts +6 -6
- package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
- package/lib/simple-tree/schemaTypes.js +3 -12
- package/lib/simple-tree/schemaTypes.js.map +1 -1
- package/lib/simple-tree/testRecursiveDomain.d.ts +1 -1
- package/lib/simple-tree/testRecursiveDomain.d.ts.map +1 -1
- package/lib/simple-tree/testRecursiveDomain.js.map +1 -1
- package/lib/simple-tree/toFlexSchema.d.ts +4 -4
- package/lib/simple-tree/toFlexSchema.d.ts.map +1 -1
- package/lib/simple-tree/toFlexSchema.js.map +1 -1
- package/lib/simple-tree/toMapTree.d.ts +2 -2
- package/lib/simple-tree/toMapTree.d.ts.map +1 -1
- package/lib/simple-tree/toMapTree.js.map +1 -1
- package/lib/simple-tree/tree.d.ts +6 -27
- package/lib/simple-tree/tree.d.ts.map +1 -1
- package/lib/simple-tree/tree.js +0 -21
- package/lib/simple-tree/tree.js.map +1 -1
- package/lib/simple-tree/treeNodeApi.d.ts +30 -27
- package/lib/simple-tree/treeNodeApi.d.ts.map +1 -1
- package/lib/simple-tree/treeNodeApi.js +8 -3
- package/lib/simple-tree/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/types.d.ts +29 -9
- package/lib/simple-tree/types.d.ts.map +1 -1
- package/lib/simple-tree/types.js +78 -54
- package/lib/simple-tree/types.js.map +1 -1
- package/lib/simple-tree/typesUnsafe.d.ts +5 -5
- package/lib/simple-tree/typesUnsafe.d.ts.map +1 -1
- package/lib/simple-tree/typesUnsafe.js.map +1 -1
- package/lib/treeFactory.d.ts +5 -5
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +10 -9
- package/lib/treeFactory.js.map +1 -1
- package/lib/util/brand.js +0 -1
- package/lib/util/brand.js.map +1 -1
- package/lib/util/brandedMap.d.ts +1 -1
- package/lib/util/brandedMap.d.ts.map +1 -1
- package/lib/util/brandedMap.js.map +1 -1
- package/lib/util/nestedMap.d.ts +1 -1
- package/lib/util/nestedMap.d.ts.map +1 -1
- package/lib/util/nestedMap.js +4 -2
- package/lib/util/nestedMap.js.map +1 -1
- package/lib/util/nestedSet.d.ts +1 -1
- package/lib/util/nestedSet.d.ts.map +1 -1
- package/lib/util/nestedSet.js.map +1 -1
- package/lib/util/offsetList.js +4 -2
- package/lib/util/offsetList.js.map +1 -1
- package/lib/util/referenceCounting.js +0 -1
- package/lib/util/referenceCounting.js.map +1 -1
- package/lib/util/stackyIterator.js +2 -3
- package/lib/util/stackyIterator.js.map +1 -1
- package/lib/util/typeboxBrand.d.ts +1 -1
- package/lib/util/typeboxBrand.d.ts.map +1 -1
- package/lib/util/typeboxBrand.js.map +1 -1
- package/package.json +20 -20
- package/src/codec/codec.ts +2 -2
- package/src/codec/discriminatedUnions.ts +2 -2
- package/src/codec/noopValidator.ts +1 -1
- package/src/codec/versioned/codec.ts +4 -4
- package/src/codec/versioned/format.ts +1 -1
- package/src/core/change-family/changeFamily.ts +5 -5
- package/src/core/change-family/editBuilder.ts +1 -1
- package/src/core/forest/editableForest.ts +9 -9
- package/src/core/forest/forest.ts +8 -8
- package/src/core/rebase/changeRebaser.ts +1 -1
- package/src/core/rebase/revisionTagCodec.ts +4 -4
- package/src/core/rebase/types.ts +5 -5
- package/src/core/rebase/utils.ts +6 -6
- package/src/core/schema-stored/format.ts +2 -2
- package/src/core/schema-stored/schema.ts +7 -7
- package/src/core/schema-stored/storedSchemaRepository.ts +6 -6
- package/src/core/schema-view/view.ts +1 -1
- package/src/core/tree/anchorSet.ts +115 -23
- package/src/core/tree/cursor.ts +3 -3
- package/src/core/tree/delta.ts +3 -3
- package/src/core/tree/deltaUtil.ts +4 -4
- package/src/core/tree/detachedFieldIndex.ts +11 -11
- package/src/core/tree/detachedFieldIndexCodec.ts +11 -7
- package/src/core/tree/detachedFieldIndexFormat.ts +2 -2
- package/src/core/tree/detachedFieldIndexTypes.ts +3 -3
- package/src/core/tree/mapTree.ts +2 -2
- package/src/core/tree/pathTree.ts +3 -3
- package/src/core/tree/persistedTreeTextFormat.ts +1 -1
- package/src/core/tree/sparseTree.ts +2 -2
- package/src/core/tree/treeTextFormat.ts +2 -2
- package/src/core/tree/types.ts +10 -4
- package/src/core/tree/visitDelta.ts +8 -8
- package/src/core/tree/visitPath.ts +2 -2
- package/src/core/tree/visitorUtils.ts +9 -9
- package/src/domains/json/jsonCursor.ts +5 -5
- package/src/domains/json/jsonDomainSchema.ts +2 -2
- package/src/domains/schemaBuilder.ts +9 -9
- package/src/feature-libraries/changeAtomIdCodec.ts +2 -2
- package/src/feature-libraries/chunked-forest/basicChunk.ts +9 -9
- package/src/feature-libraries/chunked-forest/chunk.ts +4 -4
- package/src/feature-libraries/chunked-forest/chunkTree.ts +12 -12
- package/src/feature-libraries/chunked-forest/chunkedForest.ts +17 -17
- package/src/feature-libraries/chunked-forest/codec/chunkCodecUtilities.ts +3 -3
- package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +33 -17
- package/src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts +12 -7
- package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +5 -5
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +14 -6
- package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +16 -16
- package/src/feature-libraries/chunked-forest/codec/fieldBatch.ts +1 -1
- package/src/feature-libraries/chunked-forest/codec/format.ts +1 -1
- package/src/feature-libraries/chunked-forest/codec/formatGeneric.ts +1 -1
- package/src/feature-libraries/chunked-forest/codec/nodeShape.ts +19 -14
- package/src/feature-libraries/chunked-forest/codec/schemaBasedEncoding.ts +11 -11
- package/src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts +10 -5
- package/src/feature-libraries/chunked-forest/emptyChunk.ts +5 -5
- package/src/feature-libraries/chunked-forest/sequenceChunk.ts +1 -1
- package/src/feature-libraries/chunked-forest/uniformChunk.ts +8 -8
- package/src/feature-libraries/contextuallyTyped.ts +12 -12
- package/src/feature-libraries/default-schema/defaultEditBuilder.ts +17 -17
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +11 -11
- package/src/feature-libraries/default-schema/defaultSchema.ts +1 -1
- package/src/feature-libraries/default-schema/noChangeCodecs.ts +2 -2
- package/src/feature-libraries/deltaUtils.ts +7 -2
- package/src/feature-libraries/detachedFieldIndexSummarizer.ts +5 -5
- package/src/feature-libraries/editableTreeBinder.ts +10 -10
- package/src/feature-libraries/fieldGenerator.ts +2 -2
- package/src/feature-libraries/flex-map-tree/mapTreeNode.ts +32 -32
- package/src/feature-libraries/flex-tree/context.ts +11 -11
- package/src/feature-libraries/flex-tree/flexTreeTypes.ts +15 -12
- package/src/feature-libraries/flex-tree/index.ts +1 -1
- package/src/feature-libraries/flex-tree/lazyEntity.ts +9 -4
- package/src/feature-libraries/flex-tree/lazyField.ts +22 -22
- package/src/feature-libraries/flex-tree/lazyNode.ts +32 -38
- package/src/feature-libraries/flex-tree/treeEvents.ts +1 -38
- package/src/feature-libraries/flex-tree/unboxed.ts +7 -7
- package/src/feature-libraries/flex-tree/utilities.ts +2 -2
- package/src/feature-libraries/forest-summary/codec.ts +7 -3
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +15 -15
- package/src/feature-libraries/forest-summary/format.ts +1 -1
- package/src/feature-libraries/index.ts +0 -2
- package/src/feature-libraries/mapTreeCursor.ts +6 -6
- package/src/feature-libraries/memoizedIdRangeAllocator.ts +3 -3
- package/src/feature-libraries/mitigatedChangeFamily.ts +1 -1
- package/src/feature-libraries/modular-schema/comparison.ts +6 -6
- package/src/feature-libraries/modular-schema/crossFieldQueries.ts +3 -3
- package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +7 -7
- package/src/feature-libraries/modular-schema/fieldKind.ts +1 -1
- package/src/feature-libraries/modular-schema/fieldKindConfiguration.ts +2 -2
- package/src/feature-libraries/modular-schema/fieldKindWithEditor.ts +3 -3
- package/src/feature-libraries/modular-schema/genericFieldKind.ts +10 -10
- package/src/feature-libraries/modular-schema/genericFieldKindCodecs.ts +3 -3
- package/src/feature-libraries/modular-schema/genericFieldKindFormat.ts +1 -1
- package/src/feature-libraries/modular-schema/genericFieldKindTypes.ts +1 -1
- package/src/feature-libraries/modular-schema/isNeverTree.ts +4 -4
- package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +25 -20
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +34 -34
- package/src/feature-libraries/modular-schema/modularChangeFormat.ts +3 -3
- package/src/feature-libraries/modular-schema/modularChangeTypes.ts +3 -3
- package/src/feature-libraries/node-key/mockNodeKeyManager.ts +2 -2
- package/src/feature-libraries/node-key/nodeKey.ts +3 -3
- package/src/feature-libraries/node-key/nodeKeyIndex.ts +4 -4
- package/src/feature-libraries/node-key/nodeKeyManager.ts +1 -1
- package/src/feature-libraries/object-forest/objectForest.ts +22 -22
- package/src/feature-libraries/optional-field/optionalField.ts +20 -20
- package/src/feature-libraries/optional-field/optionalFieldChangeFormatV1.ts +1 -1
- package/src/feature-libraries/optional-field/optionalFieldChangeFormatV2.ts +1 -1
- package/src/feature-libraries/optional-field/optionalFieldChangeTypes.ts +2 -2
- package/src/feature-libraries/optional-field/optionalFieldCodecV1.ts +4 -4
- package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +4 -4
- package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +2 -2
- package/src/feature-libraries/schema-aware/schemaAware.ts +8 -4
- package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +3 -3
- package/src/feature-libraries/schema-edits/schemaChangeFormat.ts +1 -1
- package/src/feature-libraries/schema-edits/schemaChangeTypes.ts +1 -1
- package/src/feature-libraries/schema-index/codec.ts +8 -4
- package/src/feature-libraries/schema-index/format.ts +1 -1
- package/src/feature-libraries/schema-index/schemaSummarizer.ts +11 -7
- package/src/feature-libraries/schemaBuilder.ts +2 -2
- package/src/feature-libraries/schemaBuilderBase.ts +12 -12
- package/src/feature-libraries/sequence-field/compose.ts +18 -18
- package/src/feature-libraries/sequence-field/formatV1.ts +1 -1
- package/src/feature-libraries/sequence-field/formatV2.ts +1 -1
- package/src/feature-libraries/sequence-field/helperTypes.ts +1 -1
- package/src/feature-libraries/sequence-field/invert.ts +14 -14
- package/src/feature-libraries/sequence-field/markListFactory.ts +1 -1
- package/src/feature-libraries/sequence-field/markQueue.ts +2 -2
- package/src/feature-libraries/sequence-field/moveEffectTable.ts +5 -5
- package/src/feature-libraries/sequence-field/prune.ts +2 -2
- package/src/feature-libraries/sequence-field/rebase.ts +18 -18
- package/src/feature-libraries/sequence-field/relevantRemovedRoots.ts +3 -3
- package/src/feature-libraries/sequence-field/replaceRevisions.ts +7 -7
- package/src/feature-libraries/sequence-field/sequenceFieldChangeHandler.ts +3 -3
- package/src/feature-libraries/sequence-field/sequenceFieldChangeRebaser.ts +2 -2
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV1.ts +17 -17
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +16 -16
- package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +4 -4
- package/src/feature-libraries/sequence-field/sequenceFieldEditor.ts +12 -3
- package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +7 -7
- package/src/feature-libraries/sequence-field/types.ts +2 -2
- package/src/feature-libraries/sequence-field/utils.ts +25 -25
- package/src/feature-libraries/storedToViewSchema.ts +7 -7
- package/src/feature-libraries/treeCursorUtils.ts +8 -8
- package/src/feature-libraries/treeTextCursor.ts +10 -6
- package/src/feature-libraries/typed-schema/schemaCollection.ts +11 -6
- package/src/feature-libraries/typed-schema/typedTreeSchema.ts +16 -16
- package/src/feature-libraries/typed-schema/view.ts +8 -8
- package/src/feature-libraries/valueUtilities.ts +2 -2
- package/src/index.ts +0 -1
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/schematizeTree.ts +7 -7
- package/src/shared-tree/schematizingTreeView.ts +19 -16
- package/src/shared-tree/sharedTree.ts +28 -16
- package/src/shared-tree/sharedTreeChangeCodecs.ts +11 -8
- package/src/shared-tree/sharedTreeChangeEnricher.ts +8 -8
- package/src/shared-tree/sharedTreeChangeFamily.ts +21 -15
- package/src/shared-tree/sharedTreeChangeFormat.ts +1 -1
- package/src/shared-tree/sharedTreeChangeTypes.ts +1 -1
- package/src/shared-tree/sharedTreeEditBuilder.ts +4 -4
- package/src/shared-tree/treeApi.ts +5 -5
- package/src/shared-tree/treeCheckout.ts +28 -23
- package/src/shared-tree/treeView.ts +8 -8
- package/src/shared-tree-core/branch.ts +8 -8
- package/src/shared-tree-core/branchCommitEnricher.ts +2 -2
- package/src/shared-tree-core/changeEnricher.ts +1 -1
- package/src/shared-tree-core/defaultResubmitMachine.ts +2 -2
- package/src/shared-tree-core/editManager.ts +8 -8
- package/src/shared-tree-core/editManagerCodecs.ts +13 -8
- package/src/shared-tree-core/editManagerFormat.ts +5 -5
- package/src/shared-tree-core/editManagerSummarizer.ts +13 -9
- package/src/shared-tree-core/messageCodecs.ts +7 -7
- package/src/shared-tree-core/messageFormat.ts +4 -4
- package/src/shared-tree-core/messageTypes.ts +2 -2
- package/src/shared-tree-core/resubmitMachine.ts +1 -1
- package/src/shared-tree-core/sequenceIdUtils.ts +1 -1
- package/src/shared-tree-core/sharedTreeCore.ts +20 -20
- package/src/shared-tree-core/transactionEnricher.ts +2 -2
- package/src/shared-tree-core/transactionStack.ts +1 -1
- package/src/simple-tree/arrayNode.ts +32 -28
- package/src/simple-tree/leafNodeSchema.ts +4 -4
- package/src/simple-tree/mapNode.ts +10 -10
- package/src/simple-tree/nodeKeys.ts +2 -2
- package/src/simple-tree/objectNode.ts +18 -18
- package/src/simple-tree/proxies.ts +21 -27
- package/src/simple-tree/proxyBinding.ts +14 -14
- package/src/simple-tree/schemaCaching.ts +5 -5
- package/src/simple-tree/schemaCreationUtilities.ts +5 -5
- package/src/simple-tree/schemaFactory.ts +39 -22
- package/src/simple-tree/schemaFactoryRecursive.ts +13 -13
- package/src/simple-tree/schemaTypes.ts +8 -8
- package/src/simple-tree/testRecursiveDomain.ts +1 -1
- package/src/simple-tree/toFlexSchema.ts +13 -13
- package/src/simple-tree/toMapTree.ts +4 -4
- package/src/simple-tree/tree.ts +6 -31
- package/src/simple-tree/treeNodeApi.ts +45 -33
- package/src/simple-tree/types.ts +60 -12
- package/src/simple-tree/typesUnsafe.ts +6 -6
- package/src/treeFactory.ts +5 -5
- package/src/util/brandedMap.ts +1 -1
- package/src/util/nestedMap.ts +1 -1
- package/src/util/nestedSet.ts +1 -1
- package/src/util/typeboxBrand.ts +1 -1
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { TreeStatus } from "../feature-libraries/index.js";
|
|
6
|
-
import { NodeKind, type TreeLeafValue, TreeNodeSchema, ImplicitAllowedTypes, TreeNodeFromImplicitAllowedTypes } from "./schemaTypes.js";
|
|
7
|
-
import { TreeNode } from "./types.js";
|
|
5
|
+
import { type TreeStatus } from "../feature-libraries/index.js";
|
|
6
|
+
import { NodeKind, type TreeLeafValue, type TreeNodeSchema, type ImplicitAllowedTypes, type TreeNodeFromImplicitAllowedTypes } from "./schemaTypes.js";
|
|
7
|
+
import type { TreeNode } from "./types.js";
|
|
8
8
|
/**
|
|
9
9
|
* Provides various functions for analyzing {@link TreeNode}s.
|
|
10
10
|
*
|
|
@@ -54,11 +54,20 @@ export interface TreeNodeApi {
|
|
|
54
54
|
*/
|
|
55
55
|
readonly status: (node: TreeNode) => TreeStatus;
|
|
56
56
|
/**
|
|
57
|
-
* Returns the {@link
|
|
57
|
+
* Returns the {@link SchemaFactory.identifier | identifier} of the given node in the most compressed form possible.
|
|
58
58
|
* @remarks
|
|
59
|
-
* If the node's identifier is a valid
|
|
60
|
-
*
|
|
61
|
-
*
|
|
59
|
+
* If the node's identifier is a valid UUID that was automatically generated by the SharedTree, then this will return a process-unique integer corresponding to that identifier.
|
|
60
|
+
* This is useful for performance-sensitive scenarios involving many nodes with identifiers that need to be compactly retained in memory or used for efficient lookup.
|
|
61
|
+
*
|
|
62
|
+
* If the node's identifier is any other user-provided string, then this will return that string.
|
|
63
|
+
*
|
|
64
|
+
* If the node has no identifier (that is, it has no {@link SchemaFactory.identifier | identifier} field), then this returns `undefined`.
|
|
65
|
+
*
|
|
66
|
+
* If the node has more than one identifier, then this will throw an error.
|
|
67
|
+
*
|
|
68
|
+
* The returned integer must not be serialized or preserved outside of the current process.
|
|
69
|
+
* Its lifetime is that of the current in-memory instance of the FF container for this client, and it is not guaranteed to be unique or stable outside of that context.
|
|
70
|
+
* The same node's identifier may, for example, be different across multiple sessions for the same client and document, or different across two clients in the same session.
|
|
62
71
|
*/
|
|
63
72
|
shortId(node: TreeNode): number | string | undefined;
|
|
64
73
|
}
|
|
@@ -72,7 +81,7 @@ export declare const treeNodeApi: TreeNodeApi;
|
|
|
72
81
|
*/
|
|
73
82
|
export declare function tryGetSchema<T>(value: T): undefined | TreeNodeSchema<string, NodeKind, unknown, T>;
|
|
74
83
|
/**
|
|
75
|
-
* A collection of events that can be
|
|
84
|
+
* A collection of events that can be emitted by a {@link TreeNode}.
|
|
76
85
|
*
|
|
77
86
|
* @privateRemarks
|
|
78
87
|
* TODO: add a way to subscribe to a specific field (for nodeChanged and treeChanged).
|
|
@@ -94,7 +103,8 @@ export declare function tryGetSchema<T>(value: T): undefined | TreeNodeSchema<st
|
|
|
94
103
|
*/
|
|
95
104
|
export interface TreeChangeEvents {
|
|
96
105
|
/**
|
|
97
|
-
* Emitted by a node
|
|
106
|
+
* Emitted by a node after a batch of changes has been applied to the tree, if a change affected the node, where a
|
|
107
|
+
* change is:
|
|
98
108
|
*
|
|
99
109
|
* - For an object node, when the value of one of its properties changes (i.e., the property's value is set
|
|
100
110
|
* to something else, including `undefined`).
|
|
@@ -104,20 +114,19 @@ export interface TreeChangeEvents {
|
|
|
104
114
|
* - For a map node, when an entry is added, updated, or removed.
|
|
105
115
|
*
|
|
106
116
|
* @remarks
|
|
107
|
-
* This event is not
|
|
117
|
+
* This event is not emitted when:
|
|
108
118
|
*
|
|
109
119
|
* - Properties of a child node change. Notably, updates to an array node or a map node (like adding or removing
|
|
110
|
-
* elements/entries) will
|
|
120
|
+
* elements/entries) will emit this event on the array/map node itself, but not on the node that contains the
|
|
111
121
|
* array/map node as one of its properties.
|
|
112
122
|
*
|
|
113
123
|
* - The node is moved to a different location in the tree or removed from the tree.
|
|
114
|
-
* In this case the event is
|
|
124
|
+
* In this case the event is emitted on the _parent_ node, not the node itself.
|
|
115
125
|
*
|
|
116
126
|
* For remote edits, this event is not guaranteed to occur in the same order or quantity that it did in
|
|
117
127
|
* the client that made the original edit.
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
* When it is raised, the tree is guaranteed to be in-schema.
|
|
128
|
+
*
|
|
129
|
+
* When it is emitted, the tree is guaranteed to be in-schema.
|
|
121
130
|
*
|
|
122
131
|
* @privateRemarks
|
|
123
132
|
* This event occurs whenever the apparent contents of the node instance change, regardless of what caused the change.
|
|
@@ -127,26 +136,20 @@ export interface TreeChangeEvents {
|
|
|
127
136
|
*/
|
|
128
137
|
nodeChanged(): void;
|
|
129
138
|
/**
|
|
130
|
-
* Emitted by a node
|
|
139
|
+
* Emitted by a node after a batch of changes has been applied to the tree, when something changed anywhere in the
|
|
140
|
+
* subtree rooted at it.
|
|
131
141
|
*
|
|
132
142
|
* @remarks
|
|
133
|
-
* This event is
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
* Consumers of this event have the guarantee that they won't miss any changes, but should also handle the scenario
|
|
137
|
-
* where the event fires with no visible changes as well.
|
|
138
|
-
*
|
|
139
|
-
* This event is not raised when the node itself is moved to a different location in the tree or removed from the tree.
|
|
140
|
-
* In that case it is raised on the _parent_ node, not the node itself.
|
|
143
|
+
* This event is not emitted when the node itself is moved to a different location in the tree or removed from the tree.
|
|
144
|
+
* In that case it is emitted on the _parent_ node, not the node itself.
|
|
141
145
|
*
|
|
142
146
|
* The node itself is part of the subtree, so this event will be emitted even if the only changes are to the properties
|
|
143
147
|
* of the node itself.
|
|
144
148
|
*
|
|
145
149
|
* For remote edits, this event is not guaranteed to occur in the same order or quantity that it did in
|
|
146
150
|
* the client that made the original edit.
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
* When it is raised, the tree is guaranteed to be in-schema.
|
|
151
|
+
*
|
|
152
|
+
* When it is emitted, the tree is guaranteed to be in-schema.
|
|
150
153
|
*/
|
|
151
154
|
treeChanged(): void;
|
|
152
155
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treeNodeApi.d.ts","sourceRoot":"","sources":["../../src/simple-tree/treeNodeApi.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAGN,UAAU,
|
|
1
|
+
{"version":3,"file":"treeNodeApi.d.ts","sourceRoot":"","sources":["../../src/simple-tree/treeNodeApi.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAGN,KAAK,UAAU,EAGf,MAAM,+BAA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,SAAS,GAAG,cAAc,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC,CAwB1D;AAmDD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,gBAAgB;IAChC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,WAAW,IAAI,IAAI,CAAC;IAEpB;;;;;;;;;;;;;;;OAeG;IACH,WAAW,IAAI,IAAI,CAAC;CACpB"}
|
|
@@ -15,6 +15,7 @@ const schemaCaching_js_1 = require("./schemaCaching.js");
|
|
|
15
15
|
const schemaTypes_js_1 = require("./schemaTypes.js");
|
|
16
16
|
const leafNodeSchema_js_1 = require("./leafNodeSchema.js");
|
|
17
17
|
const internal_2 = require("@fluidframework/runtime-utils/internal");
|
|
18
|
+
const internal_3 = require("@fluidframework/telemetry-utils/internal");
|
|
18
19
|
/**
|
|
19
20
|
* The `Tree` object holds various functions for analyzing {@link TreeNode}s.
|
|
20
21
|
*/
|
|
@@ -80,17 +81,21 @@ exports.treeNodeApi = {
|
|
|
80
81
|
},
|
|
81
82
|
shortId(node) {
|
|
82
83
|
const flexNode = (0, proxyBinding_js_1.getFlexNode)(node);
|
|
84
|
+
let shortId;
|
|
83
85
|
for (const field of flexNode.boxedIterator()) {
|
|
84
86
|
if (field.schema.kind === index_js_2.FieldKinds.identifier) {
|
|
87
|
+
if (shortId !== undefined) {
|
|
88
|
+
throw new internal_3.UsageError("shortId() may not be called on a node with more than one identifier. Consider converting extraneous identifier fields to string fields.");
|
|
89
|
+
}
|
|
85
90
|
const identifier = field.boxedAt(0);
|
|
86
91
|
(0, internal_1.assert)(identifier !== undefined, 0x927 /* The identifier must exist */);
|
|
87
92
|
const identifierValue = identifier.value;
|
|
88
93
|
const localNodeKey = identifier.context.nodeKeyManager.tryLocalizeNodeKey(identifierValue);
|
|
89
|
-
|
|
90
|
-
? (0, index_js_3.extractFromOpaque)(localNodeKey)
|
|
91
|
-
: identifierValue;
|
|
94
|
+
shortId =
|
|
95
|
+
localNodeKey !== undefined ? (0, index_js_3.extractFromOpaque)(localNodeKey) : identifierValue;
|
|
92
96
|
}
|
|
93
97
|
}
|
|
98
|
+
return shortId;
|
|
94
99
|
},
|
|
95
100
|
};
|
|
96
101
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treeNodeApi.js","sourceRoot":"","sources":["../../src/simple-tree/treeNodeApi.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA8E;AAE9E,+CAA8D;AAC9D,4DAMuC;AACvC,+CAA4E;AAE5E,6CAAgE;AAChE,uDAAgD;AAChD,yDAA4D;AAC5D,qDAQ0B;AAE1B,2DAM6B;AAC7B,qEAAuE;AA2EvE;;GAEG;AACU,QAAA,WAAW,GAAgB;IACvC,MAAM,EAAE,CAAC,IAAc,EAAwB,EAAE;QAChD,MAAM,QAAQ,GAAG,IAAA,6BAAW,EAAC,IAAI,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC;QAC7D,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC5B,OAAO,SAAS,CAAC;QAClB,CAAC;QAED,MAAM,MAAM,GAAG,IAAA,iCAAoB,EAAC,QAAQ,CAAC,CAAC;QAC9C,IAAA,iBAAM,EACL,CAAC,IAAA,sBAAW,EAAC,MAAM,CAAC,EACpB,KAAK,CAAC,gEAAgE,CACtE,CAAC;QACF,OAAO,MAAM,CAAC;IACf,CAAC;IACD,GAAG,EAAE,CAAC,IAAc,EAAE,EAAE;QACvB,sEAAsE;QACtE,8CAA8C;QAC9C,MAAM,MAAM,GAAG,mBAAW,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YAC1B,OAAO,uBAAY,CAAC;QACrB,CAAC;QAED,+DAA+D;QAC/D,mGAAmG;QACnG,wGAAwG;QACxG,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;QACrC,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AAO,OAAO,CAAC;QAChB,CAAC;IACF,CAAC;IAED,IAAI,MAAM,CAAC,SAAS,CAAC,KAAK,SAAS,EAAE,CAAC;QACrC,IAAA,eAAI,EAAC,qDAAqD,CAAC,CAAC;IAC7D,CAAC;IAED,OAAO,SAAS,CAAC;AAClB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\n\nimport { Multiplicity, rootFieldKey } from \"../core/index.js\";\nimport {\n\tFieldKinds,\n\tLazyItem,\n\tTreeStatus,\n\tisLazy,\n\tisTreeValue,\n} from \"../feature-libraries/index.js\";\nimport { fail, extractFromOpaque, isReadonlyArray } from \"../util/index.js\";\n\nimport { getOrCreateNodeProxy, isTreeNode } from \"./proxies.js\";\nimport { getFlexNode } from \"./proxyBinding.js\";\nimport { tryGetSimpleNodeSchema } from \"./schemaCaching.js\";\nimport {\n\tNodeKind,\n\ttype TreeLeafValue,\n\tTreeNodeSchema,\n\ttype ImplicitFieldSchema,\n\tFieldSchema,\n\tImplicitAllowedTypes,\n\tTreeNodeFromImplicitAllowedTypes,\n} from \"./schemaTypes.js\";\nimport { TreeNode } from \"./types.js\";\nimport {\n\tbooleanSchema,\n\thandleSchema,\n\tnullSchema,\n\tnumberSchema,\n\tstringSchema,\n} from \"./leafNodeSchema.js\";\nimport { isFluidHandle } from \"@fluidframework/runtime-utils/internal\";\n\n/**\n * Provides various functions for analyzing {@link TreeNode}s.\n *\n * @privateRemarks\n * Inlining the typing of this interface onto the `Tree` object provides slightly different .d.ts generation,\n * which avoids typescript expanding the type of TreeNodeSchema and thus encountering\n * https://github.com/microsoft/rushstack/issues/1958.\n * @public\n */\nexport interface TreeNodeApi {\n\t/**\n\t * The schema information for this node.\n\t */\n\tschema<T extends TreeNode | TreeLeafValue>(\n\t\tnode: T,\n\t): TreeNodeSchema<string, NodeKind, unknown, T>;\n\n\t/**\n\t * Narrow the type of the given value if it satisfies the given schema.\n\t * @example\n\t * ```ts\n\t * if (node.is(myNode, Point)) {\n\t * const y = myNode.y; // `myNode` is now known to satisfy the `Point` schema and therefore has a `y` coordinate.\n\t * }\n\t * ```\n\t */\n\tis<TSchema extends ImplicitAllowedTypes>(\n\t\tvalue: unknown,\n\t\tschema: TSchema,\n\t): value is TreeNodeFromImplicitAllowedTypes<TSchema>;\n\n\t/**\n\t * Return the node under which this node resides in the tree (or undefined if this is a root node of the tree).\n\t */\n\tparent(node: TreeNode): TreeNode | undefined;\n\n\t/**\n\t * The key of the given node under its parent.\n\t * @remarks\n\t * If `node` is an element in a {@link (TreeArrayNode:interface)}, this returns the index of `node` in the array node (a `number`).\n\t * Otherwise, this returns the key of the field that it is under (a `string`).\n\t */\n\tkey(node: TreeNode): string | number;\n\n\t/**\n\t * Register an event listener on the given node.\n\t * @param node - The node whose events should be subscribed to.\n\t * @param eventName - Which event to subscribe to.\n\t * @param listener - The callback to trigger for the event. The tree can be read during the callback, but it is invalid to modify the tree during this callback.\n\t * @returns A callback function which will deregister the event.\n\t * This callback should be called only once.\n\t */\n\ton<K extends keyof TreeChangeEvents>(\n\t\tnode: TreeNode,\n\t\teventName: K,\n\t\tlistener: TreeChangeEvents[K],\n\t): () => void;\n\n\t/**\n\t * Returns the {@link TreeStatus} of the given node.\n\t */\n\treadonly status: (node: TreeNode) => TreeStatus;\n\n\t/**\n\t * Returns the {@link FieldKind.Identifier | identifier} of the given node in the most compressed form possible.\n\t * @remarks\n\t * If the node's identifier is a valid `StableNodeKey`, then this will return a unique process-local integer corresponding to that identifier.\n\t * If the node's identifier is any other string, then this will return that string.\n\t * If the node has no identifier (that is, it has no field of an {@link FieldKind.Identifier | identifier} field kind), then this returns undefined.\n\t */\n\tshortId(node: TreeNode): number | string | undefined;\n}\n\n/**\n * The `Tree` object holds various functions for analyzing {@link TreeNode}s.\n */\nexport const treeNodeApi: TreeNodeApi = {\n\tparent: (node: TreeNode): TreeNode | undefined => {\n\t\tconst editNode = getFlexNode(node).parentField.parent.parent;\n\t\tif (editNode === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst output = getOrCreateNodeProxy(editNode);\n\t\tassert(\n\t\t\t!isTreeValue(output),\n\t\t\t0x87f /* Parent can't be a leaf, so it should be a node not a value */,\n\t\t);\n\t\treturn output;\n\t},\n\tkey: (node: TreeNode) => {\n\t\t// If the parent is undefined, then this node is under the root field,\n\t\t// so we know its key is the special root one.\n\t\tconst parent = treeNodeApi.parent(node);\n\t\tif (parent === undefined) {\n\t\t\treturn rootFieldKey;\n\t\t}\n\n\t\t// The flex-domain strictly operates in terms of \"stored keys\".\n\t\t// To find the associated developer-facing \"view key\", we need to look up the field associated with\n\t\t// the stored key from the flex-domain, and get view key its simple-domain counterpart was created with.\n\t\tconst storedKey = getStoredKey(node);\n\t\tconst parentSchema = treeNodeApi.schema(parent);\n\t\tconst viewKey = getViewKeyFromStoredKey(parentSchema, storedKey);\n\t\treturn viewKey;\n\t},\n\ton: <K extends keyof TreeChangeEvents>(\n\t\tnode: TreeNode,\n\t\teventName: K,\n\t\tlistener: TreeChangeEvents[K],\n\t) => {\n\t\tconst flex = getFlexNode(node);\n\t\tswitch (eventName) {\n\t\t\tcase \"nodeChanged\":\n\t\t\t\treturn flex.on(\"nodeChanged\", listener);\n\t\t\tcase \"treeChanged\":\n\t\t\t\treturn flex.on(\"treeChanged\", listener);\n\t\t\tdefault:\n\t\t\t\treturn unreachableCase(eventName);\n\t\t}\n\t},\n\tstatus: (node: TreeNode) => {\n\t\treturn getFlexNode(node, true).treeStatus();\n\t},\n\tis: <TSchema extends ImplicitAllowedTypes>(\n\t\tvalue: unknown,\n\t\tschema: TSchema,\n\t): value is TreeNodeFromImplicitAllowedTypes<TSchema> => {\n\t\tconst actualSchema = tryGetSchema(value);\n\t\tif (actualSchema === undefined) {\n\t\t\treturn false;\n\t\t}\n\t\tif (isReadonlyArray<LazyItem<TreeNodeSchema>>(schema)) {\n\t\t\tfor (const singleSchema of schema) {\n\t\t\t\tconst testSchema = isLazy(singleSchema) ? singleSchema() : singleSchema;\n\t\t\t\tif (testSchema === actualSchema) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn (schema as TreeNodeSchema) === actualSchema;\n\t\t}\n\t},\n\tschema<T extends TreeNode | TreeLeafValue>(\n\t\tnode: T,\n\t): TreeNodeSchema<string, NodeKind, unknown, T> {\n\t\treturn tryGetSchema(node) ?? fail(\"Not a tree node\");\n\t},\n\tshortId(node: TreeNode): number | string | undefined {\n\t\tconst flexNode = getFlexNode(node);\n\t\tfor (const field of flexNode.boxedIterator()) {\n\t\t\tif (field.schema.kind === FieldKinds.identifier) {\n\t\t\t\tconst identifier = field.boxedAt(0);\n\t\t\t\tassert(identifier !== undefined, 0x927 /* The identifier must exist */);\n\t\t\t\tconst identifierValue = identifier.value as string;\n\t\t\t\tconst localNodeKey =\n\t\t\t\t\tidentifier.context.nodeKeyManager.tryLocalizeNodeKey(identifierValue);\n\t\t\t\treturn localNodeKey !== undefined\n\t\t\t\t\t? extractFromOpaque(localNodeKey)\n\t\t\t\t\t: identifierValue;\n\t\t\t}\n\t\t}\n\t},\n};\n\n/**\n * Returns a schema for a value if the value is a {@link TreeNode} or a {@link TreeLeafValue}.\n * Returns undefined for other values.\n */\nexport function tryGetSchema<T>(\n\tvalue: T,\n): undefined | TreeNodeSchema<string, NodeKind, unknown, T> {\n\ttype TOut = TreeNodeSchema<string, NodeKind, unknown, T>;\n\tswitch (typeof value) {\n\t\tcase \"string\":\n\t\t\treturn stringSchema as TOut;\n\t\tcase \"number\":\n\t\t\treturn numberSchema as TOut;\n\t\tcase \"boolean\":\n\t\t\treturn booleanSchema as TOut;\n\t\tcase \"object\": {\n\t\t\tif (isTreeNode(value)) {\n\t\t\t\t// This case could be optimized, for example by placing the simple schema in a symbol on tree nodes.\n\t\t\t\treturn tryGetSimpleNodeSchema(getFlexNode(value).schema) as TOut;\n\t\t\t}\n\t\t\tif (value === null) {\n\t\t\t\treturn nullSchema as TOut;\n\t\t\t}\n\t\t\tif (isFluidHandle(value)) {\n\t\t\t\treturn handleSchema as TOut;\n\t\t\t}\n\t\t}\n\t\tdefault:\n\t\t\treturn undefined;\n\t}\n}\n\n/**\n * Gets the stored key with which the provided node is associated in the parent.\n */\nfunction getStoredKey(node: TreeNode): string | number {\n\t// Note: the flex domain strictly works with \"stored keys\", and knows nothing about the developer-facing\n\t// \"view keys\".\n\tconst parentField = getFlexNode(node).parentField;\n\tif (parentField.parent.schema.kind.multiplicity === Multiplicity.Sequence) {\n\t\t// The parent of `node` is an array node\n\t\treturn parentField.index;\n\t}\n\n\t// The parent of `node` is an object, a map, or undefined (and therefore `node` is a root/detached node).\n\treturn parentField.parent.key;\n}\n\n/**\n * Given a node schema, gets the view key corresponding with the provided {@link FieldProps.key | stored key}.\n */\nfunction getViewKeyFromStoredKey(\n\tschema: TreeNodeSchema,\n\tstoredKey: string | number,\n): string | number {\n\t// Only object nodes have the concept of a \"stored key\", differentiated from the developer-facing \"view key\".\n\t// For any other kind of node, the stored key and the view key are the same.\n\tif (schema.kind !== NodeKind.Object) {\n\t\treturn storedKey;\n\t}\n\n\tconst fields = schema.info as Record<string, ImplicitFieldSchema>;\n\n\t// Invariants:\n\t// - The set of all view keys under an object must be unique.\n\t// - The set of all stored keys (including those implicitly created from view keys) must be unique.\n\t// To find the view key associated with the provided stored key, first check for any stored key matches (which are optionally populated).\n\t// If we don't find any, then search for a matching view key.\n\tfor (const [viewKey, fieldSchema] of Object.entries(fields)) {\n\t\tif (fieldSchema instanceof FieldSchema && fieldSchema.props?.key === storedKey) {\n\t\t\treturn viewKey;\n\t\t}\n\t}\n\n\tif (fields[storedKey] === undefined) {\n\t\tfail(\"Existing stored key should always map to a view key\");\n\t}\n\n\treturn storedKey;\n}\n\n/**\n * A collection of events that can be raised by a {@link TreeNode}.\n *\n * @privateRemarks\n * TODO: add a way to subscribe to a specific field (for nodeChanged and treeChanged).\n * Probably have object node and map node specific APIs for this.\n *\n * TODO: ensure that subscription API for fields aligns with API for subscribing to the root.\n *\n * TODO: add more wider area (avoid needing tons of nodeChanged registration) events for use-cases other than treeChanged.\n * Some ideas:\n *\n * - treeChanged, but with some subtrees/fields/paths excluded\n * - helper to batch several nodeChanged calls to a treeChanged scope\n * - parent change (ex: registration on the parent field for a specific index: maybe allow it for a range. Ex: node event takes optional field and optional index range?)\n * - new content inserted into subtree. Either provide event for this and/or enough info to treeChanged to find and search the new sub-trees.\n * Add separate (non event related) API to efficiently scan tree for given set of types (using low level cursor and schema based filtering)\n * to allow efficiently searching for new content (and initial content) of a given type.\n *\n * @public\n */\nexport interface TreeChangeEvents {\n\t/**\n\t * Emitted by a node when a batch of changes is applied to it, where a change is:\n\t *\n\t * - For an object node, when the value of one of its properties changes (i.e., the property's value is set\n\t * to something else, including `undefined`).\n\t *\n\t * - For an array node, when an element is added, removed, or moved.\n\t *\n\t * - For a map node, when an entry is added, updated, or removed.\n\t *\n\t * @remarks\n\t * This event is not raised when:\n\t *\n\t * - Properties of a child node change. Notably, updates to an array node or a map node (like adding or removing\n\t * elements/entries) will raise this event on the array/map node itself, but not on the node that contains the\n\t * array/map node as one of its properties.\n\t *\n\t * - The node is moved to a different location in the tree or removed from the tree.\n\t * In this case the event is raised on the _parent_ node, not the node itself.\n\t *\n\t * For remote edits, this event is not guaranteed to occur in the same order or quantity that it did in\n\t * the client that made the original edit.\n\t * While a batch of edits will as a whole update the tree to the appropriate end state, no guarantees are made about\n\t * how many times this event will be raised during any intermediate states.\n\t * When it is raised, the tree is guaranteed to be in-schema.\n\t *\n\t * @privateRemarks\n\t * This event occurs whenever the apparent contents of the node instance change, regardless of what caused the change.\n\t * For example, it will fire when the local client reassigns a child, when part of a remote edit is applied to the\n\t * node, or when the node has to be updated due to resolution of a merge conflict\n\t * (for example a previously applied local change might be undone, then reapplied differently or not at all).\n\t */\n\tnodeChanged(): void;\n\n\t/**\n\t * Emitted by a node when something _may_ have changed anywhere in the subtree rooted at it.\n\t *\n\t * @remarks\n\t * This event is guaranteed to be emitted whenever the subtree _has_ changed.\n\t * However, it might also be emitted when the subtree has no visible changes compared to before the event firing.\n\t *\n\t * Consumers of this event have the guarantee that they won't miss any changes, but should also handle the scenario\n\t * where the event fires with no visible changes as well.\n\t *\n\t * This event is not raised when the node itself is moved to a different location in the tree or removed from the tree.\n\t * In that case it is raised on the _parent_ node, not the node itself.\n\t *\n\t * The node itself is part of the subtree, so this event will be emitted even if the only changes are to the properties\n\t * of the node itself.\n\t *\n\t * For remote edits, this event is not guaranteed to occur in the same order or quantity that it did in\n\t * the client that made the original edit.\n\t * While a batch of edits will as a whole update the tree to the appropriate end state, no guarantees are made about\n\t * how many times this event will be raised during any intermediate states.\n\t * When it is raised, the tree is guaranteed to be in-schema.\n\t */\n\ttreeChanged(): void;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"treeNodeApi.js","sourceRoot":"","sources":["../../src/simple-tree/treeNodeApi.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA8E;AAE9E,+CAA8D;AAC9D,4DAMuC;AACvC,+CAA4E;AAE5E,6CAAgE;AAChE,uDAAgD;AAChD,yDAA4D;AAC5D,qDAQ0B;AAE1B,2DAM6B;AAC7B,qEAAuE;AACvE,uEAAsE;AAoFtE;;GAEG;AACU,QAAA,WAAW,GAAgB;IACvC,MAAM,EAAE,CAAC,IAAc,EAAwB,EAAE;QAChD,MAAM,QAAQ,GAAG,IAAA,6BAAW,EAAC,IAAI,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC;QAC7D,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC5B,OAAO,SAAS,CAAC;QAClB,CAAC;QAED,MAAM,MAAM,GAAG,IAAA,iCAAoB,EAAC,QAAQ,CAAC,CAAC;QAC9C,IAAA,iBAAM,EACL,CAAC,IAAA,sBAAW,EAAC,MAAM,CAAC,EACpB,KAAK,CA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GAAG,CAAC;AAC/B,CAAC;AAED;;GAEG;AACH,SAAS,uBAAuB,CAC/B,MAAsB,EACtB,SAA0B;IAE1B,6GAA6G;IAC7G,4EAA4E;IAC5E,IAAI,MAAM,CAAC,IAAI,KAAK,yBAAQ,CAAC,MAAM,EAAE,CAAC;QACrC,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,CAAC,IAA2C,CAAC;IAElE,cAAc;IACd,6DAA6D;IAC7D,mGAAmG;IACnG,yIAAyI;IACzI,6DAA6D;IAC7D,KAAK,MAAM,CAAC,OAAO,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC7D,IAAI,WAAW,YAAY,4BAAW,IAAI,WAAW,CAAC,KAAK,EAAE,GAAG,KAAK,SAAS,EAAE,CAAC;YAChF,OAAO,OAAO,CAAC;QAChB,CAAC;IACF,CAAC;IAED,IAAI,MAAM,CAAC,SAAS,CAAC,KAAK,SAAS,EAAE,CAAC;QACrC,IAAA,eAAI,EAAC,qDAAqD,CAAC,CAAC;IAC7D,CAAC;IAED,OAAO,SAAS,CAAC;AAClB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\n\nimport { Multiplicity, rootFieldKey } from \"../core/index.js\";\nimport {\n\tFieldKinds,\n\ttype LazyItem,\n\ttype TreeStatus,\n\tisLazy,\n\tisTreeValue,\n} from \"../feature-libraries/index.js\";\nimport { fail, extractFromOpaque, isReadonlyArray } from \"../util/index.js\";\n\nimport { getOrCreateNodeProxy, isTreeNode } from \"./proxies.js\";\nimport { getFlexNode } from \"./proxyBinding.js\";\nimport { tryGetSimpleNodeSchema } from \"./schemaCaching.js\";\nimport {\n\tNodeKind,\n\ttype TreeLeafValue,\n\ttype TreeNodeSchema,\n\ttype ImplicitFieldSchema,\n\tFieldSchema,\n\ttype ImplicitAllowedTypes,\n\ttype TreeNodeFromImplicitAllowedTypes,\n} from \"./schemaTypes.js\";\nimport type { TreeNode } from \"./types.js\";\nimport {\n\tbooleanSchema,\n\thandleSchema,\n\tnullSchema,\n\tnumberSchema,\n\tstringSchema,\n} from \"./leafNodeSchema.js\";\nimport { isFluidHandle } from \"@fluidframework/runtime-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\n/**\n * Provides various functions for analyzing {@link TreeNode}s.\n *\n * @privateRemarks\n * Inlining the typing of this interface onto the `Tree` object provides slightly different .d.ts generation,\n * which avoids typescript expanding the type of TreeNodeSchema and thus encountering\n * https://github.com/microsoft/rushstack/issues/1958.\n * @public\n */\nexport interface TreeNodeApi {\n\t/**\n\t * The schema information for this node.\n\t */\n\tschema<T extends TreeNode | TreeLeafValue>(\n\t\tnode: T,\n\t): TreeNodeSchema<string, NodeKind, unknown, T>;\n\n\t/**\n\t * Narrow the type of the given value if it satisfies the given schema.\n\t * @example\n\t * ```ts\n\t * if (node.is(myNode, Point)) {\n\t * const y = myNode.y; // `myNode` is now known to satisfy the `Point` schema and therefore has a `y` coordinate.\n\t * }\n\t * ```\n\t */\n\tis<TSchema extends ImplicitAllowedTypes>(\n\t\tvalue: unknown,\n\t\tschema: TSchema,\n\t): value is TreeNodeFromImplicitAllowedTypes<TSchema>;\n\n\t/**\n\t * Return the node under which this node resides in the tree (or undefined if this is a root node of the tree).\n\t */\n\tparent(node: TreeNode): TreeNode | undefined;\n\n\t/**\n\t * The key of the given node under its parent.\n\t * @remarks\n\t * If `node` is an element in a {@link (TreeArrayNode:interface)}, this returns the index of `node` in the array node (a `number`).\n\t * Otherwise, this returns the key of the field that it is under (a `string`).\n\t */\n\tkey(node: TreeNode): string | number;\n\n\t/**\n\t * Register an event listener on the given node.\n\t * @param node - The node whose events should be subscribed to.\n\t * @param eventName - Which event to subscribe to.\n\t * @param listener - The callback to trigger for the event. The tree can be read during the callback, but it is invalid to modify the tree during this callback.\n\t * @returns A callback function which will deregister the event.\n\t * This callback should be called only once.\n\t */\n\ton<K extends keyof TreeChangeEvents>(\n\t\tnode: TreeNode,\n\t\teventName: K,\n\t\tlistener: TreeChangeEvents[K],\n\t): () => void;\n\n\t/**\n\t * Returns the {@link TreeStatus} of the given node.\n\t */\n\treadonly status: (node: TreeNode) => TreeStatus;\n\n\t/**\n\t * Returns the {@link SchemaFactory.identifier | identifier} of the given node in the most compressed form possible.\n\t * @remarks\n\t * If the node's identifier is a valid UUID that was automatically generated by the SharedTree, then this will return a process-unique integer corresponding to that identifier.\n\t * This is useful for performance-sensitive scenarios involving many nodes with identifiers that need to be compactly retained in memory or used for efficient lookup.\n\t *\n\t * If the node's identifier is any other user-provided string, then this will return that string.\n\t *\n\t * If the node has no identifier (that is, it has no {@link SchemaFactory.identifier | identifier} field), then this returns `undefined`.\n\t *\n\t * If the node has more than one identifier, then this will throw an error.\n\t *\n\t * The returned integer must not be serialized or preserved outside of the current process.\n\t * Its lifetime is that of the current in-memory instance of the FF container for this client, and it is not guaranteed to be unique or stable outside of that context.\n\t * The same node's identifier may, for example, be different across multiple sessions for the same client and document, or different across two clients in the same session.\n\t */\n\tshortId(node: TreeNode): number | string | undefined;\n}\n\n/**\n * The `Tree` object holds various functions for analyzing {@link TreeNode}s.\n */\nexport const treeNodeApi: TreeNodeApi = {\n\tparent: (node: TreeNode): TreeNode | undefined => {\n\t\tconst editNode = getFlexNode(node).parentField.parent.parent;\n\t\tif (editNode === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst output = getOrCreateNodeProxy(editNode);\n\t\tassert(\n\t\t\t!isTreeValue(output),\n\t\t\t0x87f /* Parent can't be a leaf, so it should be a node not a value */,\n\t\t);\n\t\treturn output;\n\t},\n\tkey: (node: TreeNode) => {\n\t\t// If the parent is undefined, then this node is under the root field,\n\t\t// so we know its key is the special root one.\n\t\tconst parent = treeNodeApi.parent(node);\n\t\tif (parent === undefined) {\n\t\t\treturn rootFieldKey;\n\t\t}\n\n\t\t// The flex-domain strictly operates in terms of \"stored keys\".\n\t\t// To find the associated developer-facing \"view key\", we need to look up the field associated with\n\t\t// the stored key from the flex-domain, and get view key its simple-domain counterpart was created with.\n\t\tconst storedKey = getStoredKey(node);\n\t\tconst parentSchema = treeNodeApi.schema(parent);\n\t\tconst viewKey = getViewKeyFromStoredKey(parentSchema, storedKey);\n\t\treturn viewKey;\n\t},\n\ton: <K extends keyof TreeChangeEvents>(\n\t\tnode: TreeNode,\n\t\teventName: K,\n\t\tlistener: TreeChangeEvents[K],\n\t) => {\n\t\tconst flex = getFlexNode(node);\n\t\tswitch (eventName) {\n\t\t\tcase \"nodeChanged\":\n\t\t\t\treturn flex.on(\"nodeChanged\", listener);\n\t\t\tcase \"treeChanged\":\n\t\t\t\treturn flex.on(\"treeChanged\", listener);\n\t\t\tdefault:\n\t\t\t\treturn unreachableCase(eventName);\n\t\t}\n\t},\n\tstatus: (node: TreeNode) => {\n\t\treturn getFlexNode(node, true).treeStatus();\n\t},\n\tis: <TSchema extends ImplicitAllowedTypes>(\n\t\tvalue: unknown,\n\t\tschema: TSchema,\n\t): value is TreeNodeFromImplicitAllowedTypes<TSchema> => {\n\t\tconst actualSchema = tryGetSchema(value);\n\t\tif (actualSchema === undefined) {\n\t\t\treturn false;\n\t\t}\n\t\tif (isReadonlyArray<LazyItem<TreeNodeSchema>>(schema)) {\n\t\t\tfor (const singleSchema of schema) {\n\t\t\t\tconst testSchema = isLazy(singleSchema) ? singleSchema() : singleSchema;\n\t\t\t\tif (testSchema === actualSchema) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn (schema as TreeNodeSchema) === actualSchema;\n\t\t}\n\t},\n\tschema<T extends TreeNode | TreeLeafValue>(\n\t\tnode: T,\n\t): TreeNodeSchema<string, NodeKind, unknown, T> {\n\t\treturn tryGetSchema(node) ?? fail(\"Not a tree node\");\n\t},\n\tshortId(node: TreeNode): number | string | undefined {\n\t\tconst flexNode = getFlexNode(node);\n\t\tlet shortId: number | string | undefined;\n\t\tfor (const field of flexNode.boxedIterator()) {\n\t\t\tif (field.schema.kind === FieldKinds.identifier) {\n\t\t\t\tif (shortId !== undefined) {\n\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t\"shortId() may not be called on a node with more than one identifier. Consider converting extraneous identifier fields to string fields.\",\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tconst identifier = field.boxedAt(0);\n\t\t\t\tassert(identifier !== undefined, 0x927 /* The identifier must exist */);\n\t\t\t\tconst identifierValue = identifier.value as string;\n\t\t\t\tconst localNodeKey =\n\t\t\t\t\tidentifier.context.nodeKeyManager.tryLocalizeNodeKey(identifierValue);\n\n\t\t\t\tshortId =\n\t\t\t\t\tlocalNodeKey !== undefined ? extractFromOpaque(localNodeKey) : identifierValue;\n\t\t\t}\n\t\t}\n\n\t\treturn shortId;\n\t},\n};\n\n/**\n * Returns a schema for a value if the value is a {@link TreeNode} or a {@link TreeLeafValue}.\n * Returns undefined for other values.\n */\nexport function tryGetSchema<T>(\n\tvalue: T,\n): undefined | TreeNodeSchema<string, NodeKind, unknown, T> {\n\ttype TOut = TreeNodeSchema<string, NodeKind, unknown, T>;\n\tswitch (typeof value) {\n\t\tcase \"string\":\n\t\t\treturn stringSchema as TOut;\n\t\tcase \"number\":\n\t\t\treturn numberSchema as TOut;\n\t\tcase \"boolean\":\n\t\t\treturn booleanSchema as TOut;\n\t\tcase \"object\": {\n\t\t\tif (isTreeNode(value)) {\n\t\t\t\t// This case could be optimized, for example by placing the simple schema in a symbol on tree nodes.\n\t\t\t\treturn tryGetSimpleNodeSchema(getFlexNode(value).schema) as TOut;\n\t\t\t}\n\t\t\tif (value === null) {\n\t\t\t\treturn nullSchema as TOut;\n\t\t\t}\n\t\t\tif (isFluidHandle(value)) {\n\t\t\t\treturn handleSchema as TOut;\n\t\t\t}\n\t\t}\n\t\tdefault:\n\t\t\treturn undefined;\n\t}\n}\n\n/**\n * Gets the stored key with which the provided node is associated in the parent.\n */\nfunction getStoredKey(node: TreeNode): string | number {\n\t// Note: the flex domain strictly works with \"stored keys\", and knows nothing about the developer-facing\n\t// \"view keys\".\n\tconst parentField = getFlexNode(node).parentField;\n\tif (parentField.parent.schema.kind.multiplicity === Multiplicity.Sequence) {\n\t\t// The parent of `node` is an array node\n\t\treturn parentField.index;\n\t}\n\n\t// The parent of `node` is an object, a map, or undefined (and therefore `node` is a root/detached node).\n\treturn parentField.parent.key;\n}\n\n/**\n * Given a node schema, gets the view key corresponding with the provided {@link FieldProps.key | stored key}.\n */\nfunction getViewKeyFromStoredKey(\n\tschema: TreeNodeSchema,\n\tstoredKey: string | number,\n): string | number {\n\t// Only object nodes have the concept of a \"stored key\", differentiated from the developer-facing \"view key\".\n\t// For any other kind of node, the stored key and the view key are the same.\n\tif (schema.kind !== NodeKind.Object) {\n\t\treturn storedKey;\n\t}\n\n\tconst fields = schema.info as Record<string, ImplicitFieldSchema>;\n\n\t// Invariants:\n\t// - The set of all view keys under an object must be unique.\n\t// - The set of all stored keys (including those implicitly created from view keys) must be unique.\n\t// To find the view key associated with the provided stored key, first check for any stored key matches (which are optionally populated).\n\t// If we don't find any, then search for a matching view key.\n\tfor (const [viewKey, fieldSchema] of Object.entries(fields)) {\n\t\tif (fieldSchema instanceof FieldSchema && fieldSchema.props?.key === storedKey) {\n\t\t\treturn viewKey;\n\t\t}\n\t}\n\n\tif (fields[storedKey] === undefined) {\n\t\tfail(\"Existing stored key should always map to a view key\");\n\t}\n\n\treturn storedKey;\n}\n\n/**\n * A collection of events that can be emitted by a {@link TreeNode}.\n *\n * @privateRemarks\n * TODO: add a way to subscribe to a specific field (for nodeChanged and treeChanged).\n * Probably have object node and map node specific APIs for this.\n *\n * TODO: ensure that subscription API for fields aligns with API for subscribing to the root.\n *\n * TODO: add more wider area (avoid needing tons of nodeChanged registration) events for use-cases other than treeChanged.\n * Some ideas:\n *\n * - treeChanged, but with some subtrees/fields/paths excluded\n * - helper to batch several nodeChanged calls to a treeChanged scope\n * - parent change (ex: registration on the parent field for a specific index: maybe allow it for a range. Ex: node event takes optional field and optional index range?)\n * - new content inserted into subtree. Either provide event for this and/or enough info to treeChanged to find and search the new sub-trees.\n * Add separate (non event related) API to efficiently scan tree for given set of types (using low level cursor and schema based filtering)\n * to allow efficiently searching for new content (and initial content) of a given type.\n *\n * @public\n */\nexport interface TreeChangeEvents {\n\t/**\n\t * Emitted by a node after a batch of changes has been applied to the tree, if a change affected the node, where a\n\t * change is:\n\t *\n\t * - For an object node, when the value of one of its properties changes (i.e., the property's value is set\n\t * to something else, including `undefined`).\n\t *\n\t * - For an array node, when an element is added, removed, or moved.\n\t *\n\t * - For a map node, when an entry is added, updated, or removed.\n\t *\n\t * @remarks\n\t * This event is not emitted when:\n\t *\n\t * - Properties of a child node change. Notably, updates to an array node or a map node (like adding or removing\n\t * elements/entries) will emit this event on the array/map node itself, but not on the node that contains the\n\t * array/map node as one of its properties.\n\t *\n\t * - The node is moved to a different location in the tree or removed from the tree.\n\t * In this case the event is emitted on the _parent_ node, not the node itself.\n\t *\n\t * For remote edits, this event is not guaranteed to occur in the same order or quantity that it did in\n\t * the client that made the original edit.\n\t *\n\t * When it is emitted, the tree is guaranteed to be in-schema.\n\t *\n\t * @privateRemarks\n\t * This event occurs whenever the apparent contents of the node instance change, regardless of what caused the change.\n\t * For example, it will fire when the local client reassigns a child, when part of a remote edit is applied to the\n\t * node, or when the node has to be updated due to resolution of a merge conflict\n\t * (for example a previously applied local change might be undone, then reapplied differently or not at all).\n\t */\n\tnodeChanged(): void;\n\n\t/**\n\t * Emitted by a node after a batch of changes has been applied to the tree, when something changed anywhere in the\n\t * subtree rooted at it.\n\t *\n\t * @remarks\n\t * This event is not emitted when the node itself is moved to a different location in the tree or removed from the tree.\n\t * In that case it is emitted on the _parent_ node, not the node itself.\n\t *\n\t * The node itself is part of the subtree, so this event will be emitted even if the only changes are to the properties\n\t * of the node itself.\n\t *\n\t * For remote edits, this event is not guaranteed to occur in the same order or quantity that it did in\n\t * the client that made the original edit.\n\t *\n\t * When it is emitted, the tree is guaranteed to be in-schema.\n\t */\n\ttreeChanged(): void;\n}\n"]}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { ErasedType } from "@fluidframework/core-interfaces";
|
|
6
|
-
import { WithType, type } from "./schemaTypes.js";
|
|
7
|
-
import { FlexTreeNode, MapTreeNode } from "../feature-libraries/index.js";
|
|
5
|
+
import type { ErasedType } from "@fluidframework/core-interfaces";
|
|
6
|
+
import { type WithType, type } from "./schemaTypes.js";
|
|
7
|
+
import { type FlexTreeNode, type MapTreeNode } from "../feature-libraries/index.js";
|
|
8
8
|
/**
|
|
9
9
|
* Type alias to document which values are un-hydrated.
|
|
10
10
|
*
|
|
@@ -16,7 +16,7 @@ import { FlexTreeNode, MapTreeNode } from "../feature-libraries/index.js";
|
|
|
16
16
|
*/
|
|
17
17
|
export type Unhydrated<T> = T;
|
|
18
18
|
/**
|
|
19
|
-
* A non-leaf SharedTree node. Includes objects, arrays, and maps.
|
|
19
|
+
* A non-{@link NodeKind.Leaf|leaf} SharedTree node. Includes objects, arrays, and maps.
|
|
20
20
|
*
|
|
21
21
|
* @remarks
|
|
22
22
|
* Base type which all nodes implement.
|
|
@@ -34,11 +34,8 @@ export type Unhydrated<T> = T;
|
|
|
34
34
|
*
|
|
35
35
|
* Not all node implementations include this in their prototype chain (some hide it with a proxy),
|
|
36
36
|
* and thus cause the default/built in `instanceof` to return false despite our type checking and all other APIs treating them as TreeNodes.
|
|
37
|
-
* This
|
|
38
|
-
*
|
|
39
|
-
* The runtime behavior can be changed by implementing `Symbol.hasInstance`.
|
|
40
|
-
* One of those approaches could be used to resolve this inconsistency,
|
|
41
|
-
* but for now the type-only export prevents use of `instanceof` avoiding this problem in the public API.
|
|
37
|
+
* This class provides a custom `Symbol.hasInstance` to fix `instanceof` for this class and all classes extending it.
|
|
38
|
+
* For now the type-only export prevents use of `instanceof` on this class (but allows it in subclasses like schema classes).
|
|
42
39
|
* @public
|
|
43
40
|
*/
|
|
44
41
|
export declare abstract class TreeNode implements WithType {
|
|
@@ -49,8 +46,31 @@ export declare abstract class TreeNode implements WithType {
|
|
|
49
46
|
* Subclasses provide more specific strings for this to get strong typing of otherwise type compatible nodes.
|
|
50
47
|
*/
|
|
51
48
|
abstract get [type](): string;
|
|
49
|
+
/**
|
|
50
|
+
* Provides `instanceof` support for testing if a value is a `TreeNode`.
|
|
51
|
+
* @remarks
|
|
52
|
+
* For more options, like including leaf values or narrowing to collections of schema, use `is` or `schema` from {@link TreeNodeApi}.
|
|
53
|
+
* @privateRemarks
|
|
54
|
+
* Due to type-only export, this functionality is not available outside the package.
|
|
55
|
+
*/
|
|
56
|
+
static [Symbol.hasInstance](value: unknown): value is TreeNode;
|
|
57
|
+
/**
|
|
58
|
+
* Provides `instanceof` support for all schema classes with public constructors.
|
|
59
|
+
* @remarks
|
|
60
|
+
* For more options, like including leaf values or narrowing to collections of schema, use `is` or `schema` from {@link TreeNodeApi}.
|
|
61
|
+
* @privateRemarks
|
|
62
|
+
* Despite type-only export, this functionality is available outside the package since it is inherited by subclasses.
|
|
63
|
+
*/
|
|
64
|
+
static [Symbol.hasInstance]<TSchema extends abstract new (...args: any[]) => TreeNode>(this: TSchema, value: unknown): value is InstanceType<TSchema>;
|
|
52
65
|
protected constructor();
|
|
53
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* Check if the prototype derived's prototype chain contains `base`.
|
|
69
|
+
* @param derived - prototype to check
|
|
70
|
+
* @param base - prototype to search for
|
|
71
|
+
* @returns true iff `base` is in the prototype chain starting at `derived`.
|
|
72
|
+
*/
|
|
73
|
+
export declare function inPrototypeChain(derived: object | null, base: object): boolean;
|
|
54
74
|
/**
|
|
55
75
|
* Class which all {@link TreeNode}s must extend.
|
|
56
76
|
* Since this is not exported, it allows robust detection of attempts to create TreeNodes which do not go through SchemaFactory which is the only place which exposes classes that extend this.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/simple-tree/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/simple-tree/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAGlE,OAAO,EAAiC,KAAK,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACtF,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,WAAW,EAGhB,MAAM,+BAA+B,CAAC;AASvC;;;;;;;;GAQG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,8BAAsB,QAAS,YAAW,QAAQ;;IA6BjD;;;;OAIG;IACH,aAAoB,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC;IAErC;;;;;;OAMG;WACW,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ;IAErE;;;;;;OAMG;WACW,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,OAAO,SAAS,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,QAAQ,EAC3F,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,OAAO,GACZ,KAAK,IAAI,YAAY,CAAC,OAAO,CAAC;IAajC,SAAS;CAKT;AAED;;;;;GAKG;AAEH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAS9E;AAED;;;;;;;GAOG;AACH,8BAAsB,aAAa,CAAC,MAAM,CAAE,SAAQ,QAAQ;IAC3D;;;;;;;OAOG;IACH,SAAS,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,EACjC,IAAI,EAAE,OAAO,aAAa,CAAC,CAAC,CAAC,EAC7B,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,EAC1B,KAAK,EAAE,YAAY,GACjB,aAAa,CAAC,CAAC,CAAC;IAInB;;OAEG;IACH,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,EAC9B,IAAI,EAAE,OAAO,aAAa,CAAC,CAAC,CAAC,EAC7B,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,EAC1B,KAAK,EAAE,CAAC,GACN,WAAW;IAId;;;OAGG;IACH,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,aAAa,CAAC,CAAC,CAAC,GAAG,IAAI;IAErE;;;;;;;;;;;;;;;;;OAiBG;IACH,SAAS,CAAC,MAAM,CAAC,iBAAiB,EAAE,OAAO,aAAa,GAAG,SAAS,CAAiB;gBAElE,KAAK,EAAE,MAAM,GAAG,gBAAgB;CAwDnD;AAID;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAiB,SAAQ,UAAU,CAAC,uCAAuC,CAAC;CAAG;AAEhG,wBAAgB,cAAc,CAAC,IAAI,EAAE,gBAAgB,GAAG,YAAY,CAGnE"}
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
+
var _TreeNode_brand;
|
|
6
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.toFlexTreeNode = exports.TreeNodeValid = exports.TreeNode = void 0;
|
|
8
|
+
exports.toFlexTreeNode = exports.TreeNodeValid = exports.inPrototypeChain = exports.TreeNode = void 0;
|
|
8
9
|
const internal_1 = require("@fluidframework/core-utils/internal");
|
|
9
10
|
const schemaTypes_js_1 = require("./schemaTypes.js");
|
|
10
11
|
const index_js_1 = require("../feature-libraries/index.js");
|
|
@@ -14,8 +15,9 @@ const internal_2 = require("@fluidframework/telemetry-utils/internal");
|
|
|
14
15
|
const toFlexSchema_js_1 = require("./toFlexSchema.js");
|
|
15
16
|
const index_js_2 = require("../util/index.js");
|
|
16
17
|
const proxyBinding_js_1 = require("./proxyBinding.js");
|
|
18
|
+
const treeNodeApi_js_1 = require("./treeNodeApi.js");
|
|
17
19
|
/**
|
|
18
|
-
* A non-leaf SharedTree node. Includes objects, arrays, and maps.
|
|
20
|
+
* A non-{@link NodeKind.Leaf|leaf} SharedTree node. Includes objects, arrays, and maps.
|
|
19
21
|
*
|
|
20
22
|
* @remarks
|
|
21
23
|
* Base type which all nodes implement.
|
|
@@ -33,48 +35,71 @@ const proxyBinding_js_1 = require("./proxyBinding.js");
|
|
|
33
35
|
*
|
|
34
36
|
* Not all node implementations include this in their prototype chain (some hide it with a proxy),
|
|
35
37
|
* and thus cause the default/built in `instanceof` to return false despite our type checking and all other APIs treating them as TreeNodes.
|
|
36
|
-
* This
|
|
37
|
-
*
|
|
38
|
-
* The runtime behavior can be changed by implementing `Symbol.hasInstance`.
|
|
39
|
-
* One of those approaches could be used to resolve this inconsistency,
|
|
40
|
-
* but for now the type-only export prevents use of `instanceof` avoiding this problem in the public API.
|
|
38
|
+
* This class provides a custom `Symbol.hasInstance` to fix `instanceof` for this class and all classes extending it.
|
|
39
|
+
* For now the type-only export prevents use of `instanceof` on this class (but allows it in subclasses like schema classes).
|
|
41
40
|
* @public
|
|
42
41
|
*/
|
|
43
42
|
class TreeNode {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
* @privateRemarks
|
|
53
|
-
* This is a JavaScript private field, so is not accessible from outside this class.
|
|
54
|
-
* This prevents it from having name collisions with object fields.
|
|
55
|
-
* Since this is private, the type of this field is stripped in the d.ts file.
|
|
56
|
-
* To get matching type checking within and from outside the package, the least informative type (`unknown`) is used.
|
|
57
|
-
* To avoid this having any runtime impact, the field is uninitialized.
|
|
58
|
-
*
|
|
59
|
-
* Making this field optional results in different type checking within this project than outside of it, since the d.ts file drops the optional aspect of the field.
|
|
60
|
-
* This is extra confusing since since the tests get in-project typing for intellisense and separate project checking at build time.
|
|
61
|
-
* To avoid all this mess, this field is required, not optional.
|
|
62
|
-
*
|
|
63
|
-
* Another option would be to use a symbol (possibly as a private field).
|
|
64
|
-
* That approach ran into some strange difficulties causing SchemaFactory to fail to compile, and was not investigated further.
|
|
65
|
-
*
|
|
66
|
-
* The [type] symbol here provides a lot of the value this private brand does, but is not all of it:
|
|
67
|
-
* someone could manually (or via Intellisense auto-implement completion, or in response to a type error)
|
|
68
|
-
* make an object literal with the [type] field and pass it off as a node: this private brand prevents that.
|
|
69
|
-
*/
|
|
70
|
-
#brand;
|
|
43
|
+
static [(_TreeNode_brand = new WeakMap(), Symbol.hasInstance)](value) {
|
|
44
|
+
const schema = (0, treeNodeApi_js_1.tryGetSchema)(value);
|
|
45
|
+
if (schema === undefined || schema.kind === schemaTypes_js_1.NodeKind.Leaf) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
(0, internal_1.assert)("prototype" in schema, "expected class based schema");
|
|
49
|
+
return inPrototypeChain(schema.prototype, this.prototype);
|
|
50
|
+
}
|
|
71
51
|
constructor() {
|
|
72
|
-
|
|
52
|
+
/**
|
|
53
|
+
* This is added to prevent TypeScript from implicitly allowing non-TreeNode types to be used as TreeNodes.
|
|
54
|
+
* @remarks
|
|
55
|
+
* This field forces TypeScript to use nominal instead of structural typing,
|
|
56
|
+
* preventing compiler error messages and tools like "add missing properties"
|
|
57
|
+
* from adding the [type] field as a solution when using a non-TreeNode object where a TreeNode is required.
|
|
58
|
+
* Instead TreeNodes must be created through the appropriate APIs, see the documentation on {@link TreeNode} for details.
|
|
59
|
+
*
|
|
60
|
+
* @privateRemarks
|
|
61
|
+
* This is a JavaScript private field, so is not accessible from outside this class.
|
|
62
|
+
* This prevents it from having name collisions with object fields.
|
|
63
|
+
* Since this is private, the type of this field is stripped in the d.ts file.
|
|
64
|
+
* To get matching type checking within and from outside the package, the least informative type (`unknown`) is used.
|
|
65
|
+
* To avoid this having any runtime impact, the field is uninitialized.
|
|
66
|
+
*
|
|
67
|
+
* Making this field optional results in different type checking within this project than outside of it, since the d.ts file drops the optional aspect of the field.
|
|
68
|
+
* This is extra confusing since since the tests get in-project typing for intellisense and separate project checking at build time.
|
|
69
|
+
* To avoid all this mess, this field is required, not optional.
|
|
70
|
+
*
|
|
71
|
+
* Another option would be to use a symbol (possibly as a private field).
|
|
72
|
+
* That approach ran into some strange difficulties causing SchemaFactory to fail to compile, and was not investigated further.
|
|
73
|
+
*
|
|
74
|
+
* The [type] symbol provides a lot of the value this private brand does, but is not all of it:
|
|
75
|
+
* someone could manually (or via Intellisense auto-implement completion, or in response to a type error)
|
|
76
|
+
* make an object literal with the [type] field and pass it off as a node: this private brand prevents that.
|
|
77
|
+
*/
|
|
78
|
+
_TreeNode_brand.set(this, void 0);
|
|
79
|
+
if (!inPrototypeChain(Reflect.getPrototypeOf(this), TreeNodeValid.prototype)) {
|
|
73
80
|
throw new internal_2.UsageError("TreeNodes must extend schema classes created by SchemaFactory");
|
|
74
81
|
}
|
|
75
82
|
}
|
|
76
83
|
}
|
|
77
84
|
exports.TreeNode = TreeNode;
|
|
85
|
+
/**
|
|
86
|
+
* Check if the prototype derived's prototype chain contains `base`.
|
|
87
|
+
* @param derived - prototype to check
|
|
88
|
+
* @param base - prototype to search for
|
|
89
|
+
* @returns true iff `base` is in the prototype chain starting at `derived`.
|
|
90
|
+
*/
|
|
91
|
+
// eslint-disable-next-line @rushstack/no-new-null
|
|
92
|
+
function inPrototypeChain(derived, base) {
|
|
93
|
+
let checking = derived;
|
|
94
|
+
while (checking !== null) {
|
|
95
|
+
if (base === checking) {
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
checking = Reflect.getPrototypeOf(checking);
|
|
99
|
+
}
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
exports.inPrototypeChain = inPrototypeChain;
|
|
78
103
|
/**
|
|
79
104
|
* Class which all {@link TreeNode}s must extend.
|
|
80
105
|
* Since this is not exported, it allows robust detection of attempts to create TreeNodes which do not go through SchemaFactory which is the only place which exposes classes that extend this.
|
|
@@ -106,25 +131,6 @@ class TreeNodeValid extends TreeNode {
|
|
|
106
131
|
* This is a good place to perform extra validation and cache schema derived data needed for the implementation of the node.
|
|
107
132
|
*/
|
|
108
133
|
static oneTimeSetup() { }
|
|
109
|
-
/**
|
|
110
|
-
* The most derived constructor (the one invoked with the `new` operator, not a parent class constructor invoked with as `super`) used to construct an instance of this type.
|
|
111
|
-
* @remarks
|
|
112
|
-
* Captured when an instance is constructed.
|
|
113
|
-
*
|
|
114
|
-
* Used to ensure that some derived class (which must override this member, defaulting it to `undefined`) is only instantiated with a single "most derived" class (the constructor actually invoked the the user with `new`).
|
|
115
|
-
*
|
|
116
|
-
* Typically this is override in the class that statically implements {@link TreeNodeSchema} to enforce that all nodes using that schema use the same class and not different subclasses of it.
|
|
117
|
-
*
|
|
118
|
-
* Also used to detect if oneTimeSetup has run.
|
|
119
|
-
*
|
|
120
|
-
* @privateRemarks
|
|
121
|
-
* This defaults to TreeNodeValid, which is used to trigger an error if not overridden in the derived class.
|
|
122
|
-
*
|
|
123
|
-
* The value of this on TreeNodeValid must only be overridden by base classes and never modified.
|
|
124
|
-
* Ways to enforce this immutability prevent it from being overridden,
|
|
125
|
-
* so code modifying constructorCached should be extra careful to avoid accidentally modifying the base/inherited value.
|
|
126
|
-
*/
|
|
127
|
-
static constructorCached = TreeNodeValid;
|
|
128
134
|
constructor(input) {
|
|
129
135
|
super();
|
|
130
136
|
const schema = this.constructor;
|
|
@@ -163,6 +169,25 @@ class TreeNodeValid extends TreeNode {
|
|
|
163
169
|
}
|
|
164
170
|
}
|
|
165
171
|
exports.TreeNodeValid = TreeNodeValid;
|
|
172
|
+
/**
|
|
173
|
+
* The most derived constructor (the one invoked with the `new` operator, not a parent class constructor invoked with as `super`) used to construct an instance of this type.
|
|
174
|
+
* @remarks
|
|
175
|
+
* Captured when an instance is constructed.
|
|
176
|
+
*
|
|
177
|
+
* Used to ensure that some derived class (which must override this member, defaulting it to `undefined`) is only instantiated with a single "most derived" class (the constructor actually invoked the the user with `new`).
|
|
178
|
+
*
|
|
179
|
+
* Typically this is override in the class that statically implements {@link TreeNodeSchema} to enforce that all nodes using that schema use the same class and not different subclasses of it.
|
|
180
|
+
*
|
|
181
|
+
* Also used to detect if oneTimeSetup has run.
|
|
182
|
+
*
|
|
183
|
+
* @privateRemarks
|
|
184
|
+
* This defaults to TreeNodeValid, which is used to trigger an error if not overridden in the derived class.
|
|
185
|
+
*
|
|
186
|
+
* The value of this on TreeNodeValid must only be overridden by base classes and never modified.
|
|
187
|
+
* Ways to enforce this immutability prevent it from being overridden,
|
|
188
|
+
* so code modifying constructorCached should be extra careful to avoid accidentally modifying the base/inherited value.
|
|
189
|
+
*/
|
|
190
|
+
TreeNodeValid.constructorCached = TreeNodeValid;
|
|
166
191
|
// Class objects are functions (callable), so we need a strong way to distinguish between `schema` and `() => schema` when used as a `LazyItem`.
|
|
167
192
|
(0, index_js_1.markEager)(TreeNodeValid);
|
|
168
193
|
function toFlexTreeNode(node) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/simple-tree/types.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,kEAA6D;AAE7D,qDAAkE;AAClE,4DAKuC;AACvC,yDAA4D;AAC5D,6CAA0C;AAC1C,uEAAsE;AACtE,uDAAkD;AAClD,+CAAwC;AACxC,uDAAgD;AAahD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAsB,QAAQ;IAC7B;;;;;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,CAAC;AAYzB,SAAgB,cAAc,CAAC,IAAsB;IACpD,IAAA,iBAAM,EAAC,IAAA,yBAAc,EAAC,IAAI,CAAC,EAAE,KAAK,CAAC,8BAA8B,CAAC,CAAC;IACnE,OAAO,IAAI,CAAC;AACb,CAAC;AAHD,wCAGC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ErasedType } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport { TreeNodeSchema, WithType, type } from \"./schemaTypes.js\";\nimport {\n\tFlexTreeNode,\n\tMapTreeNode,\n\tisFlexTreeNode,\n\tmarkEager,\n} from \"../feature-libraries/index.js\";\nimport { tryGetSimpleNodeSchema } from \"./schemaCaching.js\";\nimport { isTreeNode } from \"./proxies.js\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { getFlexSchema } from \"./toFlexSchema.js\";\nimport { fail } from \"../util/index.js\";\nimport { setFlexNode } from \"./proxyBinding.js\";\n\n/**\n * Type alias to document which values are un-hydrated.\n *\n * Un-hydrated values are nodes produced from schema's create functions that haven't been inserted into a tree yet.\n *\n * Since un-hydrated nodes become hydrated when inserted, strong typing can't be used to distinguish them.\n * This no-op wrapper is used instead.\n * @public\n */\nexport type Unhydrated<T> = T;\n\n/**\n * A non-leaf SharedTree node. Includes objects, arrays, and maps.\n *\n * @remarks\n * Base type which all nodes implement.\n *\n * This can be used as a type to indicate/document values which should be tree nodes.\n * Runtime use of this class object (for example when used with `instanceof` or extending it), is not currently supported.\n *\n * Instances of tree nodes must be created by opening an existing document, inserting values into the document,\n * or by using the constructors and create functions of {@link TreeNodeSchema} produced by {@link SchemaFactory}.\n * @privateRemarks\n * This is a class not an interface to enable stricter type checking (see {@link TreeNode.#brand})\n * and some runtime enforcement of schema class policy (see the the validation in the constructor).\n * This class is however only `type` exported not value exported, preventing the class object from being used,\n * similar to how interfaces work.\n *\n * Not all node implementations include this in their prototype chain (some hide it with a proxy),\n * and thus cause the default/built in `instanceof` to return false despite our type checking and all other APIs treating them as TreeNodes.\n * This results in the runtime and compile time behavior of `instanceof` differing.\n * TypeScript 5.3 allows altering the compile time behavior of `instanceof`.\n * The runtime behavior can be changed by implementing `Symbol.hasInstance`.\n * One of those approaches could be used to resolve this inconsistency,\n * but for now the type-only export prevents use of `instanceof` avoiding this problem in the public API.\n * @public\n */\nexport abstract class TreeNode implements WithType {\n\t/**\n\t * This is added to prevent TypeScript from implicitly allowing non-TreeNode types to be used as TreeNodes.\n\t * @remarks\n\t * This field forces TypeScript to use nominal instead of structural typing,\n\t * preventing compiler error messages and tools like \"add missing properties\"\n\t * from adding the [type] field as a solution when using a non-TreeNode object where a TreeNode is required.\n\t * Instead TreeNodes must be created through the appropriate APIs, see the documentation on {@link TreeNode} for details.\n\t *\n\t * @privateRemarks\n\t * This is a JavaScript private field, so is not accessible from outside this class.\n\t * This prevents it from having name collisions with object fields.\n\t * Since this is private, the type of this field is stripped in the d.ts file.\n\t * To get matching type checking within and from outside the package, the least informative type (`unknown`) is used.\n\t * To avoid this having any runtime impact, the field is uninitialized.\n\t *\n\t * Making this field optional results in different type checking within this project than outside of it, since the d.ts file drops the optional aspect of the field.\n\t * This is extra confusing since since the tests get in-project typing for intellisense and separate project checking at build time.\n\t * To avoid all this mess, this field is required, not optional.\n\t *\n\t * Another option would be to use a symbol (possibly as a private field).\n\t * That approach ran into some strange difficulties causing SchemaFactory to fail to compile, and was not investigated further.\n\t *\n\t * The [type] symbol here provides a lot of the value this private brand does, but is not all of it:\n\t * someone could manually (or via Intellisense auto-implement completion, or in response to a type error)\n\t * make an object literal with the [type] field and pass it off as a node: this private brand prevents that.\n\t */\n\treadonly #brand!: unknown;\n\n\t/**\n\t * {@inheritdoc \"type\"}\n\t * @privateRemarks\n\t * Subclasses provide more specific strings for this to get strong typing of otherwise type compatible nodes.\n\t */\n\tpublic abstract get [type](): string;\n\n\tprotected constructor() {\n\t\tif (!(this instanceof TreeNodeValid)) {\n\t\t\tthrow new UsageError(\"TreeNodes must extend schema classes created by SchemaFactory\");\n\t\t}\n\t}\n}\n\n/**\n * Class which all {@link TreeNode}s must extend.\n * Since this is not exported, it allows robust detection of attempts to create TreeNodes which do not go through SchemaFactory which is the only place which exposes classes that extend this.\n *\n * This has static members which schema classes can override to provide schema specific functionality.\n * These static members are only intended to be used / overridden by code within this package, and are used by the various node kinds.\n * Access to these static members has to be done via `this.constructor.staticMember` to support the overrides, and thus can only be used in the constructor, after the base constructor has been invoked.\n */\nexport abstract class TreeNodeValid<TInput> extends TreeNode {\n\t/**\n\t * Schema classes can override this to control what happens at the end of the constructor.\n\t * The return value from this is returned from the constructor, allowing substituting a proxy if desired.\n\t *\n\t * This is not simply done in the derived constructor to enable:\n\t * - this class to access the value which is being returned before it's returned from the constructor.\n\t * - the derived class to be provided the input `FlexTreeNode` without relying on a field on the node to hold it.\n\t */\n\tprotected static prepareInstance<T>(\n\t\tthis: typeof TreeNodeValid<T>,\n\t\tinstance: TreeNodeValid<T>,\n\t\tinput: FlexTreeNode,\n\t): TreeNodeValid<T> {\n\t\treturn instance;\n\t}\n\n\t/**\n\t * Schema classes must override to provide an implementation of RawTreeNode construction.\n\t */\n\tprotected static buildRawNode<T>(\n\t\tthis: typeof TreeNodeValid<T>,\n\t\tinstance: TreeNodeValid<T>,\n\t\tinput: T,\n\t): MapTreeNode {\n\t\treturn fail(\"Schema must override buildRawNode\");\n\t}\n\n\t/**\n\t * Schema classes can override to provide a callback that is called once when the first node is constructed.\n\t * This is a good place to perform extra validation and cache schema derived data needed for the implementation of the node.\n\t */\n\tprotected static oneTimeSetup<T>(this: typeof TreeNodeValid<T>): void {}\n\n\t/**\n\t * The most derived constructor (the one invoked with the `new` operator, not a parent class constructor invoked with as `super`) used to construct an instance of this type.\n\t * @remarks\n\t * Captured when an instance is constructed.\n\t *\n\t * Used to ensure that some derived class (which must override this member, defaulting it to `undefined`) is only instantiated with a single \"most derived\" class (the constructor actually invoked the the user with `new`).\n\t *\n\t * Typically this is override in the class that statically implements {@link TreeNodeSchema} to enforce that all nodes using that schema use the same class and not different subclasses of it.\n\t *\n\t * Also used to detect if oneTimeSetup has run.\n\t *\n\t * @privateRemarks\n\t * This defaults to TreeNodeValid, which is used to trigger an error if not overridden in the derived class.\n\t *\n\t * The value of this on TreeNodeValid must only be overridden by base classes and never modified.\n\t * Ways to enforce this immutability prevent it from being overridden,\n\t * so code modifying constructorCached should be extra careful to avoid accidentally modifying the base/inherited value.\n\t */\n\tprotected static constructorCached: typeof TreeNodeValid | undefined = TreeNodeValid;\n\n\tpublic constructor(input: TInput | InternalTreeNode) {\n\t\tsuper();\n\t\tconst schema = this.constructor as typeof TreeNodeValid & TreeNodeSchema;\n\t\tassert(\"constructorCached\" in schema, 0x95f /* invalid schema class */);\n\t\tif (schema.constructorCached !== schema) {\n\t\t\tif (schema.constructorCached !== undefined) {\n\t\t\t\tassert(\n\t\t\t\t\tschema.constructorCached !== TreeNodeValid,\n\t\t\t\t\t0x960 /* Schema class schema must override static constructorCached member */,\n\t\t\t\t);\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t`Two schema classes were instantiated (${schema.name} and ${schema.constructorCached.name}) which derived from the same SchemaFactory generated class. This is invalid`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst flexSchema = getFlexSchema(schema);\n\t\t\tassert(\n\t\t\t\ttryGetSimpleNodeSchema(flexSchema) === schema,\n\t\t\t\t0x961 /* Schema class not properly configured */,\n\t\t\t);\n\t\t\tschema.oneTimeSetup();\n\t\t\t// Set the constructorCached on the layer of the prototype chain that declared it.\n\t\t\t// This is necessary to ensure there is only one subclass of that type used:\n\t\t\t// if constructorCached was simply set on `schema`,\n\t\t\t// then a base classes between `schema` (exclusive) and where `constructorCached` is set (inclusive) and other subclasses of them\n\t\t\t// would not see the stored `constructorCached`, and the validation above against multiple derived classes would not work.\n\t\t\t{\n\t\t\t\tlet schemaBase: typeof TreeNodeValid = schema;\n\t\t\t\twhile (!Object.prototype.hasOwnProperty.call(schemaBase, \"constructorCached\")) {\n\t\t\t\t\tschemaBase = Reflect.getPrototypeOf(schemaBase) as typeof TreeNodeValid;\n\t\t\t\t}\n\t\t\t\tassert(\n\t\t\t\t\tschemaBase.constructorCached === undefined,\n\t\t\t\t\t0x962 /* overwriting wrong cache */,\n\t\t\t\t);\n\t\t\t\tschemaBase.constructorCached = schema;\n\t\t\t}\n\t\t}\n\n\t\tif (isTreeNode(input)) {\n\t\t\t// TODO: update this once we have better support for deep-copying and move operations.\n\t\t\tthrow new UsageError(\n\t\t\t\t\"Existing nodes may not be used as the constructor parameter for a new node. The existing node may be used directly instead of creating a new one, used as a child of the new node (if it has not yet been inserted into the tree). If the desired result is copying the provided node, it must be deep copied (since any child node would be parented under both the new and old nodes). Currently no API is provided to make deep copies, but it can be done manually with object spreads - for example `new Foo({...oldFoo})` will work if all fields of `oldFoo` are leaf nodes.\",\n\t\t\t);\n\t\t}\n\n\t\tconst node: FlexTreeNode = isFlexTreeNode(input) ? input : schema.buildRawNode(this, input);\n\t\tassert(\n\t\t\ttryGetSimpleNodeSchema(node.schema) === schema,\n\t\t\t0x83b /* building node with wrong schema */,\n\t\t);\n\n\t\tconst result = schema.prepareInstance(this, node);\n\t\tsetFlexNode(result, node);\n\t\treturn result;\n\t}\n}\n// Class objects are functions (callable), so we need a strong way to distinguish between `schema` and `() => schema` when used as a `LazyItem`.\nmarkEager(TreeNodeValid);\n\n/**\n * A node type internal to `@fluidframework/tree`.\n * @remarks\n * This type is used in the construction of {@link TreeNode} as an implementation detail, but leaks into the public API due to how schema are implemented.\n * @privateRemarks\n * A {@link FlexTreeNode}. Includes {@link RawTreeNode}s.\n * @public\n */\nexport interface InternalTreeNode extends ErasedType<\"@fluidframework/tree.InternalTreeNode\"> {}\n\nexport function toFlexTreeNode(node: InternalTreeNode): FlexTreeNode {\n\tassert(isFlexTreeNode(node), 0x963 /* Invalid InternalTreeNode */);\n\treturn node;\n}\n"]}
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AE,KAAK,CAAC,8BAA8B,CAAC,CAAC;IACnE,OAAO,IAAI,CAAC;AACb,CAAC;AAHD,wCAGC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ErasedType } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport { NodeKind, type TreeNodeSchema, type WithType, type } from \"./schemaTypes.js\";\nimport {\n\ttype FlexTreeNode,\n\ttype MapTreeNode,\n\tisFlexTreeNode,\n\tmarkEager,\n} from \"../feature-libraries/index.js\";\nimport { tryGetSimpleNodeSchema } from \"./schemaCaching.js\";\nimport { isTreeNode } from \"./proxies.js\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { getFlexSchema } from \"./toFlexSchema.js\";\nimport { fail } from \"../util/index.js\";\nimport { setFlexNode } from \"./proxyBinding.js\";\nimport { tryGetSchema } from \"./treeNodeApi.js\";\n\n/**\n * Type alias to document which values are un-hydrated.\n *\n * Un-hydrated values are nodes produced from schema's create functions that haven't been inserted into a tree yet.\n *\n * Since un-hydrated nodes become hydrated when inserted, strong typing can't be used to distinguish them.\n * This no-op wrapper is used instead.\n * @public\n */\nexport type Unhydrated<T> = T;\n\n/**\n * A non-{@link NodeKind.Leaf|leaf} SharedTree node. Includes objects, arrays, and maps.\n *\n * @remarks\n * Base type which all nodes implement.\n *\n * This can be used as a type to indicate/document values which should be tree nodes.\n * Runtime use of this class object (for example when used with `instanceof` or extending it), is not currently supported.\n *\n * Instances of tree nodes must be created by opening an existing document, inserting values into the document,\n * or by using the constructors and create functions of {@link TreeNodeSchema} produced by {@link SchemaFactory}.\n * @privateRemarks\n * This is a class not an interface to enable stricter type checking (see {@link TreeNode.#brand})\n * and some runtime enforcement of schema class policy (see the the validation in the constructor).\n * This class is however only `type` exported not value exported, preventing the class object from being used,\n * similar to how interfaces work.\n *\n * Not all node implementations include this in their prototype chain (some hide it with a proxy),\n * and thus cause the default/built in `instanceof` to return false despite our type checking and all other APIs treating them as TreeNodes.\n * This class provides a custom `Symbol.hasInstance` to fix `instanceof` for this class and all classes extending it.\n * For now the type-only export prevents use of `instanceof` on this class (but allows it in subclasses like schema classes).\n * @public\n */\nexport abstract class TreeNode implements WithType {\n\t/**\n\t * This is added to prevent TypeScript from implicitly allowing non-TreeNode types to be used as TreeNodes.\n\t * @remarks\n\t * This field forces TypeScript to use nominal instead of structural typing,\n\t * preventing compiler error messages and tools like \"add missing properties\"\n\t * from adding the [type] field as a solution when using a non-TreeNode object where a TreeNode is required.\n\t * Instead TreeNodes must be created through the appropriate APIs, see the documentation on {@link TreeNode} for details.\n\t *\n\t * @privateRemarks\n\t * This is a JavaScript private field, so is not accessible from outside this class.\n\t * This prevents it from having name collisions with object fields.\n\t * Since this is private, the type of this field is stripped in the d.ts file.\n\t * To get matching type checking within and from outside the package, the least informative type (`unknown`) is used.\n\t * To avoid this having any runtime impact, the field is uninitialized.\n\t *\n\t * Making this field optional results in different type checking within this project than outside of it, since the d.ts file drops the optional aspect of the field.\n\t * This is extra confusing since since the tests get in-project typing for intellisense and separate project checking at build time.\n\t * To avoid all this mess, this field is required, not optional.\n\t *\n\t * Another option would be to use a symbol (possibly as a private field).\n\t * That approach ran into some strange difficulties causing SchemaFactory to fail to compile, and was not investigated further.\n\t *\n\t * The [type] symbol provides a lot of the value this private brand does, but is not all of it:\n\t * someone could manually (or via Intellisense auto-implement completion, or in response to a type error)\n\t * make an object literal with the [type] field and pass it off as a node: this private brand prevents that.\n\t */\n\treadonly #brand!: unknown;\n\n\t/**\n\t * {@inheritdoc \"type\"}\n\t * @privateRemarks\n\t * Subclasses provide more specific strings for this to get strong typing of otherwise type compatible nodes.\n\t */\n\tpublic abstract get [type](): string;\n\n\t/**\n\t * Provides `instanceof` support for testing if a value is a `TreeNode`.\n\t * @remarks\n\t * For more options, like including leaf values or narrowing to collections of schema, use `is` or `schema` from {@link TreeNodeApi}.\n\t * @privateRemarks\n\t * Due to type-only export, this functionality is not available outside the package.\n\t */\n\tpublic static [Symbol.hasInstance](value: unknown): value is TreeNode;\n\n\t/**\n\t * Provides `instanceof` support for all schema classes with public constructors.\n\t * @remarks\n\t * For more options, like including leaf values or narrowing to collections of schema, use `is` or `schema` from {@link TreeNodeApi}.\n\t * @privateRemarks\n\t * Despite type-only export, this functionality is available outside the package since it is inherited by subclasses.\n\t */\n\tpublic static [Symbol.hasInstance]<TSchema extends abstract new (...args: any[]) => TreeNode>(\n\t\tthis: TSchema,\n\t\tvalue: unknown,\n\t): value is InstanceType<TSchema>;\n\n\tpublic static [Symbol.hasInstance](this: { prototype: object }, value: unknown): boolean {\n\t\tconst schema = tryGetSchema(value);\n\n\t\tif (schema === undefined || schema.kind === NodeKind.Leaf) {\n\t\t\treturn false;\n\t\t}\n\n\t\tassert(\"prototype\" in schema, \"expected class based schema\");\n\t\treturn inPrototypeChain(schema.prototype, this.prototype);\n\t}\n\n\tprotected constructor() {\n\t\tif (!inPrototypeChain(Reflect.getPrototypeOf(this), TreeNodeValid.prototype)) {\n\t\t\tthrow new UsageError(\"TreeNodes must extend schema classes created by SchemaFactory\");\n\t\t}\n\t}\n}\n\n/**\n * Check if the prototype derived's prototype chain contains `base`.\n * @param derived - prototype to check\n * @param base - prototype to search for\n * @returns true iff `base` is in the prototype chain starting at `derived`.\n */\n// eslint-disable-next-line @rushstack/no-new-null\nexport function inPrototypeChain(derived: object | null, base: object): boolean {\n\tlet checking = derived;\n\twhile (checking !== null) {\n\t\tif (base === checking) {\n\t\t\treturn true;\n\t\t}\n\t\tchecking = Reflect.getPrototypeOf(checking);\n\t}\n\treturn false;\n}\n\n/**\n * Class which all {@link TreeNode}s must extend.\n * Since this is not exported, it allows robust detection of attempts to create TreeNodes which do not go through SchemaFactory which is the only place which exposes classes that extend this.\n *\n * This has static members which schema classes can override to provide schema specific functionality.\n * These static members are only intended to be used / overridden by code within this package, and are used by the various node kinds.\n * Access to these static members has to be done via `this.constructor.staticMember` to support the overrides, and thus can only be used in the constructor, after the base constructor has been invoked.\n */\nexport abstract class TreeNodeValid<TInput> extends TreeNode {\n\t/**\n\t * Schema classes can override this to control what happens at the end of the constructor.\n\t * The return value from this is returned from the constructor, allowing substituting a proxy if desired.\n\t *\n\t * This is not simply done in the derived constructor to enable:\n\t * - this class to access the value which is being returned before it's returned from the constructor.\n\t * - the derived class to be provided the input `FlexTreeNode` without relying on a field on the node to hold it.\n\t */\n\tprotected static prepareInstance<T>(\n\t\tthis: typeof TreeNodeValid<T>,\n\t\tinstance: TreeNodeValid<T>,\n\t\tinput: FlexTreeNode,\n\t): TreeNodeValid<T> {\n\t\treturn instance;\n\t}\n\n\t/**\n\t * Schema classes must override to provide an implementation of RawTreeNode construction.\n\t */\n\tprotected static buildRawNode<T>(\n\t\tthis: typeof TreeNodeValid<T>,\n\t\tinstance: TreeNodeValid<T>,\n\t\tinput: T,\n\t): MapTreeNode {\n\t\treturn fail(\"Schema must override buildRawNode\");\n\t}\n\n\t/**\n\t * Schema classes can override to provide a callback that is called once when the first node is constructed.\n\t * This is a good place to perform extra validation and cache schema derived data needed for the implementation of the node.\n\t */\n\tprotected static oneTimeSetup<T>(this: typeof TreeNodeValid<T>): void {}\n\n\t/**\n\t * The most derived constructor (the one invoked with the `new` operator, not a parent class constructor invoked with as `super`) used to construct an instance of this type.\n\t * @remarks\n\t * Captured when an instance is constructed.\n\t *\n\t * Used to ensure that some derived class (which must override this member, defaulting it to `undefined`) is only instantiated with a single \"most derived\" class (the constructor actually invoked the the user with `new`).\n\t *\n\t * Typically this is override in the class that statically implements {@link TreeNodeSchema} to enforce that all nodes using that schema use the same class and not different subclasses of it.\n\t *\n\t * Also used to detect if oneTimeSetup has run.\n\t *\n\t * @privateRemarks\n\t * This defaults to TreeNodeValid, which is used to trigger an error if not overridden in the derived class.\n\t *\n\t * The value of this on TreeNodeValid must only be overridden by base classes and never modified.\n\t * Ways to enforce this immutability prevent it from being overridden,\n\t * so code modifying constructorCached should be extra careful to avoid accidentally modifying the base/inherited value.\n\t */\n\tprotected static constructorCached: typeof TreeNodeValid | undefined = TreeNodeValid;\n\n\tpublic constructor(input: TInput | InternalTreeNode) {\n\t\tsuper();\n\t\tconst schema = this.constructor as typeof TreeNodeValid & TreeNodeSchema;\n\t\tassert(\"constructorCached\" in schema, 0x95f /* invalid schema class */);\n\t\tif (schema.constructorCached !== schema) {\n\t\t\tif (schema.constructorCached !== undefined) {\n\t\t\t\tassert(\n\t\t\t\t\tschema.constructorCached !== TreeNodeValid,\n\t\t\t\t\t0x960 /* Schema class schema must override static constructorCached member */,\n\t\t\t\t);\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t`Two schema classes were instantiated (${schema.name} and ${schema.constructorCached.name}) which derived from the same SchemaFactory generated class. This is invalid`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst flexSchema = getFlexSchema(schema);\n\t\t\tassert(\n\t\t\t\ttryGetSimpleNodeSchema(flexSchema) === schema,\n\t\t\t\t0x961 /* Schema class not properly configured */,\n\t\t\t);\n\t\t\tschema.oneTimeSetup();\n\t\t\t// Set the constructorCached on the layer of the prototype chain that declared it.\n\t\t\t// This is necessary to ensure there is only one subclass of that type used:\n\t\t\t// if constructorCached was simply set on `schema`,\n\t\t\t// then a base classes between `schema` (exclusive) and where `constructorCached` is set (inclusive) and other subclasses of them\n\t\t\t// would not see the stored `constructorCached`, and the validation above against multiple derived classes would not work.\n\t\t\t{\n\t\t\t\tlet schemaBase: typeof TreeNodeValid = schema;\n\t\t\t\twhile (!Object.prototype.hasOwnProperty.call(schemaBase, \"constructorCached\")) {\n\t\t\t\t\tschemaBase = Reflect.getPrototypeOf(schemaBase) as typeof TreeNodeValid;\n\t\t\t\t}\n\t\t\t\tassert(\n\t\t\t\t\tschemaBase.constructorCached === undefined,\n\t\t\t\t\t0x962 /* overwriting wrong cache */,\n\t\t\t\t);\n\t\t\t\tschemaBase.constructorCached = schema;\n\t\t\t}\n\t\t}\n\n\t\tif (isTreeNode(input)) {\n\t\t\t// TODO: update this once we have better support for deep-copying and move operations.\n\t\t\tthrow new UsageError(\n\t\t\t\t\"Existing nodes may not be used as the constructor parameter for a new node. The existing node may be used directly instead of creating a new one, used as a child of the new node (if it has not yet been inserted into the tree). If the desired result is copying the provided node, it must be deep copied (since any child node would be parented under both the new and old nodes). Currently no API is provided to make deep copies, but it can be done manually with object spreads - for example `new Foo({...oldFoo})` will work if all fields of `oldFoo` are leaf nodes.\",\n\t\t\t);\n\t\t}\n\n\t\tconst node: FlexTreeNode = isFlexTreeNode(input) ? input : schema.buildRawNode(this, input);\n\t\tassert(\n\t\t\ttryGetSimpleNodeSchema(node.schema) === schema,\n\t\t\t0x83b /* building node with wrong schema */,\n\t\t);\n\n\t\tconst result = schema.prepareInstance(this, node);\n\t\tsetFlexNode(result, node);\n\t\treturn result;\n\t}\n}\n// Class objects are functions (callable), so we need a strong way to distinguish between `schema` and `() => schema` when used as a `LazyItem`.\nmarkEager(TreeNodeValid);\n\n/**\n * A node type internal to `@fluidframework/tree`.\n * @remarks\n * This type is used in the construction of {@link TreeNode} as an implementation detail, but leaks into the public API due to how schema are implemented.\n * @privateRemarks\n * A {@link FlexTreeNode}. Includes {@link RawTreeNode}s.\n * @public\n */\nexport interface InternalTreeNode extends ErasedType<\"@fluidframework/tree.InternalTreeNode\"> {}\n\nexport function toFlexTreeNode(node: InternalTreeNode): FlexTreeNode {\n\tassert(isFlexTreeNode(node), 0x963 /* Invalid InternalTreeNode */);\n\treturn node;\n}\n"]}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { InternalFlexListTypes, Unenforced } from "../feature-libraries/index.js";
|
|
6
|
-
import { RestrictiveReadonlyRecord } from "../util/index.js";
|
|
7
|
-
import { AllowedTypes, ApplyKind, FieldKind,
|
|
8
|
-
import { TreeArrayNodeBase, TreeArrayNode } from "./arrayNode.js";
|
|
9
|
-
import { TreeNode, Unhydrated } from "./types.js";
|
|
5
|
+
import type { InternalFlexListTypes, Unenforced } from "../feature-libraries/index.js";
|
|
6
|
+
import type { RestrictiveReadonlyRecord } from "../util/index.js";
|
|
7
|
+
import type { AllowedTypes, ApplyKind, FieldKind, FieldSchema, ImplicitAllowedTypes, ImplicitFieldSchema, NodeFromSchema, NodeKind, TreeNodeFromImplicitAllowedTypes, TreeNodeSchema, WithType } from "./schemaTypes.js";
|
|
8
|
+
import type { TreeArrayNodeBase, TreeArrayNode } from "./arrayNode.js";
|
|
9
|
+
import type { TreeNode, Unhydrated } from "./types.js";
|
|
10
10
|
/**
|
|
11
11
|
* {@link Unenforced} version of {@link ObjectFromSchemaRecord}.
|
|
12
12
|
* @public
|