simple2k13
Version:
some simple functions
13 lines (12 loc) • 505 B
TypeScript
export interface OpenArgv extends XMLHttpRequestAttribute {
method?: string;
async?: boolean;
username?: string | null;
password?: string | null;
[func: string]: any;
}
type XMLHttpRequestAttribute<T = Pick<XMLHttpRequest, 'responseType' | 'timeout' | 'withCredentials'>> = {
[K in keyof T]?: T[K];
};
declare const httpRequest: (url: string, options?: OpenArgv, callback?: ((params: XMLHttpRequest) => unknown) | undefined) => Promise<XMLHttpRequest>;
export default httpRequest;