API reference
Components
| Name | Description |
|---|---|
| ReadiumView | Renders a publication: an EPUB or PDF on iOS and Android, or a web publication on web. |
| ReadiumViewRef | Moves the reader, searches and zooms; get it with a ref on ReadiumView. |
| ReadiumProps | The props of ReadiumView. |
Hooks
| Name | Description |
|---|---|
| UseSearchResult | What useSearch returns: the accumulated results, their state, and the actions. |
| useSearch | Drives paginated full-text search for a ReadiumView. |
Functions
| Function | Description |
|---|---|
| describePublicationError | The default English description of a PublicationErrorCode, as message reports it. |
Interfaces
| Interface | Description |
|---|---|
| Dimensions | - |
| Link | An interface representing the Readium Link object. Extends the Nitro spec Link with an optional properties bag and supports hierarchical TOC via nested children. |
| Preferences | How the reader lays out and styles a publication: theme, font size, margins and the rest. Readium's defaults apply to anything left out, and PublicationReadyEvent.capabilities says which of these the publication you opened responds to. |
| PublicationMetadata | Publication metadata following Readium Web Publication Manifest spec. Extends the Nitro spec metadata with the @type field. |
| PublicationReadyEvent | - |
| ZoomEvent | Reports the reader's magnification, including changes the reader makes with a pinch or a double tap rather than through setZoom. |
| ReadiumFile | The publication a ReadiumView opens. |
| DecorationStyle | How a decoration looks. |
| Decoration | One annotation rendered over the publication, such as a highlight. |
| DecorationGroup | A named set of decorations, such as "highlights". |
| Rect | Where something is on screen, as reported with a tapped decoration below. |
| Point | A single position, in the same coordinates as Rect. |
| DecorationActivatedEvent | - |
| PublicationErrorEvent | Something went wrong with a publication; code says what. |
| LocatorLocations | Where in its resource a Locator points. |
| LocatorText | Text around a location, e.g. a search match in context. |
| Locator | A 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. |
| Contributor | What a publication says about itself: title, authors, subjects, accessibility and where it belongs in a series. |
| Subject | - |
| SeriesInfo | - |
| BelongsTo | - |
| AccessibilityCertification | - |
| Accessibility | - |
| PreferencesChangedEvent | Reported by onPreferencesChanged once preferences are applied. |
| SearchOptions | - |
| SearchResult | - |
| SearchPage | A single page of search results, returned by search() and loadMoreSearchResults(). Results are paginated lazily: keep calling loadMoreSearchResults() while hasMore is true. |
| SelectionAction | An item added to the text-selection menu. |
| SelectionEvent | Reported by onSelectionChange as the user adjusts a selection. |
| SelectionActionEvent | Reported by onSelectionAction when the user picks one of the selectionActions. |
| ResolveSourceRequest | What resolveSource is being asked to resolve. |
| PublicationSource | Where a publication's bytes are, as opposed to which publication it is. |
| SourceRequestFailure | A request the library made for the publication, which failed. |
References
File
Renames and re-exports ReadiumFile
Type Aliases
| Type Alias | Description |
|---|---|
| - | |
| The column counts kept for compatibility. | |
| ReaderColumnCount | How many columns a reflowable publication is laid out in: one, two, or whatever suits the viewport. |
| PublicationErrorCode | What went wrong with a publication. - 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. - readFailed: a read of an open publication failed and was not recovered. The only code that does not mean the publication failed to open; see the event's stage. |
| PublicationErrorStage | Whether a publication failed to open, or failed to be read after it was open. |
| PublicationErrorKind | For a read failure, whether a status was readable at all. 'unreadable' covers a host that omits CORS headers from its errors, which withholds the status from a web reader; native always has one. |
| ReaderFontFamily | Font families Readium knows by name, including the ones it ships. |
| ReaderImageFilter | What to do with a publication's images in a dark theme. |
| ReaderReadingProgression | Which way the reader turns pages: left to right, or right to left. |
| ReaderSpread | Whether two pages are shown side by side, as in a printed book. |
| ReaderTextAlign | How a publication's text is aligned, where the publication allows it. |
| ReaderTheme | The reader's colour scheme. |
| ReaderFit | How a PDF's page is sized to the view. |
| ReaderScrollAxis | Which way a scrolled PDF scrolls. |
| Capabilities | Something the reader can do with the publication it opened. |
| SourceRequestReason | Why a location is being asked for. |
Variables
| Variable | Description |
|---|---|
| RANGES | The range of each numeric preference, as [min, max], e.g. for a slider. |