Options
All
  • Public
  • Public/Protected
  • All
Menu

Class API

Hierarchy

  • API

Index

Constructors

constructor

  • new API(options?: {}): API
  • Constuct a new API wrapper

    Parameters

    • options: {} = {}

    Returns API

Properties

options

options: {} = {}

Type declaration

Methods

doujinExists

  • doujinExists(id: string | number): Promise<boolean>
  • Check if a doujin exists

    Parameters

    • id: string | number

      ID of the doujin

    Returns Promise<boolean>

Private fetch

  • fetch(path: string): Promise<unknown>
  • Node-fetch wrapper that handles api errors

    Parameters

    • path: string

      API path

    Returns Promise<unknown>

    parsed JSON

fetchDoujin

  • fetchDoujin(id: string | number): Promise<null | Doujin>
  • Fetch a doujin

    Parameters

    • id: string | number

      ID of the doujin.

    Returns Promise<null | Doujin>

fetchHomepage

randomDoujin

  • randomDoujin(): Promise<Doujin>

randomDoujinID

  • randomDoujinID(): Promise<number>
  • Fetch a random doujin ID

    Returns Promise<number>

search

searchByTagID

  • Search doujins with this tag

    Parameters

    • id: string | number

      Tag ID

    • page: string | number = 1

      Page number

    • sort: SortMethods = ...

      API sort method

    Returns Promise<SearchResult>

searchRelated

  • searchRelated(id: string | number, page?: string | number): Promise<SearchResult>
  • Find similar doujins

    Parameters

    • id: string | number

      Doujin ID

    • page: string | number = 1

      Page number

    Returns Promise<SearchResult>

Generated using TypeDoc