UNPKG

@deployport/specular-runtime

Version:

Runtime for Specular API clients with support for Node.js and Browser

24 lines (23 loc) 781 B
/// <reference types="node" resolution-mode="require"/> 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 {};