summaryrefslogtreecommitdiff
path: root/lib/epub.js/types/section.d.ts
diff options
context:
space:
mode:
Diffstat (limited to 'lib/epub.js/types/section.d.ts')
-rw-r--r--lib/epub.js/types/section.d.ts64
1 files changed, 64 insertions, 0 deletions
diff --git a/lib/epub.js/types/section.d.ts b/lib/epub.js/types/section.d.ts
new file mode 100644
index 0000000..075bef5
--- /dev/null
+++ b/lib/epub.js/types/section.d.ts
@@ -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: boolean;
+ 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;
+}