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
64
types/section.d.ts
vendored
Normal file
64
types/section.d.ts
vendored
Normal file
|
@ -0,0 +1,64 @@
|
|||
import { HooksObject } from "./utils/hook";
|
||||
|
||||
export interface GlobalLayout {
|
||||
layout: string,
|
||||
spread: string,
|
||||
orientation: string
|
||||
}
|
||||
|
||||
export interface LayoutSettings {
|
||||
layout: string,
|
||||
spread: string,
|
||||
orientation: string
|
||||
}
|
||||
|
||||
export interface SpineItem {
|
||||
index: number,
|
||||
cfiBase: string,
|
||||
href?: string,
|
||||
url?: string,
|
||||
canonical?: string,
|
||||
properties?: Array<string>,
|
||||
linear?: string,
|
||||
next: () => SpineItem,
|
||||
prev: () => SpineItem,
|
||||
}
|
||||
|
||||
export default class Section {
|
||||
constructor(item: SpineItem, hooks: HooksObject);
|
||||
|
||||
idref: string;
|
||||
linear: string;
|
||||
properties: Array<string>;
|
||||
index: number;
|
||||
href: string;
|
||||
url: string;
|
||||
canonical: string;
|
||||
next: () => SpineItem;
|
||||
prev: () => SpineItem;
|
||||
cfiBase: string;
|
||||
|
||||
document: Document;
|
||||
contents: Element;
|
||||
output: string;
|
||||
|
||||
hooks: HooksObject;
|
||||
|
||||
load(_request?: Function): Document;
|
||||
|
||||
render(_request?: Function): string;
|
||||
|
||||
find(_query: string): Array<Element>;
|
||||
|
||||
reconcileLayoutSettings(globalLayout: GlobalLayout): LayoutSettings;
|
||||
|
||||
cfiFromRange(_range: Range): string;
|
||||
|
||||
cfiFromElement(el: Element): string;
|
||||
|
||||
unload(): void;
|
||||
|
||||
destroy(): void;
|
||||
|
||||
private base(): void;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue