source: frontend/node_modules/workbox-cacheable-response/CacheableResponse.d.ts

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 1.6 KB
Line 
1import './_version.js';
2export interface CacheableResponseOptions {
3 statuses?: number[];
4 headers?: {
5 [headerName: string]: string;
6 };
7}
8/**
9 * This class allows you to set up rules determining what
10 * status codes and/or headers need to be present in order for a
11 * [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)
12 * to be considered cacheable.
13 *
14 * @memberof workbox-cacheable-response
15 */
16declare class CacheableResponse {
17 private readonly _statuses?;
18 private readonly _headers?;
19 /**
20 * To construct a new CacheableResponse instance you must provide at least
21 * one of the `config` properties.
22 *
23 * If both `statuses` and `headers` are specified, then both conditions must
24 * be met for the `Response` to be considered cacheable.
25 *
26 * @param {Object} config
27 * @param {Array<number>} [config.statuses] One or more status codes that a
28 * `Response` can have and be considered cacheable.
29 * @param {Object<string,string>} [config.headers] A mapping of header names
30 * and expected values that a `Response` can have and be considered cacheable.
31 * If multiple headers are provided, only one needs to be present.
32 */
33 constructor(config?: CacheableResponseOptions);
34 /**
35 * Checks a response to see whether it's cacheable or not, based on this
36 * object's configuration.
37 *
38 * @param {Response} response The response whose cacheability is being
39 * checked.
40 * @return {boolean} `true` if the `Response` is cacheable, and `false`
41 * otherwise.
42 */
43 isResponseCacheable(response: Response): boolean;
44}
45export { CacheableResponse };
Note: See TracBrowser for help on using the repository browser.