@derock.ir/epubjs-plus
v1.1.6
Published
A wrapper around epubjs project.
Downloads
15
Readme
Statefull Pagniated Epub Viewer
A wrapper around epubjs project.
Installation
npm i "@derock.ir/epubjs-plus"
Usage
import {
library,
StatefulPaginatedEpubViewer,
} from '@derock.ir/epubjs-plus';
const epub = await library.addFromFileDialog();
const viewer = new StatefulPaginatedEpubViewer(epub);
await viewer.initialize();
await viewer.display(targetDom);
Events
Rendering
relocated
: on new page rendered. returns aRelocatedEventPayload
object.content
: on new content loaded. returns aDocument
object.render
: on new content rendered. returns aDocument
object.page-changed
: on page changes. sends aPagination
object.
Pagination
pagination-update
: on pagination info update. sends aPaginationUpdateEventPayload
object.pagination-done
: on pagination finished. sends aPaginationDoneEventPayload
object.
Input events
swipe:left
: gusture eventswipe:right
: gusture eventtap
: on tapclick-tap
: on tap or click