@likecoin/epub-ts
    Preparing search index...

    Class Store

    Implements

    Index

    Constructors

    Properties

    _status: ((event: Event) => void) | undefined
    emit: <K extends string>(type: K, ...args: StoreEvents[K]) => void
    name: string
    off: <K extends string>(type: K, fn?: (...args: StoreEvents[K]) => void) => void
    on: <K extends string>(type: K, fn: (...args: StoreEvents[K]) => void) => void
    online: boolean
    requester: RequestFunction
    resolver: (href: string) => string
    storage: SimpleStorage
    urlCache: Record<string, string>

    Methods

    • Add all of a book resources to the store

      Parameters

      • resources: { resources: { href: string }[] }

        book resources

      • Optionalforce: boolean

        force resaving resources

      Returns Promise<(Uint8Array<ArrayBufferLike> | null)[]>

      store objects

    • Create a Url from a stored item

      Parameters

      • url: string
      • Optionaloptions: { base64?: boolean }
        • Optionalbase64?: boolean

          use base64 encoding or blob url

      Returns Promise<string>

      url promise with Url string

    • Get a base64 encoded result from Storage by Url

      Parameters

      • url: string
      • OptionalmimeType: string

      Returns Promise<string | undefined>

      base64 encoded

    • Get a Blob from Storage by Url

      Parameters

      • url: string
      • OptionalmimeType: string

      Returns Promise<Blob | undefined>

    • Get Text from Storage by Url

      Parameters

      • url: string
      • OptionalmimeType: string

      Returns Promise<string | undefined>

    • Put binary data from a url to storage

      Parameters

      • url: string

        a url to request from storage

      • OptionalwithCredentials: boolean
      • Optionalheaders: Record<string, string>

      Returns Promise<Uint8Array<ArrayBufferLike> | null>

    • Request a url

      Parameters

      • url: string

        a url to request from storage

      • Optionaltype: string

        specify the type of the returned result

      • OptionalwithCredentials: boolean
      • Optionalheaders: Record<string, string>

      Returns Promise<unknown>

    • Request a url from storage

      Parameters

      • url: string

        a url to request from storage

      • Optionaltype: string

        specify the type of the returned result

      Returns Promise<unknown>

    • Revoke Temp Url for a archive item

      Parameters

      • url: string

        url of the item in the store

      Returns void