API reference
Entry point
| Name | Description |
|---|---|
| LCP | Readium LCP for react-native-readium: initialize it, answer passphrase requests, acquire books and manage their licenses. See LcpModule for every method. |
| LcpModule | The API of LCP, the package's entry point: Readium LCP for react-native-readium. |
Classes
| Class | Description |
|---|---|
| LcpError | message is plain English, fit to show a user. To word or translate it yourself, switch on code and use the details, e.g. date for the license-status codes. |
Functions
| Function | Description |
|---|---|
| describeLcpError | The plain-English message an LcpError with this code carries, for a code you already have, such as a license's restriction. |
Interfaces
| Interface | Description |
|---|---|
| LcpErrorDetails | What native code reports with an error, besides its code. |
| LcpInitOptions | Options for LCP.initialize. |
| LcpLink | A link from a license, e.g. to its passphrase hint or its provider's support page. |
| LcpAuthRequest | Sent to the JS authentication handler when a license needs its passphrase. |
| LcpAcquiredPublication | A publication downloaded by LCP.acquirePublication. |
| LcpLicense | A publication's license, as LCP.getLicense and LCP.renewLoan report it. |
| AcquirePublicationOptions | Options for LCP.acquirePublication. |
| GetLicenseOptions | Options for LCP.getLicense. |
| RenewLoanOptions | Options for LCP.renewLoan. |
| AddPassphraseOptions | Options for LCP.addPassphrase. |
| LcpCapabilities | What this platform's Readium LCP module can do; not every API exists on both. |
| LcplSource | Where to find a license document (.lcpl). Set exactly one field. |
Type Aliases
| Type Alias | Description |
|---|---|
| LcpErrorCode | Why an LCP call failed: the code of an LcpError. Native code reports these by name, so the generated native enums keep both platforms to the same set. |
| LcpAuthReason | Why a passphrase is requested: none is stored for the license (passphraseNotFound), or the last one given was wrong (invalidPassphrase). |
| LcpLicenseStatus | A license's status, as its license server reports it. |
| LcpAuthHandler | Answers a passphrase request; see LCP.setAuthenticationHandler. Resolve with the passphrase, in clear text or as its SHA-256 hex hash, or undefined to give up. |