1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
import Section from "../section";
import Layout from "../layout";
import Contents from "../contents";
import View, { ViewSettings } from "./view";
import { EpubCFIPair } from "../mapping";
export interface ViewLocation {
index: number,
href: string,
pages: number[],
totalPages: number,
mapping: EpubCFIPair
}
export interface ManagerOptions extends ViewSettings {
infinite?: boolean,
overflow?: string,
[key: string]: any
}
export default class Manager {
constructor(options: object);
render(element: Element, size?: { width: Number, height: Number }): void;
resize(width: Number, height: Number): void;
onOrientationChange(e: Event): void;
private createView(section: Section): View;
display(section: Section, target: string | number): Promise<void>;
private afterDisplayed(view: View): void;
private afterResized(view: View): void;
private moveTo(offset: {top: Number, left: Number}): void;
private append(section: Section): Promise<void>;
private prepend(section: Section): Promise<void>;
next(): Promise<void>;
prev(): Promise<void>;
current(): View;
clear(): void;
currentLocation(): ViewLocation[];
visible(): View[];
private scrollBy(x: number, y: number, silent: boolean): void;
private scrollTo(x: number, y: number, silent: boolean): void;
private onScroll(): void;
bounds(): object;
applyLayout(layout: Layout): void;
updateLayout(): void;
setLayout(layout: Layout): void;
updateAxis(axis: string, forceUpdate: boolean): void;
updateFlow(flow: string): void;
getContents(): Contents[];
direction(dir: string): void;
isRendered(): boolean;
destroy(): void;
// Event emitters
emit(type: any, ...args: any[]): void;
off(type: any, listener: any): any;
on(type: any, listener: any): any;
once(type: any, listener: any, ...args: any[]): any;
}
|