From be9eaa2cd6dc415f98551c1aa5e9d8b1e01ec1f0 Mon Sep 17 00:00:00 2001 From: Rhys Brett-Bowen Date: Mon, 5 Feb 2018 11:41:03 +0000 Subject: [PATCH] Add priority for transform definition --- types/quill/index.d.ts | 4 ++-- types/quill/quill-tests.ts | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/types/quill/index.d.ts b/types/quill/index.d.ts index a996babf30..6cc5c824c5 100644 --- a/types/quill/index.d.ts +++ b/types/quill/index.d.ts @@ -84,9 +84,9 @@ export interface DeltaStatic { concat(other: DeltaStatic): DeltaStatic; diff(other: DeltaStatic, index?: number): DeltaStatic; eachLine(predicate: (line: DeltaStatic, attributes: StringMap, idx: number) => any, newline?: string): DeltaStatic; - transform(index: number): number; + transform(index: number, priority?: boolean): number; transform(other: DeltaStatic, priority: boolean): DeltaStatic; - transformPosition(index: number): number; + transformPosition(index: number, priority?: boolean): number; } export class Delta implements DeltaStatic { diff --git a/types/quill/quill-tests.ts b/types/quill/quill-tests.ts index f907092ed1..bda294251d 100644 --- a/types/quill/quill-tests.ts +++ b/types/quill/quill-tests.ts @@ -310,10 +310,14 @@ function test_DeltaTransform() { const d1: DeltaStatic = a.transform(b, true); // new Delta().retain(1).insert('b').retain(5).insert('c'); const d2: DeltaStatic = a.transform(b, false); // new Delta().insert('b').retain(6).insert('c'); const n1: number = a.transform(5); + const n2: number = a.transform(5, true); + const n3: number = a.transform(5, false); } function test_DeltatransformPosition() { const delta = new Delta().retain(5).insert('a'); const n1: number = delta.transformPosition(4); // 4 const n2: number = delta.transformPosition(5); // 6 + const n3: number = delta.transformPosition(5, true); + const n4: number = delta.transformPosition(5, false); }