Skip to main content

Class: BaseAPI

Types.BaseAPI

This is the base class for all generated API classes.

Hierarchy

Constructors

constructor

new BaseAPI(configuration?)

Parameters

NameTypeDefault value
configurationConfigurationDefaultConfig

Methods

withMiddleware

withMiddleware<T>(this, ...middlewares): T

Type parameters

NameType
Textends BaseAPI<T>

Parameters

NameType
thisT
...middlewaresMiddleware[]

Returns

T


withPostMiddleware

withPostMiddleware<T>(this, ...postMiddlewares): T

Type parameters

NameType
Textends BaseAPI<T>

Parameters

NameType
thisT
...postMiddlewares(undefined | (context: ResponseContext) => Promise<void | Response>)[]

Returns

T


withPreMiddleware

withPreMiddleware<T>(this, ...preMiddlewares): T

Type parameters

NameType
Textends BaseAPI<T>

Parameters

NameType
thisT
...preMiddlewares(undefined | (context: RequestContext) => Promise<void | FetchParams>)[]

Returns

T