Skip to content

Commit

Permalink
strategy JSDoc fixes (#2747)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffposnick authored Feb 13, 2021
1 parent 18e7e72 commit 6581108
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 16 deletions.
11 changes: 6 additions & 5 deletions packages/workbox-strategies/src/NetworkFirst.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,16 @@ class NetworkFirst extends Strategy {

/**
* @param {Object} [options]
* @param {string} [options.cacheName Cache name to store and retrieve
* @param {string} [options.cacheName] Cache name to store and retrieve
* requests. Defaults to cache names provided by
* [workbox-core]{@link module:workbox-core.cacheNames}.
* @param {Array<Object>} [options.plugins [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}
* @param {Array<Object>} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}
* to use in conjunction with this caching strategy.
* @param {Object} [options.fetchOptions Values passed along to the
* @param {Object} [options.fetchOptions] Values passed along to the
* [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)
* of all fetch() requests made by this strategy.
* @param {Object} [options.matchOptions [`CacheQueryOptions`](https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions)
* of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)
* `fetch()` requests made by this strategy.
* @param {Object} [options.matchOptions] [`CacheQueryOptions`](https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions)
* @param {number} [options.networkTimeoutSeconds] If set, any network requests
* that fail to respond within the timeout will fallback to the cache.
*
Expand Down
3 changes: 2 additions & 1 deletion packages/workbox-strategies/src/NetworkOnly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ class NetworkOnly extends Strategy {
* to use in conjunction with this caching strategy.
* @param {Object} [options.fetchOptions] Values passed along to the
* [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)
* of all fetch() requests made by this strategy.
* of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)
* `fetch()` requests made by this strategy.
* @param {number} [options.networkTimeoutSeconds] If set, any network requests
* that fail to respond within the timeout will result in a network error.
*/
Expand Down
13 changes: 7 additions & 6 deletions packages/workbox-strategies/src/StaleWhileRevalidate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,17 @@ import './_version.js';
*/
class StaleWhileRevalidate extends Strategy {
/**
* @param {Object} options
* @param {string} options.cacheName Cache name to store and retrieve
* @param {Object} [options]
* @param {string} [options.cacheName] Cache name to store and retrieve
* requests. Defaults to cache names provided by
* [workbox-core]{@link module:workbox-core.cacheNames}.
* @param {Array<Object>} options.plugins [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}
* @param {Array<Object>} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}
* to use in conjunction with this caching strategy.
* @param {Object} options.fetchOptions Values passed along to the
* @param {Object} [options.fetchOptions] Values passed along to the
* [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)
* of all fetch() requests made by this strategy.
* @param {Object} options.matchOptions [`CacheQueryOptions`](https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions)
* of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)
* `fetch()` requests made by this strategy.
* @param {Object} [options.matchOptions] [`CacheQueryOptions`](https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions)
*/
constructor(options: StrategyOptions) {
super(options);
Expand Down
5 changes: 3 additions & 2 deletions packages/workbox-strategies/src/Strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ abstract class Strategy implements RouteHandlerObject {
* @param {Array<Object>} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}
* to use in conjunction with this caching strategy.
* @param {Object} [options.fetchOptions] Values passed along to the
* [`init`]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters}
* of all fetch() requests made by this strategy.
* [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)
* of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)
* `fetch()` requests made by this strategy.
* @param {Object} [options.matchOptions] The
* [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions}
* for any `cache.match()` or `cache.put()` calls made by this strategy.
Expand Down
4 changes: 2 additions & 2 deletions packages/workbox-strategies/src/StrategyHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ class StrategyHandler {

/**
* Fetches a given request (and invokes any applicable plugin callback
* methods) using the `fetchOptions` and `plugins` defined on the strategy
* object.
* methods) using the `fetchOptions` (for non-navigation requests) and
* `plugins` defined on the `Strategy` object.
*
* The following plugin lifecycle methods are invoked when using this method:
* - `requestWillFetch()`
Expand Down

0 comments on commit 6581108

Please sign in to comment.