UNPKG

@eolme/vma-engine

Version:
30 lines (29 loc) 1.09 kB
export declare interface UnaxiosResponse { data?: any; status: number; request: XMLHttpRequest; } export declare interface UnaxiosError<T = any> extends Error { request: XMLHttpRequest; response?: T; } export declare type UnaxiosMethod = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK'; export declare interface UnaxiosConfig { baseURL?: string; method?: UnaxiosMethod; headers?: { [key: string]: string; }; } export declare interface UnaxiosOptions extends UnaxiosConfig { url?: string; body?: Blob | FormData | URLSearchParams | string | null; } export declare interface Unaxios { (options: UnaxiosOptions): Promise<UnaxiosResponse>; config: UnaxiosConfig; get(url?: string): Promise<UnaxiosResponse>; post(url?: string, body?: object | any[]): Promise<UnaxiosResponse>; } declare const unaxios: Unaxios; export { unaxios, unaxios as default };