@types/fetch-mock
Advanced tools
Comparing version 7.2.1 to 7.2.2
@@ -526,10 +526,79 @@ // Type definitions for fetch-mock 7.2 | ||
/** | ||
* Set some global config options, which include | ||
* sendAsJson [default `true`] - by default fetchMock will | ||
* convert objects to JSON before sending. This is overrideable | ||
* for each call but for some scenarios, e.g. when dealing with a | ||
* lot of array buffers, it can be useful to default to `false` | ||
*/ | ||
configure(opts: {}): void; | ||
config: { | ||
/** | ||
* Convert objects into JSON before delivering as stub reponses. | ||
* Can be useful to set to false globally if e.g. dealing with a | ||
* lot of array buffers. If true, will also add | ||
* content-type: application/json header. | ||
* @default true | ||
*/ | ||
sendAsJson?: boolean; | ||
/** | ||
* Automatically sets a content-length header on each response. | ||
* @default true | ||
*/ | ||
includeContentLength?: boolean; | ||
/** | ||
* - true: Unhandled calls fall through to the network | ||
* - false: Unhandled calls throw an error | ||
* - 'always': All calls fall through to the network, effectively | ||
* disabling fetch-mock. | ||
* @default false | ||
*/ | ||
fallbackToNetwork?: boolean | 'always'; | ||
/** | ||
* Determines behaviour if a new route has the same name (or | ||
* inferred name) as an existing one | ||
* - undefined: An error will be throw when routes clash | ||
* - true: Overwrites the existing route | ||
* - false: Appends the new route to the list of routes | ||
* @default undefined | ||
*/ | ||
overwriteRoutes?: boolean; | ||
/** | ||
* Print a warning if any call is caught by a fallback handler (set | ||
* using the fallbackToNetwork option or catch()) | ||
* @default true | ||
*/ | ||
warnOnFallback?: boolean; | ||
/** | ||
* Reference to the Promise constructor of a custom Promise | ||
* implementation. | ||
*/ | ||
Promise?: new (executor: ( | ||
resolve: () => void, | ||
reject: () => void, | ||
) => void) => Promise<Response>; | ||
/** | ||
* Reference to a custom fetch implementation. | ||
*/ | ||
fetch?: ( | ||
input?: string | Request, | ||
init?: RequestInit, | ||
) => Promise<Response>; | ||
/** | ||
* Reference to the Headers constructor of a custom fetch | ||
* implementation. | ||
*/ | ||
Headers?: new () => Headers; | ||
/** | ||
* Reference to the Request constructor of a custom fetch | ||
* implementation. | ||
*/ | ||
Request?: new (input: string | Request, init?: RequestInit) => Request; | ||
/** | ||
* Reference to the Response constructor of a custom fetch | ||
* implementation. | ||
*/ | ||
Response?: new () => Response; | ||
}; | ||
} | ||
@@ -536,0 +605,0 @@ |
{ | ||
"name": "@types/fetch-mock", | ||
"version": "7.2.1", | ||
"version": "7.2.2", | ||
"description": "TypeScript definitions for fetch-mock", | ||
@@ -61,4 +61,4 @@ "license": "MIT", | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "c26625853ebf8c697eb813949387a70bb8816a413609fafbff94dcb8c8b4b337", | ||
"typesPublisherContentHash": "a94c0dbb2fefca18d7e948f8d1bac76f5a1daafd2823a3258490d3b2d96b1c4d", | ||
"typeScriptVersion": "2.2" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
Additional Details | ||
* Last updated: Mon, 31 Dec 2018 16:00:18 GMT | ||
* Last updated: Wed, 23 Jan 2019 00:09:48 GMT | ||
* Dependencies: none | ||
@@ -14,0 +14,0 @@ * Global values: none |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30311
545