@fluidframework/tree 2.0.0-dev-rc.4.0.0.261659 → 2.0.0-dev-rc.5.0.0.265721
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 +25 -2
- package/CHANGELOG.md +17 -0
- package/api-report/tree.api.md +46 -36
- package/dist/beta.d.ts +2 -1
- package/dist/codec/codec.d.ts +1 -1
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js.map +1 -1
- package/dist/codec/discriminatedUnions.d.ts.map +1 -1
- package/dist/codec/discriminatedUnions.js +1 -0
- package/dist/codec/discriminatedUnions.js.map +1 -1
- package/dist/core/forest/forest.d.ts +5 -6
- package/dist/core/forest/forest.d.ts.map +1 -1
- package/dist/core/forest/forest.js.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/index.d.ts +1 -1
- package/dist/core/rebase/index.d.ts.map +1 -1
- package/dist/core/rebase/index.js +2 -1
- package/dist/core/rebase/index.js.map +1 -1
- package/dist/core/rebase/revisionTagCodec.js.map +1 -1
- package/dist/core/rebase/types.d.ts +1 -0
- package/dist/core/rebase/types.d.ts.map +1 -1
- package/dist/core/rebase/types.js +5 -1
- package/dist/core/rebase/types.js.map +1 -1
- package/dist/core/rebase/utils.d.ts.map +1 -1
- package/dist/core/rebase/utils.js.map +1 -1
- package/dist/core/rebase/verifyChangeRebaser.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +4 -0
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.js.map +1 -1
- package/dist/core/tree/anchorSet.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.js +4 -0
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/cursor.d.ts.map +1 -1
- package/dist/core/tree/cursor.js +3 -1
- package/dist/core/tree/cursor.js.map +1 -1
- package/dist/core/tree/deltaUtil.js.map +1 -1
- package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndex.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodec.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodec.js.map +1 -1
- package/dist/core/tree/mapTree.js.map +1 -1
- package/dist/core/tree/pathTree.js.map +1 -1
- package/dist/core/tree/persistedTreeTextFormat.d.ts +4 -4
- package/dist/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
- package/dist/core/tree/persistedTreeTextFormat.js +1 -0
- package/dist/core/tree/persistedTreeTextFormat.js.map +1 -1
- package/dist/core/tree/sparseTree.js.map +1 -1
- package/dist/core/tree/treeTextFormat.js.map +1 -1
- package/dist/core/tree/visitDelta.js.map +1 -1
- package/dist/core/tree/visitorUtils.js.map +1 -1
- package/dist/domains/index.d.ts +0 -1
- package/dist/domains/index.d.ts.map +1 -1
- package/dist/domains/index.js +1 -5
- package/dist/domains/index.js.map +1 -1
- package/dist/domains/json/jsonCursor.js +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.map +1 -1
- package/dist/domains/schemaBuilder.js +1 -0
- package/dist/domains/schemaBuilder.js.map +1 -1
- package/dist/domains/testRecursiveDomain.js.map +1 -1
- package/dist/events/events.d.ts +1 -1
- package/dist/events/events.d.ts.map +1 -1
- package/dist/events/events.js +1 -0
- package/dist/events/events.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.js +4 -2
- package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +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 +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncoding.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- 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.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js +13 -9
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +0 -6
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +12 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultSchema.js +1 -0
- package/dist/feature-libraries/default-schema/defaultSchema.js.map +1 -1
- package/dist/feature-libraries/default-schema/index.d.ts +2 -1
- package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/index.js +4 -1
- package/dist/feature-libraries/default-schema/index.js.map +1 -1
- package/dist/feature-libraries/default-schema/schemaChecker.js.map +1 -1
- package/dist/feature-libraries/deltaUtils.js.map +1 -1
- package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts +2 -2
- package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
- package/dist/feature-libraries/editableTreeBinder.js.map +1 -1
- package/dist/feature-libraries/flex-tree/context.d.ts +10 -16
- package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/context.js +14 -20
- package/dist/feature-libraries/flex-tree/context.js.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +14 -13
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js +0 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/dist/feature-libraries/flex-tree/index.d.ts +1 -0
- package/dist/feature-libraries/flex-tree/index.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/index.js +3 -1
- package/dist/feature-libraries/flex-tree/index.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.d.ts +3 -10
- package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +9 -39
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts +3 -7
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.js +6 -29
- package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/dist/feature-libraries/flex-tree/navigation.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/navigation.js.map +1 -1
- package/dist/feature-libraries/flex-tree/unboxed.js.map +1 -1
- package/dist/feature-libraries/flex-tree/utilities.d.ts +8 -2
- package/dist/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/utilities.js +13 -1
- package/dist/feature-libraries/flex-tree/utilities.js.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +2 -2
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +3 -3
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +5 -3
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/mapTreeCursor.js +1 -1
- package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
- package/dist/feature-libraries/memoizedIdRangeAllocator.js.map +1 -1
- package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.d.ts +1 -1
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js +4 -1
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindFormat.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKindFormat.js +3 -0
- package/dist/feature-libraries/modular-schema/genericFieldKindFormat.js.map +1 -1
- package/dist/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +2 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +0 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +1 -5
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +1 -9
- 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/index.d.ts +1 -1
- package/dist/feature-libraries/node-key/index.d.ts.map +1 -1
- package/dist/feature-libraries/node-key/index.js +1 -2
- package/dist/feature-libraries/node-key/index.js.map +1 -1
- package/dist/feature-libraries/node-key/nodeKey.d.ts +0 -8
- package/dist/feature-libraries/node-key/nodeKey.d.ts.map +1 -1
- package/dist/feature-libraries/node-key/nodeKey.js +1 -9
- package/dist/feature-libraries/node-key/nodeKey.js.map +1 -1
- package/dist/feature-libraries/node-key/nodeKeyIndex.d.ts +1 -1
- package/dist/feature-libraries/node-key/nodeKeyIndex.d.ts.map +1 -1
- package/dist/feature-libraries/node-key/nodeKeyIndex.js.map +1 -1
- package/dist/feature-libraries/node-key/nodeKeyManager.d.ts +12 -2
- package/dist/feature-libraries/node-key/nodeKeyManager.d.ts.map +1 -1
- package/dist/feature-libraries/node-key/nodeKeyManager.js +3 -3
- package/dist/feature-libraries/node-key/nodeKeyManager.js.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.js +13 -3
- package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.js +4 -0
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV1.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.js +4 -0
- package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV2.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV1.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
- package/dist/feature-libraries/schema-aware/schemaAware.d.ts +1 -1
- package/dist/feature-libraries/schema-aware/schemaAware.d.ts.map +1 -1
- package/dist/feature-libraries/schema-aware/schemaAware.js.map +1 -1
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +2 -2
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/dist/feature-libraries/schemaBuilderBase.js.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/compose.js +33 -104
- package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
- package/dist/feature-libraries/sequence-field/{format.d.ts → formatV1.d.ts} +41 -41
- package/dist/feature-libraries/sequence-field/formatV1.d.ts.map +1 -0
- package/dist/feature-libraries/sequence-field/{format.js → formatV1.js} +5 -1
- package/dist/feature-libraries/sequence-field/formatV1.js.map +1 -0
- package/dist/feature-libraries/sequence-field/formatV2.d.ts +261 -0
- package/dist/feature-libraries/sequence-field/formatV2.d.ts.map +1 -0
- package/dist/feature-libraries/sequence-field/formatV2.js +71 -0
- package/dist/feature-libraries/sequence-field/formatV2.js.map +1 -0
- package/dist/feature-libraries/sequence-field/index.d.ts +2 -2
- package/dist/feature-libraries/sequence-field/index.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/index.js +2 -2
- package/dist/feature-libraries/sequence-field/index.js.map +1 -1
- package/dist/feature-libraries/sequence-field/invert.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/invert.js +4 -21
- package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
- package/dist/feature-libraries/sequence-field/markListFactory.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/markListFactory.js +0 -4
- package/dist/feature-libraries/sequence-field/markListFactory.js.map +1 -1
- package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
- 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.js.map +1 -1
- package/dist/feature-libraries/sequence-field/rebase.d.ts +1 -2
- package/dist/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/rebase.js +15 -359
- package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
- package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -1
- package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +11 -0
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +1 -0
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js +211 -0
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +1 -0
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +11 -0
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -0
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +192 -0
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -0
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +3 -2
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js +6 -235
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +9 -7
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js +14 -15
- package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
- package/dist/feature-libraries/sequence-field/types.d.ts +2 -45
- 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 +1 -12
- package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/utils.js +7 -115
- package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
- package/dist/feature-libraries/storedToViewSchema.js.map +1 -1
- package/dist/feature-libraries/treeCursorUtils.js.map +1 -1
- package/dist/feature-libraries/treeTextCursor.js.map +1 -1
- package/dist/feature-libraries/typed-schema/flexList.js.map +1 -1
- package/dist/feature-libraries/typed-schema/schemaCollection.js.map +1 -1
- package/dist/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
- package/dist/feature-libraries/typed-schema/view.js.map +1 -1
- package/dist/feature-libraries/valueUtilities.d.ts +1 -1
- package/dist/feature-libraries/valueUtilities.d.ts.map +1 -1
- package/dist/feature-libraries/valueUtilities.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -3
- 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 +2 -1
- package/dist/shared-tree/defaultCommitEnricher.js +3 -3
- package/dist/shared-tree/defaultCommitEnricher.js.map +1 -1
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +2 -4
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +15 -8
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +4 -4
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +3 -4
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.js +4 -0
- package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/treeApi.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +16 -5
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree/treeView.d.ts +1 -3
- package/dist/shared-tree/treeView.d.ts.map +1 -1
- package/dist/shared-tree/treeView.js +5 -4
- package/dist/shared-tree/treeView.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts +0 -1
- package/dist/shared-tree-core/branch.d.ts.map +1 -1
- package/dist/shared-tree-core/branch.js +0 -1
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/shared-tree-core/editManager.d.ts.map +1 -1
- package/dist/shared-tree-core/editManager.js +0 -1
- package/dist/shared-tree-core/editManager.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js +2 -0
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormat.d.ts +8 -9
- package/dist/shared-tree-core/editManagerFormat.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormat.js +4 -1
- package/dist/shared-tree-core/editManagerFormat.js.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.d.ts +2 -2
- package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js +1 -0
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormat.js +2 -0
- package/dist/shared-tree-core/messageFormat.js.map +1 -1
- package/dist/shared-tree-core/sequenceIdUtils.d.ts +2 -8
- 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 +3 -4
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +5 -5
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/shared-tree-core/transactionStack.d.ts +1 -2
- package/dist/shared-tree-core/transactionStack.d.ts.map +1 -1
- package/dist/shared-tree-core/transactionStack.js +1 -2
- package/dist/shared-tree-core/transactionStack.js.map +1 -1
- package/dist/simple-tree/arrayNode.d.ts +8 -2
- package/dist/simple-tree/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/arrayNode.js +34 -7
- package/dist/simple-tree/arrayNode.js.map +1 -1
- package/dist/simple-tree/index.d.ts +3 -3
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +2 -2
- package/dist/simple-tree/index.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.map +1 -1
- package/dist/simple-tree/mapNode.d.ts +33 -1
- package/dist/simple-tree/mapNode.d.ts.map +1 -1
- package/dist/simple-tree/mapNode.js +4 -2
- package/dist/simple-tree/mapNode.js.map +1 -1
- package/dist/simple-tree/nodeKeys.d.ts +2 -1
- 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 +2 -3
- package/dist/simple-tree/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/objectNode.js +4 -7
- package/dist/simple-tree/objectNode.js.map +1 -1
- package/dist/simple-tree/proxies.d.ts +1 -1
- package/dist/simple-tree/proxies.d.ts.map +1 -1
- package/dist/simple-tree/proxies.js.map +1 -1
- package/dist/simple-tree/proxyBinding.js +2 -2
- package/dist/simple-tree/proxyBinding.js.map +1 -1
- package/dist/simple-tree/rawNode.js.map +1 -1
- package/dist/simple-tree/schemaCaching.d.ts.map +1 -1
- package/dist/simple-tree/schemaCaching.js +4 -0
- package/dist/simple-tree/schemaCaching.js.map +1 -1
- package/dist/simple-tree/schemaCreationUtilities.d.ts.map +1 -1
- package/dist/simple-tree/schemaCreationUtilities.js +7 -0
- package/dist/simple-tree/schemaCreationUtilities.js.map +1 -1
- package/dist/simple-tree/schemaFactory.d.ts +6 -6
- package/dist/simple-tree/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/schemaFactory.js +20 -2
- package/dist/simple-tree/schemaFactory.js.map +1 -1
- package/dist/simple-tree/schemaTypes.d.ts +28 -6
- package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
- package/dist/simple-tree/schemaTypes.js +9 -1
- package/dist/simple-tree/schemaTypes.js.map +1 -1
- package/dist/simple-tree/toFlexSchema.d.ts +15 -3
- package/dist/simple-tree/toFlexSchema.d.ts.map +1 -1
- package/dist/simple-tree/toFlexSchema.js +18 -5
- package/dist/simple-tree/toFlexSchema.js.map +1 -1
- package/dist/simple-tree/toMapTree.d.ts +24 -6
- package/dist/simple-tree/toMapTree.d.ts.map +1 -1
- package/dist/simple-tree/toMapTree.js +84 -38
- package/dist/simple-tree/toMapTree.js.map +1 -1
- package/dist/simple-tree/tree.d.ts +26 -4
- package/dist/simple-tree/tree.d.ts.map +1 -1
- package/dist/simple-tree/tree.js +7 -2
- package/dist/simple-tree/tree.js.map +1 -1
- package/{lib/simple-tree/treeApi.d.ts → dist/simple-tree/treeNodeApi.d.ts} +10 -5
- package/dist/simple-tree/treeNodeApi.d.ts.map +1 -0
- package/dist/simple-tree/{treeApi.js → treeNodeApi.js} +49 -12
- package/dist/simple-tree/treeNodeApi.js.map +1 -0
- package/dist/simple-tree/types.d.ts.map +1 -1
- package/dist/simple-tree/types.js +5 -5
- package/dist/simple-tree/types.js.map +1 -1
- package/dist/simple-tree/typesUnsafe.d.ts +2 -2
- package/dist/simple-tree/typesUnsafe.d.ts.map +1 -1
- package/dist/simple-tree/typesUnsafe.js +1 -0
- package/dist/simple-tree/typesUnsafe.js.map +1 -1
- package/dist/treeFactory.d.ts +9 -8
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +3 -3
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/brandedMap.d.ts.map +1 -1
- package/dist/util/brandedMap.js +1 -0
- package/dist/util/brandedMap.js.map +1 -1
- package/dist/util/idAllocator.js.map +1 -1
- package/dist/util/nestedMap.d.ts.map +1 -1
- package/dist/util/nestedMap.js.map +1 -1
- package/dist/util/offsetList.js.map +1 -1
- package/dist/util/opaque.d.ts.map +1 -1
- package/dist/util/opaque.js +2 -0
- package/dist/util/opaque.js.map +1 -1
- package/dist/util/rangeMap.js.map +1 -1
- package/dist/util/referenceCounting.js.map +1 -1
- package/dist/util/stackyIterator.js.map +1 -1
- package/dist/util/typeCheckTests.d.ts.map +1 -1
- package/dist/util/typeCheckTests.js.map +1 -1
- package/dist/util/typeUtils.js.map +1 -1
- package/dist/util/typeboxBrand.d.ts +3 -3
- package/dist/util/typeboxBrand.d.ts.map +1 -1
- package/dist/util/typeboxBrand.js +1 -1
- package/dist/util/typeboxBrand.js.map +1 -1
- package/dist/util/utils.d.ts.map +1 -1
- package/dist/util/utils.js.map +1 -1
- package/docs/.attachments/RefresherNotNeeded.png +0 -0
- package/docs/.attachments/StaleRefresher.png +0 -0
- package/docs/.attachments/SuperfluousRefresher.png +0 -0
- package/docs/.attachments/UndoDangerZone.drawio +787 -1
- package/docs/README.md +2 -3
- package/docs/main/compatibility.md +11 -0
- package/docs/main/detached-trees.md +480 -0
- package/docs/main/undo.md +10 -8
- package/docs/main/v1-undo.md +52 -560
- package/lib/beta.d.ts +2 -1
- package/lib/codec/codec.d.ts +1 -1
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js.map +1 -1
- package/lib/codec/discriminatedUnions.d.ts.map +1 -1
- package/lib/codec/discriminatedUnions.js +1 -0
- package/lib/codec/discriminatedUnions.js.map +1 -1
- package/lib/core/forest/forest.d.ts +5 -6
- package/lib/core/forest/forest.d.ts.map +1 -1
- package/lib/core/forest/forest.js.map +1 -1
- package/lib/core/index.d.ts +1 -1
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +1 -1
- package/lib/core/index.js.map +1 -1
- package/lib/core/rebase/index.d.ts +1 -1
- package/lib/core/rebase/index.d.ts.map +1 -1
- package/lib/core/rebase/index.js +1 -1
- package/lib/core/rebase/index.js.map +1 -1
- package/lib/core/rebase/revisionTagCodec.js.map +1 -1
- package/lib/core/rebase/types.d.ts +1 -0
- package/lib/core/rebase/types.d.ts.map +1 -1
- package/lib/core/rebase/types.js +4 -1
- package/lib/core/rebase/types.js.map +1 -1
- package/lib/core/rebase/utils.d.ts.map +1 -1
- package/lib/core/rebase/utils.js.map +1 -1
- package/lib/core/rebase/verifyChangeRebaser.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +4 -0
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.js.map +1 -1
- package/lib/core/tree/anchorSet.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.js +4 -0
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/core/tree/cursor.d.ts.map +1 -1
- package/lib/core/tree/cursor.js +3 -1
- package/lib/core/tree/cursor.js.map +1 -1
- package/lib/core/tree/deltaUtil.js.map +1 -1
- package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndex.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodec.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodec.js.map +1 -1
- package/lib/core/tree/mapTree.js.map +1 -1
- package/lib/core/tree/pathTree.js.map +1 -1
- package/lib/core/tree/persistedTreeTextFormat.d.ts +4 -4
- package/lib/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
- package/lib/core/tree/persistedTreeTextFormat.js +1 -0
- package/lib/core/tree/persistedTreeTextFormat.js.map +1 -1
- package/lib/core/tree/sparseTree.js.map +1 -1
- package/lib/core/tree/treeTextFormat.js.map +1 -1
- package/lib/core/tree/visitDelta.js.map +1 -1
- package/lib/core/tree/visitorUtils.js.map +1 -1
- package/lib/domains/index.d.ts +0 -1
- package/lib/domains/index.d.ts.map +1 -1
- package/lib/domains/index.js +0 -1
- package/lib/domains/index.js.map +1 -1
- package/lib/domains/json/jsonCursor.js +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.map +1 -1
- package/lib/domains/schemaBuilder.js +1 -0
- package/lib/domains/schemaBuilder.js.map +1 -1
- package/lib/domains/testRecursiveDomain.js.map +1 -1
- package/lib/events/events.d.ts +1 -1
- package/lib/events/events.d.ts.map +1 -1
- package/lib/events/events.js +1 -0
- package/lib/events/events.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.js +4 -2
- package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkCodecUtilities.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +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 +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncoding.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/sequenceChunk.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- 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.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js +13 -9
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +0 -6
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js +12 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultSchema.js +1 -0
- package/lib/feature-libraries/default-schema/defaultSchema.js.map +1 -1
- package/lib/feature-libraries/default-schema/index.d.ts +2 -1
- package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/index.js +1 -0
- package/lib/feature-libraries/default-schema/index.js.map +1 -1
- package/lib/feature-libraries/default-schema/schemaChecker.js.map +1 -1
- package/lib/feature-libraries/deltaUtils.js.map +1 -1
- package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts +2 -2
- package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
- package/lib/feature-libraries/editableTreeBinder.js.map +1 -1
- package/lib/feature-libraries/flex-tree/context.d.ts +10 -16
- package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/context.js +14 -20
- package/lib/feature-libraries/flex-tree/context.js.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +14 -13
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js +0 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/lib/feature-libraries/flex-tree/index.d.ts +1 -0
- package/lib/feature-libraries/flex-tree/index.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/index.js +1 -0
- package/lib/feature-libraries/flex-tree/index.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.d.ts +3 -10
- package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +9 -38
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts +3 -7
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.js +6 -28
- package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/lib/feature-libraries/flex-tree/navigation.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/navigation.js.map +1 -1
- package/lib/feature-libraries/flex-tree/unboxed.js.map +1 -1
- package/lib/feature-libraries/flex-tree/utilities.d.ts +8 -2
- package/lib/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/utilities.js +11 -0
- package/lib/feature-libraries/flex-tree/utilities.js.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +2 -2
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +3 -3
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +3 -3
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/mapTreeCursor.js +1 -1
- package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
- package/lib/feature-libraries/memoizedIdRangeAllocator.js.map +1 -1
- package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.d.ts +1 -1
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js +4 -1
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindFormat.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKindFormat.js +3 -0
- package/lib/feature-libraries/modular-schema/genericFieldKindFormat.js.map +1 -1
- package/lib/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +2 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +0 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +1 -5
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +1 -9
- 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/index.d.ts +1 -1
- package/lib/feature-libraries/node-key/index.d.ts.map +1 -1
- package/lib/feature-libraries/node-key/index.js +1 -1
- package/lib/feature-libraries/node-key/index.js.map +1 -1
- package/lib/feature-libraries/node-key/nodeKey.d.ts +0 -8
- package/lib/feature-libraries/node-key/nodeKey.d.ts.map +1 -1
- package/lib/feature-libraries/node-key/nodeKey.js +0 -8
- package/lib/feature-libraries/node-key/nodeKey.js.map +1 -1
- package/lib/feature-libraries/node-key/nodeKeyIndex.d.ts +1 -1
- package/lib/feature-libraries/node-key/nodeKeyIndex.d.ts.map +1 -1
- package/lib/feature-libraries/node-key/nodeKeyIndex.js.map +1 -1
- package/lib/feature-libraries/node-key/nodeKeyManager.d.ts +12 -2
- package/lib/feature-libraries/node-key/nodeKeyManager.d.ts.map +1 -1
- package/lib/feature-libraries/node-key/nodeKeyManager.js +4 -4
- package/lib/feature-libraries/node-key/nodeKeyManager.js.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js +13 -3
- package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.js +4 -0
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV1.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.js +4 -0
- package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV2.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV1.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
- package/lib/feature-libraries/schema-aware/schemaAware.d.ts +1 -1
- package/lib/feature-libraries/schema-aware/schemaAware.d.ts.map +1 -1
- package/lib/feature-libraries/schema-aware/schemaAware.js.map +1 -1
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +2 -2
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/lib/feature-libraries/schemaBuilderBase.js.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/compose.js +15 -86
- package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
- package/lib/feature-libraries/sequence-field/{format.d.ts → formatV1.d.ts} +41 -41
- package/lib/feature-libraries/sequence-field/formatV1.d.ts.map +1 -0
- package/lib/feature-libraries/sequence-field/{format.js → formatV1.js} +5 -1
- package/lib/feature-libraries/sequence-field/formatV1.js.map +1 -0
- package/lib/feature-libraries/sequence-field/formatV2.d.ts +261 -0
- package/lib/feature-libraries/sequence-field/formatV2.d.ts.map +1 -0
- package/lib/feature-libraries/sequence-field/formatV2.js +67 -0
- package/lib/feature-libraries/sequence-field/formatV2.js.map +1 -0
- package/lib/feature-libraries/sequence-field/index.d.ts +2 -2
- package/lib/feature-libraries/sequence-field/index.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/index.js +1 -1
- package/lib/feature-libraries/sequence-field/index.js.map +1 -1
- package/lib/feature-libraries/sequence-field/invert.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/invert.js +5 -22
- package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
- package/lib/feature-libraries/sequence-field/markListFactory.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/markListFactory.js +0 -4
- package/lib/feature-libraries/sequence-field/markListFactory.js.map +1 -1
- package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
- 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.js.map +1 -1
- package/lib/feature-libraries/sequence-field/rebase.d.ts +1 -2
- package/lib/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/rebase.js +17 -360
- package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
- package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -1
- package/lib/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +11 -0
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +1 -0
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js +207 -0
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +1 -0
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +11 -0
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -0
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +188 -0
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -0
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +3 -2
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js +7 -236
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +9 -7
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js +14 -15
- package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
- package/lib/feature-libraries/sequence-field/types.d.ts +2 -45
- 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 +1 -12
- package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/utils.js +6 -110
- package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
- package/lib/feature-libraries/storedToViewSchema.js.map +1 -1
- package/lib/feature-libraries/treeCursorUtils.js.map +1 -1
- package/lib/feature-libraries/treeTextCursor.js.map +1 -1
- package/lib/feature-libraries/typed-schema/flexList.js.map +1 -1
- package/lib/feature-libraries/typed-schema/schemaCollection.js.map +1 -1
- package/lib/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
- package/lib/feature-libraries/typed-schema/view.js.map +1 -1
- package/lib/feature-libraries/valueUtilities.d.ts +1 -1
- package/lib/feature-libraries/valueUtilities.d.ts.map +1 -1
- package/lib/feature-libraries/valueUtilities.js.map +1 -1
- package/lib/index.d.ts +3 -3
- 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 +2 -1
- package/lib/shared-tree/defaultCommitEnricher.js +3 -3
- package/lib/shared-tree/defaultCommitEnricher.js.map +1 -1
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +2 -4
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +15 -8
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +4 -4
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +4 -5
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.js +4 -0
- package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/treeApi.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +16 -5
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree/treeView.d.ts +1 -3
- package/lib/shared-tree/treeView.d.ts.map +1 -1
- package/lib/shared-tree/treeView.js +5 -4
- package/lib/shared-tree/treeView.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts +0 -1
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +0 -1
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/shared-tree-core/editManager.d.ts.map +1 -1
- package/lib/shared-tree-core/editManager.js +0 -1
- package/lib/shared-tree-core/editManager.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js +2 -0
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormat.d.ts +8 -9
- package/lib/shared-tree-core/editManagerFormat.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormat.js +4 -1
- package/lib/shared-tree-core/editManagerFormat.js.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.d.ts +2 -2
- package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecs.js +1 -0
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormat.js +2 -0
- package/lib/shared-tree-core/messageFormat.js.map +1 -1
- package/lib/shared-tree-core/sequenceIdUtils.d.ts +2 -8
- 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 +3 -4
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +5 -5
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/shared-tree-core/transactionStack.d.ts +1 -2
- package/lib/shared-tree-core/transactionStack.d.ts.map +1 -1
- package/lib/shared-tree-core/transactionStack.js +1 -2
- package/lib/shared-tree-core/transactionStack.js.map +1 -1
- package/lib/simple-tree/arrayNode.d.ts +8 -2
- package/lib/simple-tree/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/arrayNode.js +32 -5
- package/lib/simple-tree/arrayNode.js.map +1 -1
- package/lib/simple-tree/index.d.ts +3 -3
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +2 -2
- package/lib/simple-tree/index.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.map +1 -1
- package/lib/simple-tree/mapNode.d.ts +33 -1
- package/lib/simple-tree/mapNode.d.ts.map +1 -1
- package/lib/simple-tree/mapNode.js +4 -2
- package/lib/simple-tree/mapNode.js.map +1 -1
- package/lib/simple-tree/nodeKeys.d.ts +2 -1
- 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 +2 -3
- package/lib/simple-tree/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/objectNode.js +6 -9
- package/lib/simple-tree/objectNode.js.map +1 -1
- package/lib/simple-tree/proxies.d.ts +1 -1
- package/lib/simple-tree/proxies.d.ts.map +1 -1
- package/lib/simple-tree/proxies.js.map +1 -1
- package/lib/simple-tree/proxyBinding.js +2 -2
- package/lib/simple-tree/proxyBinding.js.map +1 -1
- package/lib/simple-tree/rawNode.js.map +1 -1
- package/lib/simple-tree/schemaCaching.d.ts.map +1 -1
- package/lib/simple-tree/schemaCaching.js +4 -0
- package/lib/simple-tree/schemaCaching.js.map +1 -1
- package/lib/simple-tree/schemaCreationUtilities.d.ts.map +1 -1
- package/lib/simple-tree/schemaCreationUtilities.js +7 -0
- package/lib/simple-tree/schemaCreationUtilities.js.map +1 -1
- package/lib/simple-tree/schemaFactory.d.ts +6 -6
- package/lib/simple-tree/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/schemaFactory.js +22 -4
- package/lib/simple-tree/schemaFactory.js.map +1 -1
- package/lib/simple-tree/schemaTypes.d.ts +28 -6
- package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
- package/lib/simple-tree/schemaTypes.js +6 -0
- package/lib/simple-tree/schemaTypes.js.map +1 -1
- package/lib/simple-tree/toFlexSchema.d.ts +15 -3
- package/lib/simple-tree/toFlexSchema.d.ts.map +1 -1
- package/lib/simple-tree/toFlexSchema.js +18 -5
- package/lib/simple-tree/toFlexSchema.js.map +1 -1
- package/lib/simple-tree/toMapTree.d.ts +24 -6
- package/lib/simple-tree/toMapTree.d.ts.map +1 -1
- package/lib/simple-tree/toMapTree.js +83 -38
- package/lib/simple-tree/toMapTree.js.map +1 -1
- package/lib/simple-tree/tree.d.ts +26 -4
- package/lib/simple-tree/tree.d.ts.map +1 -1
- package/lib/simple-tree/tree.js +7 -2
- package/lib/simple-tree/tree.js.map +1 -1
- package/{dist/simple-tree/treeApi.d.ts → lib/simple-tree/treeNodeApi.d.ts} +10 -5
- package/lib/simple-tree/treeNodeApi.d.ts.map +1 -0
- package/lib/simple-tree/{treeApi.js → treeNodeApi.js} +51 -15
- package/lib/simple-tree/treeNodeApi.js.map +1 -0
- package/lib/simple-tree/types.d.ts.map +1 -1
- package/lib/simple-tree/types.js +5 -5
- package/lib/simple-tree/types.js.map +1 -1
- package/lib/simple-tree/typesUnsafe.d.ts +2 -2
- package/lib/simple-tree/typesUnsafe.d.ts.map +1 -1
- package/lib/simple-tree/typesUnsafe.js +1 -0
- package/lib/simple-tree/typesUnsafe.js.map +1 -1
- package/lib/treeFactory.d.ts +9 -8
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +4 -4
- package/lib/treeFactory.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/lib/util/brandedMap.d.ts.map +1 -1
- package/lib/util/brandedMap.js +1 -0
- package/lib/util/brandedMap.js.map +1 -1
- package/lib/util/idAllocator.js.map +1 -1
- package/lib/util/nestedMap.d.ts.map +1 -1
- package/lib/util/nestedMap.js.map +1 -1
- package/lib/util/offsetList.js.map +1 -1
- package/lib/util/opaque.d.ts.map +1 -1
- package/lib/util/opaque.js +2 -0
- package/lib/util/opaque.js.map +1 -1
- package/lib/util/rangeMap.js.map +1 -1
- package/lib/util/referenceCounting.js.map +1 -1
- package/lib/util/stackyIterator.js.map +1 -1
- package/lib/util/typeCheckTests.d.ts.map +1 -1
- package/lib/util/typeCheckTests.js.map +1 -1
- package/lib/util/typeUtils.js.map +1 -1
- package/lib/util/typeboxBrand.d.ts +3 -3
- package/lib/util/typeboxBrand.d.ts.map +1 -1
- package/lib/util/typeboxBrand.js +1 -1
- package/lib/util/typeboxBrand.js.map +1 -1
- package/lib/util/utils.d.ts.map +1 -1
- package/lib/util/utils.js.map +1 -1
- package/package.json +25 -25
- package/src/codec/codec.ts +21 -15
- package/src/codec/discriminatedUnions.ts +1 -0
- package/src/core/forest/forest.ts +5 -7
- package/src/core/index.ts +1 -0
- package/src/core/rebase/index.ts +1 -0
- package/src/core/rebase/types.ts +5 -0
- package/src/core/rebase/utils.ts +4 -4
- package/src/core/rebase/verifyChangeRebaser.ts +3 -3
- package/src/core/schema-stored/schema.ts +6 -1
- package/src/core/tree/anchorSet.ts +8 -2
- package/src/core/tree/cursor.ts +5 -1
- package/src/core/tree/detachedFieldIndex.ts +2 -2
- package/src/core/tree/detachedFieldIndexCodec.ts +3 -3
- package/src/core/tree/persistedTreeTextFormat.ts +5 -0
- package/src/core/tree/visitDelta.ts +4 -4
- package/src/domains/index.ts +0 -2
- package/src/domains/schemaBuilder.ts +1 -0
- package/src/events/events.ts +4 -1
- package/src/feature-libraries/chunked-forest/chunkedForest.ts +5 -3
- package/src/feature-libraries/chunked-forest/codec/chunkCodecUtilities.ts +2 -2
- package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +2 -2
- package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +4 -4
- package/src/feature-libraries/chunked-forest/codec/formatGeneric.ts +2 -0
- package/src/feature-libraries/chunked-forest/codec/nodeShape.ts +8 -5
- package/src/feature-libraries/contextuallyTyped.ts +1 -1
- package/src/feature-libraries/default-schema/defaultEditBuilder.ts +21 -12
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +12 -6
- package/src/feature-libraries/default-schema/defaultSchema.ts +1 -0
- package/src/feature-libraries/default-schema/index.ts +2 -1
- package/src/feature-libraries/detachedFieldIndexSummarizer.ts +2 -2
- package/src/feature-libraries/editableTreeBinder.ts +3 -3
- package/src/feature-libraries/flex-tree/context.ts +16 -25
- package/src/feature-libraries/flex-tree/flexTreeTypes.ts +26 -17
- package/src/feature-libraries/flex-tree/index.ts +2 -0
- package/src/feature-libraries/flex-tree/lazyField.ts +13 -53
- package/src/feature-libraries/flex-tree/lazyNode.ts +11 -44
- package/src/feature-libraries/flex-tree/navigation.ts +2 -2
- package/src/feature-libraries/flex-tree/utilities.ts +14 -1
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +2 -2
- package/src/feature-libraries/index.ts +3 -2
- package/src/feature-libraries/modular-schema/fieldKindWithEditor.ts +6 -2
- package/src/feature-libraries/modular-schema/genericFieldKind.ts +1 -1
- package/src/feature-libraries/modular-schema/genericFieldKindFormat.ts +5 -0
- package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +2 -1
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +20 -13
- package/src/feature-libraries/modular-schema/modularChangeTypes.ts +0 -10
- package/src/feature-libraries/node-key/index.ts +0 -1
- package/src/feature-libraries/node-key/nodeKey.ts +0 -9
- package/src/feature-libraries/node-key/nodeKeyIndex.ts +1 -1
- package/src/feature-libraries/node-key/nodeKeyManager.ts +6 -11
- package/src/feature-libraries/object-forest/objectForest.ts +18 -7
- package/src/feature-libraries/optional-field/optionalFieldChangeFormatV1.ts +4 -0
- package/src/feature-libraries/optional-field/optionalFieldChangeFormatV2.ts +4 -0
- package/src/feature-libraries/schema-aware/schemaAware.ts +3 -1
- package/src/feature-libraries/schema-index/schemaSummarizer.ts +3 -3
- package/src/feature-libraries/schemaBuilderBase.ts +1 -1
- package/src/feature-libraries/sequence-field/compose.ts +31 -143
- package/src/feature-libraries/sequence-field/{format.ts → formatV1.ts} +6 -0
- package/src/feature-libraries/sequence-field/formatV2.ts +136 -0
- package/src/feature-libraries/sequence-field/index.ts +1 -5
- package/src/feature-libraries/sequence-field/invert.ts +4 -25
- package/src/feature-libraries/sequence-field/markListFactory.ts +0 -4
- package/src/feature-libraries/sequence-field/moveEffectTable.ts +1 -1
- package/src/feature-libraries/sequence-field/rebase.ts +27 -529
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV1.ts +296 -0
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +272 -0
- package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +9 -326
- package/src/feature-libraries/sequence-field/sequenceFieldEditor.ts +55 -30
- package/src/feature-libraries/sequence-field/types.ts +2 -51
- package/src/feature-libraries/sequence-field/utils.ts +8 -145
- package/src/feature-libraries/typed-schema/schemaCollection.ts +3 -3
- package/src/feature-libraries/valueUtilities.ts +1 -1
- package/src/index.ts +2 -2
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/defaultCommitEnricher.ts +3 -3
- package/src/shared-tree/schematizingTreeView.ts +18 -14
- package/src/shared-tree/sharedTree.ts +6 -10
- package/src/shared-tree/sharedTreeChangeCodecs.ts +8 -0
- package/src/shared-tree/treeCheckout.ts +24 -22
- package/src/shared-tree/treeView.ts +4 -15
- package/src/shared-tree-core/branch.ts +1 -2
- package/src/shared-tree-core/editManager.ts +0 -1
- package/src/shared-tree-core/editManagerCodecs.ts +4 -0
- package/src/shared-tree-core/editManagerFormat.ts +8 -2
- package/src/shared-tree-core/editManagerSummarizer.ts +2 -2
- package/src/shared-tree-core/messageCodecs.ts +2 -1
- package/src/shared-tree-core/messageFormat.ts +2 -0
- package/src/shared-tree-core/sequenceIdUtils.ts +5 -4
- package/src/shared-tree-core/sharedTreeCore.ts +15 -13
- package/src/shared-tree-core/transactionStack.ts +2 -3
- package/src/simple-tree/arrayNode.ts +119 -42
- package/src/simple-tree/index.ts +10 -2
- package/src/simple-tree/mapNode.ts +61 -6
- package/src/simple-tree/nodeKeys.ts +2 -1
- package/src/simple-tree/objectNode.ts +14 -12
- package/src/simple-tree/proxies.ts +1 -1
- package/src/simple-tree/proxyBinding.ts +3 -3
- package/src/simple-tree/schemaCaching.ts +4 -0
- package/src/simple-tree/schemaCreationUtilities.ts +7 -0
- package/src/simple-tree/schemaFactory.ts +36 -8
- package/src/simple-tree/schemaTypes.ts +35 -8
- package/src/simple-tree/toFlexSchema.ts +40 -6
- package/src/simple-tree/toMapTree.ts +140 -38
- package/src/simple-tree/tree.ts +35 -4
- package/src/simple-tree/{treeApi.ts → treeNodeApi.ts} +68 -29
- package/src/simple-tree/types.ts +9 -6
- package/src/simple-tree/typesUnsafe.ts +5 -2
- package/src/treeFactory.ts +15 -10
- package/src/util/brandedMap.ts +5 -0
- package/src/util/idAllocator.ts +1 -1
- package/src/util/nestedMap.ts +1 -1
- package/src/util/opaque.ts +4 -0
- package/src/util/typeCheckTests.ts +1 -0
- package/src/util/typeboxBrand.ts +3 -3
- package/src/util/utils.ts +4 -4
- package/dist/domains/nodeKey/index.d.ts +0 -6
- package/dist/domains/nodeKey/index.d.ts.map +0 -1
- package/dist/domains/nodeKey/index.js +0 -12
- package/dist/domains/nodeKey/index.js.map +0 -1
- package/dist/domains/nodeKey/nodeKeySchema.d.ts +0 -30
- package/dist/domains/nodeKey/nodeKeySchema.d.ts.map +0 -1
- package/dist/domains/nodeKey/nodeKeySchema.js +0 -36
- package/dist/domains/nodeKey/nodeKeySchema.js.map +0 -1
- package/dist/feature-libraries/sequence-field/config.d.ts +0 -13
- package/dist/feature-libraries/sequence-field/config.d.ts.map +0 -1
- package/dist/feature-libraries/sequence-field/config.js +0 -16
- package/dist/feature-libraries/sequence-field/config.js.map +0 -1
- package/dist/feature-libraries/sequence-field/format.d.ts.map +0 -1
- package/dist/feature-libraries/sequence-field/format.js.map +0 -1
- package/dist/simple-tree/treeApi.d.ts.map +0 -1
- package/dist/simple-tree/treeApi.js.map +0 -1
- package/docs/.attachments/UndoAfterCollab.png +0 -0
- package/docs/.attachments/UndoAfterCollabFast.png +0 -0
- package/docs/.attachments/UndoDuringCollab.png +0 -0
- package/docs/main/repair-data.md +0 -274
- package/docs/main/v1-undo-example-flow.md +0 -273
- package/lib/domains/nodeKey/index.d.ts +0 -6
- package/lib/domains/nodeKey/index.d.ts.map +0 -1
- package/lib/domains/nodeKey/index.js +0 -6
- package/lib/domains/nodeKey/index.js.map +0 -1
- package/lib/domains/nodeKey/nodeKeySchema.d.ts +0 -30
- package/lib/domains/nodeKey/nodeKeySchema.d.ts.map +0 -1
- package/lib/domains/nodeKey/nodeKeySchema.js +0 -33
- package/lib/domains/nodeKey/nodeKeySchema.js.map +0 -1
- package/lib/feature-libraries/sequence-field/config.d.ts +0 -13
- package/lib/feature-libraries/sequence-field/config.d.ts.map +0 -1
- package/lib/feature-libraries/sequence-field/config.js +0 -13
- package/lib/feature-libraries/sequence-field/config.js.map +0 -1
- package/lib/feature-libraries/sequence-field/format.d.ts.map +0 -1
- package/lib/feature-libraries/sequence-field/format.js.map +0 -1
- package/lib/simple-tree/treeApi.d.ts.map +0 -1
- package/lib/simple-tree/treeApi.js.map +0 -1
- package/src/domains/nodeKey/fence.json +0 -5
- package/src/domains/nodeKey/index.ts +0 -6
- package/src/domains/nodeKey/nodeKeySchema.ts +0 -44
- package/src/feature-libraries/sequence-field/config.ts +0 -17
package/.eslintrc.cjs
CHANGED
|
@@ -14,7 +14,7 @@ module.exports = {
|
|
|
14
14
|
rules: {
|
|
15
15
|
"@typescript-eslint/no-namespace": "off",
|
|
16
16
|
"@typescript-eslint/no-empty-interface": "off",
|
|
17
|
-
|
|
17
|
+
|
|
18
18
|
// This package is build with noUnusedLocals disabled for a specific use case (see note in tsconfig.json),
|
|
19
19
|
// but should reject other cases using this rule:
|
|
20
20
|
"@typescript-eslint/no-unused-vars": [
|
|
@@ -25,8 +25,30 @@ module.exports = {
|
|
|
25
25
|
caughtErrorsIgnorePattern: "^_",
|
|
26
26
|
},
|
|
27
27
|
],
|
|
28
|
-
|
|
28
|
+
|
|
29
|
+
// TODO: Remove this override once dependency on eslint-config-fluid has been updated to 5.2.0+
|
|
29
30
|
"import/order": "off",
|
|
31
|
+
|
|
32
|
+
// TODO: Remove these overrides once this config has been updated to extend at least the "recommended" base config.
|
|
33
|
+
"@typescript-eslint/no-explicit-any": [
|
|
34
|
+
"error",
|
|
35
|
+
{
|
|
36
|
+
ignoreRestArgs: true,
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
"@typescript-eslint/explicit-function-return-type": [
|
|
40
|
+
"error",
|
|
41
|
+
{
|
|
42
|
+
allowExpressions: true,
|
|
43
|
+
allowTypedFunctionExpressions: true,
|
|
44
|
+
allowHigherOrderFunctions: true,
|
|
45
|
+
allowDirectConstAssertionInArrowFunctions: true,
|
|
46
|
+
allowConciseArrowFunctionExpressionsStartingWithVoid: false,
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
|
|
50
|
+
// TODO: Remove these overrides once this config has been updated to extend the "strict" base config.
|
|
51
|
+
"@typescript-eslint/explicit-member-accessibility": "error",
|
|
30
52
|
},
|
|
31
53
|
overrides: [
|
|
32
54
|
{
|
|
@@ -36,6 +58,7 @@ module.exports = {
|
|
|
36
58
|
},
|
|
37
59
|
rules: {
|
|
38
60
|
"@typescript-eslint/no-unused-vars": ["off"],
|
|
61
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
39
62
|
},
|
|
40
63
|
},
|
|
41
64
|
],
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @fluidframework/tree
|
|
2
2
|
|
|
3
|
+
## 2.0.0-rc.4.0.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Deprecated members of IFluidHandle are split off into new IFluidHandleInternal interface [96872186d0](https://github.com/microsoft/FluidFramework/commit/96872186d0d0f245c1fece7d19b3743e501679b6)
|
|
8
|
+
|
|
9
|
+
Split IFluidHandle into two interfaces, `IFluidHandle` and `IFluidHandleInternal`.
|
|
10
|
+
Code depending on the previously deprecated members of IFluidHandle can access them by using `toFluidHandleInternal` from `@fluidframework/runtime-utils/legacy`.
|
|
11
|
+
|
|
12
|
+
External implementation of the `IFluidHandle` interface are not supported: this change makes the typing better convey this using the `ErasedType` pattern.
|
|
13
|
+
Any existing and previously working, and now broken, external implementations of `IFluidHandle` should still work at runtime, but will need some unsafe type casts to compile.
|
|
14
|
+
Such handle implementation may break in the future and thus should be replaced with use of handles produced by the Fluid Framework client packages.
|
|
15
|
+
|
|
16
|
+
- Minor API fixes for "@fluidframework/tree" package. [96872186d0](https://github.com/microsoft/FluidFramework/commit/96872186d0d0f245c1fece7d19b3743e501679b6)
|
|
17
|
+
|
|
18
|
+
Changes constructor for `FieldSchema` from public to private. Users should call `makeFieldSchema` to create instance of `FieldSchema`.
|
|
19
|
+
|
|
3
20
|
## 2.0.0-rc.3.0.0
|
|
4
21
|
|
|
5
22
|
### Major Changes
|
package/api-report/tree.api.md
CHANGED
|
@@ -5,13 +5,12 @@
|
|
|
5
5
|
```ts
|
|
6
6
|
|
|
7
7
|
import { ErasedType } from '@fluidframework/core-interfaces';
|
|
8
|
-
import { FluidObject } from '@fluidframework/core-interfaces';
|
|
9
|
-
import { IChannel } from '@fluidframework/datastore-definitions';
|
|
10
8
|
import { IFluidHandle } from '@fluidframework/core-interfaces';
|
|
11
9
|
import { IFluidLoadable } from '@fluidframework/core-interfaces';
|
|
12
|
-
import { ISharedObject } from '@fluidframework/shared-object-base';
|
|
13
|
-
import { ISharedObjectKind } from '@fluidframework/shared-object-base';
|
|
10
|
+
import { ISharedObject } from '@fluidframework/shared-object-base/internal';
|
|
11
|
+
import { ISharedObjectKind } from '@fluidframework/shared-object-base/internal';
|
|
14
12
|
import { SessionSpaceCompressedId } from '@fluidframework/id-compressor';
|
|
13
|
+
import { SharedObjectKind } from '@fluidframework/shared-object-base';
|
|
15
14
|
import { StableId } from '@fluidframework/id-compressor';
|
|
16
15
|
import type { Static } from '@sinclair/typebox';
|
|
17
16
|
import type { TSchema } from '@sinclair/typebox';
|
|
@@ -136,7 +135,11 @@ export const Any: "Any";
|
|
|
136
135
|
export type Any = typeof Any;
|
|
137
136
|
|
|
138
137
|
// @public
|
|
139
|
-
export type ApplyKind<T, Kind extends FieldKind
|
|
138
|
+
export type ApplyKind<T, Kind extends FieldKind, DefaultsAreOptional extends boolean> = {
|
|
139
|
+
[FieldKind.Required]: T;
|
|
140
|
+
[FieldKind.Optional]: T | undefined;
|
|
141
|
+
[FieldKind.Identifier]: DefaultsAreOptional extends true ? T | undefined : T;
|
|
142
|
+
}[Kind];
|
|
140
143
|
|
|
141
144
|
// @internal
|
|
142
145
|
export type ApplyMultiplicity<TMultiplicity extends Multiplicity, TypedChild> = {
|
|
@@ -240,7 +243,7 @@ export interface CommitMetadata {
|
|
|
240
243
|
export function compareLocalNodeKeys(a: LocalNodeKey, b: LocalNodeKey): -1 | 0 | 1;
|
|
241
244
|
|
|
242
245
|
// @internal
|
|
243
|
-
export function configuredSharedTree(options: SharedTreeOptions): ISharedObjectKind<ITree>;
|
|
246
|
+
export function configuredSharedTree(options: SharedTreeOptions): ISharedObjectKind<ITree> & SharedObjectKind<ITree>;
|
|
244
247
|
|
|
245
248
|
// @internal
|
|
246
249
|
export type ContextuallyTypedFieldData = ContextuallyTypedNodeData | undefined;
|
|
@@ -304,6 +307,10 @@ export interface CursorWithNode<TNode> extends ITreeCursorSynchronous {
|
|
|
304
307
|
getNode(): TNode;
|
|
305
308
|
}
|
|
306
309
|
|
|
310
|
+
// @public
|
|
311
|
+
export interface DefaultProvider extends ErasedType<"@fluidframework/tree.FieldProvider"> {
|
|
312
|
+
}
|
|
313
|
+
|
|
307
314
|
// @internal
|
|
308
315
|
export const defaultSchemaPolicy: FullSchemaPolicy;
|
|
309
316
|
|
|
@@ -480,7 +487,6 @@ export const FieldKinds: {
|
|
|
480
487
|
readonly required: Required_2;
|
|
481
488
|
readonly optional: Optional;
|
|
482
489
|
readonly sequence: Sequence;
|
|
483
|
-
readonly nodeKey: NodeKeyFieldKind;
|
|
484
490
|
readonly identifier: Identifier;
|
|
485
491
|
readonly forbidden: Forbidden;
|
|
486
492
|
};
|
|
@@ -501,6 +507,7 @@ export interface FieldMapObject<TChild> {
|
|
|
501
507
|
|
|
502
508
|
// @public
|
|
503
509
|
export interface FieldProps {
|
|
510
|
+
readonly defaultProvider?: DefaultProvider;
|
|
504
511
|
readonly key?: string;
|
|
505
512
|
}
|
|
506
513
|
|
|
@@ -630,7 +637,7 @@ export class FlexObjectNodeSchema<const out Name extends string = string, const
|
|
|
630
637
|
|
|
631
638
|
// @internal
|
|
632
639
|
export interface FlexTreeContext extends ISubscribable<ForestEvents> {
|
|
633
|
-
readonly
|
|
640
|
+
readonly checkout: ITreeCheckout;
|
|
634
641
|
// (undocumented)
|
|
635
642
|
readonly nodeKeyManager: NodeKeyManager;
|
|
636
643
|
get root(): FlexTreeField;
|
|
@@ -823,14 +830,14 @@ export interface FlexTreeSequenceField<in out TTypes extends FlexAllowedTypes> e
|
|
|
823
830
|
moveToStart(sourceIndex: number): void;
|
|
824
831
|
moveToStart(sourceIndex: number, source: FlexTreeSequenceField<FlexAllowedTypes>): void;
|
|
825
832
|
removeAt(index: number): void;
|
|
826
|
-
|
|
833
|
+
sequenceEditor(): SequenceFieldEditBuilder;
|
|
827
834
|
}
|
|
828
835
|
|
|
829
836
|
// @internal
|
|
830
837
|
export type FlexTreeTypedField<TSchema extends FlexFieldSchema> = FlexTreeTypedFieldInner<TSchema["kind"], TSchema["allowedTypes"]>;
|
|
831
838
|
|
|
832
839
|
// @internal
|
|
833
|
-
export type FlexTreeTypedFieldInner<Kind extends FlexFieldKind, Types extends FlexAllowedTypes> = Kind extends typeof FieldKinds.sequence ? FlexTreeSequenceField<Types> : Kind extends typeof FieldKinds.required ? FlexTreeRequiredField<Types> : Kind extends typeof FieldKinds.optional ? FlexTreeOptionalField<Types> :
|
|
840
|
+
export type FlexTreeTypedFieldInner<Kind extends FlexFieldKind, Types extends FlexAllowedTypes> = Kind extends typeof FieldKinds.sequence ? FlexTreeSequenceField<Types> : Kind extends typeof FieldKinds.required ? FlexTreeRequiredField<Types> : Kind extends typeof FieldKinds.optional ? FlexTreeOptionalField<Types> : FlexTreeField;
|
|
834
841
|
|
|
835
842
|
// @internal
|
|
836
843
|
export type FlexTreeTypedNode<TSchema extends FlexTreeNodeSchema> = TSchema extends LeafNodeSchema ? FlexTreeLeafNode<TSchema> : TSchema extends FlexMapNodeSchema ? FlexTreeMapNode<TSchema> : TSchema extends FlexFieldNodeSchema ? FlexTreeFieldNode<TSchema> : TSchema extends FlexObjectNodeSchema ? FlexTreeObjectNodeTyped<TSchema> : FlexTreeNode;
|
|
@@ -842,7 +849,7 @@ export type FlexTreeTypedNodeUnion<T extends FlexAllowedTypes> = T extends FlexL
|
|
|
842
849
|
export type FlexTreeUnboxField<TSchema extends FlexFieldSchema, Emptiness extends "maybeEmpty" | "notEmpty" = "maybeEmpty"> = FlexTreeUnboxFieldInner<TSchema["kind"], TSchema["allowedTypes"], Emptiness>;
|
|
843
850
|
|
|
844
851
|
// @internal
|
|
845
|
-
export type FlexTreeUnboxFieldInner<Kind extends FlexFieldKind, TTypes extends FlexAllowedTypes, Emptiness extends "maybeEmpty" | "notEmpty"> = Kind extends typeof FieldKinds.sequence ? FlexTreeSequenceField<TTypes> : Kind extends typeof FieldKinds.required ? FlexTreeUnboxNodeUnion<TTypes> : Kind extends typeof FieldKinds.optional ? FlexTreeUnboxNodeUnion<TTypes> | (Emptiness extends "notEmpty" ? never : undefined) :
|
|
852
|
+
export type FlexTreeUnboxFieldInner<Kind extends FlexFieldKind, TTypes extends FlexAllowedTypes, Emptiness extends "maybeEmpty" | "notEmpty"> = Kind extends typeof FieldKinds.sequence ? FlexTreeSequenceField<TTypes> : Kind extends typeof FieldKinds.required ? FlexTreeUnboxNodeUnion<TTypes> : Kind extends typeof FieldKinds.optional ? FlexTreeUnboxNodeUnion<TTypes> | (Emptiness extends "notEmpty" ? never : undefined) : unknown;
|
|
846
853
|
|
|
847
854
|
// @internal
|
|
848
855
|
export type FlexTreeUnboxNode<TSchema extends FlexTreeNodeSchema> = TSchema extends LeafNodeSchema ? TreeValue<TSchema["info"]> : TSchema extends FlexMapNodeSchema ? FlexTreeMapNode<TSchema> : TSchema extends FlexFieldNodeSchema ? FlexTreeFieldNode<TSchema> : TSchema extends FlexObjectNodeSchema ? FlexTreeObjectNodeTyped<TSchema> : FlexTreeUnknownUnboxed;
|
|
@@ -872,7 +879,6 @@ export const forbiddenFieldKindIdentifier = "Forbidden";
|
|
|
872
879
|
|
|
873
880
|
// @internal
|
|
874
881
|
export interface ForestEvents {
|
|
875
|
-
afterChange(): void;
|
|
876
882
|
afterRootFieldCreated(key: FieldKey): void;
|
|
877
883
|
beforeChange(): void;
|
|
878
884
|
}
|
|
@@ -985,7 +991,7 @@ ApplyMultiplicity<TField["kind"]["multiplicity"], AllowedTypesToFlexInsertableTr
|
|
|
985
991
|
// @internal
|
|
986
992
|
export type InsertableFlexNode<TSchema extends FlexTreeNodeSchema> = FlattenKeys<CollectOptions<TSchema extends FlexObjectNodeSchema<string, infer TFields extends FlexObjectNodeFields> ? TypedFields<TFields> : TSchema extends FlexFieldNodeSchema<string, infer TField extends FlexFieldSchema> ? InsertableFlexField<TField> : TSchema extends FlexMapNodeSchema<string, infer TField extends FlexFieldSchema> ? {
|
|
987
993
|
readonly [P in string]: InsertableFlexField<TField>;
|
|
988
|
-
} : EmptyObject, TSchema extends LeafNodeSchema<string, infer TValueSchema> ? TValueSchema : undefined, TSchema["name"]>>;
|
|
994
|
+
} : EmptyObject, TSchema extends LeafNodeSchema<string, infer TValueSchema extends ValueSchema> ? TValueSchema : undefined, TSchema["name"]>>;
|
|
989
995
|
|
|
990
996
|
// @public
|
|
991
997
|
export type InsertableObjectFromSchemaRecord<T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema>> = {
|
|
@@ -998,10 +1004,10 @@ export type InsertableObjectFromSchemaRecordUnsafe<T extends Unenforced<Restrict
|
|
|
998
1004
|
};
|
|
999
1005
|
|
|
1000
1006
|
// @public
|
|
1001
|
-
export type InsertableTreeFieldFromImplicitField<TSchema extends ImplicitFieldSchema = FieldSchema> = TSchema extends FieldSchema<infer Kind, infer Types> ? ApplyKind<InsertableTreeNodeFromImplicitAllowedTypes<Types>, Kind> : TSchema extends ImplicitAllowedTypes ? InsertableTreeNodeFromImplicitAllowedTypes<TSchema> : unknown;
|
|
1007
|
+
export type InsertableTreeFieldFromImplicitField<TSchema extends ImplicitFieldSchema = FieldSchema> = TSchema extends FieldSchema<infer Kind, infer Types> ? ApplyKind<InsertableTreeNodeFromImplicitAllowedTypes<Types>, Kind, true> : TSchema extends ImplicitAllowedTypes ? InsertableTreeNodeFromImplicitAllowedTypes<TSchema> : unknown;
|
|
1002
1008
|
|
|
1003
1009
|
// @public
|
|
1004
|
-
export type InsertableTreeFieldFromImplicitFieldUnsafe<TSchema extends Unenforced<ImplicitFieldSchema>> = TSchema extends FieldSchemaUnsafe<infer Kind, infer Types> ? ApplyKind<InsertableTreeNodeFromImplicitAllowedTypesUnsafe<Types>, Kind> : InsertableTreeNodeFromImplicitAllowedTypesUnsafe<TSchema>;
|
|
1010
|
+
export type InsertableTreeFieldFromImplicitFieldUnsafe<TSchema extends Unenforced<ImplicitFieldSchema>> = TSchema extends FieldSchemaUnsafe<infer Kind, infer Types> ? ApplyKind<InsertableTreeNodeFromImplicitAllowedTypesUnsafe<Types>, Kind, true> : InsertableTreeNodeFromImplicitAllowedTypesUnsafe<TSchema>;
|
|
1005
1011
|
|
|
1006
1012
|
// @public
|
|
1007
1013
|
export type InsertableTreeNodeFromImplicitAllowedTypes<TSchema extends ImplicitAllowedTypes = TreeNodeSchema> = TSchema extends TreeNodeSchema ? InsertableTypedNode<TSchema> : TSchema extends AllowedTypes ? InsertableTypedNode<FlexListToUnion<TSchema>> : never;
|
|
@@ -1077,7 +1083,7 @@ export interface ITransaction {
|
|
|
1077
1083
|
}
|
|
1078
1084
|
|
|
1079
1085
|
// @public
|
|
1080
|
-
export interface ITree extends
|
|
1086
|
+
export interface ITree extends IFluidLoadable {
|
|
1081
1087
|
schematize<TRoot extends ImplicitFieldSchema>(config: TreeConfiguration<TRoot>): TreeView<TRoot>;
|
|
1082
1088
|
}
|
|
1083
1089
|
|
|
@@ -1102,6 +1108,11 @@ export interface ITreeCheckoutFork extends ITreeCheckout, IDisposable {
|
|
|
1102
1108
|
rebaseOnto(view: ITreeCheckout): void;
|
|
1103
1109
|
}
|
|
1104
1110
|
|
|
1111
|
+
// @public
|
|
1112
|
+
export interface ITreeConfigurationOptions {
|
|
1113
|
+
enableSchemaValidation?: boolean;
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1105
1116
|
// @internal
|
|
1106
1117
|
export interface ITreeCursor {
|
|
1107
1118
|
readonly [CursorMarker]: true;
|
|
@@ -1313,13 +1324,6 @@ export interface NodeInDocumentConstraint {
|
|
|
1313
1324
|
type: "nodeInDocument";
|
|
1314
1325
|
}
|
|
1315
1326
|
|
|
1316
|
-
// @internal
|
|
1317
|
-
export const nodeKeyFieldKey = "__n_id__";
|
|
1318
|
-
|
|
1319
|
-
// @internal (undocumented)
|
|
1320
|
-
export interface NodeKeyFieldKind extends FlexFieldKind<"NodeKey", Multiplicity.Single> {
|
|
1321
|
-
}
|
|
1322
|
-
|
|
1323
1327
|
// @internal
|
|
1324
1328
|
export interface NodeKeyManager {
|
|
1325
1329
|
generateLocalNodeKey(): LocalNodeKey;
|
|
@@ -1482,7 +1486,7 @@ export const reservedObjectNodeFieldPropertyNamePrefixes: readonly ["set", "boxe
|
|
|
1482
1486
|
export type ReservedObjectNodeFieldPropertyNames = (typeof reservedObjectNodeFieldPropertyNames)[number];
|
|
1483
1487
|
|
|
1484
1488
|
// @internal
|
|
1485
|
-
export const reservedObjectNodeFieldPropertyNames: readonly ["anchorNode", "constructor", "context", "is", "on", "parentField", "schema", "treeStatus", "tryGetField", "type", "value", "
|
|
1489
|
+
export const reservedObjectNodeFieldPropertyNames: readonly ["anchorNode", "constructor", "context", "is", "on", "parentField", "schema", "treeStatus", "tryGetField", "type", "value", "boxedIterator", "iterator", "getBoxed"];
|
|
1486
1490
|
|
|
1487
1491
|
// @public
|
|
1488
1492
|
export type RestrictiveReadonlyRecord<K extends symbol | string, T> = {
|
|
@@ -1601,8 +1605,8 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
|
|
|
1601
1605
|
[Symbol.iterator](): Iterator<InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>>;
|
|
1602
1606
|
}, false, T>;
|
|
1603
1607
|
readonly boolean: TreeNodeSchema<"com.fluidframework.leaf.boolean", NodeKind.Leaf, boolean, boolean>;
|
|
1604
|
-
readonly handle: TreeNodeSchema<"com.fluidframework.leaf.handle", NodeKind.Leaf, IFluidHandle<
|
|
1605
|
-
get identifier(): FieldSchema<FieldKind.Identifier>;
|
|
1608
|
+
readonly handle: TreeNodeSchema<"com.fluidframework.leaf.handle", NodeKind.Leaf, IFluidHandle<unknown>, IFluidHandle<unknown>>;
|
|
1609
|
+
get identifier(): FieldSchema<FieldKind.Identifier, typeof SchemaFactory.string>;
|
|
1606
1610
|
map<const T extends TreeNodeSchema | readonly TreeNodeSchema[]>(allowedTypes: T): TreeNodeSchema<ScopedSchemaName<TScope, `Map<${string}>`>, NodeKind.Map, TreeMapNode<T> & WithType<ScopedSchemaName<TScope, `Map<${string}>`>>, Iterable<[string, InsertableTreeNodeFromImplicitAllowedTypes<T>]>, true, T>;
|
|
1607
1611
|
map<Name extends TName, const T extends ImplicitAllowedTypes>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Map, TreeMapNode<T> & WithType<ScopedSchemaName<TScope, Name>>, Iterable<[string, InsertableTreeNodeFromImplicitAllowedTypes<T>]>, true, T>;
|
|
1608
1612
|
mapRecursive<Name extends TName, const T extends Unenforced<ImplicitAllowedTypes>>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Map, TreeMapNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name>>, {
|
|
@@ -1615,10 +1619,10 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde
|
|
|
1615
1619
|
readonly number: TreeNodeSchema<"com.fluidframework.leaf.number", NodeKind.Leaf, number, number>;
|
|
1616
1620
|
object<const Name extends TName, const T extends RestrictiveReadonlyRecord<string, ImplicitFieldSchema>>(name: Name, fields: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNode<T, ScopedSchemaName<TScope, Name>>, object & InsertableObjectFromSchemaRecord<T>, true, T>;
|
|
1617
1621
|
objectRecursive<const Name extends TName, const T extends Unenforced<RestrictiveReadonlyRecord<string, ImplicitFieldSchema>>>(name: Name, t: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>, object & InsertableObjectFromSchemaRecordUnsafe<T>, false, T>;
|
|
1618
|
-
optional<const T extends ImplicitAllowedTypes>(t: T, props?: FieldProps): FieldSchema<FieldKind.Optional, T>;
|
|
1619
|
-
optionalRecursive<const T extends Unenforced<ImplicitAllowedTypes>>(t: T, props?: FieldProps): FieldSchemaUnsafe<FieldKind.Optional, T>;
|
|
1620
|
-
required<const T extends ImplicitAllowedTypes>(t: T, props?: FieldProps): FieldSchema<FieldKind.Required, T>;
|
|
1621
|
-
requiredRecursive<const T extends Unenforced<ImplicitAllowedTypes>>(t: T, props?: FieldProps): FieldSchemaUnsafe<FieldKind.Required, T>;
|
|
1622
|
+
optional<const T extends ImplicitAllowedTypes>(t: T, props?: Omit<FieldProps, "defaultProvider">): FieldSchema<FieldKind.Optional, T>;
|
|
1623
|
+
optionalRecursive<const T extends Unenforced<ImplicitAllowedTypes>>(t: T, props?: Omit<FieldProps, "defaultProvider">): FieldSchemaUnsafe<FieldKind.Optional, T>;
|
|
1624
|
+
required<const T extends ImplicitAllowedTypes>(t: T, props?: Omit<FieldProps, "defaultProvider">): FieldSchema<FieldKind.Required, T>;
|
|
1625
|
+
requiredRecursive<const T extends Unenforced<ImplicitAllowedTypes>>(t: T, props?: Omit<FieldProps, "defaultProvider">): FieldSchemaUnsafe<FieldKind.Required, T>;
|
|
1622
1626
|
// (undocumented)
|
|
1623
1627
|
readonly scope: TScope;
|
|
1624
1628
|
readonly string: TreeNodeSchema<"com.fluidframework.leaf.string", NodeKind.Leaf, string, string>;
|
|
@@ -1665,6 +1669,7 @@ export interface SchemaLintConfiguration {
|
|
|
1665
1669
|
// @internal
|
|
1666
1670
|
export interface SchemaPolicy {
|
|
1667
1671
|
readonly fieldKinds: ReadonlyMap<FieldKindIdentifier, FieldKindData>;
|
|
1672
|
+
readonly validateSchema: boolean;
|
|
1668
1673
|
}
|
|
1669
1674
|
|
|
1670
1675
|
// @internal
|
|
@@ -1692,8 +1697,8 @@ export interface SequenceFieldEditBuilder {
|
|
|
1692
1697
|
remove(index: number, count: number): void;
|
|
1693
1698
|
}
|
|
1694
1699
|
|
|
1695
|
-
// @
|
|
1696
|
-
export const SharedTree: ISharedObjectKind<ITree>;
|
|
1700
|
+
// @alpha
|
|
1701
|
+
export const SharedTree: ISharedObjectKind<ITree> & SharedObjectKind<ITree>;
|
|
1697
1702
|
|
|
1698
1703
|
// @internal
|
|
1699
1704
|
export interface SharedTreeContentSnapshot {
|
|
@@ -1845,9 +1850,10 @@ export enum TreeCompressionStrategy {
|
|
|
1845
1850
|
|
|
1846
1851
|
// @public
|
|
1847
1852
|
export class TreeConfiguration<TSchema extends ImplicitFieldSchema = ImplicitFieldSchema> {
|
|
1848
|
-
constructor(schema: TSchema, initialTree: () => InsertableTreeFieldFromImplicitField<TSchema
|
|
1853
|
+
constructor(schema: TSchema, initialTree: () => InsertableTreeFieldFromImplicitField<TSchema>, options?: ITreeConfigurationOptions);
|
|
1849
1854
|
// (undocumented)
|
|
1850
1855
|
readonly initialTree: () => InsertableTreeFieldFromImplicitField<TSchema>;
|
|
1856
|
+
readonly options: Required<ITreeConfigurationOptions>;
|
|
1851
1857
|
// (undocumented)
|
|
1852
1858
|
readonly schema: TSchema;
|
|
1853
1859
|
}
|
|
@@ -1864,10 +1870,10 @@ export interface TreeDataContext {
|
|
|
1864
1870
|
}
|
|
1865
1871
|
|
|
1866
1872
|
// @public
|
|
1867
|
-
export type TreeFieldFromImplicitField<TSchema extends ImplicitFieldSchema = FieldSchema> = TSchema extends FieldSchema<infer Kind, infer Types> ? ApplyKind<TreeNodeFromImplicitAllowedTypes<Types>, Kind> : TSchema extends ImplicitAllowedTypes ? TreeNodeFromImplicitAllowedTypes<TSchema> : unknown;
|
|
1873
|
+
export type TreeFieldFromImplicitField<TSchema extends ImplicitFieldSchema = FieldSchema> = TSchema extends FieldSchema<infer Kind, infer Types> ? ApplyKind<TreeNodeFromImplicitAllowedTypes<Types>, Kind, false> : TSchema extends ImplicitAllowedTypes ? TreeNodeFromImplicitAllowedTypes<TSchema> : unknown;
|
|
1868
1874
|
|
|
1869
1875
|
// @public
|
|
1870
|
-
export type TreeFieldFromImplicitFieldUnsafe<TSchema extends Unenforced<ImplicitFieldSchema>> = TSchema extends FieldSchemaUnsafe<infer Kind, infer Types> ? ApplyKind<TreeNodeFromImplicitAllowedTypesUnsafe<Types>, Kind> : TSchema extends ImplicitAllowedTypes ? TreeNodeFromImplicitAllowedTypesUnsafe<TSchema> : unknown;
|
|
1876
|
+
export type TreeFieldFromImplicitFieldUnsafe<TSchema extends Unenforced<ImplicitFieldSchema>> = TSchema extends FieldSchemaUnsafe<infer Kind, infer Types> ? ApplyKind<TreeNodeFromImplicitAllowedTypesUnsafe<Types>, Kind, false> : TSchema extends ImplicitAllowedTypes ? TreeNodeFromImplicitAllowedTypesUnsafe<TSchema> : unknown;
|
|
1871
1877
|
|
|
1872
1878
|
// @internal
|
|
1873
1879
|
export interface TreeFieldStoredSchema {
|
|
@@ -1890,7 +1896,11 @@ export interface TreeLocation {
|
|
|
1890
1896
|
// @public
|
|
1891
1897
|
export interface TreeMapNode<T extends ImplicitAllowedTypes = ImplicitAllowedTypes> extends ReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>, TreeNode {
|
|
1892
1898
|
delete(key: string): void;
|
|
1899
|
+
entries(): IterableIterator<[string, TreeNodeFromImplicitAllowedTypes<T>]>;
|
|
1900
|
+
forEach(callbackfn: (value: TreeNodeFromImplicitAllowedTypes<T>, key: string, map: ReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>) => void, thisArg?: any): void;
|
|
1901
|
+
keys(): IterableIterator<string>;
|
|
1893
1902
|
set(key: string, value: InsertableTreeNodeFromImplicitAllowedTypes<T> | undefined): void;
|
|
1903
|
+
values(): IterableIterator<TreeNodeFromImplicitAllowedTypes<T>>;
|
|
1894
1904
|
}
|
|
1895
1905
|
|
|
1896
1906
|
// @public
|
|
@@ -1914,7 +1924,7 @@ export abstract class TreeNode implements WithType {
|
|
|
1914
1924
|
|
|
1915
1925
|
// @public
|
|
1916
1926
|
export interface TreeNodeApi {
|
|
1917
|
-
is<TSchema extends
|
|
1927
|
+
is<TSchema extends ImplicitAllowedTypes>(value: unknown, schema: TSchema): value is TreeNodeFromImplicitAllowedTypes<TSchema>;
|
|
1918
1928
|
key(node: TreeNode): string | number;
|
|
1919
1929
|
on<K extends keyof TreeChangeEvents>(node: TreeNode, eventName: K, listener: TreeChangeEvents[K]): () => void;
|
|
1920
1930
|
parent(node: TreeNode): TreeNode | undefined;
|
package/dist/beta.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export {
|
|
|
14
14
|
ApplyKind,
|
|
15
15
|
CommitKind,
|
|
16
16
|
CommitMetadata,
|
|
17
|
+
DefaultProvider,
|
|
17
18
|
Events,
|
|
18
19
|
ExtractItemType,
|
|
19
20
|
FieldKind,
|
|
@@ -25,6 +26,7 @@ export {
|
|
|
25
26
|
IDisposable,
|
|
26
27
|
ISubscribable,
|
|
27
28
|
ITree,
|
|
29
|
+
ITreeConfigurationOptions,
|
|
28
30
|
ImplicitAllowedTypes,
|
|
29
31
|
ImplicitFieldSchema,
|
|
30
32
|
InsertableObjectFromSchemaRecord,
|
|
@@ -56,7 +58,6 @@ export {
|
|
|
56
58
|
SchemaFactory,
|
|
57
59
|
SchemaIncompatible,
|
|
58
60
|
ScopedSchemaName,
|
|
59
|
-
SharedTree,
|
|
60
61
|
TransactionConstraint,
|
|
61
62
|
Tree,
|
|
62
63
|
TreeApi,
|
package/dist/codec/codec.d.ts
CHANGED
|
@@ -174,7 +174,7 @@ export declare function ensureBinaryEncoding<TDecoded, TContext>(codec: IMultiFo
|
|
|
174
174
|
/**
|
|
175
175
|
* Codec for objects which carry no information.
|
|
176
176
|
*/
|
|
177
|
-
export declare const unitCodec: IMultiFormatCodec<0, JsonCompatibleReadOnly, JsonCompatibleReadOnly,
|
|
177
|
+
export declare const unitCodec: IMultiFormatCodec<0, JsonCompatibleReadOnly, JsonCompatibleReadOnly, unknown>;
|
|
178
178
|
/**
|
|
179
179
|
* Wraps a codec with JSON schema validation for its encoded type.
|
|
180
180
|
* @returns An {@link IJsonCodec} which validates the data it encodes and decodes matches the provided schema.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../src/codec/codec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAkB,MAAM,8BAA8B,CAAC;AAEzE,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAErE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAQ,MAAM,kBAAkB,CAAC;AAEhE;;;GAGG;AACH,MAAM,WAAW,QAAQ,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ;IACrD;;OAEG;IACH,MAAM,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,GAAG,QAAQ,CAAC;CACnD;AAED;;;GAGG;AACH,MAAM,WAAW,QAAQ,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ;IACrD;;OAEG;IACH,MAAM,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,GAAG,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,OAAkB,EAAE,OAAiB,EAAE,EAAE;YACjD,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE;gBACnC,IAAA,eAAI,EAAC,gCAAgC,CAAC,CAAC;aACvC;YACD,2GAA2G;YAC3G,OAAO,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAA+B,CAAC;QACrE,CAAC;KACD,CAAC;AACH,CAAC;AA/BD,oDA+BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IsoBuffer, bufferToString } from \"@fluid-internal/client-utils\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { Static, TAnySchema, TSchema } from \"@sinclair/typebox\";\n\nimport { ChangeEncodingContext } from \"../core/index.js\";\nimport { JsonCompatibleReadOnly, fail } from \"../util/index.js\";\n\n/**\n * Translates decoded data to encoded data.\n * @remarks Typically paired with an {@link IEncoder}.\n */\nexport interface IEncoder<TDecoded, TEncoded, TContext> {\n\t/**\n\t * Encodes `obj` into some encoded format.\n\t */\n\tencode(obj: TDecoded, context: TContext): TEncoded;\n}\n\n/**\n * Translates encoded data to decoded data.\n * @remarks Typically paired with an {@link IEncoder}.\n */\nexport interface IDecoder<TDecoded, TEncoded, TContext> {\n\t/**\n\t * Decodes `obj` from some encoded format.\n\t */\n\tdecode(obj: TEncoded, context: TContext): TDecoded;\n}\n\n/**\n * Validates data complies with some particular schema.\n * Implementations are typically created by a {@link JsonValidator}.\n * @internal\n */\nexport interface SchemaValidationFunction<Schema extends TSchema> {\n\t/**\n\t * @returns Whether the data matches a schema.\n\t */\n\tcheck(data: unknown): data is Static<Schema>;\n}\n\n/**\n * JSON schema validator compliant with draft 6 schema. See https://json-schema.org.\n * @internal\n */\nexport interface JsonValidator {\n\t/**\n\t * Compiles the provided JSON schema into a validator for that schema.\n\t * @param schema - A valid draft 6 JSON schema\n\t * @remarks IFluidHandles--which have circular property references--are used in various places in SharedTree's persisted\n\t * format. Handles should only be contained in sections of data which are validated against the empty schema `{}`\n\t * (see https://datatracker.ietf.org/doc/html/draft-wright-json-schema-01#section-4.4).\n\t *\n\t * Implementations of `JsonValidator` must therefore tolerate these values, despite the input not being valid JSON.\n\t */\n\tcompile<Schema extends TSchema>(schema: Schema): SchemaValidationFunction<Schema>;\n}\n\n/**\n * Options relating to handling of persisted data.\n * @internal\n */\nexport interface ICodecOptions {\n\t/**\n\t * {@link JsonValidator} which SharedTree uses to validate persisted data it reads & writes\n\t * matches the expected encoded format (i.e. the wire format for ops and summaries).\n\t *\n\t * See {@link noopValidator} and {@link typeboxValidator} for out-of-the-box implementations.\n\t *\n\t * This option is not \"on-by-default\" because JSON schema validation comes with a small but noticeable\n\t * runtime performance cost, and popular schema validation libraries have relatively large bundle size.\n\t *\n\t * SharedTree users are still encouraged to use a non-trivial validator (i.e. not `noopValidator`)\n\t * whenever reasonable: it gives better fail-fast behavior when unexpected encoded data is found,\n\t * which reduces the risk of unrecoverable data corruption.\n\t */\n\treadonly jsonValidator: JsonValidator;\n}\n\n/**\n * `TContext` allows passing context to the codec which may configure how data is encoded/decoded.\n * This parameter is typically used for:\n * - Codecs which can pick from multiple encoding options, and imbue the encoded data with information about which option was used.\n * The caller of such a codec can provide context about which encoding choice to make as part of the `encode` call without creating\n * additional codecs. Note that this pattern can always be implemented by having the caller create multiple codecs and selecting the\n * appropriate one, but depending on API layering this might be less ergonomic.\n * - Context for the object currently being encoded, which might enable more efficient encoding. When used in this fashion, the codec author\n * should be careful to include the context somewhere in the encoded data such that decoding can correctly round-trip.\n * For example, a composed set of codecs could implement a form of [dictionary coding](https://en.wikipedia.org/wiki/Dictionary_coder)\n * using a context map which was created by the top-level codec and passed to the inner codecs.\n * This pattern is used:\n * - To avoid repeatedly encoding session ids on commits (only recording it once at the top level)\n * @remarks `TEncoded` should always be valid Json (i.e. not contain functions), but due to TypeScript's handling\n * of index signatures and `JsonCompatibleReadOnly`'s index signature in the Json object case, specifying this as a\n * type-system level constraint makes code that uses this interface more difficult to write.\n *\n * If provided, `TValidate` allows the input type passed to `decode` to be different than `TEncoded`.\n * This is useful when, for example, the type being decoded is `unknown` and must be validated to be a `TEncoded` before being decoded to a `TDecoded`.\n */\nexport interface IJsonCodec<\n\tTDecoded,\n\tTEncoded = JsonCompatibleReadOnly,\n\tTValidate = TEncoded,\n\tTContext = void,\n> extends IEncoder<TDecoded, TEncoded, TContext>,\n\t\tIDecoder<TDecoded, TValidate, TContext> {\n\tencodedSchema?: TAnySchema;\n}\n\n/**\n * @remarks TODO: We might consider using DataView or some kind of writer instead of IsoBuffer.\n */\nexport interface IBinaryCodec<TDecoded, TContext = void>\n\textends IEncoder<TDecoded, IsoBuffer, TContext>,\n\t\tIDecoder<TDecoded, IsoBuffer, TContext> {}\n\n/**\n * Contains knowledge of how to encode some in-memory type into JSON and binary formats,\n * as well as how to decode those representations.\n *\n * @remarks Codecs are typically used in shared-tree to convert data into some persisted format.\n * For this common use case, any format for encoding that was ever actually used needs to\n * be supported for decoding in all future code versions.\n *\n * Using an {@link ICodecFamily} is the recommended strategy for managing this support, keeping in\n * mind evolution of encodings over time.\n */\nexport interface IMultiFormatCodec<\n\tTDecoded,\n\tTJsonEncoded extends JsonCompatibleReadOnly = JsonCompatibleReadOnly,\n\tTJsonValidate = TJsonEncoded,\n\tTContext = void,\n> {\n\tjson: IJsonCodec<TDecoded, TJsonEncoded, TJsonValidate, TContext>;\n\tbinary: IBinaryCodec<TDecoded, TContext>;\n\n\t/** Ensures multi-format codecs cannot also be single-format codecs. */\n\tencode?: never;\n\t/** Ensures multi-format codecs cannot also be single-format codecs. */\n\tdecode?: never;\n}\n\n/**\n * Represents a family of codecs that can be used to encode and decode data in different formats.\n * The family is identified by a format version, which is typically used to select the codec to use.\n *\n * Separating codecs into families rather than having a single codec support multiple versions (i.e. currying\n * the `formatVersion` parameter)\n * allows avoiding some duplicate work at encode/decode time, since the vast majority of document usage will not\n * involve mixed format versions.\n *\n * @privateRemarks - This interface currently assumes all codecs in a family require the same encode/decode context,\n * which isn't necessarily true.\n * This may need to be relaxed in the future.\n */\nexport interface ICodecFamily<TDecoded, TContext = void> {\n\t/**\n\t * @returns a codec that can be used to encode and decode data in the specified format.\n\t * @throws - if the format version is not supported by this family.\n\t * @remarks Implementations should typically emit telemetry (either indirectly by throwing a well-known error with\n\t * logged properties or directly using some logger) when a format version is requested that is not supported.\n\t * This ensures that applications can diagnose compatibility issues.\n\t */\n\tresolve(\n\t\tformatVersion: FormatVersion,\n\t): IMultiFormatCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>;\n\n\t/**\n\t * @returns an iterable of all format versions supported by this family.\n\t */\n\tgetSupportedFormats(): Iterable<FormatVersion>;\n}\n\n/**\n * A version stamp for encoded data.\n *\n * Undefined is tolerated to enable the scenario where data was not initially versioned.\n */\nexport type FormatVersion = number | undefined;\n\n/**\n * Creates a codec family from a registry of codecs.\n * Any codec that is not a {@link IMultiFormatCodec} will be wrapped with a default binary encoding.\n */\nexport function makeCodecFamily<TDecoded, TContext>(\n\tregistry: Iterable<\n\t\t[\n\t\t\tformatVersion: FormatVersion,\n\t\t\tcodec:\n\t\t\t\t| IMultiFormatCodec<\n\t\t\t\t\t\tTDecoded,\n\t\t\t\t\t\tJsonCompatibleReadOnly,\n\t\t\t\t\t\tJsonCompatibleReadOnly,\n\t\t\t\t\t\tTContext\n\t\t\t\t >\n\t\t\t\t| IJsonCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>,\n\t\t]\n\t>,\n): ICodecFamily<TDecoded, TContext> {\n\tconst codecs: Map<\n\t\tFormatVersion,\n\t\tIMultiFormatCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>\n\t> = new Map();\n\tfor (const [formatVersion, codec] of registry) {\n\t\tif (codecs.has(formatVersion)) {\n\t\t\tfail(\"Duplicate codecs specified.\");\n\t\t}\n\t\tcodecs.set(formatVersion, ensureBinaryEncoding(codec));\n\t}\n\n\treturn {\n\t\tresolve(formatVersion: number) {\n\t\t\tconst codec = codecs.get(formatVersion);\n\t\t\tassert(codec !== undefined, 0x5e6 /* Requested coded for unsupported format. */);\n\t\t\treturn codec;\n\t\t},\n\t\tgetSupportedFormats() {\n\t\t\treturn codecs.keys();\n\t\t},\n\t};\n}\n\nclass DefaultBinaryCodec<TDecoded, TContext> implements IBinaryCodec<TDecoded, TContext> {\n\tpublic constructor(\n\t\tprivate readonly jsonCodec: IJsonCodec<TDecoded, unknown, unknown, TContext>,\n\t) {}\n\n\tpublic encode(change: TDecoded, context: TContext): IsoBuffer {\n\t\tconst jsonable = this.jsonCodec.encode(change, context);\n\t\tconst json = JSON.stringify(jsonable);\n\t\treturn IsoBuffer.from(json);\n\t}\n\n\tpublic decode(change: IsoBuffer, context: TContext): TDecoded {\n\t\tconst json = bufferToString(change, \"utf8\");\n\t\tconst jsonable = JSON.parse(json);\n\t\treturn this.jsonCodec.decode(jsonable, context);\n\t}\n}\n\nfunction isJsonCodec<TDecoded, TContext>(\n\tcodec:\n\t\t| IMultiFormatCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>\n\t\t| IJsonCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>,\n): codec is IJsonCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext> {\n\treturn typeof codec.encode === \"function\" && typeof codec.decode === \"function\";\n}\n\n/**\n * Constructs a {@link IMultiFormatCodec} from a `IJsonCodec` using a generic binary encoding that simply writes\n * the json representation of the object to a buffer.\n */\nexport function withDefaultBinaryEncoding<TDecoded, TContext>(\n\tjsonCodec: IJsonCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>,\n): IMultiFormatCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext> {\n\treturn {\n\t\tjson: jsonCodec,\n\t\tbinary: new DefaultBinaryCodec(jsonCodec),\n\t};\n}\n\n/**\n * Ensures that the provided single or multi-format codec has a binary encoding.\n * Adapts the json encoding using {@link withDefaultBinaryEncoding} if necessary.\n */\nexport function ensureBinaryEncoding<TDecoded, TContext>(\n\tcodec:\n\t\t| IMultiFormatCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>\n\t\t| IJsonCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>,\n): IMultiFormatCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext> {\n\treturn isJsonCodec(codec) ? withDefaultBinaryEncoding(codec) : codec;\n}\n\n/**\n * Codec for objects which carry no information.\n */\nexport const unitCodec: IMultiFormatCodec<0, JsonCompatibleReadOnly, JsonCompatibleReadOnly, any> =\n\t{\n\t\tjson: {\n\t\t\tencode: () => 0,\n\t\t\tdecode: () => 0,\n\t\t},\n\t\tbinary: {\n\t\t\tencode: () => IsoBuffer.from(\"\"),\n\t\t\tdecode: () => 0,\n\t\t},\n\t};\n\n/**\n * Wraps a codec with JSON schema validation for its encoded type.\n * @returns An {@link IJsonCodec} which validates the data it encodes and decodes matches the provided schema.\n */\nexport function withSchemaValidation<\n\tTInMemoryFormat,\n\tEncodedSchema extends TSchema,\n\tTEncodedFormat = JsonCompatibleReadOnly,\n\tTValidate = TEncodedFormat,\n\tTContext = ChangeEncodingContext,\n>(\n\tschema: EncodedSchema,\n\tcodec: IJsonCodec<TInMemoryFormat, TEncodedFormat, TValidate, TContext>,\n\tvalidator?: JsonValidator,\n): IJsonCodec<TInMemoryFormat, TEncodedFormat, TValidate, TContext> {\n\tif (!validator) {\n\t\treturn codec;\n\t}\n\tconst compiledFormat = validator.compile(schema);\n\treturn {\n\t\tencode: (obj: TInMemoryFormat, context: TContext) => {\n\t\t\tconst encoded = codec.encode(obj, context);\n\t\t\tif (!compiledFormat.check(encoded)) {\n\t\t\t\tfail(\"Encoded schema should validate\");\n\t\t\t}\n\t\t\treturn encoded;\n\t\t},\n\t\tdecode: (encoded: TValidate, context: TContext) => {\n\t\t\tif (!compiledFormat.check(encoded)) {\n\t\t\t\tfail(\"Encoded schema should validate\");\n\t\t\t}\n\t\t\t// TODO: would be nice to provide a more specific validate type to the inner codec than the outer one gets.\n\t\t\treturn codec.decode(encoded, context) as unknown as TInMemoryFormat;\n\t\t},\n\t};\n}\n"]}
|
|
1
|
+
{"version":3,"file":"codec.js","sourceRoot":"","sources":["../../src/codec/codec.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAyE;AACzE,kEAA6D;AAI7D,+CAAgE;AA+KhE;;;GAGG;AACH,SAAgB,eAAe,CAC9B,QAYC;IAED,MAAM,MAAM,GAGR,IAAI,GAAG,EAAE,CAAC;IACd,KAAK,MAAM,CAAC,aAAa,EAAE,KAAK,CAAC,IAAI,QAAQ,EAAE,CAAC;QAC/C,IAAI,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;YAC/B,IAAA,eAAI,EAAC,6BAA6B,CAAC,CAAC;QACrC,CAAC;QACD,MAAM,CAAC,GAAG,CAAC,aAAa,EAAE,oBAAoB,CAAC,KAAK,CAAC,CAAC,CAAC;IACxD,CAAC;IAED,OAAO;QACN,OAAO,CACN,aAAqB;YAErB,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;YACxC,IAAA,iBAAM,EAAC,KAAK,KAAK,SAAS,EAAE,KAAK,CAAC,6CAA6C,CAAC,CAAC;YACjF,OAAO,KAAK,CAAC;QACd,CAAC;QACD,mBAAmB;YAClB,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;QACtB,CAAC;KACD,CAAC;AACH,CAAC;AAtCD,0CAsCC;AAED,MAAM,kBAAkB;IACvB,YACkB,SAA2D;QAA3D,cAAS,GAAT,SAAS,CAAkD;IAC1E,CAAC;IAEG,MAAM,CAAC,MAAgB,EAAE,OAAiB;QAChD,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAA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ACH,SAAgB,oBAAoB,CAOnC,MAAqB,EACrB,KAAuE,EACvE,SAAyB;IAEzB,IAAI,CAAC,SAAS,EAAE,CAAC;QAChB,OAAO,KAAK,CAAC;IACd,CAAC;IACD,MAAM,cAAc,GAAG,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACjD,OAAO;QACN,MAAM,EAAE,CAAC,GAAoB,EAAE,OAAiB,EAAkB,EAAE;YACnE,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;YAC3C,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;gBACpC,IAAA,eAAI,EAAC,gCAAgC,CAAC,CAAC;YACxC,CAAC;YACD,OAAO,OAAO,CAAC;QAChB,CAAC;QACD,MAAM,EAAE,CAAC,OAAkB,EAAE,OAAiB,EAAmB,EAAE;YAClE,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;gBACpC,IAAA,eAAI,EAAC,gCAAgC,CAAC,CAAC;YACxC,CAAC;YACD,2GAA2G;YAC3G,OAAO,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAA+B,CAAC;QACrE,CAAC;KACD,CAAC;AACH,CAAC;AA/BD,oDA+BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IsoBuffer, bufferToString } from \"@fluid-internal/client-utils\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { Static, TAnySchema, TSchema } from \"@sinclair/typebox\";\n\nimport { ChangeEncodingContext } from \"../core/index.js\";\nimport { JsonCompatibleReadOnly, fail } from \"../util/index.js\";\n\n/**\n * Translates decoded data to encoded data.\n * @remarks Typically paired with an {@link IEncoder}.\n */\nexport interface IEncoder<TDecoded, TEncoded, TContext> {\n\t/**\n\t * Encodes `obj` into some encoded format.\n\t */\n\tencode(obj: TDecoded, context: TContext): TEncoded;\n}\n\n/**\n * Translates encoded data to decoded data.\n * @remarks Typically paired with an {@link IEncoder}.\n */\nexport interface IDecoder<TDecoded, TEncoded, TContext> {\n\t/**\n\t * Decodes `obj` from some encoded format.\n\t */\n\tdecode(obj: TEncoded, context: TContext): TDecoded;\n}\n\n/**\n * Validates data complies with some particular schema.\n * Implementations are typically created by a {@link JsonValidator}.\n * @internal\n */\nexport interface SchemaValidationFunction<Schema extends TSchema> {\n\t/**\n\t * @returns Whether the data matches a schema.\n\t */\n\tcheck(data: unknown): data is Static<Schema>;\n}\n\n/**\n * JSON schema validator compliant with draft 6 schema. See https://json-schema.org.\n * @internal\n */\nexport interface JsonValidator {\n\t/**\n\t * Compiles the provided JSON schema into a validator for that schema.\n\t * @param schema - A valid draft 6 JSON schema\n\t * @remarks IFluidHandles--which have circular property references--are used in various places in SharedTree's persisted\n\t * format. Handles should only be contained in sections of data which are validated against the empty schema `{}`\n\t * (see https://datatracker.ietf.org/doc/html/draft-wright-json-schema-01#section-4.4).\n\t *\n\t * Implementations of `JsonValidator` must therefore tolerate these values, despite the input not being valid JSON.\n\t */\n\tcompile<Schema extends TSchema>(schema: Schema): SchemaValidationFunction<Schema>;\n}\n\n/**\n * Options relating to handling of persisted data.\n * @internal\n */\nexport interface ICodecOptions {\n\t/**\n\t * {@link JsonValidator} which SharedTree uses to validate persisted data it reads & writes\n\t * matches the expected encoded format (i.e. the wire format for ops and summaries).\n\t *\n\t * See {@link noopValidator} and {@link typeboxValidator} for out-of-the-box implementations.\n\t *\n\t * This option is not \"on-by-default\" because JSON schema validation comes with a small but noticeable\n\t * runtime performance cost, and popular schema validation libraries have relatively large bundle size.\n\t *\n\t * SharedTree users are still encouraged to use a non-trivial validator (i.e. not `noopValidator`)\n\t * whenever reasonable: it gives better fail-fast behavior when unexpected encoded data is found,\n\t * which reduces the risk of unrecoverable data corruption.\n\t */\n\treadonly jsonValidator: JsonValidator;\n}\n\n/**\n * `TContext` allows passing context to the codec which may configure how data is encoded/decoded.\n * This parameter is typically used for:\n * - Codecs which can pick from multiple encoding options, and imbue the encoded data with information about which option was used.\n * The caller of such a codec can provide context about which encoding choice to make as part of the `encode` call without creating\n * additional codecs. Note that this pattern can always be implemented by having the caller create multiple codecs and selecting the\n * appropriate one, but depending on API layering this might be less ergonomic.\n * - Context for the object currently being encoded, which might enable more efficient encoding. When used in this fashion, the codec author\n * should be careful to include the context somewhere in the encoded data such that decoding can correctly round-trip.\n * For example, a composed set of codecs could implement a form of [dictionary coding](https://en.wikipedia.org/wiki/Dictionary_coder)\n * using a context map which was created by the top-level codec and passed to the inner codecs.\n * This pattern is used:\n * - To avoid repeatedly encoding session ids on commits (only recording it once at the top level)\n * @remarks `TEncoded` should always be valid Json (i.e. not contain functions), but due to TypeScript's handling\n * of index signatures and `JsonCompatibleReadOnly`'s index signature in the Json object case, specifying this as a\n * type-system level constraint makes code that uses this interface more difficult to write.\n *\n * If provided, `TValidate` allows the input type passed to `decode` to be different than `TEncoded`.\n * This is useful when, for example, the type being decoded is `unknown` and must be validated to be a `TEncoded` before being decoded to a `TDecoded`.\n */\nexport interface IJsonCodec<\n\tTDecoded,\n\tTEncoded = JsonCompatibleReadOnly,\n\tTValidate = TEncoded,\n\tTContext = void,\n> extends IEncoder<TDecoded, TEncoded, TContext>,\n\t\tIDecoder<TDecoded, TValidate, TContext> {\n\tencodedSchema?: TAnySchema;\n}\n\n/**\n * @remarks TODO: We might consider using DataView or some kind of writer instead of IsoBuffer.\n */\nexport interface IBinaryCodec<TDecoded, TContext = void>\n\textends IEncoder<TDecoded, IsoBuffer, TContext>,\n\t\tIDecoder<TDecoded, IsoBuffer, TContext> {}\n\n/**\n * Contains knowledge of how to encode some in-memory type into JSON and binary formats,\n * as well as how to decode those representations.\n *\n * @remarks Codecs are typically used in shared-tree to convert data into some persisted format.\n * For this common use case, any format for encoding that was ever actually used needs to\n * be supported for decoding in all future code versions.\n *\n * Using an {@link ICodecFamily} is the recommended strategy for managing this support, keeping in\n * mind evolution of encodings over time.\n */\nexport interface IMultiFormatCodec<\n\tTDecoded,\n\tTJsonEncoded extends JsonCompatibleReadOnly = JsonCompatibleReadOnly,\n\tTJsonValidate = TJsonEncoded,\n\tTContext = void,\n> {\n\tjson: IJsonCodec<TDecoded, TJsonEncoded, TJsonValidate, TContext>;\n\tbinary: IBinaryCodec<TDecoded, TContext>;\n\n\t/** Ensures multi-format codecs cannot also be single-format codecs. */\n\tencode?: never;\n\t/** Ensures multi-format codecs cannot also be single-format codecs. */\n\tdecode?: never;\n}\n\n/**\n * Represents a family of codecs that can be used to encode and decode data in different formats.\n * The family is identified by a format version, which is typically used to select the codec to use.\n *\n * Separating codecs into families rather than having a single codec support multiple versions (i.e. currying\n * the `formatVersion` parameter)\n * allows avoiding some duplicate work at encode/decode time, since the vast majority of document usage will not\n * involve mixed format versions.\n *\n * @privateRemarks - This interface currently assumes all codecs in a family require the same encode/decode context,\n * which isn't necessarily true.\n * This may need to be relaxed in the future.\n */\nexport interface ICodecFamily<TDecoded, TContext = void> {\n\t/**\n\t * @returns a codec that can be used to encode and decode data in the specified format.\n\t * @throws - if the format version is not supported by this family.\n\t * @remarks Implementations should typically emit telemetry (either indirectly by throwing a well-known error with\n\t * logged properties or directly using some logger) when a format version is requested that is not supported.\n\t * This ensures that applications can diagnose compatibility issues.\n\t */\n\tresolve(\n\t\tformatVersion: FormatVersion,\n\t): IMultiFormatCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>;\n\n\t/**\n\t * @returns an iterable of all format versions supported by this family.\n\t */\n\tgetSupportedFormats(): Iterable<FormatVersion>;\n}\n\n/**\n * A version stamp for encoded data.\n *\n * Undefined is tolerated to enable the scenario where data was not initially versioned.\n */\nexport type FormatVersion = number | undefined;\n\n/**\n * Creates a codec family from a registry of codecs.\n * Any codec that is not a {@link IMultiFormatCodec} will be wrapped with a default binary encoding.\n */\nexport function makeCodecFamily<TDecoded, TContext>(\n\tregistry: Iterable<\n\t\t[\n\t\t\tformatVersion: FormatVersion,\n\t\t\tcodec:\n\t\t\t\t| IMultiFormatCodec<\n\t\t\t\t\t\tTDecoded,\n\t\t\t\t\t\tJsonCompatibleReadOnly,\n\t\t\t\t\t\tJsonCompatibleReadOnly,\n\t\t\t\t\t\tTContext\n\t\t\t\t >\n\t\t\t\t| IJsonCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>,\n\t\t]\n\t>,\n): ICodecFamily<TDecoded, TContext> {\n\tconst codecs: Map<\n\t\tFormatVersion,\n\t\tIMultiFormatCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>\n\t> = new Map();\n\tfor (const [formatVersion, codec] of registry) {\n\t\tif (codecs.has(formatVersion)) {\n\t\t\tfail(\"Duplicate codecs specified.\");\n\t\t}\n\t\tcodecs.set(formatVersion, ensureBinaryEncoding(codec));\n\t}\n\n\treturn {\n\t\tresolve(\n\t\t\tformatVersion: number,\n\t\t): IMultiFormatCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext> {\n\t\t\tconst codec = codecs.get(formatVersion);\n\t\t\tassert(codec !== undefined, 0x5e6 /* Requested coded for unsupported format. */);\n\t\t\treturn codec;\n\t\t},\n\t\tgetSupportedFormats(): Iterable<FormatVersion> {\n\t\t\treturn codecs.keys();\n\t\t},\n\t};\n}\n\nclass DefaultBinaryCodec<TDecoded, TContext> implements IBinaryCodec<TDecoded, TContext> {\n\tpublic constructor(\n\t\tprivate readonly jsonCodec: IJsonCodec<TDecoded, unknown, unknown, TContext>,\n\t) {}\n\n\tpublic encode(change: TDecoded, context: TContext): IsoBuffer {\n\t\tconst jsonable = this.jsonCodec.encode(change, context);\n\t\tconst json = JSON.stringify(jsonable);\n\t\treturn IsoBuffer.from(json);\n\t}\n\n\tpublic decode(change: IsoBuffer, context: TContext): TDecoded {\n\t\tconst json = bufferToString(change, \"utf8\");\n\t\tconst jsonable = JSON.parse(json);\n\t\treturn this.jsonCodec.decode(jsonable, context);\n\t}\n}\n\nfunction isJsonCodec<TDecoded, TContext>(\n\tcodec:\n\t\t| IMultiFormatCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>\n\t\t| IJsonCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>,\n): codec is IJsonCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext> {\n\treturn typeof codec.encode === \"function\" && typeof codec.decode === \"function\";\n}\n\n/**\n * Constructs a {@link IMultiFormatCodec} from a `IJsonCodec` using a generic binary encoding that simply writes\n * the json representation of the object to a buffer.\n */\nexport function withDefaultBinaryEncoding<TDecoded, TContext>(\n\tjsonCodec: IJsonCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>,\n): IMultiFormatCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext> {\n\treturn {\n\t\tjson: jsonCodec,\n\t\tbinary: new DefaultBinaryCodec(jsonCodec),\n\t};\n}\n\n/**\n * Ensures that the provided single or multi-format codec has a binary encoding.\n * Adapts the json encoding using {@link withDefaultBinaryEncoding} if necessary.\n */\nexport function ensureBinaryEncoding<TDecoded, TContext>(\n\tcodec:\n\t\t| IMultiFormatCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>\n\t\t| IJsonCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>,\n): IMultiFormatCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext> {\n\treturn isJsonCodec(codec) ? withDefaultBinaryEncoding(codec) : codec;\n}\n\n/**\n * Codec for objects which carry no information.\n */\nexport const unitCodec: IMultiFormatCodec<\n\t0,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnly,\n\tunknown\n> = {\n\tjson: {\n\t\tencode: () => 0,\n\t\tdecode: () => 0,\n\t},\n\tbinary: {\n\t\tencode: () => IsoBuffer.from(\"\"),\n\t\tdecode: () => 0,\n\t},\n};\n\n/**\n * Wraps a codec with JSON schema validation for its encoded type.\n * @returns An {@link IJsonCodec} which validates the data it encodes and decodes matches the provided schema.\n */\nexport function withSchemaValidation<\n\tTInMemoryFormat,\n\tEncodedSchema extends TSchema,\n\tTEncodedFormat = JsonCompatibleReadOnly,\n\tTValidate = TEncodedFormat,\n\tTContext = ChangeEncodingContext,\n>(\n\tschema: EncodedSchema,\n\tcodec: IJsonCodec<TInMemoryFormat, TEncodedFormat, TValidate, TContext>,\n\tvalidator?: JsonValidator,\n): IJsonCodec<TInMemoryFormat, TEncodedFormat, TValidate, TContext> {\n\tif (!validator) {\n\t\treturn codec;\n\t}\n\tconst compiledFormat = validator.compile(schema);\n\treturn {\n\t\tencode: (obj: TInMemoryFormat, context: TContext): TEncodedFormat => {\n\t\t\tconst encoded = codec.encode(obj, context);\n\t\t\tif (!compiledFormat.check(encoded)) {\n\t\t\t\tfail(\"Encoded schema should validate\");\n\t\t\t}\n\t\t\treturn encoded;\n\t\t},\n\t\tdecode: (encoded: TValidate, context: TContext): TInMemoryFormat => {\n\t\t\tif (!compiledFormat.check(encoded)) {\n\t\t\t\tfail(\"Encoded schema should validate\");\n\t\t\t}\n\t\t\t// TODO: would be nice to provide a more specific validate type to the inner codec than the outer one gets.\n\t\t\treturn codec.decode(encoded, context) as unknown as TInMemoryFormat;\n\t\t},\n\t};\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discriminatedUnions.d.ts","sourceRoot":"","sources":["../../src/codec/discriminatedUnions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,YAAY,EAAqB,MAAM,kBAAkB,CAAC;AAEnE;;;;GAIG;AAEH;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,aAI1B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;
|
|
1
|
+
{"version":3,"file":"discriminatedUnions.d.ts","sourceRoot":"","sources":["../../src/codec/discriminatedUnions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,YAAY,EAAqB,MAAM,kBAAkB,CAAC;AAEnE;;;;GAIG;AAEH;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,aAI1B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAEH,qBAAa,4BAA4B,CAAC,MAAM,SAAS,MAAM,EAAE,KAAK,SAAS,GAAG,EAAE,EAAE,OAAO;IAC5F,OAAO,CAAC,QAAQ,CAAC,OAAO,CAGtB;gBAGD,OAAO,EAAE;QACR;YACC,QAAQ,EAAE,QAAQ,IAAI,MAAM,MAAM,CAAC,CAAC,GAAG,CACtC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,EACjC,GAAG,IAAI,EAAE,KAAK,KACV,OAAO;SACZ;KACD,CAAC,YAAY,CAAC;IAOT,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,KAAK,GAAG,OAAO;CAYvD"}
|
|
@@ -77,6 +77,7 @@ exports.unionOptions = {
|
|
|
77
77
|
* ```
|
|
78
78
|
* where only a single property of `EncodedOperation` is populated for a given encoded value.
|
|
79
79
|
*/
|
|
80
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
80
81
|
class DiscriminatedUnionDispatcher {
|
|
81
82
|
constructor(library) {
|
|
82
83
|
this.library = (0, index_js_1.objectToMap)(library);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discriminatedUnions.js","sourceRoot":"","sources":["../../src/codec/discriminatedUnions.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAG7D,+CAAmE;AAEnE;;;;GAIG;AAEH;;;;GAIG;AACU,QAAA,YAAY,GAAkB;IAC1C,oBAAoB,EAAE,KAAK;IAC3B,aAAa,EAAE,CAAC;IAChB,aAAa,EAAE,CAAC;CAChB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,MAAa,4BAA4B;IAMxC,YACC,OAOe;QAEf,IAAI,CAAC,OAAO,GAAG,IAAA,sBAAW,EACzB,OAA4E,CAC5E,CAAC;IACH,CAAC;IAEM,QAAQ,CAAC,KAAa,EAAE,GAAG,IAAW;QAC5C,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACpC,IAAA,iBAAM,EACL,IAAI,CAAC,MAAM,KAAK,CAAC,EACjB,KAAK,CAAC,6DAA6D,CACnE,CAAC;QACF,MAAM,GAAG,GAAiB,IAAI,CAAC,CAAC,CAAiB,CAAC;QAClD,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;QACzB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,IAAA,eAAI,EAAC,mCAAmC,CAAC,CAAC;QACnF,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,CAAC;QACvC,OAAO,MAAM,CAAC;IACf,CAAC;CACD;AAjCD,oEAiCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { ObjectOptions } from \"@sinclair/typebox\";\n\nimport { _InlineTrick, fail, objectToMap } from \"../util/index.js\";\n\n/**\n * This module contains utilities for an encoding of a discriminated union that is efficient to validate using\n * a JSON schema validator.\n * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.\n */\n\n/**\n * Options to configure a TypeBox schema as a discriminated union that is simple to validate data against.\n *\n * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.\n */\nexport const unionOptions: ObjectOptions = {\n\tadditionalProperties: false,\n\tminProperties: 1,\n\tmaxProperties: 1,\n};\n\n/**\n * Applies a function to the content of a [discriminated union](https://en.wikipedia.org/wiki/Tagged_union)\n * where the function to apply depends on which value from the union it holds.\n *\n * This uses a rather non-standard encoding of the union where it is an object with many differently named optional fields,\n * and which of the fields is populated determines the content type.\n * This union encoding has the advantage that schema validation (such as that implemented by TypeBox) can validate the data efficiently.\n * Other encodings--such as using an untagged union, then tagging the content types with a marker enum--require the schema validator to disambiguate the union members.\n * Most JSON validator implementations fail to recognize the marker enum determines which component of the discriminated union the data must be,\n * and end up checking against all candidate members of the union.\n *\n * @example\n *\n * The following union:\n * ```typescript\n * type Operation = Add | Subtract | Multiply | Divide;\n *\n * interface BinaryOperation {\n * readonly left: number;\n * readonly right: number;\n * }\n *\n * interface Add extends BinaryOperation {\n * readonly type: \"add\";\n * }\n *\n * interface Subtract extends BinaryOperation {\n * readonly type: \"subtract\";\n * }\n *\n * interface Multiply extends BinaryOperation {\n * readonly type: \"multiply\";\n * }\n *\n * interface Divide extends BinaryOperation {\n * readonly type: \"divide\";\n * }\n *\n * ```\n * Would be encoded using this strategy as:\n * ```typescript\n * interface EncodedBinaryOperation {\n * readonly left: number;\n * readonly right: number;\n * }\n *\n * interface EncodedOperation {\n * add?: EncodedBinaryOperation;\n * subtract?: EncodedBinaryOperation;\n * multiply?: EncodedBinaryOperation;\n * divide?: EncodedBinaryOperation;\n * }\n * ```\n * where only a single property of `EncodedOperation` is populated for a given encoded value.\n */\nexport class DiscriminatedUnionDispatcher<TUnion extends object, TArgs extends any[], TResult> {\n\tprivate readonly library: ReadonlyMap<\n\t\tkeyof TUnion,\n\t\t(value: unknown, ...args: TArgs) => TResult\n\t>;\n\n\tpublic constructor(\n\t\tlibrary: [\n\t\t\t{\n\t\t\t\treadonly [Property in keyof TUnion]-?: (\n\t\t\t\t\tvalue: Required<TUnion>[Property],\n\t\t\t\t\t...args: TArgs\n\t\t\t\t) => TResult;\n\t\t\t},\n\t\t][_InlineTrick],\n\t) {\n\t\tthis.library = objectToMap(\n\t\t\tlibrary as Record<keyof TUnion, (value: unknown, ...args: TArgs) => TResult>,\n\t\t);\n\t}\n\n\tpublic dispatch(union: TUnion, ...args: TArgs): TResult {\n\t\tconst keys = Reflect.ownKeys(union);\n\t\tassert(\n\t\t\tkeys.length === 1,\n\t\t\t0x733 /* discriminated union type should have exactly one member */,\n\t\t);\n\t\tconst key: keyof TUnion = keys[0] as keyof TUnion;\n\t\tconst value = union[key];\n\t\tconst factory = this.library.get(key) ?? fail(\"missing function for union member\");\n\t\tconst result = factory(value, ...args);\n\t\treturn result;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"discriminatedUnions.js","sourceRoot":"","sources":["../../src/codec/discriminatedUnions.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAG7D,+CAAmE;AAEnE;;;;GAIG;AAEH;;;;GAIG;AACU,QAAA,YAAY,GAAkB;IAC1C,oBAAoB,EAAE,KAAK;IAC3B,aAAa,EAAE,CAAC;IAChB,aAAa,EAAE,CAAC;CAChB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,8DAA8D;AAC9D,MAAa,4BAA4B;IAMxC,YACC,OAOe;QAEf,IAAI,CAAC,OAAO,GAAG,IAAA,sBAAW,EACzB,OAA4E,CAC5E,CAAC;IACH,CAAC;IAEM,QAAQ,CAAC,KAAa,EAAE,GAAG,IAAW;QAC5C,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACpC,IAAA,iBAAM,EACL,IAAI,CAAC,MAAM,KAAK,CAAC,EACjB,KAAK,CAAC,6DAA6D,CACnE,CAAC;QACF,MAAM,GAAG,GAAiB,IAAI,CAAC,CAAC,CAAiB,CAAC;QAClD,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;QACzB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,IAAA,eAAI,EAAC,mCAAmC,CAAC,CAAC;QACnF,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,CAAC;QACvC,OAAO,MAAM,CAAC;IACf,CAAC;CACD;AAjCD,oEAiCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { ObjectOptions } from \"@sinclair/typebox\";\n\nimport { _InlineTrick, fail, objectToMap } from \"../util/index.js\";\n\n/**\n * This module contains utilities for an encoding of a discriminated union that is efficient to validate using\n * a JSON schema validator.\n * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.\n */\n\n/**\n * Options to configure a TypeBox schema as a discriminated union that is simple to validate data against.\n *\n * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.\n */\nexport const unionOptions: ObjectOptions = {\n\tadditionalProperties: false,\n\tminProperties: 1,\n\tmaxProperties: 1,\n};\n\n/**\n * Applies a function to the content of a [discriminated union](https://en.wikipedia.org/wiki/Tagged_union)\n * where the function to apply depends on which value from the union it holds.\n *\n * This uses a rather non-standard encoding of the union where it is an object with many differently named optional fields,\n * and which of the fields is populated determines the content type.\n * This union encoding has the advantage that schema validation (such as that implemented by TypeBox) can validate the data efficiently.\n * Other encodings--such as using an untagged union, then tagging the content types with a marker enum--require the schema validator to disambiguate the union members.\n * Most JSON validator implementations fail to recognize the marker enum determines which component of the discriminated union the data must be,\n * and end up checking against all candidate members of the union.\n *\n * @example\n *\n * The following union:\n * ```typescript\n * type Operation = Add | Subtract | Multiply | Divide;\n *\n * interface BinaryOperation {\n * readonly left: number;\n * readonly right: number;\n * }\n *\n * interface Add extends BinaryOperation {\n * readonly type: \"add\";\n * }\n *\n * interface Subtract extends BinaryOperation {\n * readonly type: \"subtract\";\n * }\n *\n * interface Multiply extends BinaryOperation {\n * readonly type: \"multiply\";\n * }\n *\n * interface Divide extends BinaryOperation {\n * readonly type: \"divide\";\n * }\n *\n * ```\n * Would be encoded using this strategy as:\n * ```typescript\n * interface EncodedBinaryOperation {\n * readonly left: number;\n * readonly right: number;\n * }\n *\n * interface EncodedOperation {\n * add?: EncodedBinaryOperation;\n * subtract?: EncodedBinaryOperation;\n * multiply?: EncodedBinaryOperation;\n * divide?: EncodedBinaryOperation;\n * }\n * ```\n * where only a single property of `EncodedOperation` is populated for a given encoded value.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class DiscriminatedUnionDispatcher<TUnion extends object, TArgs extends any[], TResult> {\n\tprivate readonly library: ReadonlyMap<\n\t\tkeyof TUnion,\n\t\t(value: unknown, ...args: TArgs) => TResult\n\t>;\n\n\tpublic constructor(\n\t\tlibrary: [\n\t\t\t{\n\t\t\t\treadonly [Property in keyof TUnion]-?: (\n\t\t\t\t\tvalue: Required<TUnion>[Property],\n\t\t\t\t\t...args: TArgs\n\t\t\t\t) => TResult;\n\t\t\t},\n\t\t][_InlineTrick],\n\t) {\n\t\tthis.library = objectToMap(\n\t\t\tlibrary as Record<keyof TUnion, (value: unknown, ...args: TArgs) => TResult>,\n\t\t);\n\t}\n\n\tpublic dispatch(union: TUnion, ...args: TArgs): TResult {\n\t\tconst keys = Reflect.ownKeys(union);\n\t\tassert(\n\t\t\tkeys.length === 1,\n\t\t\t0x733 /* discriminated union type should have exactly one member */,\n\t\t);\n\t\tconst key: keyof TUnion = keys[0] as keyof TUnion;\n\t\tconst value = union[key];\n\t\tconst factory = this.library.get(key) ?? fail(\"missing function for union member\");\n\t\tconst result = factory(value, ...args);\n\t\treturn result;\n\t}\n}\n"]}
|
|
@@ -27,14 +27,13 @@ export interface ForestEvents {
|
|
|
27
27
|
afterRootFieldCreated(key: FieldKey): void;
|
|
28
28
|
/**
|
|
29
29
|
* The forest is about to be changed.
|
|
30
|
-
* Emitted before
|
|
30
|
+
* Emitted before each change in a batch of changes.
|
|
31
|
+
* @remarks
|
|
32
|
+
* This is the last chance for users of the forest to remove cursors from the forest before the edit.
|
|
33
|
+
* Removing these cursors is important since they are not allowed to live across edits and
|
|
34
|
+
* not clearing them can lead to corruption of in memory structures.
|
|
31
35
|
*/
|
|
32
36
|
beforeChange(): void;
|
|
33
|
-
/**
|
|
34
|
-
* The forest was just changed.
|
|
35
|
-
* Emitted after the last change in a batch of changes.
|
|
36
|
-
*/
|
|
37
|
-
afterChange(): void;
|
|
38
37
|
}
|
|
39
38
|
/**
|
|
40
39
|
* Invalidates whenever the tree content changes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forest.d.ts","sourceRoot":"","sources":["../../../src/core/forest/forest.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACnF,OAAO,EACN,MAAM,EACN,SAAS,EACT,aAAa,EACb,WAAW,EACX,sBAAsB,EACtB,MAAM,EAGN,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;;;;;;GAOG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC5B;;OAEG;IACH,qBAAqB,CAAC,GAAG,EAAE,QAAQ,GAAG,IAAI,CAAC;IAE3C
|
|
1
|
+
{"version":3,"file":"forest.d.ts","sourceRoot":"","sources":["../../../src/core/forest/forest.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACnF,OAAO,EACN,MAAM,EACN,SAAS,EACT,aAAa,EACb,WAAW,EACX,s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AE,aAAyB,GAC9B,IAAI,CAMN;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC3B;;;OAGG;IACH,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,EAAE,QAAQ,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAwB,SAAQ,WAAW;IAC3D;;OAEG;IACH,IAAI,IAAI,uBAAuB,CAAC;IAEhC;;;OAGG;IACH,IAAI,IAAI,IAAI,CAAC;IAEb;;;;OAIG;IACH,KAAK,IAAI,IAAI,CAAC;IAEd;;;;;OAKG;IACH,WAAW,IAAI,MAAM,CAAC;IAEtB;;;;;OAKG;IACH,gBAAgB,IAAI,WAAW,CAAC;IAEhC;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,4BAA4B,CAAC;CAO7C;AAED;;GAEG;AACH,oBAAY,4BAA4B;IACvC;;OAEG;IACH,OAAO,IAAA;IACP;;OAEG;IACH,OAAO,IAAA;IACP;;OAEG;IACH,KAAK,IAAA;CACL;AAED;;GAEG;AACH,0BAAkB,oBAAoB;IACrC;;OAEG;IACH,QAAQ,KAAK;IAEb;;OAEG;IACH,OAAO,IAAI;IAEX;;OAEG;IACH,EAAE,IAAI;CACN;AAED;;;GAGG;AACH,MAAM,MAAM,2BAA2B,GAAG,oBAAoB,CAAC,EAAE,GAAG,oBAAoB,CAAC,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forest.js","sourceRoot":"","sources":["../../../src/core/forest/forest.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAI7D,+CAS0B;
|
|
1
|
+
{"version":3,"file":"forest.js","sourceRoot":"","sources":["../../../src/core/forest/forest.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAI7D,+CAS0B;AAmH1B;;;GAGG;AACH,SAAgB,UAAU,CAAC,QAAuB,oBAAS;IAC1D,OAAO;QACN,MAAM,EAAE,SAAS;QACjB,QAAQ,EAAE,IAAA,6BAAkB,EAAC,KAAK,CAAC;KACnC,CAAC;AACH,CAAC;AALD,gCAKC;AAED;;;GAGG;AACH,SAAgB,mBAAmB,CAClC,MAA2B,EAC3B,YAAqC,EACrC,QAAuB,oBAAS;IAEhC,MAAM,MAAM,GAAG,MAAM,CAAC,oBAAoB,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC,CAAC;IAC5E,IAAA,iBAAM,EACL,MAAM,oCAA4B,EAClC,KAAK,CAAC,qDAAqD,CAC3D,CAAC;AACH,CAAC;AAVD,kDAUC;AAmED;;GAEG;AACH,IAAY,4BAaX;AAbD,WAAY,4BAA4B;IACvC;;OAEG;IACH,qFAAO,CAAA;IACP;;OAEG;IACH,qFAAO,CAAA;IACP;;OAEG;IACH,iFAAK,CAAA;AACN,CAAC,EAbW,4BAA4B,4CAA5B,4BAA4B,QAavC;AAED;;GAEG;AACH,IAAkB,oBAejB;AAfD,WAAkB,oBAAoB;IACrC;;OAEG;IACH,wEAAa,CAAA;IAEb;;OAEG;IACH,qEAAW,CAAA;IAEX;;OAEG;IACH,2DAAM,CAAA;AACP,CAAC,EAfiB,oBAAoB,oCAApB,oBAAoB,QAerC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport { ISubscribable } from \"../../events/index.js\";\nimport { FieldKey, TreeStoredSchemaSubscription } from \"../schema-stored/index.js\";\nimport {\n\tAnchor,\n\tAnchorSet,\n\tDetachedField,\n\tITreeCursor,\n\tITreeCursorSynchronous,\n\tUpPath,\n\tdetachedFieldAsKey,\n\trootField,\n} from \"../tree/index.js\";\n\nimport type { IEditableForest } from \"./editableForest.js\";\n\n/**\n * APIs for forest designed so the implementation can be copy on write,\n * or mutate in place, and we can ensure no references are dangling into the forest to allow this.\n *\n * This results in rather manual memory management,\n * but makes it practical to provide highly optimized implementations,\n * for example WASM powered binary formats that can track reference counts and only copy when needed.\n */\n\n/**\n * Events for {@link IForestSubscription}.\n *\n * TODO: consider having before and after events per subtree instead while applying anchor (and this just shows what happens at the root).\n * @internal\n */\nexport interface ForestEvents {\n\t/**\n\t * A new root field was just created in this forest.\n\t */\n\tafterRootFieldCreated(key: FieldKey): void;\n\n\t/**\n\t * The forest is about to be changed.\n\t * Emitted before each change in a batch of changes.\n\t * @remarks\n\t * This is the last chance for users of the forest to remove cursors from the forest before the edit.\n\t * Removing these cursors is important since they are not allowed to live across edits and\n\t * not clearing them can lead to corruption of in memory structures.\n\t */\n\tbeforeChange(): void;\n}\n\n/**\n * Invalidates whenever the tree content changes.\n * For now (might change later) downloading new parts of the forest counts as a change.\n * Not invalidated when schema changes.\n *\n * When invalidating, all outstanding cursors must be freed or cleared.\n * @internal\n */\nexport interface IForestSubscription extends ISubscribable<ForestEvents> {\n\t/**\n\t * Set of anchors this forest is tracking.\n\t *\n\t * To keep these anchors usable, this AnchorSet must be updated / rebased for any changes made to the forest.\n\t * It is the responsibility of the caller of the forest-editing methods to do this, not the forest itself.\n\t * The caller performs these updates because it has more semantic knowledge about the edits, which can be needed to\n\t * update the anchors in a semantically optimal way.\n\t */\n\treadonly anchors: AnchorSet;\n\n\t/**\n\t * Create an independent copy of this forest, that uses the provided schema and anchors.\n\t *\n\t * The new copy will not invalidate observers (dependents) of the old one.\n\t */\n\tclone(schema: TreeStoredSchemaSubscription, anchors: AnchorSet): IEditableForest;\n\n\t/**\n\t * Allocates a cursor in the \"cleared\" state.\n\t */\n\tallocateCursor(): ITreeSubscriptionCursor;\n\n\t/**\n\t * Frees an Anchor, stopping tracking its position across edits.\n\t */\n\tforgetAnchor(anchor: Anchor): void;\n\n\t/**\n\t * It is an error not to free `cursorToMove` before the next edit.\n\t * Must provide a `cursorToMove` from this subscription (acquired via `allocateCursor`).\n\t */\n\ttryMoveCursorToNode(\n\t\tdestination: Anchor,\n\t\tcursorToMove: ITreeSubscriptionCursor,\n\t): TreeNavigationResult;\n\n\t/**\n\t * It is an error not to free `cursorToMove` before the next edit.\n\t * Must provide a `cursorToMove` from this subscription (acquired via `allocateCursor`).\n\t */\n\ttryMoveCursorToField(\n\t\tdestination: FieldAnchor,\n\t\tcursorToMove: ITreeSubscriptionCursor,\n\t): TreeNavigationResult;\n\n\t/**\n\t * Set `cursorToMove` to location described by path.\n\t * This is NOT a relative move: current position is discarded.\n\t * Path must point to existing node.\n\t */\n\tmoveCursorToPath(destination: UpPath, cursorToMove: ITreeSubscriptionCursor): void;\n\n\t/**\n\t * The cursor is moved to a special dummy node above the detached fields.\n\t * This dummy node can be used to read the detached fields,\n\t * but other operations (such as inspecting the dummy node's type or path) should not be relied upon.\n\t * While this method does not return an {@link ITreeSubscriptionCursor}, similar restrictions apply to its use:\n\t * the returned cursor must not used after any edits are made to the forest.\n\t */\n\tgetCursorAboveDetachedFields(): ITreeCursorSynchronous;\n\n\t/**\n\t * True if there are no nodes in the forest at all.\n\t *\n\t * @remarks\n\t * This means no nodes under any detached field, not just the special document root one.\n\t */\n\treadonly isEmpty: boolean;\n}\n\n/**\n * @param field - defaults to {@link rootField}.\n * @returns anchor to `field`.\n */\nexport function rootAnchor(field: DetachedField = rootField): FieldAnchor {\n\treturn {\n\t\tparent: undefined,\n\t\tfieldKey: detachedFieldAsKey(field),\n\t};\n}\n\n/**\n * @param field - defaults to {@link rootField}.\n * @returns anchor to `field`.\n */\nexport function moveToDetachedField(\n\tforest: IForestSubscription,\n\tcursorToMove: ITreeSubscriptionCursor,\n\tfield: DetachedField = rootField,\n): void {\n\tconst result = forest.tryMoveCursorToField(rootAnchor(field), cursorToMove);\n\tassert(\n\t\tresult === TreeNavigationResult.Ok,\n\t\t0x42d /* Navigation to detached fields should never fail */,\n\t);\n}\n\n/**\n * Anchor to a field.\n * This is structurally based on the parent, so it will move only as the parent moves.\n * @internal\n */\nexport interface FieldAnchor {\n\t/**\n\t * Node above this field.\n\t * If `undefined`, field is a detached field.\n\t */\n\tparent: Anchor | undefined;\n\tfieldKey: FieldKey;\n}\n\n/**\n * ITreeCursor supporting IForestSubscription and its changes over time.\n * @internal\n */\nexport interface ITreeSubscriptionCursor extends ITreeCursor {\n\t/**\n\t * @returns an independent copy of this cursor at the same location in the tree.\n\t */\n\tfork(): ITreeSubscriptionCursor;\n\n\t/**\n\t * Release any resources this cursor is holding onto.\n\t * After doing this, further use of this object other than reading `state` is forbidden (undefined behavior).\n\t */\n\tfree(): void;\n\n\t/**\n\t * Release any resources this cursor is holding onto.\n\t * After doing this, further use of this object other than reading `state` or passing to `tryGet`\n\t * or calling `free` is forbidden (undefined behavior).\n\t */\n\tclear(): void;\n\n\t/**\n\t * Construct an `Anchor` which the IForestSubscription will keep rebased to `current`.\n\t * Note that maintaining an Anchor has cost: free them to stop incurring that cost.\n\t *\n\t * Only valid when `mode` is `Nodes`.\n\t */\n\tbuildAnchor(): Anchor;\n\n\t/**\n\t * Construct a `FieldAnchor` which the IForestSubscription will keep rebased to `current`.\n\t * Note that maintaining an Anchor has cost: free them to stop incurring that cost.\n\t *\n\t * Only valid when `mode` is `Fields`.\n\t */\n\tbuildFieldAnchor(): FieldAnchor;\n\n\t/**\n\t * Current state.\n\t */\n\treadonly state: ITreeSubscriptionCursorState;\n\n\t/**\n\t * @returns location within parent field or range.\n\t */\n\t// TODO: maybe support this.\n\t// getParentInfo(id: NodeId): TreeLocation;\n}\n\n/**\n * @internal\n */\nexport enum ITreeSubscriptionCursorState {\n\t/**\n\t * On the current revision of the forest.\n\t */\n\tCurrent,\n\t/**\n\t * Empty, but can be reused.\n\t */\n\tCleared,\n\t/**\n\t * Freed and must not be used.\n\t */\n\tFreed,\n}\n\n/**\n * @internal\n */\nexport const enum TreeNavigationResult {\n\t/**\n\t * Attempt to navigate cursor to a key or index that is outside the client's view.\n\t */\n\tNotFound = -1,\n\n\t/**\n\t * Attempt to navigate cursor to a portion of the tree that has not yet been loaded.\n\t */\n\tPending = 0,\n\n\t/**\n\t * ITreeReader successfully navigated to the desired node.\n\t */\n\tOk = 1,\n}\n\n/**\n * TreeNavigationResult, but never \"Pending\".\n * Can be used when data is never pending.\n */\nexport type SynchronousNavigationResult = TreeNavigationResult.Ok | TreeNavigationResult.NotFound;\n"]}
|
package/dist/core/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export { EmptyKey, TreeType, Value, TreeValue, AnchorSet, DetachedField, UpPath,
|
|
|
6
6
|
export { TreeNavigationResult, IEditableForest, IForestSubscription, TreeLocation, FieldLocation, ForestLocation, ITreeSubscriptionCursor, ITreeSubscriptionCursorState, initializeForest, FieldAnchor, moveToDetachedField, ForestEvents, } from "./forest/index.js";
|
|
7
7
|
export { FieldKey, TreeNodeSchemaIdentifier, TreeFieldStoredSchema, ValueSchema, TreeNodeStoredSchema, TreeStoredSchemaSubscription as TreeStoredSchemaSubscription, MutableTreeStoredSchema, FieldKindIdentifier, FieldKindData, TreeTypeSet, TreeStoredSchema, TreeStoredSchemaRepository, schemaDataIsEmpty, SchemaEvents, forbiddenFieldKindIdentifier, storedEmptyFieldSchema, StoredSchemaCollection, schemaFormat, LeafNodeStoredSchema, ObjectNodeStoredSchema, MapNodeStoredSchema, toTreeNodeSchemaDataFormat, decodeFieldSchema, encodeFieldSchema, storedSchemaDecodeDispatcher, ErasedTreeNodeSchemaDataFormat, SchemaAndPolicy, Multiplicity, SchemaPolicy, } from "./schema-stored/index.js";
|
|
8
8
|
export { ChangeFamily, ChangeFamilyCodec, ChangeEncodingContext, ChangeFamilyEditor, EditBuilder, } from "./change-family/index.js";
|
|
9
|
-
export { areEqualChangeAtomIds, makeChangeAtomId, asChangeAtomId, ChangeRebaser, findAncestor, findCommonAncestor, GraphCommit, CommitKind, CommitMetadata, RevisionTag, RevisionTagSchema, RevisionTagCodec, ChangesetLocalId, ChangeAtomId, ChangeAtomIdMap, TaggedChange, makeAnonChange, tagChange, mapTaggedChange, noFailure, OutputType, verifyChangeRebaser, tagRollbackInverse, SessionIdSchema, mintCommit, rebaseBranch, BranchRebaseResult, rebaseChange, rebaseChangeOverChanges, RevisionMetadataSource, revisionMetadataSourceFromInfo, RevisionInfo, EncodedRevisionTag, EncodedChangeAtomId, taggedAtomId, taggedOptAtomId, replaceAtomRevisions, } from "./rebase/index.js";
|
|
9
|
+
export { areEqualChangeAtomIds, makeChangeAtomId, asChangeAtomId, ChangeRebaser, findAncestor, findCommonAncestor, GraphCommit, CommitKind, CommitMetadata, RevisionTag, RevisionTagSchema, RevisionTagCodec, ChangesetLocalId, ChangeAtomId, ChangeAtomIdMap, TaggedChange, makeAnonChange, tagChange, mapTaggedChange, noFailure, OutputType, verifyChangeRebaser, tagRollbackInverse, SessionIdSchema, mintCommit, rebaseBranch, BranchRebaseResult, rebaseChange, rebaseChangeOverChanges, RevisionMetadataSource, revisionMetadataSourceFromInfo, RevisionInfo, EncodedRevisionTag, EncodedChangeAtomId, taggedAtomId, taggedOptAtomId, offsetChangeAtomId, replaceAtomRevisions, } from "./rebase/index.js";
|
|
10
10
|
export { Adapters, AdaptedViewSchema, Compatibility, TreeAdapter, AllowedUpdateType, } from "./schema-view/index.js";
|
|
11
11
|
export { Revertible, RevertibleStatus } from "./revertible/index.js";
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|