import { Methods } from './constants'; export type BasicObject = Record; export type Method = keyof typeof Methods; export interface MiddlewareMeta extends Partial { request?: Omit, 'signal'>; signal?: Request['signal']; } export type MiddlewareType = 'request' | 'response'; export type MiddlewareHandler = (params: unknown, meta: MiddlewareMeta) => Promise; export type MiddlewareHandlers = Array; export type Middleware = { [key in MiddlewareType]?: MiddlewareHandlers }; export type CreateMethod = { query?: unknown, url?: string, baseUrl?: string, timeout?: number, middleware?: Middleware, params?: Partial, method?: Uppercase<`${Methods}`>, format?: keyof Omit, }; export type CreateHttpClientOptions = { baseUrl?: string; middleware?: Middleware; }; type ResponseFormats = keyof Omit; export type FormattedResponse = ReturnType | Record;