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/navigation.d.ts
vendored
Normal file
41
types/navigation.d.ts
vendored
Normal file
|
@ -0,0 +1,41 @@
|
|||
export interface NavItem {
|
||||
id?: string,
|
||||
href?: string,
|
||||
label?: string,
|
||||
subitems?: Array<NavItem>,
|
||||
parent?: NavItem
|
||||
}
|
||||
|
||||
export interface LandmarkItem {
|
||||
href?: string,
|
||||
label?: string,
|
||||
type?: string
|
||||
}
|
||||
|
||||
export default class Navigation {
|
||||
constructor(xml: XMLDocument);
|
||||
|
||||
parse(xml: XMLDocument): void;
|
||||
|
||||
get(target: string) : NavItem;
|
||||
|
||||
landmark(type: string) : LandmarkItem;
|
||||
|
||||
load(json: JSON): Array<NavItem>;
|
||||
|
||||
forEach(fn: (item: NavItem) => {}): any;
|
||||
|
||||
private unpack(toc: Array<NavItem>): void;
|
||||
|
||||
private parseNav(navHtml: XMLDocument): Array<NavItem>;
|
||||
|
||||
private navItem(item: Element): NavItem;
|
||||
|
||||
private parseLandmarks(navHtml: XMLDocument): Array<LandmarkItem>;
|
||||
|
||||
private landmarkItem(item: Element): LandmarkItem;
|
||||
|
||||
private parseNcx(navHtml: XMLDocument): Array<NavItem>;
|
||||
|
||||
private ncxItem(item: Element): NavItem;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue