Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Agent

Hierarchy

  • Agent

Index

Constructors

constructor

  • new Agent(__namedParameters?: { apiHost: string; host: string }): Agent
  • Parameters

    • Default value __namedParameters: { apiHost: string; host: string } = {}
      • apiHost: string
      • host: string

    Returns Agent

Properties

apiHost

apiHost: string

host

host: string

Optional persistentId

persistentId: string

Optional sessionId

sessionId: string

Methods

call

  • call<K, T>(url?: string, options?: NyaaRequestOptions<T>): Promise<NonNullable<ResponseTypeMap<K>[T]>>
  • Type parameters

    • K

    • T: ResponseType = "text"

    Parameters

    Returns Promise<NonNullable<ResponseTypeMap<K>[T]>>

callApi

Static call

  • call<K, T>(url: string, options?: NyaaRequestOptions<T>): Promise<RequestResult<NonNullable<ResponseTypeMap<K>[T]>>>
  • Type parameters

    • K

    • T: ResponseType = "text"

    Parameters

    Returns Promise<RequestResult<NonNullable<ResponseTypeMap<K>[T]>>>

Static callApi

Generated using TypeDoc