//#region src/mock.d.ts /** * @public */ interface Scaffold { status: number; statusText?: string; headers: Record; body: Record | string | null; method: string; url: string; response: Record; } /** * @public */ type ScaffoldGenerator = () => Scaffold; /** * @public */ type ResponseGenerator = () => Record; /** * Sets up Mocking for a GET request on the mock server * for the supplied url. * * The response body is generated by the supplied response function. * * Available options: * - status: the status code to return (default: 200) * - headers: the headers to return (default: {}) * - body: the body to match against for the request (default: null) * - RECORD: whether to record the request (default: false) * * @param url the url to mock, relative to the mock server host (e.g. `users/1`) * @param response a function which generates the response to return * @param options status, headers for the response, body to match against for the request, and whether to record the request * @return */ declare function GET(owner: object, url: string, response: ResponseGenerator, options?: Partial> & { RECORD?: boolean; }): Promise; /** * Mock a POST request */ declare function POST(owner: object, url: string, response: ResponseGenerator, options?: Partial> & { RECORD?: boolean; }): Promise; /** * mock a PUT request */ declare function PUT(owner: object, url: string, response: ResponseGenerator, options?: Partial> & { RECORD?: boolean; }): Promise; /** * mock a PATCH request * */ declare function PATCH(owner: object, url: string, response: ResponseGenerator, options?: Partial> & { RECORD?: boolean; }): Promise; /** * mock a DELETE request */ declare function DELETE(owner: object, url: string, response: ResponseGenerator, options?: Partial> & { RECORD?: boolean; }): Promise; /** * Sets up Mocking for a HEAD request on the mock server * for the supplied url. * * The response body is generated by the supplied response function. * * Available options: * - status: the status code to return (default: 200) * - headers: the headers to return (default: {}) * - body: the body to match against for the request (default: null) * - RECORD: whether to record the request (default: false) * * @param url the url to mock, relative to the mock server host (e.g. `users/1`) * @param response a function which generates the response to return * @param options status, headers for the response, body to match against for the request, and whether to record the request * @return */ declare function HEAD(owner: object, url: string, response: ResponseGenerator, options?: Partial> & { RECORD?: boolean; }): Promise; //#endregion export { DELETE, GET, HEAD, PATCH, POST, PUT, ResponseGenerator, Scaffold, ScaffoldGenerator }; //# sourceMappingURL=mock.d.ts.map