editor.js/src/components/collaborative-editing/diff/types/Operation.ts
Ilya Maroz a513e1079a
feat(collaborative): function for getting changes from string (#2101)
* create function for getting changes from a string

* remove useless variables

* add more test cases

* refactor: return array of operations

* refactor: rename function, conditions, add docs

* refactor: use interfeces, move them to separate file, add comments

* refactor: rename test cases

* refactor: rename test cases

* refactor: change types schema

* refactor: rename function

* test: add the case for multiple changes
2022-09-06 11:32:38 +01:00

19 lines
271 B
TypeScript

import { OperationType } from './OperationType';
export interface Operation<DATA_TYPE = string> {
/**
* Type of the operation
*/
type: OperationType;
/**
* Start index of changes
*/
index: number;
/**
* Changed data
*/
data: DATA_TYPE;
}