Class HawAPIClient

Hierarchy

  • HawAPIClient

Constructors

Properties

cache: InMemoryCacheManager
headers: HeadersInit
options: HawAPIOptions
request: RequestInit
service: Service

Methods

  • Method to get all keys of cached data

    Returns Promise<IterableIterator<string>>

    All cached keys

  • Method to get the size of cached data

    Returns Promise<number>

    The count of all cached data

  • Method to clear all cached data

    Returns Promise<number>

    The count of all cleaned data

  • Method that get all items

    Type Parameters

    Parameters

    • target: "actors" | "characters" | "episodes" | "games" | "locations" | "seasons" | "soundtracks"

      The target name

    • Optional filters: null | Filters
    • Optional pageable: null | Pageable

    Returns Promise<RequestResult<T[]>>

    An new RequestResult with all target items

  • Method that get all item translations

    Type Parameters

    Parameters

    • target: "actors" | "characters" | "episodes" | "games" | "locations" | "seasons" | "soundtracks"

      The target name

    • uuid: string

      The target uuid

    Returns Promise<RequestResult<T[]>>

    An new RequestResult with all target item translations

  • Method that get a single item

    Type Parameters

    Parameters

    • target: "actors" | "characters" | "episodes" | "games" | "locations" | "seasons" | "soundtracks"

      The target name

    • uuid: string

      The target uuid

    Returns Promise<RequestResult<T>>

    An new RequestResult with specific target item

  • Method that get the API overview

    Type Parameters

    • OverviewModel

    Parameters

    • Optional language: string

      The result language

    Returns Promise<RequestResult<OverviewModel>>

    An new RequestResult with overview

  • Method that get a single random item

    Type Parameters

    Parameters

    • target: "actors" | "characters" | "episodes" | "games" | "locations" | "seasons" | "soundtracks"

      The target name

    Returns Promise<RequestResult<T>>

    An new RequestResult with random target item

  • Method that get a single random item translation

    Type Parameters

    Parameters

    • target: "actors" | "characters" | "episodes" | "games" | "locations" | "seasons" | "soundtracks"

      The target name

    • uuid: string

      The target uuid

    Returns Promise<RequestResult<T>>

    An new RequestResult with random target item translation

  • Method that get a single item

    Type Parameters

    Parameters

    • target: "actors" | "characters" | "episodes" | "games" | "locations" | "seasons" | "soundtracks"

      The target name

    • uuid: string

      The target uuid

    • language: string

      The target translation language

    Returns Promise<RequestResult<T>>

    An new RequestResult with specific target item translation

  • Method to test API connection

    Returns Promise<string>

    If connected. An string with 'Ping' value

  • Method to remove specific cache data

    Parameters

    • key: string

      The cache key

    Returns Promise<boolean>

    true if an element in the Map existed and has been removed, or false if the element does not exist.

  • Method to define new language into client options

    Parameters

    • language: string

    Returns Promise<void>

Generated using TypeDoc