mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-04 15:09:16 +02:00
Added type declarations
This commit is contained in:
parent
0da286b0a2
commit
6bfcd1e4eb
50 changed files with 1837 additions and 54 deletions
41
types/locations.d.ts
vendored
Normal file
41
types/locations.d.ts
vendored
Normal file
|
@ -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: 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>;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue