newmax-utils
Version:
Utils & Libs for Newmax Tech
39 lines (38 loc) • 933 B
TypeScript
type FetchDataType = {
url: string;
method?: string;
body?: object | string;
headersOptions?: object;
options?: object;
};
export declare class FetchRequest {
commonHeaders: {
[key: string]: string;
};
errorStatus: {
[key: string]: {
code: number;
count: number;
};
};
constructor();
fetchData: ({ url, method, body, headersOptions, options, }: FetchDataType) => Promise<{
data?: object;
headers?: Headers;
text?: string;
error?: {
status: number;
message: string;
};
}>;
fetchErrorLoop: (caller: string, params: FetchDataType, company: string, errStatusBreakList?: number[]) => Promise<{
data?: object;
headers?: Headers;
text?: string;
error?: {
status: number;
message: string;
};
}>;
}
export {};