From 4fd9b8f2b5a98bfcde57970b48fed2488a80f356 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 17 Sep 2021 21:53:37 +0300 Subject: add in master snapshot of epubjs --- lib/epub.js/types/locations.d.ts | 41 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 lib/epub.js/types/locations.d.ts (limited to 'lib/epub.js/types/locations.d.ts') 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>; + + 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; + + 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; +} -- cgit v1.2.3