| 6 | type Resolver<T> = (options: ApiRequestOptions<T>) => Promise<T> |
| 7 | |
| 8 | export class Interceptors<T> { |
| 9 | _fns: Middleware<T>[] |
| 10 | |
| 11 | constructor() { |
| 12 | this._fns = [] |
| 13 | } |
| 14 | |
| 15 | eject(fn: Middleware<T>): void { |
| 16 | const index = this._fns.indexOf(fn) |
| 17 | if (index !== -1) { |
| 18 | this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)] |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | use(fn: Middleware<T>): void { |
| 23 | this._fns = [...this._fns, fn] |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | export type OpenAPIConfig = { |
| 28 | BASE: string |
nothing calls this directly
no outgoing calls
no test coverage detected