@univerjs-procollaborationinterfacesImutationtransformalgorithm

@univerjs-pro/collaboration v0.5.4


Interface: IMutationTransformAlgorithm<M, N>

Defined in: packages/collaboration/src/services/transform/transform.service.ts:24

A single transform algorithm. Algorithms are registered to the transform service in the form of {m1}-{m2}. When the transform service is transforming two mutations, it would find the algorithm by the form of {m1}-{m2}. m1 is the mutation on the left side, and m2 is the mutation on the right side.

Type Parameters

Type ParameterDefault type
M extends objectany
N extends objectany

Properties

PropertyTypeDefined in
m1stringpackages/collaboration/src/services/transform/transform.service.ts:25
m2?stringpackages/collaboration/src/services/transform/transform.service.ts:26

Methods

handler()

Call Signature

handler(m1, m2): ITransformMutationResult

Defined in: packages/collaboration/src/services/transform/transform.service.ts:28

Parameters
ParameterType
m1IMutationInfo<M>
m2IMutationInfo<N>
Returns

ITransformMutationResult

Call Signature

handler(
   m1, 
   m2, 
   onlyLater?): 
  | IFailureTransformMutationResult
| Omit<ISuccessTransformMutationResult, "m1Prime">

Defined in: packages/collaboration/src/services/transform/transform.service.ts:29

Parameters
ParameterType
m1IMutationInfo<M>
m2IMutationInfo<N>
onlyLater?true
Returns

| IFailureTransformMutationResult | Omit<ISuccessTransformMutationResult, "m1Prime">