export type Headers = Record; export interface NormalizedRequest { method: string; url: string; headers: Headers; body?: string; } export interface NormalizedResponse { statusCode: number; statusText: string; headers?: Headers; body?: string; } export type AdapterRequest = any; export type AdapterResponse = any; export type AdapterHeaders = any; export interface AdapterArgs { /** * The raw request, from the app's framework. */ rawRequest: AdapterRequest; /** * The raw response, from the app's framework. Only applies to frameworks that expose an API similar to Node's HTTP * module. */ rawResponse?: AdapterResponse; } export type AbstractFetchFunc = ( ...params: Parameters ) => Promise; export type AbstractConvertRequestFunc = ( adapterArgs: AdapterArgs, ) => Promise; export type AbstractConvertIncomingResponseFunc = ( adapterArgs: AdapterArgs, ) => Promise; export type AbstractConvertResponseFunc = ( response: NormalizedResponse, adapterArgs: AdapterArgs, ) => Promise; export type AbstractConvertHeadersFunc = ( headers: Headers, adapterArgs: AdapterArgs, ) => Promise;