json-joy
Version:
Collection of libraries for building collaborative editing apps.
26 lines (25 loc) • 974 B
TypeScript
import type { CompactStrDelOp } from '../codec/compact/types';
import { AbstractOp } from './AbstractOp';
import type { OperationStrDel } from '../types';
import { type Path } from '@jsonjoy.com/json-pointer';
import { OPCODE } from '../constants';
import type { IMessagePackEncoder } from '@jsonjoy.com/json-pack/lib/msgpack';
/**
* @category JSON Patch Extended
*/
export declare class OpStrDel extends AbstractOp<'str_del'> {
readonly pos: number;
readonly str: string | undefined;
readonly len: number | undefined;
constructor(path: Path, pos: number, str: string | undefined, len: number | undefined);
op(): "str_del";
code(): OPCODE;
deleteLength(): number;
apply(doc: unknown): {
doc: unknown;
old: string;
};
toJson(parent?: AbstractOp): OperationStrDel;
toCompact(parent: undefined | AbstractOp, verbose: boolean): CompactStrDelOp;
encode(encoder: IMessagePackEncoder, parent?: AbstractOp): void;
}