json-joy
Version:
Collection of libraries for building collaborative editing apps.
15 lines (14 loc) • 913 B
TypeScript
export type OpType = JsonPatchOpType | PredicateOpType | JsonPatchExtendedOpType;
export type JsonPatchOpType = 'add' | 'remove' | 'replace' | 'copy' | 'move';
export type PredicateOpType = FirstOrderPredicateOpType | SecondOrderPredicateOpType | AdditionalPredicateOpType;
export type FirstOrderPredicateOpType = 'test' | 'contains' | 'defined' | 'ends' | 'in' | 'less' | 'matches' | 'more' | 'starts' | 'test' | 'type' | 'undefined';
export type AdditionalPredicateOpType = 'test_type' | 'test_string' | 'test_string_len';
export type SecondOrderPredicateOpType = 'and' | 'not' | 'or';
export type JsonPatchExtendedOpType = 'flip' | 'inc' | 'str_ins' | 'str_del' | 'split' | 'merge' | 'extend';
/**
* # Ideas
*
* This operation could "box" a value into and array container, e.g. x -> [x].
* Or box into an object container, e.g. x -> {value: x, ...props}.
* This operation could also be called "wrap".
*/