@fluidframework/tree 2.81.1 → 2.82.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +125 -0
- package/api-report/tree.alpha.api.md +54 -22
- package/api-report/tree.beta.api.md +150 -1
- package/api-report/tree.legacy.beta.api.md +150 -1
- package/api-report/tree.legacy.public.api.md +1 -0
- package/api-report/tree.public.api.md +1 -0
- package/dist/alpha.d.ts +8 -2
- package/dist/beta.d.ts +3 -0
- package/dist/codec/codec.d.ts +17 -8
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +8 -1
- package/dist/codec/codec.js.map +1 -1
- package/dist/codec/index.d.ts +1 -1
- package/dist/codec/index.d.ts.map +1 -1
- package/dist/codec/index.js +2 -1
- package/dist/codec/index.js.map +1 -1
- package/dist/codec/versioned/codec.d.ts +1 -1
- package/dist/codec/versioned/codec.d.ts.map +1 -1
- package/dist/codec/versioned/codec.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 +4 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/changeRebaser.d.ts +3 -2
- package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
- package/dist/core/rebase/changeRebaser.js.map +1 -1
- package/dist/core/rebase/index.d.ts +1 -1
- package/dist/core/rebase/index.d.ts.map +1 -1
- package/dist/core/rebase/index.js +4 -2
- package/dist/core/rebase/index.js.map +1 -1
- package/dist/core/rebase/types.d.ts +23 -3
- package/dist/core/rebase/types.d.ts.map +1 -1
- package/dist/core/rebase/types.js +30 -16
- package/dist/core/rebase/types.js.map +1 -1
- package/dist/core/schema-stored/formatV1.d.ts +2 -2
- package/dist/core/schema-stored/formatV1.d.ts.map +1 -1
- package/dist/core/schema-stored/formatV1.js +0 -5
- package/dist/core/schema-stored/formatV1.js.map +1 -1
- package/dist/core/schema-stored/formatV2.d.ts +11 -10
- package/dist/core/schema-stored/formatV2.d.ts.map +1 -1
- package/dist/core/schema-stored/formatV2.js +1 -6
- package/dist/core/schema-stored/formatV2.js.map +1 -1
- package/dist/core/schema-stored/index.d.ts.map +1 -1
- package/dist/core/schema-stored/index.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/tree/anchorSet.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/delta.d.ts +9 -7
- package/dist/core/tree/delta.d.ts.map +1 -1
- package/dist/core/tree/delta.js.map +1 -1
- package/dist/core/tree/deltaUtil.js +1 -1
- package/dist/core/tree/deltaUtil.js.map +1 -1
- package/dist/core/tree/visitDelta.js +2 -2
- package/dist/core/tree/visitDelta.js.map +1 -1
- package/dist/extensibleSchemaUnion.d.ts +72 -0
- package/dist/extensibleSchemaUnion.d.ts.map +1 -0
- package/dist/extensibleSchemaUnion.js +79 -0
- package/dist/extensibleSchemaUnion.js.map +1 -0
- package/dist/feature-libraries/changeAtomIdBTree.d.ts +4 -2
- package/dist/feature-libraries/changeAtomIdBTree.d.ts.map +1 -1
- package/dist/feature-libraries/changeAtomIdBTree.js +9 -1
- package/dist/feature-libraries/changeAtomIdBTree.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +1 -3
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +20 -21
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/default-schema/index.d.ts +1 -1
- package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/index.js.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.d.ts +2 -1
- package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +5 -2
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/forest-summary/formatCommon.d.ts +1 -39
- package/dist/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/formatCommon.js +1 -2
- package/dist/feature-libraries/forest-summary/formatCommon.js.map +1 -1
- package/dist/feature-libraries/forest-summary/formatV1.d.ts +1 -39
- package/dist/feature-libraries/forest-summary/formatV1.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/formatV2.d.ts +1 -39
- package/dist/feature-libraries/forest-summary/formatV2.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +1 -1
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +1 -1
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.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 +4 -3
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js +42 -22
- package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.js +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/index.d.ts +1 -1
- package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/index.js +2 -1
- package/dist/feature-libraries/modular-schema/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +9 -5
- package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +11 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +30 -7
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +38 -27
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts +10 -127
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js +2 -4
- package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +3 -79
- package/dist/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.js +1 -1
- package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/dist/feature-libraries/optional-field/requiredField.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/requiredField.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -2
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/feature-libraries/schema-index/formatV2.d.ts +4 -4
- package/dist/feature-libraries/schema-index/schemaSummarizer.js +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/dist/feature-libraries/sequence-field/invert.js +2 -2
- package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
- package/dist/feature-libraries/sequence-field/replaceRevisions.js +16 -16
- package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +3 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/shared-tree/independentView.d.ts +36 -13
- package/dist/shared-tree/independentView.d.ts.map +1 -1
- package/dist/shared-tree/independentView.js +1 -0
- package/dist/shared-tree/independentView.js.map +1 -1
- package/dist/shared-tree/index.d.ts +1 -1
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +10 -0
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +25 -9
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +3 -3
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +8 -32
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +11 -3
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.js +38 -4
- package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFormat.d.ts +4 -4
- package/dist/shared-tree/tree.js +1 -1
- package/dist/shared-tree/tree.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +20 -0
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +39 -3
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.js +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.js +2 -2
- package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/transaction.d.ts +14 -3
- package/dist/shared-tree-core/transaction.d.ts.map +1 -1
- package/dist/shared-tree-core/transaction.js +59 -16
- package/dist/shared-tree-core/transaction.js.map +1 -1
- package/dist/shared-tree-core/versionedSummarizer.d.ts.map +1 -1
- package/dist/shared-tree-core/versionedSummarizer.js +1 -1
- package/dist/shared-tree-core/versionedSummarizer.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +1 -1
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +3 -2
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaCreationUtilities.d.ts +9 -0
- package/dist/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaCreationUtilities.js +16 -1
- package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
- package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
- package/dist/simple-tree/api/transactionTypes.d.ts +10 -0
- package/dist/simple-tree/api/transactionTypes.d.ts.map +1 -1
- package/dist/simple-tree/api/transactionTypes.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +81 -6
- package/dist/simple-tree/api/tree.d.ts.map +1 -1
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/dist/simple-tree/index.d.ts +2 -2
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +4 -2
- package/dist/simple-tree/index.js.map +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/node-kinds/array/arrayNode.d.ts +63 -0
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js +43 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/index.d.ts +1 -1
- package/dist/simple-tree/node-kinds/array/index.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/index.js +2 -1
- package/dist/simple-tree/node-kinds/array/index.js.map +1 -1
- package/dist/simple-tree/node-kinds/index.d.ts +1 -1
- package/dist/simple-tree/node-kinds/index.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/index.js +2 -1
- package/dist/simple-tree/node-kinds/index.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/dist/tableSchema.d.ts +71 -48
- package/dist/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +200 -98
- package/dist/tableSchema.js.map +1 -1
- package/dist/text/textDomainFormatted.js +1 -1
- package/dist/text/textDomainFormatted.js.map +1 -1
- package/dist/util/bTreeUtils.d.ts +30 -4
- package/dist/util/bTreeUtils.d.ts.map +1 -1
- package/dist/util/bTreeUtils.js +29 -17
- package/dist/util/bTreeUtils.js.map +1 -1
- package/dist/util/brand.d.ts.map +1 -1
- package/dist/util/brand.js.map +1 -1
- package/dist/util/brandedMap.d.ts.map +1 -1
- package/dist/util/brandedMap.js.map +1 -1
- package/dist/util/breakable.d.ts.map +1 -1
- package/dist/util/breakable.js +2 -1
- package/dist/util/breakable.js.map +1 -1
- package/dist/util/index.d.ts +2 -2
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +6 -3
- package/dist/util/index.js.map +1 -1
- package/dist/util/opaque.d.ts.map +1 -1
- package/dist/util/opaque.js.map +1 -1
- package/dist/util/rangeMap.d.ts +3 -2
- package/dist/util/rangeMap.d.ts.map +1 -1
- package/dist/util/rangeMap.js +7 -1
- package/dist/util/rangeMap.js.map +1 -1
- package/dist/util/readSnapshotBlob.d.ts +1 -1
- package/dist/util/readSnapshotBlob.d.ts.map +1 -1
- package/dist/util/readSnapshotBlob.js.map +1 -1
- package/dist/util/typeCheck.d.ts.map +1 -1
- package/dist/util/typeCheck.js.map +1 -1
- package/dist/util/utils.d.ts +20 -16
- package/dist/util/utils.d.ts.map +1 -1
- package/dist/util/utils.js +49 -17
- package/dist/util/utils.js.map +1 -1
- package/eslint.config.mts +0 -9
- package/lib/alpha.d.ts +8 -2
- package/lib/beta.d.ts +3 -0
- package/lib/codec/codec.d.ts +17 -8
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +6 -0
- package/lib/codec/codec.js.map +1 -1
- package/lib/codec/index.d.ts +1 -1
- package/lib/codec/index.d.ts.map +1 -1
- package/lib/codec/index.js +1 -1
- package/lib/codec/index.js.map +1 -1
- package/lib/codec/versioned/codec.d.ts +1 -1
- package/lib/codec/versioned/codec.d.ts.map +1 -1
- package/lib/codec/versioned/codec.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/changeRebaser.d.ts +3 -2
- package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
- package/lib/core/rebase/changeRebaser.js.map +1 -1
- package/lib/core/rebase/index.d.ts +1 -1
- package/lib/core/rebase/index.d.ts.map +1 -1
- package/lib/core/rebase/index.js +1 -1
- package/lib/core/rebase/index.js.map +1 -1
- package/lib/core/rebase/types.d.ts +23 -3
- package/lib/core/rebase/types.d.ts.map +1 -1
- package/lib/core/rebase/types.js +27 -15
- package/lib/core/rebase/types.js.map +1 -1
- package/lib/core/schema-stored/formatV1.d.ts +2 -2
- package/lib/core/schema-stored/formatV1.d.ts.map +1 -1
- package/lib/core/schema-stored/formatV1.js +0 -5
- package/lib/core/schema-stored/formatV1.js.map +1 -1
- package/lib/core/schema-stored/formatV2.d.ts +11 -10
- package/lib/core/schema-stored/formatV2.d.ts.map +1 -1
- package/lib/core/schema-stored/formatV2.js +1 -6
- package/lib/core/schema-stored/formatV2.js.map +1 -1
- package/lib/core/schema-stored/index.d.ts.map +1 -1
- package/lib/core/schema-stored/index.js +2 -0
- package/lib/core/schema-stored/index.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/tree/anchorSet.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/core/tree/delta.d.ts +9 -7
- package/lib/core/tree/delta.d.ts.map +1 -1
- package/lib/core/tree/delta.js.map +1 -1
- package/lib/core/tree/deltaUtil.js +1 -1
- package/lib/core/tree/deltaUtil.js.map +1 -1
- package/lib/core/tree/visitDelta.js +2 -2
- package/lib/core/tree/visitDelta.js.map +1 -1
- package/lib/extensibleSchemaUnion.d.ts +72 -0
- package/lib/extensibleSchemaUnion.d.ts.map +1 -0
- package/lib/extensibleSchemaUnion.js +76 -0
- package/lib/extensibleSchemaUnion.js.map +1 -0
- package/lib/feature-libraries/changeAtomIdBTree.d.ts +4 -2
- package/lib/feature-libraries/changeAtomIdBTree.d.ts.map +1 -1
- package/lib/feature-libraries/changeAtomIdBTree.js +7 -0
- package/lib/feature-libraries/changeAtomIdBTree.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +1 -3
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js +4 -5
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/lib/feature-libraries/default-schema/index.d.ts +1 -1
- package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/index.js.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.d.ts +2 -1
- package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +6 -3
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/forest-summary/formatCommon.d.ts +1 -39
- package/lib/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/formatCommon.js +2 -3
- package/lib/feature-libraries/forest-summary/formatCommon.js.map +1 -1
- package/lib/feature-libraries/forest-summary/formatV1.d.ts +1 -39
- package/lib/feature-libraries/forest-summary/formatV1.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/formatV2.d.ts +1 -39
- package/lib/feature-libraries/forest-summary/formatV2.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +1 -1
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +1 -1
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.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/modular-schema/defaultRevisionReplacer.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js +41 -21
- package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.js +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/index.d.ts +1 -1
- package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/index.js +1 -1
- package/lib/feature-libraries/modular-schema/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +10 -6
- package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +11 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +29 -6
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +41 -30
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts +10 -127
- package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js +2 -4
- package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts +3 -79
- package/lib/feature-libraries/modular-schema/modularChangeFormatV2.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalField.js +1 -1
- package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/lib/feature-libraries/optional-field/requiredField.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/requiredField.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -2
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/feature-libraries/schema-index/formatV2.d.ts +4 -4
- package/lib/feature-libraries/schema-index/schemaSummarizer.js +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/lib/feature-libraries/sequence-field/invert.js +2 -2
- package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
- package/lib/feature-libraries/sequence-field/replaceRevisions.js +16 -16
- package/lib/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
- package/lib/index.d.ts +5 -5
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -3
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +3 -0
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/shared-tree/independentView.d.ts +36 -13
- package/lib/shared-tree/independentView.d.ts.map +1 -1
- package/lib/shared-tree/independentView.js +1 -0
- package/lib/shared-tree/independentView.js.map +1 -1
- package/lib/shared-tree/index.d.ts +1 -1
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +10 -0
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +25 -9
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +3 -3
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +10 -34
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +11 -3
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.js +39 -5
- package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFormat.d.ts +4 -4
- package/lib/shared-tree/tree.js +1 -1
- package/lib/shared-tree/tree.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +20 -0
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +39 -3
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.js +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.js +2 -2
- package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/lib/shared-tree-core/transaction.d.ts +14 -3
- package/lib/shared-tree-core/transaction.d.ts.map +1 -1
- package/lib/shared-tree-core/transaction.js +61 -18
- package/lib/shared-tree-core/transaction.js.map +1 -1
- package/lib/shared-tree-core/versionedSummarizer.d.ts.map +1 -1
- package/lib/shared-tree-core/versionedSummarizer.js +1 -1
- package/lib/shared-tree-core/versionedSummarizer.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +1 -1
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +1 -1
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaCreationUtilities.d.ts +9 -0
- package/lib/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaCreationUtilities.js +14 -0
- package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -1
- package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
- package/lib/simple-tree/api/transactionTypes.d.ts +10 -0
- package/lib/simple-tree/api/transactionTypes.d.ts.map +1 -1
- package/lib/simple-tree/api/transactionTypes.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +81 -6
- package/lib/simple-tree/api/tree.d.ts.map +1 -1
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/lib/simple-tree/index.d.ts +2 -2
- 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.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +63 -0
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js +41 -0
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/index.d.ts +1 -1
- package/lib/simple-tree/node-kinds/array/index.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/index.js +1 -1
- package/lib/simple-tree/node-kinds/array/index.js.map +1 -1
- package/lib/simple-tree/node-kinds/index.d.ts +1 -1
- package/lib/simple-tree/node-kinds/index.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/index.js +1 -1
- package/lib/simple-tree/node-kinds/index.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/lib/tableSchema.d.ts +71 -48
- package/lib/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +201 -99
- package/lib/tableSchema.js.map +1 -1
- package/lib/text/textDomainFormatted.js +1 -1
- package/lib/text/textDomainFormatted.js.map +1 -1
- package/lib/util/bTreeUtils.d.ts +30 -4
- package/lib/util/bTreeUtils.d.ts.map +1 -1
- package/lib/util/bTreeUtils.js +27 -16
- package/lib/util/bTreeUtils.js.map +1 -1
- package/lib/util/brand.d.ts.map +1 -1
- package/lib/util/brand.js.map +1 -1
- package/lib/util/brandedMap.d.ts.map +1 -1
- package/lib/util/brandedMap.js.map +1 -1
- package/lib/util/breakable.d.ts.map +1 -1
- package/lib/util/breakable.js +2 -1
- package/lib/util/breakable.js.map +1 -1
- package/lib/util/index.d.ts +2 -2
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +2 -2
- package/lib/util/index.js.map +1 -1
- package/lib/util/opaque.d.ts.map +1 -1
- package/lib/util/opaque.js.map +1 -1
- package/lib/util/rangeMap.d.ts +3 -2
- package/lib/util/rangeMap.d.ts.map +1 -1
- package/lib/util/rangeMap.js +7 -1
- package/lib/util/rangeMap.js.map +1 -1
- package/lib/util/readSnapshotBlob.d.ts +1 -1
- package/lib/util/readSnapshotBlob.d.ts.map +1 -1
- package/lib/util/readSnapshotBlob.js.map +1 -1
- package/lib/util/typeCheck.d.ts.map +1 -1
- package/lib/util/typeCheck.js.map +1 -1
- package/lib/util/utils.d.ts +20 -16
- package/lib/util/utils.d.ts.map +1 -1
- package/lib/util/utils.js +44 -15
- package/lib/util/utils.js.map +1 -1
- package/package.json +22 -22
- package/src/codec/codec.ts +30 -11
- package/src/codec/index.ts +2 -0
- package/src/codec/versioned/codec.ts +9 -13
- package/src/core/index.ts +3 -1
- package/src/core/rebase/changeRebaser.ts +3 -2
- package/src/core/rebase/index.ts +3 -1
- package/src/core/rebase/types.ts +51 -13
- package/src/core/schema-stored/formatV1.ts +2 -4
- package/src/core/schema-stored/formatV2.ts +9 -7
- package/src/core/schema-stored/index.ts +2 -0
- package/src/core/schema-stored/schema.ts +4 -1
- package/src/core/tree/anchorSet.ts +1 -3
- package/src/core/tree/delta.ts +9 -7
- package/src/core/tree/deltaUtil.ts +1 -1
- package/src/core/tree/visitDelta.ts +2 -2
- package/src/extensibleSchemaUnion.ts +135 -0
- package/src/feature-libraries/changeAtomIdBTree.ts +17 -2
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +5 -6
- package/src/feature-libraries/default-schema/index.ts +0 -1
- package/src/feature-libraries/forest-summary/codec.ts +7 -2
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +15 -3
- package/src/feature-libraries/forest-summary/formatCommon.ts +2 -3
- package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +4 -5
- package/src/feature-libraries/index.ts +3 -2
- package/src/feature-libraries/modular-schema/defaultRevisionReplacer.ts +57 -31
- package/src/feature-libraries/modular-schema/genericFieldKind.ts +1 -1
- package/src/feature-libraries/modular-schema/index.ts +4 -1
- package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +7 -6
- package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +32 -7
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +54 -33
- package/src/feature-libraries/modular-schema/modularChangeFormatV1.ts +2 -4
- package/src/feature-libraries/optional-field/optionalField.ts +1 -1
- package/src/feature-libraries/optional-field/requiredField.ts +2 -4
- package/src/feature-libraries/schema-index/codec.ts +1 -1
- package/src/feature-libraries/schema-index/schemaSummarizer.ts +1 -1
- package/src/feature-libraries/sequence-field/invert.ts +2 -2
- package/src/feature-libraries/sequence-field/replaceRevisions.ts +17 -10
- package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +1 -1
- package/src/index.ts +12 -7
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/independentView.ts +42 -6
- package/src/shared-tree/index.ts +2 -0
- package/src/shared-tree/schematizingTreeView.ts +63 -18
- package/src/shared-tree/sharedTree.ts +19 -37
- package/src/shared-tree/sharedTreeChangeCodecs.ts +43 -9
- package/src/shared-tree/tree.ts +1 -1
- package/src/shared-tree/treeCheckout.ts +50 -3
- package/src/shared-tree-core/editManagerSummarizer.ts +1 -1
- package/src/shared-tree-core/messageCodecV1ToV4.ts +4 -3
- package/src/shared-tree-core/transaction.ts +125 -23
- package/src/shared-tree-core/versionedSummarizer.ts +3 -2
- package/src/simple-tree/api/index.ts +1 -0
- package/src/simple-tree/api/schemaCreationUtilities.ts +35 -5
- package/src/simple-tree/api/simpleTreeIndex.ts +1 -1
- package/src/simple-tree/api/transactionTypes.ts +10 -0
- package/src/simple-tree/api/tree.ts +88 -6
- package/src/simple-tree/core/treeNodeSchema.ts +5 -8
- package/src/simple-tree/index.ts +3 -0
- package/src/simple-tree/leafNodeSchema.ts +3 -2
- package/src/simple-tree/node-kinds/array/arrayNode.ts +86 -0
- package/src/simple-tree/node-kinds/array/index.ts +2 -0
- package/src/simple-tree/node-kinds/index.ts +2 -0
- package/src/simple-tree/node-kinds/object/objectNode.ts +19 -18
- package/src/tableSchema.ts +280 -140
- package/src/text/textDomainFormatted.ts +1 -1
- package/src/util/bTreeUtils.ts +45 -26
- package/src/util/brand.ts +4 -12
- package/src/util/brandedMap.ts +2 -6
- package/src/util/breakable.ts +3 -2
- package/src/util/index.ts +9 -3
- package/src/util/opaque.ts +2 -6
- package/src/util/rangeMap.ts +11 -5
- package/src/util/readSnapshotBlob.ts +3 -3
- package/src/util/typeCheck.ts +11 -9
- package/src/util/utils.ts +57 -28
- package/biome.jsonc +0 -4
|
@@ -110,7 +110,7 @@ export declare class ClientVersionDispatchingCodecBuilder<Name extends CodecName
|
|
|
110
110
|
* making it easier to create builders without needing to explicitly specify all type parameters.
|
|
111
111
|
* This gets better type inference than the constructor.
|
|
112
112
|
*/
|
|
113
|
-
static build<Name extends CodecName, Entry extends CodecVersion<unknown, unknown, FormatVersion, never>>(name: Name, inputRegistry: ConfigMapEntry<Entry>): ClientVersionDispatchingCodecBuilder<Name, Entry extends CodecVersion<infer D, unknown, FormatVersion, never> ? D : never, (Entry extends CodecVersion<unknown, infer C, FormatVersion, never> ? C : never)
|
|
113
|
+
static build<Name extends CodecName, Entry extends CodecVersion<unknown, unknown, FormatVersion, never>>(name: Name, inputRegistry: ConfigMapEntry<Entry>): ClientVersionDispatchingCodecBuilder<Name, Entry extends CodecVersion<infer D, unknown, FormatVersion, never> ? D : never, unknown extends (Entry extends CodecVersion<unknown, infer C, FormatVersion, never> ? C : never) ? void : Entry extends CodecVersion<unknown, infer C, FormatVersion, never> ? C : never, Entry extends CodecVersion<unknown, unknown, infer F extends FormatVersion, never> ? F : never, Entry extends CodecVersion<unknown, unknown, FormatVersion, infer B extends CodecWriteOptions> ? B : never>;
|
|
114
114
|
}
|
|
115
115
|
export {};
|
|
116
116
|
//# sourceMappingURL=codec.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../../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cesContent":["/*!\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 type { MinimumVersionForCollab } from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\tgetConfigForMinVersionForCollabIterable,\n\ttype ConfigMapEntry,\n\ttype MinimumMinorSemanticVersion,\n\ttype SemanticVersion,\n} from \"@fluidframework/runtime-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { Type, type TSchema } from \"@sinclair/typebox\";\nimport { gt } from \"semver-ts\";\n\nimport { pkgVersion } from \"../../packageVersion.js\";\nimport type {\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnlyObject,\n} from \"../../util/index.js\";\nimport {\n\ttype ICodecFamily,\n\ttype ICodecOptions,\n\ttype IJsonCodec,\n\twithSchemaValidation,\n\ttype FormatVersion,\n\ttype CodecWriteOptions,\n\ttype IMultiFormatCodec,\n\ttype CodecName,\n\tensureBinaryEncoding,\n\ttype CodecTree,\n} from \"../codec.js\";\n\nimport { Versioned } from \"./format.js\";\n\n/**\n * Json compatible data with a format version.\n */\ntype VersionedJson = JsonCompatibleReadOnlyObject & Versioned;\n\nfunction makeVersionedCodec<\n\tTDecoded,\n\tTEncoded extends Versioned = VersionedJson,\n\tTValidate = TEncoded,\n\tTContext = void,\n>(\n\tsupportedVersions: Set<FormatVersion>,\n\t{ jsonValidator: validator }: ICodecOptions,\n\tinner: IJsonCodec<TDecoded, TEncoded, TValidate, TContext>,\n): IJsonCodec<TDecoded, TEncoded, TValidate, TContext> {\n\tconst codec = {\n\t\tencode: (data: TDecoded, context: TContext): TEncoded => {\n\t\t\tconst encoded = inner.encode(data, context);\n\t\t\tassert(\n\t\t\t\tsupportedVersions.has(encoded.version),\n\t\t\t\t0x88b /* version being encoded should be supported */,\n\t\t\t);\n\t\t\treturn encoded;\n\t\t},\n\t\tdecode: (data: TValidate, context: TContext): TDecoded => {\n\t\t\tconst versioned = data as Versioned; // Validated by withSchemaValidation\n\t\t\tif (!supportedVersions.has(versioned.version)) {\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t`Unsupported version ${versioned.version} encountered while decoding data. Supported versions for this data are: ${[...supportedVersions].join(\", \")}.\nThe client which encoded this data likely specified an \"minVersionForCollab\" value which corresponds to a version newer than the version of this client (\"${pkgVersion}\").`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst decoded = inner.decode(data, context);\n\t\t\treturn decoded;\n\t\t},\n\t};\n\n\treturn supportedVersions.has(undefined)\n\t\t? codec\n\t\t: withSchemaValidation(Versioned, codec, validator);\n}\n\n/**\n * TODO: users of this should migrate to {@link ClientVersionDispatchingCodecBuilder}.\n */\nexport function makeVersionedValidatedCodec<\n\tEncodedSchema extends TSchema,\n\tTDecoded,\n\tTEncoded extends Versioned = VersionedJson,\n\tTValidate = TEncoded,\n\tTContext = void,\n>(\n\toptions: ICodecOptions,\n\tsupportedVersions: Set<FormatVersion>,\n\tschema: EncodedSchema,\n\tcodec: IJsonCodec<TDecoded, TEncoded, TValidate, TContext>,\n): IJsonCodec<TDecoded, TEncoded, TValidate, TContext> {\n\treturn makeVersionedCodec(\n\t\tsupportedVersions,\n\t\toptions,\n\t\twithSchemaValidation(schema, codec, options.jsonValidator),\n\t);\n}\n\n/**\n * Creates a codec which always throws a UsageError when encoding or decoding, indicating that the format version is discontinued.\n *\n * TODO: {@link ClientVersionDispatchingCodecBuilder} should get support for extra decode only entries and/or unstable formats (codecs without a minVersionForCollab that will never be selected for write unless overridden).\n * Once done, users of this should migrate to ClientVersionDispatchingCodecBuilder and this function can be simplified.\n */\nexport function makeDiscontinuedCodecVersion<\n\tTDecoded,\n\tTEncoded extends Versioned = VersionedJson,\n\tTContext = unknown,\n>(\n\toptions: ICodecOptions,\n\tdiscontinuedVersion: FormatVersion,\n\tdiscontinuedSince: SemanticVersion,\n): IJsonCodec<TDecoded, TEncoded, TEncoded, TContext> {\n\tconst schema = Type.Object(\n\t\t{\n\t\t\tversion:\n\t\t\t\tdiscontinuedVersion === undefined\n\t\t\t\t\t? Type.Undefined()\n\t\t\t\t\t: Type.Literal(discontinuedVersion),\n\t\t},\n\t\t// Using `additionalProperties: true` allows this schema to be used when loading data encoded by older versions even though they contain additional properties.\n\t\t{ additionalProperties: true },\n\t);\n\tconst codec: IJsonCodec<TDecoded, TEncoded, TEncoded, TContext> = {\n\t\tencode: (_: TDecoded): TEncoded => {\n\t\t\tthrow new UsageError(\n\t\t\t\t`Cannot encode data to format ${discontinuedVersion}. The codec was discontinued in Fluid Framework client version ${discontinuedSince}.`,\n\t\t\t);\n\t\t},\n\t\tdecode: (data: TEncoded): TDecoded => {\n\t\t\tthrow new UsageError(\n\t\t\t\t`Cannot decode data to format ${data.version}. The codec was discontinued in Fluid Framework client version ${discontinuedSince}.`,\n\t\t\t);\n\t\t},\n\t};\n\treturn makeVersionedValidatedCodec(options, new Set([discontinuedVersion]), schema, codec);\n}\n\n/**\n * Creates a codec which dispatches to the appropriate member of a codec family based on the version of\n * data it encounters.\n * @remarks\n * Each member of the codec family must write an explicit version number into the data it encodes (implementing {@link Versioned}).\n *\n * TODO: Users of this should migrate to {@link ClientVersionDispatchingCodecBuilder} so that the actual format version used can be encapsulated.\n */\nexport function makeVersionDispatchingCodec<TDecoded, TContext>(\n\tfamily: ICodecFamily<TDecoded, TContext>,\n\toptions: ICodecOptions & { writeVersion: FormatVersion },\n): IJsonCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext> {\n\tconst writeCodec = family.resolve(options.writeVersion).json;\n\tconst supportedVersions = new Set(family.getSupportedFormats());\n\treturn makeVersionedCodec(supportedVersions, options, {\n\t\tencode(data, context): Versioned {\n\t\t\treturn writeCodec.encode(data, context) as Versioned;\n\t\t},\n\t\tdecode(data: Versioned, context) {\n\t\t\tconst codec = family.resolve(data.version);\n\t\t\treturn codec.json.decode(data, context);\n\t\t},\n\t});\n}\n\n/**\n * A friendly format for codec authors use to define their codec and schema for use in {@link CodecVersion}.\n * @remarks\n * The codec should not perform its own schema validation.\n * The schema validation gets added when normalizing to {@link NormalizedCodecVersion}.\n */\nexport type CodecAndSchema<TDecoded, TContext = void> = { readonly schema: TSchema } & (\n\t| IMultiFormatCodec<TDecoded, VersionedJson, JsonCompatibleReadOnly, TContext>\n\t| IJsonCodec<TDecoded, VersionedJson, JsonCompatibleReadOnly, TContext>\n);\n\n/**\n * A codec alongside its format version and schema.\n */\nexport interface CodecVersionBase<\n\tT = unknown,\n\tTFormatVersion extends FormatVersion = FormatVersion,\n> {\n\treadonly formatVersion: TFormatVersion;\n\treadonly codec: T;\n}\n\n/**\n * A particular version of a codec and when to use it.\n * @privateRemarks\n * This allows lazy building of the codec with options.\n * This option can likely be removed as the codec handling is made simpler and more consistent.\n * Removing support for this laziness would be nice to help prevent unexpected coupling and alteration to codec behavior,\n * helping ensure that tests and production code behave the same.\n */\nexport interface CodecVersion<\n\tTDecoded,\n\tTContext,\n\tTFormatVersion extends FormatVersion,\n\tTBuildOptions extends CodecWriteOptions,\n> extends CodecVersionBase<\n\t\t| CodecAndSchema<TDecoded, TContext>\n\t\t| ((options: TBuildOptions) => CodecAndSchema<TDecoded, TContext>),\n\t\tTFormatVersion\n\t> {}\n\n/**\n * {@link CodecVersion} after normalization into a consistent type.\n * @remarks\n * Produced by {@link normalizeCodecVersion}.\n * Includes schema validation.\n */\nexport interface NormalizedCodecVersion<\n\tTDecoded,\n\tTContext,\n\tTFormatVersion extends FormatVersion,\n\tTBuildOptions extends CodecWriteOptions,\n> extends CodecVersionBase<\n\t\t(\n\t\t\toptions: TBuildOptions,\n\t\t) => IJsonCodec<TDecoded, VersionedJson, JsonCompatibleReadOnly, TContext>,\n\t\tTFormatVersion\n\t> {}\n\n/**\n * {@link NormalizedCodecVersion} after applying the build options.\n * @remarks\n * Produced by {@link ClientVersionDispatchingCodecBuilder.applyOptions}.\n */\nexport interface EvaluatedCodecVersion<\n\tTDecoded,\n\tTContext,\n\tTFormatVersion extends FormatVersion,\n> extends CodecVersionBase<\n\t\tIJsonCodec<TDecoded, VersionedJson, JsonCompatibleReadOnly, TContext>,\n\t\tTFormatVersion\n\t> {}\n\n/**\n * Normalize the codec to a single format.\n * @remarks\n * Bakes in schema validation, so output no longer exposes the schema.\n */\nfunction normalizeCodecVersion<\n\tTDecoded,\n\tTContext,\n\tTFormatVersion extends FormatVersion,\n\tTBuildOptions extends CodecWriteOptions,\n>(\n\tcodecVersion: CodecVersion<TDecoded, TContext, TFormatVersion, TBuildOptions>,\n): NormalizedCodecVersion<TDecoded, TContext, TFormatVersion, TBuildOptions> {\n\tconst codecBuilder: (options: TBuildOptions) => CodecAndSchema<TDecoded, TContext> =\n\t\ttypeof codecVersion.codec === \"function\"\n\t\t\t? codecVersion.codec\n\t\t\t: () => codecVersion.codec as CodecAndSchema<TDecoded, TContext>;\n\tconst codec = (\n\t\toptions: TBuildOptions,\n\t): IJsonCodec<TDecoded, VersionedJson, JsonCompatibleReadOnly, TContext> => {\n\t\tconst built = codecBuilder(options);\n\t\t// We currently don't expose or use binary formats, but someday we might.\n\t\tconst multiFormat = ensureBinaryEncoding<TDecoded, TContext, VersionedJson>(built);\n\t\treturn makeVersionedValidatedCodec(\n\t\t\toptions,\n\t\t\tnew Set([codecVersion.formatVersion]),\n\t\t\tbuilt.schema,\n\t\t\tmultiFormat.json,\n\t\t);\n\t};\n\n\treturn {\n\t\tformatVersion: codecVersion.formatVersion,\n\t\tcodec,\n\t};\n}\n\n/**\n * Creates a codec which dispatches to the appropriate member of a codec family based on the `minVersionForCollab` for encode and the\n * version number in data it encounters for decode.\n * @privateRemarks\n * This is a two stage builder so the first stage can encapsulate all codec specific details and the second can bring in configuration.\n */\nexport class ClientVersionDispatchingCodecBuilder<\n\tName extends CodecName,\n\tTDecoded,\n\tTContext,\n\tTFormatVersion extends FormatVersion,\n\tTBuildOptions extends CodecWriteOptions,\n> {\n\tpublic readonly registry: ReadonlyMap<\n\t\tMinimumVersionForCollab,\n\t\tNormalizedCodecVersion<TDecoded, TContext, TFormatVersion, TBuildOptions>\n\t>;\n\n\t/**\n\t * Use {@link ClientVersionDispatchingCodecBuilder.build} to create an instance of this class.\n\t */\n\tprivate constructor(\n\t\t/**\n\t\t * See {@link CodecName}.\n\t\t */\n\t\tpublic readonly name: Name,\n\t\t/**\n\t\t * The registry of codecs which this builder can use to encode and decode data.\n\t\t */\n\t\tinputRegistry: ConfigMapEntry<\n\t\t\tCodecVersion<TDecoded, TContext, TFormatVersion, TBuildOptions>\n\t\t>,\n\t) {\n\t\ttype Normalized = NormalizedCodecVersion<\n\t\t\tTDecoded,\n\t\t\tTContext,\n\t\t\tTFormatVersion,\n\t\t\tTBuildOptions\n\t\t>;\n\t\tconst normalizedRegistry = new Map<MinimumVersionForCollab, Normalized>();\n\n\t\tfor (const [minVersionForCollab, codec] of Object.entries(inputRegistry) as Iterable<\n\t\t\t[\n\t\t\t\tMinimumVersionForCollab,\n\t\t\t\tCodecVersion<TDecoded, TContext, TFormatVersion, TBuildOptions>,\n\t\t\t]\n\t\t>) {\n\t\t\tconst normalizedCodec = normalizeCodecVersion(codec);\n\t\t\tnormalizedRegistry.set(minVersionForCollab, normalizedCodec);\n\t\t}\n\n\t\tthis.registry = normalizedRegistry;\n\t}\n\n\t/**\n\t * Applies the provided options to the codec registry to produce a list of evaluated codecs.\n\t * @remarks\n\t * This is used by build, which is what production code should use.\n\t * This is only exposed for testing purposes.\n\t */\n\tpublic applyOptions(\n\t\toptions: TBuildOptions,\n\t): [MinimumVersionForCollab, EvaluatedCodecVersion<TDecoded, TContext, TFormatVersion>][] {\n\t\treturn Array.from(\n\t\t\tthis.registry,\n\t\t\t([version, codec]) =>\n\t\t\t\t[\n\t\t\t\t\tversion,\n\t\t\t\t\t{\n\t\t\t\t\t\tformatVersion: codec.formatVersion,\n\t\t\t\t\t\tcodec: codec.codec(options),\n\t\t\t\t\t},\n\t\t\t\t] as const,\n\t\t);\n\t}\n\n\t/**\n\t * Produce a single codec which can read any supported format, and writes a version selected based on the provided options.\n\t */\n\tpublic build(\n\t\toptions: TBuildOptions,\n\t): IJsonCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext> {\n\t\tconst applied = this.applyOptions(options);\n\t\tconst writeVersion = getWriteVersion(this.name, options, applied);\n\t\tconst fromFormatVersion = new Map<\n\t\t\tFormatVersion,\n\t\t\tEvaluatedCodecVersion<TDecoded, TContext, TFormatVersion>\n\t\t>(applied.map(([_version, codec]) => [codec.formatVersion, codec]));\n\t\treturn {\n\t\t\tencode: (data: TDecoded, context: TContext): JsonCompatibleReadOnly => {\n\t\t\t\treturn writeVersion.codec.encode(data, context);\n\t\t\t},\n\t\t\tdecode: (data: JsonCompatibleReadOnly, context: TContext): TDecoded => {\n\t\t\t\tconst versioned = data as Partial<Versioned>;\n\t\t\t\tconst codec = fromFormatVersion.get(versioned.version);\n\t\t\t\tif (codec === undefined) {\n\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t`Unsupported version ${versioned.version} encountered while decoding ${this.name} data. Supported versions for this data are: ${versionList(applied)}.\nThe client which encoded this data likely specified an \"minVersionForCollab\" value which corresponds to a version newer than the version of this client (\"${pkgVersion}\").`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn codec.codec.decode(data, context);\n\t\t\t},\n\t\t};\n\t}\n\n\tpublic getCodecTree(clientVersion: MinimumVersionForCollab): CodecTree {\n\t\t// TODO: add support for children codecs.\n\t\tconst selected = getConfigForMinVersionForCollabIterable(clientVersion, this.registry);\n\t\treturn {\n\t\t\tname: this.name,\n\t\t\tversion: selected.formatVersion,\n\t\t};\n\t}\n\n\t/**\n\t * Builds a ClientVersionDispatchingCodecBuilder from the provided registry.\n\t * @remarks\n\t * This static method infers the types of the builder from the provided registry,\n\t * making it easier to create builders without needing to explicitly specify all type parameters.\n\t * This gets better type inference than the constructor.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n\tpublic static build<\n\t\tName extends CodecName,\n\t\tEntry extends CodecVersion<unknown, unknown, FormatVersion, never>,\n\t>(name: Name, inputRegistry: ConfigMapEntry<Entry>) {\n\t\ttype TDecoded2 = Entry extends CodecVersion<infer D, unknown, FormatVersion, never>\n\t\t\t? D\n\t\t\t: never;\n\t\ttype TContext2 = Entry extends CodecVersion<unknown, infer C, FormatVersion, never>\n\t\t\t? C\n\t\t\t: never;\n\t\ttype TFormatVersion2 = Entry extends CodecVersion<unknown, unknown, infer F, never>\n\t\t\t? F\n\t\t\t: never;\n\t\ttype TBuildOptions2 = Entry extends CodecVersion<unknown, unknown, FormatVersion, infer B>\n\t\t\t? B\n\t\t\t: never;\n\t\tconst builder = new ClientVersionDispatchingCodecBuilder(\n\t\t\tname,\n\t\t\tinputRegistry as ConfigMapEntry<unknown> as ConfigMapEntry<\n\t\t\t\tCodecVersion<\n\t\t\t\t\tTDecoded2,\n\t\t\t\t\t// If it does not matter what context is provided, undefined is fine, so allow it to be omitted.\n\t\t\t\t\tTContext2 extends unknown ? void : TContext2,\n\t\t\t\t\tTFormatVersion2,\n\t\t\t\t\tTBuildOptions2\n\t\t\t\t>\n\t\t\t>,\n\t\t);\n\t\treturn builder;\n\t}\n}\n\n/**\n * Selects which format should be used when writing data.\n * @remarks\n * This either uses the override specified in the options, or selects the newest format compatible with the provided minVersionForCollab.\n */\nfunction getWriteVersion<T extends CodecVersionBase>(\n\tname: CodecName,\n\toptions: CodecWriteOptions,\n\tversions: readonly [MinimumMinorSemanticVersion | MinimumVersionForCollab, T][],\n): T {\n\tif (options.writeVersionOverrides?.has(name) === true) {\n\t\tconst selectedFormatVersion = options.writeVersionOverrides.get(name);\n\t\tconst selected = versions.find(\n\t\t\t([_v, codec]) => codec.formatVersion === selectedFormatVersion,\n\t\t);\n\t\tif (selected === undefined) {\n\t\t\tthrow new UsageError(\n\t\t\t\t`Codec \"${name}\" does not support requested format version ${selectedFormatVersion}. Supported versions are: ${versionList(versions)}.`,\n\t\t\t);\n\t\t} else if (options.allowPossiblyIncompatibleWriteVersionOverrides !== true) {\n\t\t\tconst selectedMinVersionForCollab = selected[0];\n\t\t\t// Currently all versions must specify a minVersionForCollab, so undefined is not expected here.\n\t\t\t// TODO: It should be possible to have a version which would never be automatically selected for write (and thus does not have or need a minVersionForCollab), but can be selected via override.\n\t\t\t// Use-cases for this include experimental versions not yet stable, and discontinued or intermediate versions which are mainly being kept for read compatibility but still support writing (perhaps for round-trip testing).\n\t\t\t// For now, this check should never pass, and there is no way to create such a version yet.\n\t\t\tif (selectedMinVersionForCollab === undefined) {\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t`Codec \"${name}\" does not support requested format version ${selectedFormatVersion} because it does not specify a minVersionForCollab. Use \"allowPossiblyIncompatibleWriteVersionOverrides\" to suppress this error if appropriate.`,\n\t\t\t\t);\n\t\t\t} else if (gt(selectedMinVersionForCollab, options.minVersionForCollab)) {\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t`Codec \"${name}\" does not support requested format version ${selectedFormatVersion} because it is only compatible back to client version ${selectedMinVersionForCollab} and the requested oldest compatible client was ${options.minVersionForCollab}. Use \"allowPossiblyIncompatibleWriteVersionOverrides\" to suppress this error if appropriate.`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn selected[1];\n\t}\n\tconst result: T = getConfigForMinVersionForCollabIterable(\n\t\toptions.minVersionForCollab,\n\t\tversions,\n\t);\n\treturn result;\n}\n\n/**\n * Formats a list of versions for use in UsageErrors.\n */\nfunction versionList(\n\tversions: readonly [\n\t\tMinimumMinorSemanticVersion | MinimumVersionForCollab,\n\t\tCodecVersionBase,\n\t][],\n): string {\n\treturn `${Array.from(versions, ([_v, codec]) => codec.formatVersion).join(\", \")}`;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"codec.js","sourceRoot":"","sources":["../../../src/codec/versioned/codec.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D,qEAKgD;AAChD,uEAAsE;AACtE,+CAAuD;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,CACnB,UAAU,IAAI,+CAA+C,qBAAqB,6BAA6B,WAAW,CAAC,QAAQ,CAAC,GAAG,CACvI,CAAC;QACH,CAAC;aAAM,IAAI,OAAO,CAAC,8CAA8C,KAAK,IAAI,EAAE,CAAC;YAC5E,MAAM,2BAA2B,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;YAChD,gGAAgG;YAChG,gMAAgM;YAChM,4NAA4N;YAC5N,2FAA2F;YAC3F,IAAI,2BAA2B,KAAK,SAAS,EAAE,CAAC;gBAC/C,MAAM,IAAI,qBAAU,CACnB,UAAU,IAAI,+CAA+C,qBAAqB,iJAAiJ,CACnO,CAAC;YACH,CAAC;iBAAM,IAAI,IAAA,cAAE,EAAC,2BAA2B,EAAE,OAAO,CAAC,mBAAmB,CAAC,EAAE,CAAC;gBACzE,MAAM,IAAI,qBAAU,CACnB,UAAU,IAAI,+CAA+C,qBAAqB,yDAAyD,2BAA2B,mDAAmD,OAAO,CAAC,mBAAmB,+FAA+F,CACnV,CAAC;YACH,CAAC;QACF,CAAC;QAED,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IACD,MAAM,MAAM,GAAM,IAAA,kDAAuC,EACxD,OAAO,CAAC,mBAAmB,EAC3B,QAAQ,CACR,CAAC;IACF,OAAO,MAAM,CAAC;AACf,CAAC;AAED;;GAEG;AACH,SAAS,WAAW,CACnB,QAGG;IAEH,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AACnF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { MinimumVersionForCollab } from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\tgetConfigForMinVersionForCollabIterable,\n\ttype ConfigMapEntry,\n\ttype MinimumMinorSemanticVersion,\n\ttype SemanticVersion,\n} from \"@fluidframework/runtime-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { Type, type TSchema } from \"@sinclair/typebox\";\nimport { gt } from \"semver-ts\";\n\nimport { pkgVersion } from \"../../packageVersion.js\";\nimport type {\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnlyObject,\n} from \"../../util/index.js\";\nimport {\n\ttype ICodecFamily,\n\ttype ICodecOptions,\n\ttype IJsonCodec,\n\twithSchemaValidation,\n\ttype FormatVersion,\n\ttype CodecWriteOptions,\n\ttype IMultiFormatCodec,\n\ttype CodecName,\n\tensureBinaryEncoding,\n\ttype CodecTree,\n} from \"../codec.js\";\n\nimport { Versioned } from \"./format.js\";\n\n/**\n * Json compatible data with a format version.\n */\ntype VersionedJson = JsonCompatibleReadOnlyObject & Versioned;\n\nfunction makeVersionedCodec<\n\tTDecoded,\n\tTEncoded extends Versioned = VersionedJson,\n\tTValidate = TEncoded,\n\tTContext = void,\n>(\n\tsupportedVersions: Set<FormatVersion>,\n\t{ jsonValidator: validator }: ICodecOptions,\n\tinner: IJsonCodec<TDecoded, TEncoded, TValidate, TContext>,\n): IJsonCodec<TDecoded, TEncoded, TValidate, TContext> {\n\tconst codec = {\n\t\tencode: (data: TDecoded, context: TContext): TEncoded => {\n\t\t\tconst encoded = inner.encode(data, context);\n\t\t\tassert(\n\t\t\t\tsupportedVersions.has(encoded.version),\n\t\t\t\t0x88b /* version being encoded should be supported */,\n\t\t\t);\n\t\t\treturn encoded;\n\t\t},\n\t\tdecode: (data: TValidate, context: TContext): TDecoded => {\n\t\t\tconst versioned = data as Versioned; // Validated by withSchemaValidation\n\t\t\tif (!supportedVersions.has(versioned.version)) {\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t`Unsupported version ${versioned.version} encountered while decoding data. Supported versions for this data are: ${[...supportedVersions].join(\", \")}.\nThe client which encoded this data likely specified an \"minVersionForCollab\" value which corresponds to a version newer than the version of this client (\"${pkgVersion}\").`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst decoded = inner.decode(data, context);\n\t\t\treturn decoded;\n\t\t},\n\t};\n\n\treturn supportedVersions.has(undefined)\n\t\t? codec\n\t\t: withSchemaValidation(Versioned, codec, validator);\n}\n\n/**\n * TODO: users of this should migrate to {@link ClientVersionDispatchingCodecBuilder}.\n */\nexport function makeVersionedValidatedCodec<\n\tEncodedSchema extends TSchema,\n\tTDecoded,\n\tTEncoded extends Versioned = VersionedJson,\n\tTValidate = TEncoded,\n\tTContext = void,\n>(\n\toptions: ICodecOptions,\n\tsupportedVersions: Set<FormatVersion>,\n\tschema: EncodedSchema,\n\tcodec: IJsonCodec<TDecoded, TEncoded, TValidate, TContext>,\n): IJsonCodec<TDecoded, TEncoded, TValidate, TContext> {\n\treturn makeVersionedCodec(\n\t\tsupportedVersions,\n\t\toptions,\n\t\twithSchemaValidation(schema, codec, options.jsonValidator),\n\t);\n}\n\n/**\n * Creates a codec which always throws a UsageError when encoding or decoding, indicating that the format version is discontinued.\n *\n * TODO: {@link ClientVersionDispatchingCodecBuilder} should get support for extra decode only entries and/or unstable formats (codecs without a minVersionForCollab that will never be selected for write unless overridden).\n * Once done, users of this should migrate to ClientVersionDispatchingCodecBuilder and this function can be simplified.\n */\nexport function makeDiscontinuedCodecVersion<\n\tTDecoded,\n\tTEncoded extends Versioned = VersionedJson,\n\tTContext = unknown,\n>(\n\toptions: ICodecOptions,\n\tdiscontinuedVersion: FormatVersion,\n\tdiscontinuedSince: SemanticVersion,\n): IJsonCodec<TDecoded, TEncoded, TEncoded, TContext> {\n\tconst schema = Type.Object(\n\t\t{\n\t\t\tversion:\n\t\t\t\tdiscontinuedVersion === undefined\n\t\t\t\t\t? Type.Undefined()\n\t\t\t\t\t: Type.Literal(discontinuedVersion),\n\t\t},\n\t\t// Using `additionalProperties: true` allows this schema to be used when loading data encoded by older versions even though they contain additional properties.\n\t\t{ additionalProperties: true },\n\t);\n\tconst codec: IJsonCodec<TDecoded, TEncoded, TEncoded, TContext> = {\n\t\tencode: (_: TDecoded): TEncoded => {\n\t\t\tthrow new UsageError(\n\t\t\t\t`Cannot encode data to format ${discontinuedVersion}. The codec was discontinued in Fluid Framework client version ${discontinuedSince}.`,\n\t\t\t);\n\t\t},\n\t\tdecode: (data: TEncoded): TDecoded => {\n\t\t\tthrow new UsageError(\n\t\t\t\t`Cannot decode data to format ${data.version}. The codec was discontinued in Fluid Framework client version ${discontinuedSince}.`,\n\t\t\t);\n\t\t},\n\t};\n\treturn makeVersionedValidatedCodec(options, new Set([discontinuedVersion]), schema, codec);\n}\n\n/**\n * Creates a codec which dispatches to the appropriate member of a codec family based on the version of\n * data it encounters.\n * @remarks\n * Each member of the codec family must write an explicit version number into the data it encodes (implementing {@link Versioned}).\n *\n * TODO: Users of this should migrate to {@link ClientVersionDispatchingCodecBuilder} so that the actual format version used can be encapsulated.\n */\nexport function makeVersionDispatchingCodec<TDecoded, TContext>(\n\tfamily: ICodecFamily<TDecoded, TContext>,\n\toptions: ICodecOptions & { writeVersion: FormatVersion },\n): IJsonCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext> {\n\tconst writeCodec = family.resolve(options.writeVersion).json;\n\tconst supportedVersions = new Set(family.getSupportedFormats());\n\treturn makeVersionedCodec(supportedVersions, options, {\n\t\tencode(data, context): Versioned {\n\t\t\treturn writeCodec.encode(data, context) as Versioned;\n\t\t},\n\t\tdecode(data: Versioned, context) {\n\t\t\tconst codec = family.resolve(data.version);\n\t\t\treturn codec.json.decode(data, context);\n\t\t},\n\t});\n}\n\n/**\n * A friendly format for codec authors use to define their codec and schema for use in {@link CodecVersion}.\n * @remarks\n * The codec should not perform its own schema validation.\n * The schema validation gets added when normalizing to {@link NormalizedCodecVersion}.\n */\nexport type CodecAndSchema<TDecoded, TContext = void> = { readonly schema: TSchema } & (\n\t| IMultiFormatCodec<TDecoded, VersionedJson, JsonCompatibleReadOnly, TContext>\n\t| IJsonCodec<TDecoded, VersionedJson, JsonCompatibleReadOnly, TContext>\n);\n\n/**\n * A codec alongside its format version and schema.\n */\nexport interface CodecVersionBase<\n\tT = unknown,\n\tTFormatVersion extends FormatVersion = FormatVersion,\n> {\n\treadonly formatVersion: TFormatVersion;\n\treadonly codec: T;\n}\n\n/**\n * A particular version of a codec and when to use it.\n * @privateRemarks\n * This allows lazy building of the codec with options.\n * This option can likely be removed as the codec handling is made simpler and more consistent.\n * Removing support for this laziness would be nice to help prevent unexpected coupling and alteration to codec behavior,\n * helping ensure that tests and production code behave the same.\n */\nexport interface CodecVersion<\n\tTDecoded,\n\tTContext,\n\tTFormatVersion extends FormatVersion,\n\tTBuildOptions extends CodecWriteOptions,\n> extends CodecVersionBase<\n\t\t| CodecAndSchema<TDecoded, TContext>\n\t\t| ((options: TBuildOptions) => CodecAndSchema<TDecoded, TContext>),\n\t\tTFormatVersion\n\t> {}\n\n/**\n * {@link CodecVersion} after normalization into a consistent type.\n * @remarks\n * Produced by {@link normalizeCodecVersion}.\n * Includes schema validation.\n */\nexport interface NormalizedCodecVersion<\n\tTDecoded,\n\tTContext,\n\tTFormatVersion extends FormatVersion,\n\tTBuildOptions extends CodecWriteOptions,\n> extends CodecVersionBase<\n\t\t(\n\t\t\toptions: TBuildOptions,\n\t\t) => IJsonCodec<TDecoded, VersionedJson, JsonCompatibleReadOnly, TContext>,\n\t\tTFormatVersion\n\t> {}\n\n/**\n * {@link NormalizedCodecVersion} after applying the build options.\n * @remarks\n * Produced by {@link ClientVersionDispatchingCodecBuilder.applyOptions}.\n */\nexport interface EvaluatedCodecVersion<\n\tTDecoded,\n\tTContext,\n\tTFormatVersion extends FormatVersion,\n> extends CodecVersionBase<\n\t\tIJsonCodec<TDecoded, VersionedJson, JsonCompatibleReadOnly, TContext>,\n\t\tTFormatVersion\n\t> {}\n\n/**\n * Normalize the codec to a single format.\n * @remarks\n * Bakes in schema validation, so output no longer exposes the schema.\n */\nfunction normalizeCodecVersion<\n\tTDecoded,\n\tTContext,\n\tTFormatVersion extends FormatVersion,\n\tTBuildOptions extends CodecWriteOptions,\n>(\n\tcodecVersion: CodecVersion<TDecoded, TContext, TFormatVersion, TBuildOptions>,\n): NormalizedCodecVersion<TDecoded, TContext, TFormatVersion, TBuildOptions> {\n\tconst codecBuilder: (options: TBuildOptions) => CodecAndSchema<TDecoded, TContext> =\n\t\ttypeof codecVersion.codec === \"function\"\n\t\t\t? codecVersion.codec\n\t\t\t: () => codecVersion.codec as CodecAndSchema<TDecoded, TContext>;\n\tconst codec = (\n\t\toptions: TBuildOptions,\n\t): IJsonCodec<TDecoded, VersionedJson, JsonCompatibleReadOnly, TContext> => {\n\t\tconst built = codecBuilder(options);\n\t\t// We currently don't expose or use binary formats, but someday we might.\n\t\tconst multiFormat = ensureBinaryEncoding<TDecoded, TContext, VersionedJson>(built);\n\t\treturn makeVersionedValidatedCodec(\n\t\t\toptions,\n\t\t\tnew Set([codecVersion.formatVersion]),\n\t\t\tbuilt.schema,\n\t\t\tmultiFormat.json,\n\t\t);\n\t};\n\n\treturn {\n\t\tformatVersion: codecVersion.formatVersion,\n\t\tcodec,\n\t};\n}\n\n/**\n * Creates a codec which dispatches to the appropriate member of a codec family based on the `minVersionForCollab` for encode and the\n * version number in data it encounters for decode.\n * @privateRemarks\n * This is a two stage builder so the first stage can encapsulate all codec specific details and the second can bring in configuration.\n */\nexport class ClientVersionDispatchingCodecBuilder<\n\tName extends CodecName,\n\tTDecoded,\n\tTContext,\n\tTFormatVersion extends FormatVersion,\n\tTBuildOptions extends CodecWriteOptions,\n> {\n\tpublic readonly registry: ReadonlyMap<\n\t\tMinimumVersionForCollab,\n\t\tNormalizedCodecVersion<TDecoded, TContext, TFormatVersion, TBuildOptions>\n\t>;\n\n\t/**\n\t * Use {@link ClientVersionDispatchingCodecBuilder.build} to create an instance of this class.\n\t */\n\tprivate constructor(\n\t\t/**\n\t\t * See {@link CodecName}.\n\t\t */\n\t\tpublic readonly name: Name,\n\t\t/**\n\t\t * The registry of codecs which this builder can use to encode and decode data.\n\t\t */\n\t\tinputRegistry: ConfigMapEntry<\n\t\t\tCodecVersion<TDecoded, TContext, TFormatVersion, TBuildOptions>\n\t\t>,\n\t) {\n\t\ttype Normalized = NormalizedCodecVersion<\n\t\t\tTDecoded,\n\t\t\tTContext,\n\t\t\tTFormatVersion,\n\t\t\tTBuildOptions\n\t\t>;\n\t\tconst normalizedRegistry = new Map<MinimumVersionForCollab, Normalized>();\n\n\t\tfor (const [minVersionForCollab, codec] of Object.entries(inputRegistry) as Iterable<\n\t\t\t[\n\t\t\t\tMinimumVersionForCollab,\n\t\t\t\tCodecVersion<TDecoded, TContext, TFormatVersion, TBuildOptions>,\n\t\t\t]\n\t\t>) {\n\t\t\tconst normalizedCodec = normalizeCodecVersion(codec);\n\t\t\tnormalizedRegistry.set(minVersionForCollab, normalizedCodec);\n\t\t}\n\n\t\tthis.registry = normalizedRegistry;\n\t}\n\n\t/**\n\t * Applies the provided options to the codec registry to produce a list of evaluated codecs.\n\t * @remarks\n\t * This is used by build, which is what production code should use.\n\t * This is only exposed for testing purposes.\n\t */\n\tpublic applyOptions(\n\t\toptions: TBuildOptions,\n\t): [MinimumVersionForCollab, EvaluatedCodecVersion<TDecoded, TContext, TFormatVersion>][] {\n\t\treturn Array.from(\n\t\t\tthis.registry,\n\t\t\t([version, codec]) =>\n\t\t\t\t[\n\t\t\t\t\tversion,\n\t\t\t\t\t{\n\t\t\t\t\t\tformatVersion: codec.formatVersion,\n\t\t\t\t\t\tcodec: codec.codec(options),\n\t\t\t\t\t},\n\t\t\t\t] as const,\n\t\t);\n\t}\n\n\t/**\n\t * Produce a single codec which can read any supported format, and writes a version selected based on the provided options.\n\t */\n\tpublic build(\n\t\toptions: TBuildOptions,\n\t): IJsonCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext> {\n\t\tconst applied = this.applyOptions(options);\n\t\tconst writeVersion = getWriteVersion(this.name, options, applied);\n\t\tconst fromFormatVersion = new Map<\n\t\t\tFormatVersion,\n\t\t\tEvaluatedCodecVersion<TDecoded, TContext, TFormatVersion>\n\t\t>(applied.map(([_version, codec]) => [codec.formatVersion, codec]));\n\t\treturn {\n\t\t\tencode: (data: TDecoded, context: TContext): JsonCompatibleReadOnly => {\n\t\t\t\treturn writeVersion.codec.encode(data, context);\n\t\t\t},\n\t\t\tdecode: (data: JsonCompatibleReadOnly, context: TContext): TDecoded => {\n\t\t\t\tconst versioned = data as Partial<Versioned>;\n\t\t\t\tconst codec = fromFormatVersion.get(versioned.version);\n\t\t\t\tif (codec === undefined) {\n\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t`Unsupported version ${versioned.version} encountered while decoding ${this.name} data. Supported versions for this data are: ${versionList(applied)}.\nThe client which encoded this data likely specified an \"minVersionForCollab\" value which corresponds to a version newer than the version of this client (\"${pkgVersion}\").`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn codec.codec.decode(data, context);\n\t\t\t},\n\t\t};\n\t}\n\n\tpublic getCodecTree(clientVersion: MinimumVersionForCollab): CodecTree {\n\t\t// TODO: add support for children codecs.\n\t\tconst selected = getConfigForMinVersionForCollabIterable(clientVersion, this.registry);\n\t\treturn {\n\t\t\tname: this.name,\n\t\t\tversion: selected.formatVersion,\n\t\t};\n\t}\n\n\t/**\n\t * Builds a ClientVersionDispatchingCodecBuilder from the provided registry.\n\t * @remarks\n\t * This static method infers the types of the builder from the provided registry,\n\t * making it easier to create builders without needing to explicitly specify all type parameters.\n\t * This gets better type inference than the constructor.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n\tpublic static build<\n\t\tName extends CodecName,\n\t\tEntry extends CodecVersion<unknown, unknown, FormatVersion, never>,\n\t>(name: Name, inputRegistry: ConfigMapEntry<Entry>) {\n\t\ttype TDecoded2 =\n\t\t\tEntry extends CodecVersion<infer D, unknown, FormatVersion, never> ? D : never;\n\t\ttype TContext2 =\n\t\t\tEntry extends CodecVersion<unknown, infer C, FormatVersion, never> ? C : never;\n\t\ttype TFormatVersion2 =\n\t\t\tEntry extends CodecVersion<unknown, unknown, infer F, never> ? F : never;\n\t\ttype TBuildOptions2 =\n\t\t\tEntry extends CodecVersion<unknown, unknown, FormatVersion, infer B> ? B : never;\n\t\tconst builder = new ClientVersionDispatchingCodecBuilder(\n\t\t\tname,\n\t\t\tinputRegistry as ConfigMapEntry<unknown> as ConfigMapEntry<\n\t\t\t\tCodecVersion<\n\t\t\t\t\tTDecoded2,\n\t\t\t\t\t// If it does not matter what context is provided, undefined is fine, so allow it to be omitted.\n\t\t\t\t\tunknown extends TContext2 ? void : TContext2,\n\t\t\t\t\tTFormatVersion2,\n\t\t\t\t\tTBuildOptions2\n\t\t\t\t>\n\t\t\t>,\n\t\t);\n\t\treturn builder;\n\t}\n}\n\n/**\n * Selects which format should be used when writing data.\n * @remarks\n * This either uses the override specified in the options, or selects the newest format compatible with the provided minVersionForCollab.\n */\nfunction getWriteVersion<T extends CodecVersionBase>(\n\tname: CodecName,\n\toptions: CodecWriteOptions,\n\tversions: readonly [MinimumMinorSemanticVersion | MinimumVersionForCollab, T][],\n): T {\n\tif (options.writeVersionOverrides?.has(name) === true) {\n\t\tconst selectedFormatVersion = options.writeVersionOverrides.get(name);\n\t\tconst selected = versions.find(\n\t\t\t([_v, codec]) => codec.formatVersion === selectedFormatVersion,\n\t\t);\n\t\tif (selected === undefined) {\n\t\t\tthrow new UsageError(\n\t\t\t\t`Codec \"${name}\" does not support requested format version ${selectedFormatVersion}. Supported versions are: ${versionList(versions)}.`,\n\t\t\t);\n\t\t} else if (options.allowPossiblyIncompatibleWriteVersionOverrides !== true) {\n\t\t\tconst selectedMinVersionForCollab = selected[0];\n\t\t\t// Currently all versions must specify a minVersionForCollab, so undefined is not expected here.\n\t\t\t// TODO: It should be possible to have a version which would never be automatically selected for write (and thus does not have or need a minVersionForCollab), but can be selected via override.\n\t\t\t// Use-cases for this include experimental versions not yet stable, and discontinued or intermediate versions which are mainly being kept for read compatibility but still support writing (perhaps for round-trip testing).\n\t\t\t// For now, this check should never pass, and there is no way to create such a version yet.\n\t\t\tif (selectedMinVersionForCollab === undefined) {\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t`Codec \"${name}\" does not support requested format version ${selectedFormatVersion} because it does not specify a minVersionForCollab. Use \"allowPossiblyIncompatibleWriteVersionOverrides\" to suppress this error if appropriate.`,\n\t\t\t\t);\n\t\t\t} else if (gt(selectedMinVersionForCollab, options.minVersionForCollab)) {\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t`Codec \"${name}\" does not support requested format version ${selectedFormatVersion} because it is only compatible back to client version ${selectedMinVersionForCollab} and the requested oldest compatible client was ${options.minVersionForCollab}. Use \"allowPossiblyIncompatibleWriteVersionOverrides\" to suppress this error if appropriate.`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn selected[1];\n\t}\n\tconst result: T = getConfigForMinVersionForCollabIterable(\n\t\toptions.minVersionForCollab,\n\t\tversions,\n\t);\n\treturn result;\n}\n\n/**\n * Formats a list of versions for use in UsageErrors.\n */\nfunction versionList(\n\tversions: readonly [\n\t\tMinimumMinorSemanticVersion | MinimumVersionForCollab,\n\t\tCodecVersionBase,\n\t][],\n): string {\n\treturn `${Array.from(versions, ([_v, codec]) => codec.formatVersion).join(\", \")}`;\n}\n"]}
|
package/dist/core/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export { EmptyKey, type TreeType, type Value, type TreeValue, AnchorSet, type De
|
|
|
6
6
|
export { TreeNavigationResult, type IEditableForest, type IForestSubscription, type TreeLocation, type FieldLocation, type ForestLocation, type ITreeSubscriptionCursor, ITreeSubscriptionCursorState, type FieldAnchor, moveToDetachedField, type ForestEvents, } from "./forest/index.js";
|
|
7
7
|
export { type FieldKey, type TreeNodeSchemaIdentifier, type TreeFieldStoredSchema, ValueSchema, TreeNodeStoredSchema, type TreeStoredSchemaSubscription, type MutableTreeStoredSchema, type FieldKindIdentifier, type FieldKindData, type TreeTypeSet, type TreeStoredSchema, TreeStoredSchemaRepository, schemaDataIsEmpty, type SchemaEvents, forbiddenFieldKindIdentifier, identifierFieldKindIdentifier, storedEmptyFieldSchema, type StoredSchemaCollection, schemaFormatV1, schemaFormatV2, LeafNodeStoredSchema, ObjectNodeStoredSchema, MapNodeStoredSchema, decodeFieldSchema, encodeFieldSchemaV1, encodeFieldSchemaV2, storedSchemaDecodeDispatcher, type SchemaAndPolicy, Multiplicity, type SchemaPolicy, SchemaFormatVersion, } from "./schema-stored/index.js";
|
|
8
8
|
export { type ChangeFamily, type ChangeFamilyCodec, type ChangeEncodingContext, type ChangeFamilyEditor, EditBuilder, } from "./change-family/index.js";
|
|
9
|
-
export { areEqualChangeAtomIds, areEqualChangeAtomIdOpts, makeChangeAtomId, asChangeAtomId, type ChangeRebaser, findAncestor, findCommonAncestor, type GraphCommit, CommitKind, type CommitMetadata, type LocalChangeMetadata, type RemoteChangeMetadata, type ChangeMetadata, type RevisionTag, RevisionTagSchema, RevisionTagCodec, type ChangesetLocalId, type ChangeAtomId, type ChangeAtomIdMap, type TaggedChange, makeAnonChange, tagChange, mapTaggedChange, tagRollbackInverse, SessionIdSchema, mintCommit, rebaseBranch, type BranchRebaseResult, rebaseChange, rebaseChangeOverChanges, type RevisionMetadataSource, revisionMetadataSourceFromInfo, type RevisionInfo, type EncodedRevisionTag, type EncodedStableId, type EncodedChangeAtomId, taggedAtomId, taggedOptAtomId, offsetChangeAtomId, StableIdSchema, subtractChangeAtomIds, replaceChange, type RebaseStats, type RebaseStatsWithDuration, isAncestor, type ChangeAtomIdRangeMap, newChangeAtomIdRangeMap,
|
|
9
|
+
export { areEqualChangeAtomIds, areEqualChangeAtomIdOpts, makeChangeAtomId, asChangeAtomId, type ChangeRebaser, findAncestor, findCommonAncestor, type GraphCommit, CommitKind, type CommitMetadata, type LocalChangeMetadata, type RemoteChangeMetadata, type ChangeMetadata, type RevisionTag, RevisionTagSchema, RevisionTagCodec, type ChangesetLocalId, type ChangeAtomId, type ChangeAtomIdMap, type TaggedChange, makeAnonChange, tagChange, mapTaggedChange, tagRollbackInverse, SessionIdSchema, mintCommit, rebaseBranch, type BranchRebaseResult, rebaseChange, rebaseChangeOverChanges, type RevisionMetadataSource, revisionMetadataSourceFromInfo, type RevisionInfo, type EncodedRevisionTag, type EncodedStableId, type EncodedChangeAtomId, taggedAtomId, taggedOptAtomId, offsetChangeAtomId, StableIdSchema, subtractChangeAtomIds, replaceChange, type RebaseStats, type RebaseStatsWithDuration, isAncestor, type ChangeAtomIdRangeMap, newChangeAtomIdRangeMap, comparePartialRevisions, compareChangesetLocalIds, comparePartialChangesetLocalIds, diffHistories, type RevisionReplacer, } from "./rebase/index.js";
|
|
10
10
|
export { type Adapters, AdaptedViewSchema, type TreeAdapter, } from "./schema-view/index.js";
|
|
11
11
|
export { type Revertible, RevertibleStatus, type RevertibleFactory, type RevertibleAlphaFactory, type RevertibleAlpha, } from "./revertible.js";
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,QAAQ,EACR,KAAK,QAAQ,EACb,KAAK,KAAK,EACV,KAAK,SAAS,EACd,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,mBAA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e,EACf,kBAAkB,EAClB,eAAe,EACf,UAAU,EACV,YAAY,EACZ,KAAK,kBAAkB,EACvB,YAAY,EACZ,uBAAuB,EACvB,KAAK,sBAAsB,EAC3B,8BAA8B,EAC9B,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,aAAa,EACb,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAC5B,UAAU,EACV,KAAK,oBAAoB,EACzB,uBAAuB,EACvB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,QAAQ,EACR,KAAK,QAAQ,EACb,KAAK,KAAK,EACV,KAAK,SAAS,EACd,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,KAAK,WAAW,EAChB,kBAAkB,EAClB,KAAK,sBAAsB,EAC3B,uBAAuB,EACvB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACxB,QAAQ,EACR,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,KAAK,OAAO,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,UAAU,EACV,sBAAsB,EACtB,eAAe,EACf,aAAa,EACb,UAA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C5B,UAAU,EACV,KAAK,oBAAoB,EACzB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,+BAA+B,EAC/B,aAAa,EACb,KAAK,gBAAgB,GACrB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACN,KAAK,QAAQ,EACb,iBAAiB,EACjB,KAAK,WAAW,GAChB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACN,KAAK,UAAU,EACf,gBAAgB,EAChB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,eAAe,GACpB,MAAM,iBAAiB,CAAC"}
|
package/dist/core/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.DetachedFieldIndexFormatVersion = exports.tryGetChunk = exports.cursorChunk = exports.dummyRoot = exports.deepCopyMapTree = exports.aboveRootPlaceholder = exports.getDetachedFieldContainingPath = exports.DetachedFieldIndex = exports.isCursor = exports.CursorMarker = exports.inCursorNode = exports.inCursorField = exports.isDetachedUpPath = exports.anchorSlot = exports.emptyDelta = exports.offsetDetachId = exports.makeDetachedNodeId = exports.deltaForRootInitialization = exports.forEachField = exports.forEachNodeInSubtree = exports.forEachNode = exports.compareFieldUpPaths = exports.topDownPath = exports.clonePath = exports.compareUpPaths = exports.getDescendant = exports.SparseNode = exports.setGenericTreeField = exports.makeDetachedFieldIndex = exports.applyDelta = exports.announceDelta = exports.combineVisitors = exports.createAnnouncedVisitor = exports.visitDelta = exports.keyAsDetachedField = exports.detachedFieldAsKey = exports.iterateCursorField = exports.mapCursorFields = exports.mapCursorField = exports.getDepth = exports.genericTreeDeleteIfEmpty = exports.getGenericTreeField = exports.genericTreeKeys = exports.castCursorToSynchronous = exports.CursorLocationType = exports.rootField = exports.rootFieldKey = exports.EncodedJsonableTree = exports.AnchorSet = exports.EmptyKey = void 0;
|
|
8
8
|
exports.newChangeAtomIdRangeMap = exports.isAncestor = exports.replaceChange = exports.subtractChangeAtomIds = exports.StableIdSchema = exports.offsetChangeAtomId = exports.taggedOptAtomId = exports.taggedAtomId = exports.revisionMetadataSourceFromInfo = exports.rebaseChangeOverChanges = exports.rebaseChange = exports.rebaseBranch = exports.mintCommit = exports.SessionIdSchema = exports.tagRollbackInverse = exports.mapTaggedChange = exports.tagChange = exports.makeAnonChange = exports.RevisionTagCodec = exports.RevisionTagSchema = exports.CommitKind = exports.findCommonAncestor = exports.findAncestor = exports.asChangeAtomId = exports.makeChangeAtomId = exports.areEqualChangeAtomIdOpts = exports.areEqualChangeAtomIds = exports.EditBuilder = exports.SchemaFormatVersion = exports.Multiplicity = exports.storedSchemaDecodeDispatcher = exports.encodeFieldSchemaV2 = exports.encodeFieldSchemaV1 = exports.decodeFieldSchema = exports.MapNodeStoredSchema = exports.ObjectNodeStoredSchema = exports.LeafNodeStoredSchema = exports.schemaFormatV2 = exports.schemaFormatV1 = exports.storedEmptyFieldSchema = exports.identifierFieldKindIdentifier = exports.forbiddenFieldKindIdentifier = exports.schemaDataIsEmpty = exports.TreeStoredSchemaRepository = exports.TreeNodeStoredSchema = exports.ValueSchema = exports.moveToDetachedField = exports.ITreeSubscriptionCursorState = exports.TreeNavigationResult = exports.detachedFieldIndexCodecBuilder = void 0;
|
|
9
|
-
exports.RevertibleStatus = exports.AdaptedViewSchema = exports.diffHistories = exports.
|
|
9
|
+
exports.RevertibleStatus = exports.AdaptedViewSchema = exports.diffHistories = exports.comparePartialChangesetLocalIds = exports.compareChangesetLocalIds = exports.comparePartialRevisions = void 0;
|
|
10
10
|
var index_js_1 = require("./tree/index.js");
|
|
11
11
|
Object.defineProperty(exports, "EmptyKey", { enumerable: true, get: function () { return index_js_1.EmptyKey; } });
|
|
12
12
|
Object.defineProperty(exports, "AnchorSet", { enumerable: true, get: function () { return index_js_1.AnchorSet; } });
|
|
@@ -112,7 +112,9 @@ Object.defineProperty(exports, "subtractChangeAtomIds", { enumerable: true, get:
|
|
|
112
112
|
Object.defineProperty(exports, "replaceChange", { enumerable: true, get: function () { return index_js_5.replaceChange; } });
|
|
113
113
|
Object.defineProperty(exports, "isAncestor", { enumerable: true, get: function () { return index_js_5.isAncestor; } });
|
|
114
114
|
Object.defineProperty(exports, "newChangeAtomIdRangeMap", { enumerable: true, get: function () { return index_js_5.newChangeAtomIdRangeMap; } });
|
|
115
|
-
Object.defineProperty(exports, "
|
|
115
|
+
Object.defineProperty(exports, "comparePartialRevisions", { enumerable: true, get: function () { return index_js_5.comparePartialRevisions; } });
|
|
116
|
+
Object.defineProperty(exports, "compareChangesetLocalIds", { enumerable: true, get: function () { return index_js_5.compareChangesetLocalIds; } });
|
|
117
|
+
Object.defineProperty(exports, "comparePartialChangesetLocalIds", { enumerable: true, get: function () { return index_js_5.comparePartialChangesetLocalIds; } });
|
|
116
118
|
Object.defineProperty(exports, "diffHistories", { enumerable: true, get: function () { return index_js_5.diffHistories; } });
|
|
117
119
|
var index_js_6 = require("./schema-view/index.js");
|
|
118
120
|
Object.defineProperty(exports, "AdaptedViewSchema", { enumerable: true, get: function () { return index_js_6.AdaptedViewSchema; } });
|
package/dist/core/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;AAEH,4CAuGyB;AAtGxB,oGAAA,QAAQ,OAAA;AAIR,qGAAA,SAAS,OAAA;AAoBT,+GAAA,mBAAmB,OAAA;AACnB,wGAAA,YAAY,OAAA;AACZ,qGAAA,SAAS,OAAA;AAET,8GAAA,kBAAkB,OAAA;AAElB,mHAAA,uBAAuB,OAAA;AAGvB,2GAAA,eAAe,OAAA;AACf,+GAAA,mBAAmB,OAAA;AACnB,oHAAA,wBAAwB,OAAA;AACxB,oGAAA,QAAQ,OAAA;AACR,0GAAA,cAAc,OAAA;AACd,2GAAA,eAAe,OAAA;AACf,8GAAA,kBAAkB,OAAA;AAElB,8GAAA,kBAAkB,OAAA;AAClB,8GA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8CAqD2B;AApD1B,iHAAA,qBAAqB,OAAA;AACrB,oHAAA,wBAAwB,OAAA;AACxB,4GAAA,gBAAgB,OAAA;AAChB,0GAAA,cAAc,OAAA;AAEd,wGAAA,YAAY,OAAA;AACZ,8GAAA,kBAAkB,OAAA;AAElB,sGAAA,UAAU,OAAA;AAMV,6GAAA,iBAAiB,OAAA;AACjB,4GAAA,gBAAgB,OAAA;AAKhB,0GAAA,cAAc,OAAA;AACd,qGAAA,SAAS,OAAA;AACT,2GAAA,eAAe,OAAA;AACf,8GAAA,kBAAkB,OAAA;AAClB,2GAAA,eAAe,OAAA;AACf,sGAAA,UAAU,OAAA;AACV,wGAAA,YAAY,OAAA;AAEZ,wGAAA,YAAY,OAAA;AACZ,mHAAA,uBAAuB,OAAA;AAEvB,0HAAA,8BAA8B,OAAA;AAK9B,wGAAA,YAAY,OAAA;AACZ,2GAAA,eAAe,OAAA;AACf,8GAAA,kBAAkB,OAAA;AAClB,0GAAA,cAAc,OAAA;AACd,iHAAA,qBAAqB,OAAA;AACrB,yGAAA,aAAa,OAAA;AAGb,sGAAA,UAAU,OAAA;AAEV,mHAAA,uBAAuB,OAAA;AACvB,mHAAA,uBAAuB,OAAA;AACvB,oHAAA,wBAAwB,OAAA;AACxB,2HAAA,+BAA+B,OAAA;AAC/B,yGAAA,aAAa,OAAA;AAId,mDAIgC;AAF/B,6GAAA,iBAAiB,OAAA;AAIlB,iDAMyB;AAJxB,iHAAA,gBAAgB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tEmptyKey,\n\ttype TreeType,\n\ttype Value,\n\ttype TreeValue,\n\tAnchorSet,\n\ttype DetachedField,\n\ttype UpPath,\n\ttype NormalizedUpPath,\n\ttype INormalizedUpPath,\n\ttype NormalizedFieldUpPath,\n\ttype Range,\n\ttype RangeUpPath,\n\ttype PlaceUpPath,\n\ttype PlaceIndex,\n\ttype NodeIndex,\n\ttype FieldUpPath,\n\ttype Anchor,\n\ttype RootField,\n\ttype ChildCollection,\n\ttype ChildLocation,\n\ttype FieldMapObject,\n\ttype NodeData,\n\ttype GenericTreeNode,\n\ttype JsonableTree,\n\tEncodedJsonableTree,\n\trootFieldKey,\n\trootField,\n\ttype ITreeCursor,\n\tCursorLocationType,\n\ttype ITreeCursorSynchronous,\n\tcastCursorToSynchronous,\n\ttype GenericFieldsNode,\n\ttype AnchorLocator,\n\tgenericTreeKeys,\n\tgetGenericTreeField,\n\tgenericTreeDeleteIfEmpty,\n\tgetDepth,\n\tmapCursorField,\n\tmapCursorFields,\n\titerateCursorField,\n\ttype MapTree,\n\tdetachedFieldAsKey,\n\tkeyAsDetachedField,\n\tvisitDelta,\n\tcreateAnnouncedVisitor,\n\tcombineVisitors,\n\tannounceDelta,\n\tapplyDelta,\n\tmakeDetachedFieldIndex,\n\tsetGenericTreeField,\n\ttype DeltaVisitor,\n\ttype AnnouncedVisitor,\n\tSparseNode,\n\tgetDescendant,\n\tcompareUpPaths,\n\tclonePath,\n\ttopDownPath,\n\tcompareFieldUpPaths,\n\tforEachNode,\n\tforEachNodeInSubtree,\n\tforEachField,\n\ttype PathRootPrefix,\n\tdeltaForRootInitialization,\n\tmakeDetachedNodeId,\n\toffsetDetachId,\n\temptyDelta,\n\ttype AnchorSlot,\n\ttype AnchorNode,\n\tanchorSlot,\n\ttype UpPathDefault,\n\tisDetachedUpPath,\n\tinCursorField,\n\tinCursorNode,\n\ttype AnchorEvents,\n\ttype AnchorSetRootEvents,\n\ttype ProtoNodes,\n\tCursorMarker,\n\tisCursor,\n\tDetachedFieldIndex,\n\ttype ReadOnlyDetachedFieldIndex,\n\ttype DetachedFieldIndexCheckpoint,\n\ttype ForestRootId,\n\tgetDetachedFieldContainingPath,\n\taboveRootPlaceholder,\n\ttype DeltaRoot,\n\ttype DeltaMark,\n\ttype DeltaDetachedNodeId,\n\ttype DeltaFieldMap,\n\ttype DeltaDetachedNodeChanges,\n\ttype DeltaDetachedNodeBuild,\n\ttype DeltaDetachedNodeDestruction,\n\ttype DeltaDetachedNodeRename,\n\ttype DeltaFieldChanges,\n\ttype ExclusiveMapTree,\n\tdeepCopyMapTree,\n\ttype TreeChunk,\n\tdummyRoot,\n\tcursorChunk,\n\ttryGetChunk,\n\ttype ChunkedCursor,\n\tDetachedFieldIndexFormatVersion,\n\tdetachedFieldIndexCodecBuilder,\n} from \"./tree/index.js\";\n\nexport {\n\tTreeNavigationResult,\n\ttype IEditableForest,\n\ttype IForestSubscription,\n\ttype TreeLocation,\n\ttype FieldLocation,\n\ttype ForestLocation,\n\ttype ITreeSubscriptionCursor,\n\tITreeSubscriptionCursorState,\n\ttype FieldAnchor,\n\tmoveToDetachedField,\n\ttype ForestEvents,\n} from \"./forest/index.js\";\n\nexport {\n\ttype FieldKey,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeFieldStoredSchema,\n\tValueSchema,\n\tTreeNodeStoredSchema,\n\ttype TreeStoredSchemaSubscription,\n\ttype MutableTreeStoredSchema,\n\ttype FieldKindIdentifier,\n\ttype FieldKindData,\n\ttype TreeTypeSet,\n\ttype TreeStoredSchema,\n\tTreeStoredSchemaRepository,\n\tschemaDataIsEmpty,\n\ttype SchemaEvents,\n\tforbiddenFieldKindIdentifier,\n\tidentifierFieldKindIdentifier,\n\tstoredEmptyFieldSchema,\n\ttype StoredSchemaCollection,\n\tschemaFormatV1,\n\tschemaFormatV2,\n\tLeafNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tdecodeFieldSchema,\n\tencodeFieldSchemaV1,\n\tencodeFieldSchemaV2,\n\tstoredSchemaDecodeDispatcher,\n\ttype SchemaAndPolicy,\n\tMultiplicity,\n\ttype SchemaPolicy,\n\tSchemaFormatVersion,\n} from \"./schema-stored/index.js\";\n\nexport {\n\ttype ChangeFamily,\n\ttype ChangeFamilyCodec,\n\ttype ChangeEncodingContext,\n\ttype ChangeFamilyEditor,\n\tEditBuilder,\n} from \"./change-family/index.js\";\n\nexport {\n\tareEqualChangeAtomIds,\n\tareEqualChangeAtomIdOpts,\n\tmakeChangeAtomId,\n\tasChangeAtomId,\n\ttype ChangeRebaser,\n\tfindAncestor,\n\tfindCommonAncestor,\n\ttype GraphCommit,\n\tCommitKind,\n\ttype CommitMetadata,\n\ttype LocalChangeMetadata,\n\ttype RemoteChangeMetadata,\n\ttype ChangeMetadata,\n\ttype RevisionTag,\n\tRevisionTagSchema,\n\tRevisionTagCodec,\n\ttype ChangesetLocalId,\n\ttype ChangeAtomId,\n\ttype ChangeAtomIdMap,\n\ttype TaggedChange,\n\tmakeAnonChange,\n\ttagChange,\n\tmapTaggedChange,\n\ttagRollbackInverse,\n\tSessionIdSchema,\n\tmintCommit,\n\trebaseBranch,\n\ttype BranchRebaseResult,\n\trebaseChange,\n\trebaseChangeOverChanges,\n\ttype RevisionMetadataSource,\n\trevisionMetadataSourceFromInfo,\n\ttype RevisionInfo,\n\ttype EncodedRevisionTag,\n\ttype EncodedStableId,\n\ttype EncodedChangeAtomId,\n\ttaggedAtomId,\n\ttaggedOptAtomId,\n\toffsetChangeAtomId,\n\tStableIdSchema,\n\tsubtractChangeAtomIds,\n\treplaceChange,\n\ttype RebaseStats,\n\ttype RebaseStatsWithDuration,\n\tisAncestor,\n\ttype ChangeAtomIdRangeMap,\n\tnewChangeAtomIdRangeMap,\n\tcomparePartialRevisions,\n\tcompareChangesetLocalIds,\n\tcomparePartialChangesetLocalIds,\n\tdiffHistories,\n\ttype RevisionReplacer,\n} from \"./rebase/index.js\";\n\nexport {\n\ttype Adapters,\n\tAdaptedViewSchema,\n\ttype TreeAdapter,\n} from \"./schema-view/index.js\";\n\nexport {\n\ttype Revertible,\n\tRevertibleStatus,\n\ttype RevertibleFactory,\n\ttype RevertibleAlphaFactory,\n\ttype RevertibleAlpha,\n} from \"./revertible.js\";\n"]}
|
|
@@ -102,13 +102,14 @@ export interface RevisionReplacer {
|
|
|
102
102
|
isObsolete(revision: RevisionTag | undefined): boolean;
|
|
103
103
|
/**
|
|
104
104
|
* Returns the updated ID for the given ID.
|
|
105
|
-
* @param id - The ID to update.
|
|
105
|
+
* @param id - The ID of the first change atom to update.
|
|
106
|
+
* @param count - The number of contiguous change atoms to update. Defaults to 1.
|
|
106
107
|
* @returns an updated ID iff the given `id` needs updating, otherwise returns the given `id`.
|
|
107
108
|
* @remarks
|
|
108
109
|
* This function always maps the same input {@link ChangeAtomId.revision | revision} and {@link ChangeAtomId.localId | local ID} to the same output revision local ID.
|
|
109
110
|
* This means multiple references to the same atom of change will remain consistent after revision replacement.
|
|
110
111
|
*/
|
|
111
|
-
getUpdatedAtomId<T extends ChangeAtomId>(id: T): T;
|
|
112
|
+
getUpdatedAtomId<T extends ChangeAtomId>(id: T, count?: number): T;
|
|
112
113
|
}
|
|
113
114
|
export interface TaggedChange<TChangeset, TTag = RevisionTag | undefined> {
|
|
114
115
|
readonly revision: TTag;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changeRebaser.d.ts","sourceRoot":"","sources":["../../../src/core/rebase/changeRebaser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,WAAW,aAAa,CAAC,UAAU;IACxC,UAAU,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IAEnC;;;OAGG;IACH,OAAO,CAAC,OAAO,EAAE,YAAY,CAAC,UAAU,CAAC,EAAE,GAAG,UAAU,CAAC;IAEzD;;;;;;;;;;;;OAYG;IACH,MAAM,CACL,OAAO,EAAE,YAAY,CAAC,UAAU,CAAC,EACjC,UAAU,EAAE,OAAO,EACnB,QAAQ,EAAE,WAAW,GACnB,UAAU,CAAC;IAEd;;;;;;;;;;;;;;;;OAg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S,CAAC;IAChF,QAAQ,CAAC,WAAW,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,OAAO,CAAC;CACpD;AAED,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,WAAW,CAAC;CAClC;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,WAAW,GAAG,SAAS,GAAG,YAAY,CAAC,CAAC,CAAC,CAE1F;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,IAAI,EAC/C,aAAa,EAAE,OAAO,EACtB,QAAQ,EAAE,IAAI,EACd,UAAU,EAAE,WAAW,GAAG,SAAS,GACjC,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,CAM7B;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAE5D;AAED,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;CACnC;AAED,oBAAY,iBAAiB;IAC5B,UAAU,IAAA;IACV,OAAO,IAAA;IACP,QAAQ,IAAA;CACR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changeRebaser.js","sourceRoot":"","sources":["../../../src/core/rebase/changeRebaser.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"changeRebaser.js","sourceRoot":"","sources":["../../../src/core/rebase/changeRebaser.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA4IH,SAAgB,eAAe,CAC9B,KAAwB,EACxB,MAAY;IAEZ,OAAO,EAAE,GAAG,KAAK,EAAE,MAAM,EAAE,CAAC;AAC7B,CAAC;AALD,0CAKC;AA6BD,SAAgB,SAAS,CAAI,MAAS,EAAE,QAAiC;IACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;AAC7B,CAAC;AAFD,8BAEC;AAED,SAAgB,kBAAkB,CACjC,aAAsB,EACtB,QAAc,EACd,UAAmC;IAEnC,OAAO;QACN,QAAQ;QACR,MAAM,EAAE,aAAa;QACrB,UAAU;KACV,CAAC;AACH,CAAC;AAVD,gDAUC;AAED,SAAgB,cAAc,CAAI,MAAS;IAC1C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;AACxC,CAAC;AAFD,wCAEC;AAMD,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC5B,qEAAU,CAAA;IACV,+DAAO,CAAA;IACP,iEAAQ,CAAA;AACT,CAAC,EAJW,iBAAiB,iCAAjB,iBAAiB,QAI5B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { Invariant } from \"../../util/index.js\";\n\nimport type { ChangeAtomId, RevisionTag } from \"./types.js\";\n\n/**\n * Rebasing logic for a particular kind of change.\n *\n * This interface is used to provide rebase policy to `Rebaser`.\n *\n * The implementation must ensure TChangeset forms a {@link https://en.wikipedia.org/wiki/Group_(mathematics | group}) where:\n * - `compose([])` is the identity element.\n * - associativity is defined as `compose([...a, ...b])` is equal to\n * `compose([compose(a), compose(b)])` for all `a` and `b`.\n * - `inverse(a)` gives the inverse element of `a`.\n *\n * In these requirements the definition of equality is up to the implementer,\n * but it is required that any two changes which are considered equal:\n * - have the same impact when applied to any tree.\n * - can be substituted for each-other in all methods on this\n * interface and produce equal (by this same definition) results.\n *\n * For the sake of testability, implementations will likely want to have a concrete equality implementation.\n *\n * This API uses `compose` on arrays instead of an explicit identity element and associative binary operator\n * to allow the implementation more room for optimization,\n * but should otherwise be equivalent to the identity element and binary operator group approach.\n *\n * TODO:\n * Be more specific about the above requirements.\n * For example, would something that is close to forming a group but has precision issues\n * (ex: the floating point numbers and addition) be ok?\n * Would this cause decoherence (and thus be absolutely not ok),\n * or just minor semantic precision issues, which could be tolerated.\n * For now assume that such issues are not ok.\n */\nexport interface ChangeRebaser<TChangeset> {\n\t_typeCheck?: Invariant<TChangeset>;\n\n\t/**\n\t * Compose a collection of changesets into a single one.\n\t * See {@link ChangeRebaser} for requirements.\n\t */\n\tcompose(changes: TaggedChange<TChangeset>[]): TChangeset;\n\n\t/**\n\t * @param changes - The changes to invert.\n\t * @param isRollback - Whether the inverted change is meant to rollback a change on a branch as is the case when\n\t * performing a sandwich rebase.\n\t * @param revision - The revision for the invert changeset.\n\t * This flag is relevant to merge semantics that are dependent on edit sequencing order:\n\t * - In the context of an undo, this function inverts a change that is sequenced and applied before the produced inverse.\n\t * - In the context of a rollback, this function inverts a change that is sequenced after but applied before the produced inverse.\n\t * @returns the inverse of `changes`.\n\t *\n\t * `compose([changes, inverse(changes)])` be equal to `compose([])`:\n\t * See {@link ChangeRebaser} for details.\n\t */\n\tinvert(\n\t\tchanges: TaggedChange<TChangeset>,\n\t\tisRollback: boolean,\n\t\trevision: RevisionTag,\n\t): TChangeset;\n\n\t/**\n\t * Rebase `change` over `over`.\n\t *\n\t * The resulting changeset should, as much as possible, replicate the same semantics as `change`,\n\t * except be valid to apply after `over` instead of before it.\n\t *\n\t * When rebasing `change` onto a new branch, `revisionMetadata` should include entries for all changesets\n\t * from the source which are being rebased onto the target branch.\n\t *\n\t * Requirements:\n\t * The implementation must ensure that for all possible changesets `a`, `b` and `c`:\n\t * - `rebase(a, compose([b, c])` is equal to `rebase(rebase(a, b), c)`.\n\t * - `rebase(compose([a, b]), c)` is equal to\n\t * `compose([rebase(a, c), rebase(b, compose([inverse(a), c, rebase(a, c)])])`.\n\t * - `rebase(a, compose([]))` is equal to `a`.\n\t * - `rebase(compose([]), a)` is equal to `compose([])`.\n\t */\n\trebase(\n\t\tchange: TaggedChange<TChangeset>,\n\t\tover: TaggedChange<TChangeset>,\n\t\trevisionMetadata: RevisionMetadataSource,\n\t): TChangeset;\n\n\t/**\n\t * Retrieves the set of revisions associated with the given change.\n\t */\n\tgetRevisions(change: TChangeset): Set<RevisionTag | undefined>;\n\n\t/**\n\t * Produces a changeset that is equivalent to the given `change`, but with all references to its own revisions replaced according to the given `replacer`.\n\t * @param change - The change to update. Not modified.\n\t * @param replacer - The replacer to use.\n\t * @returns A changeset equivalent to `change`, but with all references to its own revision replaced according to `replacer`.\n\t */\n\tchangeRevision(change: TChangeset, replacer: RevisionReplacer): TChangeset;\n}\n\n/**\n * A type that can update references to a set of obsolete revisions across multiple changesets.\n */\nexport interface RevisionReplacer {\n\t/**\n\t * The revision to use in place of the obsolete revisions.\n\t */\n\treadonly updatedRevision: RevisionTag;\n\n\t/**\n\t * Predicate to determine if a revision needs replacing.\n\t * @param revision - The revision that may need replacing.\n\t * @returns true iff the given `revision` needs replacing.\n\t */\n\tisObsolete(revision: RevisionTag | undefined): boolean;\n\n\t/**\n\t * Returns the updated ID for the given ID.\n\t * @param id - The ID of the first change atom to update.\n\t * @param count - The number of contiguous change atoms to update. Defaults to 1.\n\t * @returns an updated ID iff the given `id` needs updating, otherwise returns the given `id`.\n\t * @remarks\n\t * This function always maps the same input {@link ChangeAtomId.revision | revision} and {@link ChangeAtomId.localId | local ID} to the same output revision local ID.\n\t * This means multiple references to the same atom of change will remain consistent after revision replacement.\n\t */\n\tgetUpdatedAtomId<T extends ChangeAtomId>(id: T, count?: number): T;\n}\n\nexport interface TaggedChange<TChangeset, TTag = RevisionTag | undefined> {\n\treadonly revision: TTag;\n\t/**\n\t * When populated, indicates that the changeset is a rollback for the purpose of a rebase sandwich.\n\t * The value corresponds to the `revision` of the original changeset being rolled back.\n\t */\n\treadonly rollbackOf?: RevisionTag;\n\treadonly change: TChangeset;\n}\n\nexport function mapTaggedChange<TIn, TOut>(\n\tinput: TaggedChange<TIn>,\n\tchange: TOut,\n): TaggedChange<TOut> {\n\treturn { ...input, change };\n}\n\n/**\n * A callback that returns the index of the changeset associated with the given RevisionTag among the changesets being\n * composed or rebased. This index is solely meant to communicate relative ordering, and is only valid within the scope of the\n * compose or rebase operation.\n *\n * During composition, the index reflects the order of the changeset within the overall composed changeset that is\n * being produced.\n *\n * During rebase, the indices of the base changes are all lower than the indices of the change being rebased.\n */\nexport type RevisionIndexer = (tag: RevisionTag) => number | undefined;\n\nexport interface RevisionMetadataSource {\n\treadonly getIndex: RevisionIndexer;\n\treadonly tryGetInfo: (tag: RevisionTag | undefined) => RevisionInfo | undefined;\n\treadonly hasRollback: (tag: RevisionTag) => boolean;\n}\n\nexport interface RevisionInfo {\n\treadonly revision: RevisionTag;\n\t/**\n\t * When populated, indicates that the changeset is a rollback for the purpose of a rebase sandwich.\n\t * The value corresponds to the `revision` of the original changeset being rolled back.\n\t */\n\treadonly rollbackOf?: RevisionTag;\n}\n\nexport function tagChange<T>(change: T, revision: RevisionTag | undefined): TaggedChange<T> {\n\treturn { revision, change };\n}\n\nexport function tagRollbackInverse<TChange, TTag>(\n\tinverseChange: TChange,\n\trevision: TTag,\n\trollbackOf: RevisionTag | undefined,\n): TaggedChange<TChange, TTag> {\n\treturn {\n\t\trevision,\n\t\tchange: inverseChange,\n\t\trollbackOf,\n\t};\n}\n\nexport function makeAnonChange<T>(change: T): TaggedChange<T> {\n\treturn { revision: undefined, change };\n}\n\nexport interface FinalChange {\n\treadonly status: FinalChangeStatus;\n}\n\nexport enum FinalChangeStatus {\n\tconflicted,\n\trebased,\n\tcommuted,\n}\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export { areEqualChangeAtomIds, areEqualChangeAtomIdOpts, makeChangeAtomId, asChangeAtomId, mintCommit, type GraphCommit, CommitKind, type CommitMetadata, type LocalChangeMetadata, type RemoteChangeMetadata, type ChangeMetadata, type RevisionTag, RevisionTagSchema, type EncodedRevisionTag, type EncodedChangeAtomId, type EncodedStableId, type ChangesetLocalId, type ChangeAtomId, type ChangeAtomIdMap, SessionIdSchema, taggedAtomId, taggedOptAtomId, offsetChangeAtomId, StableIdSchema, subtractChangeAtomIds, type ChangeAtomIdRangeMap, newChangeAtomIdRangeMap,
|
|
5
|
+
export { areEqualChangeAtomIds, areEqualChangeAtomIdOpts, makeChangeAtomId, asChangeAtomId, mintCommit, type GraphCommit, CommitKind, type CommitMetadata, type LocalChangeMetadata, type RemoteChangeMetadata, type ChangeMetadata, type RevisionTag, RevisionTagSchema, type EncodedRevisionTag, type EncodedChangeAtomId, type EncodedStableId, type ChangesetLocalId, type ChangeAtomId, type ChangeAtomIdMap, SessionIdSchema, taggedAtomId, taggedOptAtomId, offsetChangeAtomId, StableIdSchema, subtractChangeAtomIds, type ChangeAtomIdRangeMap, newChangeAtomIdRangeMap, comparePartialRevisions, compareChangesetLocalIds, comparePartialChangesetLocalIds, } from "./types.js";
|
|
6
6
|
export { RevisionTagCodec } from "./revisionTagCodec.js";
|
|
7
7
|
export { type ChangeRebaser, type FinalChange, FinalChangeStatus, makeAnonChange, tagChange, mapTaggedChange, tagRollbackInverse, type TaggedChange, type RevisionMetadataSource, type RevisionInfo, type RevisionReplacer, } from "./changeRebaser.js";
|
|
8
8
|
export { findAncestor, findCommonAncestor, rebaseBranch, type BranchRebaseResult, rebaseChange, rebaseChangeOverChanges, revisionMetadataSourceFromInfo, type RebaseStats, type RebaseStatsWithDuration, replaceChange, isAncestor, diffHistories, } from "./utils.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/rebase/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,qBAAqB,EACrB,wBAAwB,EACxB,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,KAAK,WAAW,EAChB,UAAU,EACV,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,iBAAiB,EACjB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,eAAe,EACf,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,KAAK,oBAAoB,EACzB,uBAAuB,EACvB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/rebase/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,qBAAqB,EACrB,wBAAwB,EACxB,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,KAAK,WAAW,EAChB,UAAU,EACV,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,iBAAiB,EACjB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,eAAe,EACf,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,KAAK,oBAAoB,EACzB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,+BAA+B,GAC/B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EACN,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,iBAAiB,EACjB,cAAc,EACd,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EACjB,KAAK,gBAAgB,GACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,KAAK,kBAAkB,EACvB,YAAY,EACZ,uBAAuB,EACvB,8BAA8B,EAC9B,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAC5B,aAAa,EACb,UAAU,EACV,aAAa,GACb,MAAM,YAAY,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.diffHistories = exports.isAncestor = exports.replaceChange = exports.revisionMetadataSourceFromInfo = exports.rebaseChangeOverChanges = exports.rebaseChange = exports.rebaseBranch = exports.findCommonAncestor = exports.findAncestor = exports.tagRollbackInverse = exports.mapTaggedChange = exports.tagChange = exports.makeAnonChange = exports.FinalChangeStatus = exports.RevisionTagCodec = exports.
|
|
7
|
+
exports.diffHistories = exports.isAncestor = exports.replaceChange = exports.revisionMetadataSourceFromInfo = exports.rebaseChangeOverChanges = exports.rebaseChange = exports.rebaseBranch = exports.findCommonAncestor = exports.findAncestor = exports.tagRollbackInverse = exports.mapTaggedChange = exports.tagChange = exports.makeAnonChange = exports.FinalChangeStatus = exports.RevisionTagCodec = exports.comparePartialChangesetLocalIds = exports.compareChangesetLocalIds = exports.comparePartialRevisions = exports.newChangeAtomIdRangeMap = exports.subtractChangeAtomIds = exports.StableIdSchema = exports.offsetChangeAtomId = exports.taggedOptAtomId = exports.taggedAtomId = exports.SessionIdSchema = exports.RevisionTagSchema = exports.CommitKind = exports.mintCommit = exports.asChangeAtomId = exports.makeChangeAtomId = exports.areEqualChangeAtomIdOpts = exports.areEqualChangeAtomIds = void 0;
|
|
8
8
|
var types_js_1 = require("./types.js");
|
|
9
9
|
Object.defineProperty(exports, "areEqualChangeAtomIds", { enumerable: true, get: function () { return types_js_1.areEqualChangeAtomIds; } });
|
|
10
10
|
Object.defineProperty(exports, "areEqualChangeAtomIdOpts", { enumerable: true, get: function () { return types_js_1.areEqualChangeAtomIdOpts; } });
|
|
@@ -20,7 +20,9 @@ Object.defineProperty(exports, "offsetChangeAtomId", { enumerable: true, get: fu
|
|
|
20
20
|
Object.defineProperty(exports, "StableIdSchema", { enumerable: true, get: function () { return types_js_1.StableIdSchema; } });
|
|
21
21
|
Object.defineProperty(exports, "subtractChangeAtomIds", { enumerable: true, get: function () { return types_js_1.subtractChangeAtomIds; } });
|
|
22
22
|
Object.defineProperty(exports, "newChangeAtomIdRangeMap", { enumerable: true, get: function () { return types_js_1.newChangeAtomIdRangeMap; } });
|
|
23
|
-
Object.defineProperty(exports, "
|
|
23
|
+
Object.defineProperty(exports, "comparePartialRevisions", { enumerable: true, get: function () { return types_js_1.comparePartialRevisions; } });
|
|
24
|
+
Object.defineProperty(exports, "compareChangesetLocalIds", { enumerable: true, get: function () { return types_js_1.compareChangesetLocalIds; } });
|
|
25
|
+
Object.defineProperty(exports, "comparePartialChangesetLocalIds", { enumerable: true, get: function () { return types_js_1.comparePartialChangesetLocalIds; } });
|
|
24
26
|
var revisionTagCodec_js_1 = require("./revisionTagCodec.js");
|
|
25
27
|
Object.defineProperty(exports, "RevisionTagCodec", { enumerable: true, get: function () { return revisionTagCodec_js_1.RevisionTagCodec; } });
|
|
26
28
|
var changeRebaser_js_1 = require("./changeRebaser.js");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/rebase/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/rebase/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uCA+BoB;AA9BnB,iHAAA,qBAAqB,OAAA;AACrB,oHAAA,wBAAwB,OAAA;AACxB,4GAAA,gBAAgB,OAAA;AAChB,0GAAA,cAAc,OAAA;AACd,sGAAA,UAAU,OAAA;AAEV,sGAAA,UAAU,OAAA;AAMV,6GAAA,iBAAiB,OAAA;AAOjB,2GAAA,eAAe,OAAA;AACf,wGAAA,YAAY,OAAA;AACZ,2GAAA,eAAe,OAAA;AACf,8GAAA,kBAAkB,OAAA;AAClB,0GAAA,cAAc,OAAA;AACd,iHAAA,qBAAqB,OAAA;AAErB,mHAAA,uBAAuB,OAAA;AACvB,mHAAA,uBAAuB,OAAA;AACvB,oHAAA,wBAAwB,OAAA;AACxB,2HAAA,+BAA+B,OAAA;AAEhC,6DAAyD;AAAhD,uHAAA,gBAAgB,OAAA;AACzB,uDAY4B;AAT3B,qHAAA,iBAAiB,OAAA;AACjB,kHAAA,cAAc,OAAA;AACd,6GAAA,SAAS,OAAA;AACT,mHAAA,eAAe,OAAA;AACf,sHAAA,kBAAkB,OAAA;AAMnB,uCAaoB;AAZnB,wGAAA,YAAY,OAAA;AACZ,8GAAA,kBAAkB,OAAA;AAClB,wGAAA,YAAY,OAAA;AAEZ,wGAAA,YAAY,OAAA;AACZ,mHAAA,uBAAuB,OAAA;AACvB,0HAAA,8BAA8B,OAAA;AAG9B,yGAAA,aAAa,OAAA;AACb,sGAAA,UAAU,OAAA;AACV,yGAAA,aAAa,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tareEqualChangeAtomIds,\n\tareEqualChangeAtomIdOpts,\n\tmakeChangeAtomId,\n\tasChangeAtomId,\n\tmintCommit,\n\ttype GraphCommit,\n\tCommitKind,\n\ttype CommitMetadata,\n\ttype LocalChangeMetadata,\n\ttype RemoteChangeMetadata,\n\ttype ChangeMetadata,\n\ttype RevisionTag,\n\tRevisionTagSchema,\n\ttype EncodedRevisionTag,\n\ttype EncodedChangeAtomId,\n\ttype EncodedStableId,\n\ttype ChangesetLocalId,\n\ttype ChangeAtomId,\n\ttype ChangeAtomIdMap,\n\tSessionIdSchema,\n\ttaggedAtomId,\n\ttaggedOptAtomId,\n\toffsetChangeAtomId,\n\tStableIdSchema,\n\tsubtractChangeAtomIds,\n\ttype ChangeAtomIdRangeMap,\n\tnewChangeAtomIdRangeMap,\n\tcomparePartialRevisions,\n\tcompareChangesetLocalIds,\n\tcomparePartialChangesetLocalIds,\n} from \"./types.js\";\nexport { RevisionTagCodec } from \"./revisionTagCodec.js\";\nexport {\n\ttype ChangeRebaser,\n\ttype FinalChange,\n\tFinalChangeStatus,\n\tmakeAnonChange,\n\ttagChange,\n\tmapTaggedChange,\n\ttagRollbackInverse,\n\ttype TaggedChange,\n\ttype RevisionMetadataSource,\n\ttype RevisionInfo,\n\ttype RevisionReplacer,\n} from \"./changeRebaser.js\";\nexport {\n\tfindAncestor,\n\tfindCommonAncestor,\n\trebaseBranch,\n\ttype BranchRebaseResult,\n\trebaseChange,\n\trebaseChangeOverChanges,\n\trevisionMetadataSourceFromInfo,\n\ttype RebaseStats,\n\ttype RebaseStatsWithDuration,\n\treplaceChange,\n\tisAncestor,\n\tdiffHistories,\n} from \"./utils.js\";\n"]}
|
|
@@ -23,6 +23,9 @@ export type EncodedStableId = Brand<StableId, "EncodedStableId">;
|
|
|
23
23
|
export declare const StableIdSchema: import("@sinclair/typebox").TString;
|
|
24
24
|
/**
|
|
25
25
|
* An ID which is unique within a revision of a `ModularChangeset`.
|
|
26
|
+
* @remarks
|
|
27
|
+
* Always a real number (never `NaN` or +/- `Infinity`).
|
|
28
|
+
*
|
|
26
29
|
* A `ModularChangeset` which is a composition of multiple revisions may contain duplicate `ChangesetLocalId`s,
|
|
27
30
|
* but they are unique when qualified by the revision of the change they are used in.
|
|
28
31
|
*/
|
|
@@ -58,7 +61,9 @@ export declare function makeChangeAtomId(localId: ChangesetLocalId, revision?: R
|
|
|
58
61
|
export declare function asChangeAtomId(id: ChangesetLocalId | ChangeAtomId): ChangeAtomId;
|
|
59
62
|
export declare function taggedAtomId(id: ChangeAtomId, revision: RevisionTag | undefined): ChangeAtomId;
|
|
60
63
|
export declare function taggedOptAtomId(id: ChangeAtomId | undefined, revision: RevisionTag | undefined): ChangeAtomId | undefined;
|
|
61
|
-
export declare function offsetChangeAtomId(id:
|
|
64
|
+
export declare function offsetChangeAtomId<T extends ChangeAtomId>(id: T, offset: number): T;
|
|
65
|
+
export declare function compareChangesetLocalIds(a: ChangesetLocalId, b: ChangesetLocalId): number;
|
|
66
|
+
export declare function comparePartialChangesetLocalIds(a: ChangesetLocalId | undefined, b: ChangesetLocalId | undefined): number;
|
|
62
67
|
/**
|
|
63
68
|
* A node in a graph of commits. A commit's parent is the commit on which it was based.
|
|
64
69
|
*/
|
|
@@ -132,6 +137,11 @@ export interface LocalChangeMetadata extends CommitMetadata {
|
|
|
132
137
|
* @throws Throws an error if called outside the scope of the `changed` event that provided it.
|
|
133
138
|
*/
|
|
134
139
|
getRevertible(onDisposed?: (revertible: RevertibleAlpha) => void): RevertibleAlpha | undefined;
|
|
140
|
+
/**
|
|
141
|
+
* Optional label provided by the user when commit was created.
|
|
142
|
+
* This can be used by undo/redo to group or classify edits.
|
|
143
|
+
*/
|
|
144
|
+
readonly label?: unknown;
|
|
135
145
|
}
|
|
136
146
|
/**
|
|
137
147
|
* Information about a change that has been applied by a remote client.
|
|
@@ -152,6 +162,11 @@ export interface RemoteChangeMetadata extends CommitMetadata {
|
|
|
152
162
|
* @remarks This is only available for {@link LocalChangeMetadata | local changes}.
|
|
153
163
|
*/
|
|
154
164
|
readonly getRevertible?: undefined;
|
|
165
|
+
/**
|
|
166
|
+
* Label provided by the user when commit was created.
|
|
167
|
+
* @remarks This is only available for {@link LocalChangeMetadata | local changes}.
|
|
168
|
+
*/
|
|
169
|
+
readonly label?: undefined;
|
|
155
170
|
}
|
|
156
171
|
/**
|
|
157
172
|
* Information about a {@link LocalChangeMetadata | local} or {@link RemoteChangeMetadata | remote} change that has been applied.
|
|
@@ -166,7 +181,12 @@ export type ChangeMetadata = LocalChangeMetadata | RemoteChangeMetadata;
|
|
|
166
181
|
*/
|
|
167
182
|
export declare function mintCommit<TChange>(parent: GraphCommit<TChange>, commit: Omit<GraphCommit<TChange>, "parent">): GraphCommit<TChange>;
|
|
168
183
|
export type ChangeAtomIdRangeMap<V> = RangeMap<ChangeAtomId, V>;
|
|
169
|
-
export declare function newChangeAtomIdRangeMap<V>(): ChangeAtomIdRangeMap<V>;
|
|
184
|
+
export declare function newChangeAtomIdRangeMap<V>(offsetValue?: (value: V, offset: number) => V): ChangeAtomIdRangeMap<V>;
|
|
170
185
|
export declare function subtractChangeAtomIds(a: ChangeAtomId, b: ChangeAtomId): number;
|
|
171
|
-
|
|
186
|
+
/**
|
|
187
|
+
* Compares two {@link RevisionTag}s to form a strict total ordering.
|
|
188
|
+
* @remarks This function tolerates arbitrary strings, not just the string "root".
|
|
189
|
+
* It sorts as follows: `undefined` \< `string` \< `number`
|
|
190
|
+
*/
|
|
191
|
+
export declare function comparePartialRevisions(a: RevisionTag | undefined, b: RevisionTag | undefined): number;
|
|
172
192
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/rebase/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,mBAAmB,EACnB,SAAS,EACT,wBAAwB,EACxB,QAAQ,EACR,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EACN,KAAK,KAAK,EACV,KAAK,sBAAsB,EAC3B,KAAK,SAAS,EACd,QAAQ,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/rebase/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,mBAAmB,EACnB,SAAS,EACT,wBAAwB,EACxB,QAAQ,EACR,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EACN,KAAK,KAAK,EACV,KAAK,sBAAsB,EAC3B,KAAK,SAAS,EACd,QAAQ,EAKR,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,eAAe,gDAAiC,CAAC;AAE9D;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG,wBAAwB,GAAG,MAAM,CAAC;AAC5D,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,mBAAmB,E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|
7
|
+
exports.comparePartialRevisions = exports.subtractChangeAtomIds = exports.newChangeAtomIdRangeMap = exports.mintCommit = exports.CommitKind = exports.comparePartialChangesetLocalIds = exports.compareChangesetLocalIds = exports.offsetChangeAtomId = exports.taggedOptAtomId = exports.taggedAtomId = exports.asChangeAtomId = exports.makeChangeAtomId = exports.areEqualChangeAtomIdOpts = exports.areEqualChangeAtomIds = exports.StableIdSchema = exports.RevisionTagSchema = exports.SessionIdSchema = void 0;
|
|
8
8
|
const typebox_1 = require("@sinclair/typebox");
|
|
9
9
|
const index_js_1 = require("../../util/index.js");
|
|
10
10
|
/**
|
|
@@ -56,6 +56,21 @@ function offsetChangeAtomId(id, offset) {
|
|
|
56
56
|
return { ...id, localId: (0, index_js_1.brand)(id.localId + offset) };
|
|
57
57
|
}
|
|
58
58
|
exports.offsetChangeAtomId = offsetChangeAtomId;
|
|
59
|
+
// #region These comparison functions are used instead of e.g. `compareNumbers` as a performance optimization
|
|
60
|
+
function compareChangesetLocalIds(a, b) {
|
|
61
|
+
return a - b; // No need to consider `NaN` or `Infinity` since ChangesetLocalId is always a real number
|
|
62
|
+
}
|
|
63
|
+
exports.compareChangesetLocalIds = compareChangesetLocalIds;
|
|
64
|
+
function comparePartialChangesetLocalIds(a, b) {
|
|
65
|
+
if (a === undefined) {
|
|
66
|
+
return b === undefined ? 0 : -1;
|
|
67
|
+
}
|
|
68
|
+
else if (b === undefined) {
|
|
69
|
+
return 1;
|
|
70
|
+
}
|
|
71
|
+
return compareChangesetLocalIds(a, b);
|
|
72
|
+
}
|
|
73
|
+
exports.comparePartialChangesetLocalIds = comparePartialChangesetLocalIds;
|
|
59
74
|
/**
|
|
60
75
|
* The type of a commit. This is used to describe the context in which the commit was created.
|
|
61
76
|
*
|
|
@@ -87,32 +102,31 @@ function mintCommit(parent, commit) {
|
|
|
87
102
|
};
|
|
88
103
|
}
|
|
89
104
|
exports.mintCommit = mintCommit;
|
|
90
|
-
function newChangeAtomIdRangeMap() {
|
|
91
|
-
return new index_js_1.RangeMap(offsetChangeAtomId, subtractChangeAtomIds);
|
|
105
|
+
function newChangeAtomIdRangeMap(offsetValue) {
|
|
106
|
+
return new index_js_1.RangeMap(offsetChangeAtomId, subtractChangeAtomIds, offsetValue);
|
|
92
107
|
}
|
|
93
108
|
exports.newChangeAtomIdRangeMap = newChangeAtomIdRangeMap;
|
|
94
109
|
function subtractChangeAtomIds(a, b) {
|
|
95
|
-
const cmp =
|
|
110
|
+
const cmp = comparePartialRevisions(a.revision, b.revision);
|
|
96
111
|
if (cmp !== 0) {
|
|
97
112
|
return cmp * Number.POSITIVE_INFINITY;
|
|
98
113
|
}
|
|
99
114
|
return a.localId - b.localId;
|
|
100
115
|
}
|
|
101
116
|
exports.subtractChangeAtomIds = subtractChangeAtomIds;
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
117
|
+
/**
|
|
118
|
+
* Compares two {@link RevisionTag}s to form a strict total ordering.
|
|
119
|
+
* @remarks This function tolerates arbitrary strings, not just the string "root".
|
|
120
|
+
* It sorts as follows: `undefined` \< `string` \< `number`
|
|
121
|
+
*/
|
|
122
|
+
function comparePartialRevisions(a, b) {
|
|
123
|
+
if (typeof a === "number") {
|
|
124
|
+
return typeof b === "number" ? a - b : 1;
|
|
108
125
|
}
|
|
109
|
-
else if (
|
|
126
|
+
else if (typeof b === "number") {
|
|
110
127
|
return -1;
|
|
111
128
|
}
|
|
112
|
-
|
|
113
|
-
return 1;
|
|
114
|
-
}
|
|
115
|
-
return 0;
|
|
129
|
+
return (0, index_js_1.comparePartialStrings)(a, b);
|
|
116
130
|
}
|
|
117
|
-
exports.
|
|
131
|
+
exports.comparePartialRevisions = comparePartialRevisions;
|
|
118
132
|
//# sourceMappingURL=types.js.map
|