/** * @license * Copyright 2021 KonghaYao 江夏尧 * SPDX-License-Identifier: Apache-2.0 */ type ProxyFunc = (input: { url: URL; headers: Headers; method: RequestInit['method']; body: RequestInit['body']; }) => void | Promise; type Method = NonNullable; export declare class MockXMLHttpRequest extends XMLHttpRequest { $mock: boolean; open(method: Method, url: string | URL, _?: boolean, username?: string, password?: string): void; send(body: any): void; setRequestHeader(key: string, value: string): void; $data: { readyState: number; status: number; response: string; responseText: string; statusText: string; headers: Record; url: string | URL; method: string; }; _responseHeaders: Headers; _useResponseType(res: Response): Promise; $request(res: Response): Promise; } export declare function mockXHR({ proxy, silent, window, }: { proxy: ProxyFunc; silent: boolean; window?: any; }): void; export {};