Constructors
constructor
- new Agent(__namedParameters?: { apiHost: string; host: string }): Agent
-
Parameters
-
Default value __namedParameters: { apiHost: string; host: string } = {}
-
apiHost: string
-
host: string
Properties
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
-
Default value url: string = ""
-
Returns Promise<NonNullable<ResponseTypeMap<K>[T]>>
callApi
-
Type parameters
Parameters
-
Default value url: string = ""
-
Returns Promise<T>
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
-
Type parameters
Parameters
Returns Promise<T>