mirror of
https://github.com/codex-team/editor.js
synced 2024-06-01 13:32:43 +02:00
a513e1079a
* 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
19 lines
271 B
TypeScript
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;
|
|
}
|