UNPKG

874 BJavaScriptView Raw
1// @flow
2
3import type { Subrequest } from './BlueprintManager';
4import type { Response } from './Responses';
5
6export interface RequestorInterface {
7
8 /**
9 * Makes multiple requests in parallel.
10 *
11 * @param {Subrequest[]} subrequests
12 * The list of requests to make.
13 *
14 * @return {Promise.<Response[]>}
15 * The responses to the requests.
16 */
17 requestInParallel(subrequests: Array<Subrequest>): Array<Promise<Response>>;
18
19 /**
20 * Translate the response from the lib format into the typed Response object.
21 *
22 * Responses come back as an object defined in the request module. We want to
23 * transform them into the typed object.
24 *
25 * @param {*} response
26 * The response in the library object.
27 *
28 * @return {Response}
29 * The response in the common structure.
30 */
31 translateResponseFromLibFormat(response: mixed): Response;
32
33}