npaw-plugin-nwf
Version:
NPAW's Plugin
27 lines (26 loc) • 873 B
TypeScript
interface Natives {
open: (method: string, url: string, async?: boolean) => void;
send: (body?: Document | XMLHttpRequestBodyInit | null) => void;
setRequestHeader: (name: string, value: string) => void;
abort: () => void;
}
export default class ShadowXhrBridge {
readonly shadow: XMLHttpRequest;
private readonly original;
private readonly natives;
private readonly savedDescriptors;
private savedGetResponseHeader;
private savedGetAllResponseHeaders;
private installedGetResponseHeader;
private installedGetAllResponseHeaders;
private started;
private terminated;
constructor(original: XMLHttpRequest, natives: Natives);
start(url: string, headers?: Record<string, string>): void;
abort(): void;
private prepareOriginal;
private wireShadow;
private mirror;
private cleanup;
}
export {};