copyResponse.d.ts 935 B

12345678910111213141516171819
  1. import './_version.js';
  2. /**
  3. * Allows developers to copy a response and modify its `headers`, `status`,
  4. * or `statusText` values (the values settable via a
  5. * [`ResponseInit`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Response/Response#Syntax}
  6. * object in the constructor).
  7. * To modify these values, pass a function as the second argument. That
  8. * function will be invoked with a single object with the response properties
  9. * `{headers, status, statusText}`. The return value of this function will
  10. * be used as the `ResponseInit` for the new `Response`. To change the values
  11. * either modify the passed parameter(s) and return it, or return a totally
  12. * new object.
  13. *
  14. * @param {Response} response
  15. * @param {Function} modifier
  16. * @memberof module:workbox-core
  17. */
  18. declare function copyResponse(response: Response, modifier?: (responseInit: ResponseInit) => ResponseInit): Promise<Response>;
  19. export { copyResponse };