import { OperationBuilderFactory, PositiveInt } from '@kizahasi/ot-core'; import { NonEmptyString } from './nonEmptyString'; export const upFactory: OperationBuilderFactory = { getInsertLength: x => x.length, getDeleteLength: x => x, concatInsert: (x, y) => x.concat(y), concatDelete: (x, y) => PositiveInt.add(x, y), }; export const downFactory: OperationBuilderFactory = { getInsertLength: x => x, getDeleteLength: x => x.length, concatInsert: (x, y) => PositiveInt.add(x, y), concatDelete: (x, y) => x.concat(y), }; export const twoWayFactory: OperationBuilderFactory = { getInsertLength: x => x.length, getDeleteLength: x => x.length, concatInsert: (x, y) => x.concat(y), concatDelete: (x, y) => x.concat(y), };