UNPKG

dff-util

Version:

DesignForFeature Utilities

36 lines (35 loc) 1.43 kB
export declare enum RespType { JSON = "json", TEXT = "text", BLOB = "blob", FORM_DATA = "formData", ARRAY_BUFFER = "arrayBuffer" } export declare const HttpHeaders: { 'Content-Type': string; authorization: null; 'request-id': null; }; export declare const BaseHeaders: { authorization: null; 'request-id': null; }; export declare const HttpMethods: { GET: string; POST: string; PUT: string; DELETE: string; }; export declare class Http { static API_BASE_URL: string; static TOKEN_URL: string; private static RespData; static Get(url: string, params: any, headers: any, type?: RespType): Promise<any>; static Post(url: string, data: any, headers: any, type?: RespType): Promise<any>; static Put(url: string, data: any, headers: any, type?: RespType): Promise<any>; static Delete(url: string, params: any, headers: any, type?: RespType): Promise<any>; static Token(sessionInfo: any, appKey: string, apiKey?: string, type?: RespType): Promise<any>; static FormUpload(url: string, file: File, isHeadersAddMultiForm?: boolean, data?: Record<string, any>, headers?: any, method?: 'POST' | 'PUT', type?: RespType): Promise<any>; static CloudUpload(fullUrl: string, file: File, headers?: any, method?: 'POST' | 'PUT'): Promise<Response>; static FileDownload(fullUrl: string, params: any, headers?: any, method?: string): Promise<Blob>; }