UNPKG

791 BJavaScriptView Raw
1// @flow
2
3export type Response = {
4 body: string,
5 headers: Map<string, string>,
6};
7
8export interface ResponseMergerInterface {}
9
10export interface ResponseMergerStaticsInterface {
11
12 /**
13 * Merges many responses into a single one.
14 *
15 * @param {Response[]} responses
16 * An object containing information about the response body and headers.
17 *
18 * @return {Response}
19 * A single response containing all the responses.
20 */
21 mergeResponses(responses: Array<Response>): Response;
22
23 /**
24 * Builds a subresponse object based on the response to the subrequest.
25 *
26 * @param {Response} response
27 * The individual subresponse.
28 *
29 * @return {string}
30 * The serialized subresponse.
31 *
32 * @private
33 */
34 serializeResponse(response: Response): string;
35
36}