UNPKG

1.97 kBJavaScriptView Raw
1/*
2 Copyright 2018 Google LLC
3
4 Use of this source code is governed by an MIT-style
5 license that can be found in the LICENSE file or at
6 https://opensource.org/licenses/MIT.
7*/
8import './_version.js';
9// * * * IMPORTANT! * * *
10// ------------------------------------------------------------------------- //
11// jdsoc type definitions cannot be declared above TypeScript definitions or
12// they'll be stripped from the built `.js` files, and they'll only be in the
13// `d.ts` files, which aren't read by the jsdoc generator. As a result we
14// have to put declare them below.
15/**
16 * @typedef {Object} InstallResult
17 * @property {Array<string>} updatedURLs List of URLs that were updated during
18 * installation.
19 * @property {Array<string>} notUpdatedURLs List of URLs that were already up to
20 * date.
21 *
22 * @memberof workbox-precaching
23 */
24/**
25 * @typedef {Object} CleanupResult
26 * @property {Array<string>} deletedCacheRequests List of URLs that were deleted
27 * while cleaning up the cache.
28 *
29 * @memberof workbox-precaching
30 */
31/**
32 * @typedef {Object} PrecacheEntry
33 * @property {string} url URL to precache.
34 * @property {string} [revision] Revision information for the URL.
35 * @property {string} [integrity] Integrity metadata that will be used when
36 * making the network request for the URL.
37 *
38 * @memberof workbox-precaching
39 */
40/**
41 * The "urlManipulation" callback can be used to determine if there are any
42 * additional permutations of a URL that should be used to check against
43 * the available precached files.
44 *
45 * For example, Workbox supports checking for '/index.html' when the URL
46 * '/' is provided. This callback allows additional, custom checks.
47 *
48 * @callback ~urlManipulation
49 * @param {Object} context
50 * @param {URL} context.url The request's URL.
51 * @return {Array<URL>} To add additional urls to test, return an Array of
52 * URLs. Please note that these **should not be strings**, but URL objects.
53 *
54 * @memberof workbox-precaching
55 */