ui-lib/lib/utility/request.d.ts

13 lines
594 B
TypeScript

interface RequestOptions {
method?: string;
accept?: string;
contentType?: string;
customHeaders?: { [key: string]: string };
mode?: RequestMode | undefined;
signal?: AbortSignal | null;
progress?: (this: XMLHttpRequestUpload, ev: ProgressEvent<XMLHttpRequestEventTarget>) => any
}
export function get(url: string, options?: RequestOptions): Promise<Response>
export function post(url: string, data?: BodyInit | null, options?: RequestOptions): Promise<Response>
export function upload(url: string, data: FormData, options?: RequestOptions): Promise<XMLHttpRequest>