mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-02 14:49:16 +02:00
41 lines
925 B
TypeScript
41 lines
925 B
TypeScript
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: JSON): Array<string>;
|
|
|
|
save(): JSON;
|
|
|
|
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>;
|
|
}
|