diff --git a/src/dom/common/lib/range.ts b/src/dom/common/lib/range.ts index 7dc1d490..4e1945b5 100644 --- a/src/dom/common/lib/range.ts +++ b/src/dom/common/lib/range.ts @@ -15,7 +15,7 @@ export class PersistentRange { endOffset: number; - constructor(range: Range) { + constructor(range: AbstractRange) { this.startContainer = range.startContainer; this.startOffset = range.startOffset; this.endContainer = range.endContainer; diff --git a/src/dom/epub/lib/page-mapping.ts b/src/dom/epub/lib/page-mapping.ts index bac0ad55..8ea2a3cf 100644 --- a/src/dom/epub/lib/page-mapping.ts +++ b/src/dom/epub/lib/page-mapping.ts @@ -138,7 +138,7 @@ class PageMapping { ((new Date().getTime() - startTime) / 1000).toFixed(2)}s`); } - getPageIndex(range: Range): number | null { + getPageIndex(range: AbstractRange): number | null { let pageStartRange = this.tree.getPairOrNextLower(new PersistentRange(range))?.[0]; if (!pageStartRange) { return null; @@ -146,7 +146,7 @@ class PageMapping { return this.tree.keysArray().indexOf(pageStartRange); } - getPageLabel(range: Range): string | null { + getPageLabel(range: AbstractRange): string | null { return this.tree.getPairOrNextLower(new PersistentRange(range))?.[1] ?? null; }