summaryrefslogtreecommitdiff
path: root/lib/epub.js/types/section.d.ts
blob: 075bef5ede3b54c0c3f413adefd2820ef6dff69d (plain)
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
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;
}