interface THttpResponse { status: 200 | number; data: T; } export declare namespace $http { const handlers: { rgx: RegExp; handler: (opts: IHttpFetch) => Promise<{ status: any; data: any; headers?: any; }>; }[]; export function register(rgx: RegExp, handler: (typeof handlers[0]['handler'])): void; export interface IHttpFetch { url: string; method?: 'GET' | string; params?: Record; body?: string | Record | any; headers?: Record; responseType?: 'stream'; } export function get(opts: IHttpFetch): Promise>; export function get(url: string): Promise>; export function post(opts: IHttpFetch): Promise>; /** * output: Directory or File */ export function download(url: string, config: IHttpFetch & { output: string; }): Promise; export {}; } export declare namespace $httpBrowser { /** * output: Directory or File */ function download(url: string, output: string, config?: RequestInit): Promise; } export {};