summaryrefslogtreecommitdiff
path: root/lib/epub.js/types/locations.d.ts
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-09-17 21:53:37 +0300
committerAndrew Dolgov <[email protected]>2021-09-17 21:53:37 +0300
commit4fd9b8f2b5a98bfcde57970b48fed2488a80f356 (patch)
tree51e0ce9cd61c24916b7d5820ee69e74bd3e76aac /lib/epub.js/types/locations.d.ts
parentd0cd10f08286be33306336fe8c4cac26ea7ce637 (diff)
add in master snapshot of epubjs
Diffstat (limited to 'lib/epub.js/types/locations.d.ts')
-rw-r--r--lib/epub.js/types/locations.d.ts41
1 files changed, 41 insertions, 0 deletions
diff --git a/lib/epub.js/types/locations.d.ts b/lib/epub.js/types/locations.d.ts
new file mode 100644
index 0000000..be314da
--- /dev/null
+++ b/lib/epub.js/types/locations.d.ts
@@ -0,0 +1,41 @@
+import Spine from "./spine";
+import Section from "./section";
+import EpubCFI from "./epubcfi";
+
+export default class Locations {
+ constructor(spine: Spine, request?: Function, pause?: number);
+
+ generate(chars: number): object;
+
+ process(section: Section): Promise<Array<string>>;
+
+ locationFromCfi(cfi: string | EpubCFI): Location;
+
+ percentageFromCfi(cfi: string | EpubCFI): number;
+
+ percentageFromLocation(loc: number): number;
+
+ cfiFromLocation(loc: number): string;
+
+ cfiFromPercentage(percentage: number): string;
+
+ load(locations: string): Array<string>;
+
+ save(): string;
+
+ currentLocation(): Location;
+ currentLocation(curr: string | number): void;
+
+ length(): number;
+
+ destroy(): void;
+
+ private createRange(): {
+ startContainer: Element,
+ startOffset: number,
+ endContainer: Element,
+ endOffset: number
+ };
+
+ private parse(contents: Node, cfiBase: string, chars: number) : Array<string>;
+}