Options
All
  • Public
  • Public/Protected
  • All
Menu

Allows management of a ReaderPublication's storage state, such as 'localStorage' for EPUB. This allows applications to save and restore the IReaderPublicationStorageState across reading-sessions and devices.

The API acts as a proxy for the Web Storage API, but does not use the same storage mechanism as the browser.

Hierarchy

  • IReaderPublicationStorage

Index

Methods

  • getStorageSizeLimit(): number
  • Get the size limit of each publication storage area. The size of a publication storage area is defined as the total string length of all the keys and values in the storage area.

    A ReaderDocument script cannot insert a key-value pair into the localStorage or sessionStorage if it causes the total size to become greater than this size limit.

    This size limit is only used when a content document uses the Web Storage APIs in JavaScript. It is ignored if any method in IReaderPublicationStorage or IReaderPublicationStorageArea is used to modify the contents of a storage area.

    Returns number

  • Get a serializable object representing the current state of the publication storage.

    deprecated

    in 4.0.0. Please use getStorageArea(ReaderPublicationStorageAreaType.LOCAL_STORAGE).getItems() instead.

    Returns IReaderPublicationStorageState

  • setStorageSizeLimit(sizeLimit: number): void
  • Set the size limit of each publication storage area. The size of a publication storage area is defined as the total string length of all the keys and values in the storage area.

    A ReaderDocument script cannot insert a key-value pair into the localStorage or sessionStorage if it causes the total size to become greater than this size limit.

    This size limit is only used when a content document uses the Web Storage APIs in JavaScript. It is ignored if any method in IReaderPublicationStorage or IReaderPublicationStorageArea is used to modify the contents of a storage area.

    The default size limit is 5000000.

    Parameters

    • sizeLimit: number

    Returns void

  • Sets the storage state for this IReaderPublication. This method should be called BEFORE rendering the publication using a ReaderView.

    deprecated

    in 4.0.0. Please use getStorageArea(ReaderPublicationStorageAreaType.LOCAL_STORAGE).setItems() instead.

    Parameters

    Returns void

Generated using TypeDoc