[]
Defines the interface for customizing operational transformation (OT) behavior in collaboration.
| Name | Type | Description |
|---|---|---|
S |
unknown |
The type of snapshot data. |
T |
unknown |
The type of op data. |
• uri: string
The URI identifying the document type.
▸ Optional apply(snapshot, op): S
Applies an operation to snapshot data.
| Name | Type | Description |
|---|---|---|
snapshot |
S |
The current snapshot data. |
op |
T |
The operation to apply. |
S
The updated snapshot data.
▸ Optional applyFragments(request, op): Promise<void>
Applies an operation to snapshot fragments asynchronously.
| Name | Type | Description |
|---|---|---|
request |
ISnapshotFragmentsRequest<unknown> |
The request containing snapshot fragments. |
op |
T |
The operation to apply. |
Promise<void>
A promise that resolves when the operation is applied.
▸ Optional composeFragments(fragments): S
Composes snapshot data from snapshot fragments.
| Name | Type | Description |
|---|---|---|
fragments |
ISnapshotFragments<unknown> |
The snapshot fragments. |
S
The composed snapshot data.
▸ Optional create(data): S
Creates initial snapshot data from provided data.
| Name | Type | Description |
|---|---|---|
data |
S |
The initial snapshot data. |
S
The created snapshot data.
▸ Optional createFragments(data): ISnapshotFragments<unknown>
Generates snapshot fragments from snapshot data.
| Name | Type | Description |
|---|---|---|
data |
S |
The snapshot data. |
ISnapshotFragments<unknown>
The generated snapshot fragments.
▸ transform(op1, op2, side): T
Transforms an operation to resolve conflicts with another operation.
| Name | Type | Description |
|---|---|---|
op1 |
T |
The operation to transform. |
op2 |
T |
The operation serving as the basis for transformation. |
side |
"left" | "right" |
Indicates which operation arrived at the server later. |
T
The transformed operation.