mute-structs
Version:
NodeJS module providing an implementation of the LogootSplit CRDT algorithm
28 lines (27 loc) • 1.13 kB
TypeScript
import { Identifier } from "../../identifier";
import { LogootSRopes } from "../../logootsropes";
import { LogootSOperation } from "../logootsoperation";
import { TextInsert } from "./textinsert";
/**
* Represents a LogootSplit insert operation.
*/
export declare class LogootSAdd extends LogootSOperation {
static fromPlain(o: unknown): LogootSAdd | null;
readonly id: Identifier;
readonly content: string;
readonly author: number;
/**
* @constructor
* @param {Identifier} id - the identifier that localise the insertion in the logoot sequence.
* @param {string} content - the content of the block to be inserted.
*/
constructor(id: Identifier, content: string);
readonly insertedIds: Identifier[];
equals(aOther: LogootSAdd): boolean;
/**
* Apply the current insert operation to a LogootSplit document.
* @param {LogootSRopes} doc - the LogootSplit document on which the operation wil be applied.
* @return {TextInsert[]} the insertion to be applied on the sequence representing the document content.
*/
execute(doc: LogootSRopes): TextInsert[];
}