Skip to main content

API reference

Components​

NameDescription
ReadiumViewRenders a publication: an EPUB or PDF on iOS and Android, or a web publication on web.
ReadiumViewRefMoves the reader, searches and zooms; get it with a ref on ReadiumView.
ReadiumPropsThe props of ReadiumView.

Hooks​

NameDescription
UseSearchResultWhat useSearch returns: the accumulated results, their state, and the actions.
useSearchDrives paginated full-text search for a ReadiumView.

Functions​

FunctionDescription
describePublicationErrorThe default English description of a PublicationErrorCode, as message reports it.

Interfaces​

InterfaceDescription
Dimensions-
LinkAn interface representing the Readium Link object. Extends the Nitro spec Link with an optional properties bag and supports hierarchical TOC via nested children.
PreferencesPreferences with refined string union types for better IDE autocompletion.
PublicationErrorEventThe publication could not be opened. url, code and protectionScheme are as native reports them; message and detail are described below.
PublicationMetadataPublication metadata following Readium Web Publication Manifest spec. Extends the Nitro spec metadata with the @type field.
PublicationReadyEvent-
ZoomEventReports the reader's magnification, including changes the reader makes with a pinch or a double tap rather than through setZoom.
LocatorLocationsWhere in its resource a Locator points.
LocatorTextText around a location, e.g. a search match in context.
LocatorA location in a publication, as Readium describes it: reading positions, bookmarks, highlights and search results are all locators. Store them as they are to reopen there later.
DecorationStyleHow a decoration looks.
DecorationOne annotation rendered over the publication, such as a highlight.
DecorationGroupA named set of decorations, such as "highlights".
Rect-
Point-
SelectionActionAn item added to the text-selection menu.
Contributor-
Subject-
SeriesInfo-
BelongsTo-
AccessibilityCertification-
Accessibility-
SearchOptions-
SearchResult-
SearchPageA single page of search results, returned by search() and loadMoreSearchResults(). Results are paginated lazily: keep calling loadMoreSearchResults() while hasMore is true.
PreferencesChangedEventReported by onPreferencesChanged once preferences are applied.
DecorationActivatedEventReported by onDecorationActivated when the user taps a decoration.
SelectionEventReported by onSelectionChange as the user adjusts a selection.
SelectionActionEventReported by onSelectionAction when the user picks one of the selectionActions.
ReadiumFileThe publication a ReadiumView opens.

References​

File​

Renames and re-exports ReadiumFile

Type Aliases​

Type AliasDescription
DecorationGroups-
CapabilitiesSomething the reader can do with the publication it opened.
PublicationErrorCodeWhy a publication could not be opened. - protectionNotSupported: protected with a scheme no registered content protection handles. - restricted: a protection matched but refused access, e.g. an expired license. - cancelled: restricted with no error, e.g. the passphrase prompt was dismissed.

Variables​

VariableDescription
RANGESThe range of each numeric preference, as [min, max], e.g. for a slider.