/** * Initialize the mock with response objects. * * @param {Object} apiUrlResponseConfig - Config object containing URL strings as keys and respective mock response objects as values * @param {boolean} [overwritePreviousConfig=true] - If the map from a previous configure call should be overwritten by this call (true) or not (false) * @memberOf MockRequests */ export function configure(apiUrlResponseConfig?: { [x: string]: JsonPrimitive; }, overwritePreviousConfig?: boolean): void; /** * Initialize the mock with response objects and their dynamic update functions * * @param {Object} dynamicApiUrlResponseConfig - URL-MockResponseConfig mappings * @param {boolean} [overwritePreviousConfig=true] - If the map from a previous configure call should be overwritten by this call (true) or not (false) * @memberOf MockRequests */ export function configureDynamicResponses(dynamicApiUrlResponseConfig?: { [x: string]: MockResponseConfig; }, overwritePreviousConfig?: boolean): void; /** * Mock any network requests to the given URL using the given responseObject * * @param {string} url - URL to mock * @param {JsonPrimitive} response - Mock response object * @memberOf MockRequests */ export function setMockUrlResponse(url: string, response?: JsonPrimitive): void; /** * Mock any network requests to the given URL using the given responseObject * and dynamic response modification function * * @param {string} url - URL to mock * @param {MockResponseConfig} mockResponseConfig - Config object with the fields desired to be configured * @memberOf MockRequests */ export function setDynamicMockUrlResponse(url: string, mockResponseConfig: MockResponseConfig): void; /** * Get the mock response object associated with the passed URL * * @param {string} url - URL that was previously mocked * @returns {JsonPrimitive} - Configured response object * @memberOf MockRequests */ export function getResponse(url: string): JsonPrimitive; /** * Deletes the URL and respective mock object * * @param {string} url - URL that was previously mocked * @returns {boolean} - Value returned from `delete Object.url` * @memberOf MockRequests */ export function deleteMockUrlResponse(url: string): boolean; /** * Deletes all entries in the MockRequests configuration * * @memberOf MockRequests */ export function clearAllMocks(): void; /** * Reformats a static URL-response config object to match the dynamic MockResponseConfig object structure * * @param {Object} staticConfig - URL-staticResponse map * @returns {Object} - URL-MockResponseConfig object with default configuration fields * @memberOf MockRequests */ export function mapStaticConfigToDynamic(staticConfig: { [x: string]: JsonPrimitive; }): { [x: string]: MockResponseConfig; }; export const OriginalXHR: XMLHttpRequest; export const originalFetch: Function; export type JsonPrimitive = import('./types').JsonPrimitive; export type DynamicResponseModFn = import('./types').DynamicResponseModFn; export type MockResponseConfig = import('./types').MockResponseConfig;