_types.d.ts
1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import './_version.js';
export interface InstallResult {
updatedURLs: string[];
notUpdatedURLs: string[];
}
export interface CleanupResult {
deletedCacheRequests: string[];
}
export interface PrecacheEntry {
integrity?: string;
url: string;
revision?: string;
}
export declare type urlManipulation = ({ url }: {
url: URL;
}) => URL[];
/**
* @typedef {Object} InstallResult
* @property {Array<string>} updatedURLs List of URLs that were updated during
* installation.
* @property {Array<string>} notUpdatedURLs List of URLs that were already up to
* date.
*
* @memberof module:workbox-precaching
*/
/**
* @typedef {Object} CleanupResult
* @property {Array<string>} deletedCacheRequests List of URLs that were deleted
* while cleaning up the cache.
*
* @memberof module:workbox-precaching
*/
/**
* @typedef {Object} PrecacheEntry
* @property {string} url URL to precache.
* @property {string} [revision] Revision information for the URL.
* @property {string} [integrity] Integrity metadata that will be used when
* making the network request for the URL.
*
* @memberof module:workbox-precaching
*/
/**
* The "urlManipulation" callback can be used to determine if there are any
* additional permutations of a URL that should be used to check against
* the available precached files.
*
* For example, Workbox supports checking for '/index.html' when the URL
* '/' is provided. This callback allows additional, custom checks.
*
* @callback ~urlManipulation
* @param {Object} context
* @param {URL} context.url The request's URL.
* @return {Array<URL>} To add additional urls to test, return an Array of
* URLs. Please note that these **should not be strings**, but URL objects.
*
* @memberof module:workbox-precaching
*/