1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-09-20 20:21:55 +00:00
musix-oss/node_modules/@firebase/storage/dist/test/xhrio.d.ts
2020-03-03 22:30:50 +02:00

33 lines
1.1 KiB
TypeScript

import { ErrorCode, Headers, XhrIo } from '../src/implementation/xhrio';
export declare type SendHook = (xhrio: TestingXhrIo, url: string, method: string, body?: ArrayBufferView | Blob | string | null, headers?: Headers) => void;
export declare enum State {
START = 0,
SENT = 1,
DONE = 2
}
export interface StringHeaders {
[name: string]: string;
}
export declare class TestingXhrIo implements XhrIo {
private state;
private sendPromise;
private resolve;
private sendHook;
private status;
private responseText;
private headers;
private errorCode;
constructor(sendHook: SendHook | null);
send(url: string, method: string, body?: ArrayBufferView | Blob | string | null, headers?: Headers): Promise<XhrIo>;
simulateResponse(status: number, body: string, headers: {
[key: string]: string;
}): void;
getErrorCode(): ErrorCode;
getStatus(): number;
getResponseText(): string;
abort(): void;
getResponseHeader(header: string): string | null;
addUploadProgressListener(): void;
removeUploadProgressListener(): void;
}