@deployport/specular-runtime
Version:
Runtime for Specular API clients with support for Node.js and Browser
23 lines (22 loc) • 725 B
TypeScript
export type Part = {
headers: Record<string, string>;
body: string;
};
/**
* StreamCallback is a callback function that is called for each chunk of data
* received from the server. The callback is called with a null chunk when the
* stream is complete.
*/
type StreamCallback = (chunk: Part) => Promise<void>;
export declare function StreamMultipartMixedChunks(httpResponse: any, callback: StreamCallback): Promise<void>;
export type HTTPHeaders = Record<string, string | string[]>;
export declare class HTTPRequest {
method: string;
url: string;
headers: HTTPHeaders;
body: string;
abortController: AbortController | null;
get path(): string;
fetch(): Promise<Response>;
}
export {};