forked from gerhardsletten/react-reader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
65 lines (57 loc) · 1.76 KB
/
index.d.ts
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
import * as React from "react";
import * as CSS from "csstype";
import { BookOptions } from "epubjs/types/book";
import { RenditionOptions } from "epubjs/types/rendition";
import { Contents, EpubCFI, Rendition } from "epubjs";
interface EpubViewProps {
url: string | ArrayBuffer;
epubInitOptions?: BookOptions;
epubOptions?: RenditionOptions;
styles?: EpubViewStyles;
loadingView?: React.ReactNode;
location?: string | number;
showToc?: boolean;
locationChanged?(value: string | number): void;
tocChanged?(value: Toc): void;
getRendition?(rendition: Rendition): void;
handleKeyPress?(): void;
handleTextSelected?(cfiRange: string, contents: Contents): void;
}
declare class EpubView extends React.Component<EpubViewProps> {}
interface EpubViewStyles {
viewHolder: CSS.Properties;
view: CSS.Properties;
}
interface Toc {
label: string;
href: string;
}
interface ReactReaderProps extends Omit<EpubViewProps, "styles"> {
title?: string;
showToc?: boolean;
styles?: ReactReaderStyles;
swipeable?: boolean;
}
declare class ReactReader extends React.Component<ReactReaderProps> {}
interface ReactReaderStyles {
container: CSS.Properties;
readerArea: CSS.Properties;
containerExpanded: CSS.Properties;
titleArea: CSS.Properties;
reader: CSS.Properties;
swipeWrapper: CSS.Properties;
prev: CSS.Properties;
next: CSS.Properties;
arrow: CSS.Properties;
arrowHover: CSS.Properties;
tocBackground: CSS.Properties;
tocArea: CSS.Properties;
tocAreaButton: CSS.Properties;
tocButton: CSS.Properties;
tocButtonExpanded: CSS.Properties;
tocButtonBar: CSS.Properties;
tocButtonBarTop: CSS.Properties;
tocButtonBarBottom: CSS.Properties;
loadingView: CSS.Properties;
}
export { ReactReader, ReactReaderStyles, EpubView, EpubViewStyles };