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 | */
|
8 |
|
9 | import './_version.mjs';
|
10 |
|
11 | /**
|
12 | * @typedef {Object} ManifestEntry
|
13 | * @property {string} url The URL to the asset in the manifest.
|
14 | * @property {string} revision The revision details for the file. This should be
|
15 | * either a hash generated based on the file contents, or `null` if there is
|
16 | * versioning already included in the URL.
|
17 | * @property {string} [integrity] Integrity metadata that will be used when
|
18 | * making the network request for the URL.
|
19 | *
|
20 | * @memberof module:workbox-build
|
21 | */
|
22 |
|
23 | /**
|
24 | * @typedef {Object} ManifestTransformResult
|
25 | * @property {Array<module:workbox-build.ManifestEntry>} manifest
|
26 | * @property {Array<string>|undefined} warnings
|
27 | *
|
28 | * @memberof module:workbox-build
|
29 | */
|
30 |
|
31 | /**
|
32 | * @typedef {Object} RuntimeCachingEntry
|
33 | *
|
34 | * @property {string|module:workbox-routing~handlerCallback} handler
|
35 | * Either the name of one of the [built-in strategy classes]{@link module:workbox-strategies},
|
36 | * or custom handler callback to use when the generated route matches.
|
37 | *
|
38 | * @property {string|RegExp|module:workbox-routing~matchCallback} urlPattern
|
39 | * The value that will be passed to [`registerRoute()`]{@link module:workbox-routing.registerRoute},
|
40 | * used to determine whether the generated route will match a given request.
|
41 | *
|
42 | * @property {string} [method='GET'] The
|
43 | * [HTTP method](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) that
|
44 | * will match the generated route.
|
45 | *
|
46 | * @property {Object} [options]
|
47 | *
|
48 | * @property {Object} [options.backgroundSync]
|
49 | *
|
50 | * @property {string} [options.backgroundSync.name] The `name` property to use
|
51 | * when creating the
|
52 | * [`BackgroundSyncPlugin`]{@link module:workbox-background-sync.BackgroundSyncPlugin}.
|
53 | *
|
54 | * @property {Object} [options.backgroundSync.options] The `options` property
|
55 | * to use when creating the
|
56 | * [`BackgroundSyncPlugin`]{@link module:workbox-background-sync.BackgroundSyncPlugin}.
|
57 | *
|
58 | * @property {Object} [options.broadcastUpdate]
|
59 | *
|
60 | * @property {string} [options.broadcastUpdate.channelName] The `channelName`
|
61 | * property to use when creating the
|
62 | * [`BroadcastCacheUpdatePlugin`]{@link module:workbox-broadcast-update.BroadcastUpdatePlugin}.
|
63 | *
|
64 | * @property {Object} [options.broadcastUpdate.options] The `options` property
|
65 | * to use when creating the
|
66 | * [`BroadcastCacheUpdatePlugin`]{@link module:workbox-broadcast-update.BroadcastUpdatePlugin}.
|
67 | *
|
68 | * @property {Object} [options.cacheableResponse]
|
69 | *
|
70 | * @property {Object} [options.cacheableResponse.headers] The `headers` property
|
71 | * to use when creating the
|
72 | * [`CacheableResponsePlugin`]{@link module:workbox-cacheable-response.CacheableResponsePlugin}.
|
73 | *
|
74 | * @property {Array<number>} [options.cacheableResponse.statuses] `statuses`
|
75 | * property to use when creating the
|
76 | * [`CacheableResponsePlugin`]{@link module:workbox-cacheable-response.CacheableResponsePlugin}.
|
77 | *
|
78 | * @property {string} [options.cacheName] The `cacheName` to use when
|
79 | * constructing one of the
|
80 | * [Workbox strategy classes]{@link module:workbox-strategies}.
|
81 | *
|
82 | * @property {Object} [options.fetchOptions] The `fetchOptions` property value
|
83 | * to use when constructing one of the
|
84 | * [Workbox strategy classes]{@link module:workbox-strategies}.
|
85 | *
|
86 | * @property {Object} [options.expiration]
|
87 | *
|
88 | * @property {number} [options.expiration.maxAgeSeconds] The `maxAgeSeconds`
|
89 | * property to use when creating the
|
90 | * [`ExpirationPlugin`]{@link module:workbox-expiration.ExpirationPlugin}.
|
91 | *
|
92 | * @property {number} [options.expiration.maxEntries] The `maxEntries`
|
93 | * property to use when creating the
|
94 | * [`ExpirationPlugin`]{@link module:workbox-expiration.ExpirationPlugin}.
|
95 | *
|
96 | * @property {Object} [options.precacheFallback]
|
97 | *
|
98 | * @property {string} [options.precacheFallback.fallbackURL] The `fallbackURL`
|
99 | * property to use when creating the
|
100 | * [`PrecacheFallbackPlugin`]{@link module:workbox-precaching.PrecacheFallbackPlugin}.
|
101 | *
|
102 | * @property {boolean} [options.rangeRequests] Set to `true` to add the
|
103 | * [`RangeRequestsPlugin`]{@link module:workbox-range-requests.RangeRequestsPlugin}
|
104 | * for the strategy being configured.
|
105 | *
|
106 | * @property {Object} [options.matchOptions] The `matchOptions` property value
|
107 | * to use when constructing one of the
|
108 | * [Workbox strategy classes]{@link module:workbox-strategies}.
|
109 | *
|
110 | * @property {number} [options.networkTimeoutSeconds] The
|
111 | * `networkTimeoutSeconds` property value to use when creating a
|
112 | * [`NetworkFirst`]{@link module:workbox-strategies.NetworkFirst} strategy.
|
113 | *
|
114 | * @property {Array<Object>} [options.plugins]
|
115 | * One or more [additional plugins](https://developers.google.com/web/tools/workbox/guides/using-plugins#custom_plugins)
|
116 | * to apply to the handler. Useful when you want a plugin that doesn't have a
|
117 | * "shortcut" configuration.
|
118 | *
|
119 | * @memberof module:workbox-build
|
120 | */
|