Skip to content

Book

Book = object

Defined in: core/src/book.ts:35

off: Emitter<BookEvents>["off"]

Defined in: core/src/book.ts:45


on: Emitter<BookEvents>["on"]

Defined in: core/src/book.ts:44


readonly orientation: Orientation

Defined in: core/src/book.ts:39


readonly page: number

Defined in: core/src/book.ts:37

First page of the open spread, zero-based.


readonly pageCount: number

Defined in: core/src/book.ts:38


readonly rect: BookRect

Defined in: core/src/book.ts:42

In book space: container pixels for a left-bound book, mirrored or transposed for the others.


readonly state: FlipState

Defined in: core/src/book.ts:40

destroy(): void

Defined in: core/src/book.ts:68

Stop everything, drop listeners and observers, and restore the DOM.

void


flipNext(corner?): Promise<boolean>

Defined in: core/src/book.ts:48

Animated turns. Resolve with false when there is nothing to turn to.

FlipCorner

Promise<boolean>


flipPrev(corner?): Promise<boolean>

Defined in: core/src/book.ts:49

FlipCorner

Promise<boolean>


flipTo(page, corner?): Promise<boolean>

Defined in: core/src/book.ts:55

Turns the page on show straight onto the spread holding page. Further than the next spread, it turns as a clump: a few blank sheets, one per spread passed up to five, fan out from under it and close up again before it lands. Only the pages on show and the target are drawn.

number

FlipCorner

Promise<boolean>


redraw(): void

Defined in: core/src/book.ts:66

Redraw the current frame without measuring, after something else rewrote page attributes. Cheap.

void


setPages(pages): void

Defined in: core/src/book.ts:62

Replace the page elements. Keeps the current page where possible.

Iterable<HTMLElement>

void


turnNext(): void

Defined in: core/src/book.ts:58

void


turnPrev(): void

Defined in: core/src/book.ts:59

void


turnTo(page): void

Defined in: core/src/book.ts:57

Instant turns.

number

void


update(): void

Defined in: core/src/book.ts:64

Re-measure the container and redraw. Resizes are handled automatically; call this after other layout changes.

void