Options
All
  • Public
  • Public/Protected
  • All
Menu

Describes the contents in the ReaderView as a one-dimensional timeline of all renderable pages.

Positions in the timeline consist of a page index and an offset within that page as a value between 0 and 1. The page index of the first page in the timeline is 0. The timeline length and the page positions can be fixed or estimated depending on the publication and the pageProgressionTimelineOptions ReaderView option.

You can determine if the page numbers are fixed or estimated using IPageProgressionTimeline.getTimelineType(). Please see PageProgressionTimelineType documentation for more information.

You can listen on the EngineEvent 'pageProgressionTimelineVisibleRangeChanged' to react to changes in the timeline.

An alternative to IPageProgressionTimeline

For most use-cases, the IContentPositionTimeline is preferred over the IPageProgressionTimeline to measure reading progress due to its more deterministic nature.

link

IContentPositionTimeline for more information.

Hierarchy

  • IPageProgressionTimeline

Index

Methods

fetchLocatorFromPageIndex

  • fetchLocatorFromPageIndex(pageIndex: number, snapToFirstPageIfSpread?: boolean): Promise<Locator>
  • Fetch a locator from a zero-based page index. The passed page index will be clamped between the timeline start and end.

    Parameters

    • pageIndex: number

      The zero-based page index.

    • Optional snapToFirstPageIfSpread: boolean

      If set to true, the locator will point to the first page of a spread. Has no effect on non-spread renderers.

    Returns Promise<Locator>

fetchLocatorFromPosition

  • Fetch a locator from a timeline position. The passed position will be clamped between the timeline start and end position.

    Parameters

    • position: IPageProgressionTimelinePositionData

      The position from which to fetch a locator.

    • Optional snapToFirstPageIfSpread: boolean

      If set to true, the locator will point to the first page of a spread. Has no effect on non-spread renderers.

    Returns Promise<Locator>

fetchPositionFromLocator

  • Fetch a timeline position from a locator.

    The returned Promise will be rejected if the passed locator cannot be resolved to a readerDocument in the ReaderView. If getTimelineType() is not FIXED_PAGES, the returned PageProgressionTimeline position will be "volatile" and may no longer be valid after a "pageProgressionTimelineRecalculated" event has occurred.

    Parameters

    Returns Promise<IPageProgressionTimelinePositionData>

getTimelineType

getTotalNumberOfPages

  • getTotalNumberOfPages(): number
  • Get the total number of pages for all of the reader documents inside the ReaderView. Use getTimelineType() to determine if this value is estimated or fixed.

    Returns number

getVisibleTimelineRange

  • Get a timeline range describing the positions currently visible in the ReaderView. Use getTimelineType() to determine if this range estimated or fixed value.

    Returns IPageProgressionTimelineRangeData

toJSON

Generated using TypeDoc