Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Config options to workbox-sw setConfig() #1337

Merged
merged 3 commits into from
Mar 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions packages/workbox-precaching/_types.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ import './_version.mjs';
/**
* @typedef {Object} InstallResult
* @property {
* Array<module:workbox-precaching.PrecacheController.PrecacheEntry|string>
* Array<workbox.precaching.PrecacheEntry|string>
* } updatedEntries List of entries
* supplied for precaching that were precached.
* @property {
* Array<module:workbox-precaching.PrecacheController.PrecacheEntry|string>
* } notUpdatedEntries List of entries
* @property {Array<workbox.precaching.PrecacheEntry|string>}
* notUpdatedEntries List of entries
* supplied for precaching that were already precached.
*
* @memberof workbox.precaching
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class PrecacheController {
* @param {Array<Object>} options.plugins Plugins to be used for fetching
* and caching during install.
* @return {
* Promise<module:workbox-precaching.PrecacheController.InstallResult>}
* Promise<workbox.precaching.InstallResult>}
*/
async install(options = {}) {
if (process.env.NODE_ENV !== 'production') {
Expand Down Expand Up @@ -229,7 +229,7 @@ class PrecacheController {
* This should be called in the service worker activate event.
*
* @return {
* Promise<module:workbox-precaching.PrecacheController.CleanupResult>}
* Promise<workbox.precaching.CleanupResult>}
* Resolves with an object containing details of the deleted cache requests
* and precache revision details.
*/
Expand Down
10 changes: 5 additions & 5 deletions packages/workbox-strategies/_default.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,27 @@ import './_version.mjs';

/**
* @function workbox.strategies.cacheFirst
* @param {StrategyOptions} options
* @param {workbox.strategies.StrategyOptions} options
*/

/**
* @function workbox.strategies.cacheOnly
* @param {StrategyOptions} options
* @param {workbox.strategies.StrategyOptions} options
*/

/**
* @function workbox.strategies.networkFirst
* @param {StrategyOptions} options
* @param {workbox.strategies.StrategyOptions} options
*/

/**
* @function workbox.strategies.networkOnly
* @param {StrategyOptions} options
* @param {workbox.strategies.StrategyOptions} options
*/

/**
* @function workbox.strategies.staleWhileRevalidate
* @param {StrategyOptions} options
* @param {workbox.strategies.StrategyOptions} options
*/

const mapping = {
Expand Down
32 changes: 32 additions & 0 deletions packages/workbox-sw/_types.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
Copyright 2017 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

import './_version.mjs';

/**
* A `ModulePathCallback` function can be used to modify the modify the where
* Workbox modules are loaded.
*
* @callback ~ModulePathCallback
* @param {string} moduleName The name of the module to load (i.e.
* 'workbox-core', 'workbox-precaching' etc.).
* @param {boolean} debug When true, `dev` builds should be loaded, otherwise
* load `prod` builds.
* @return {string} This callback should return a path of module. This will
* be passed to `importScripts()`.
*
* @memberof workbox
*/
10 changes: 9 additions & 1 deletion packages/workbox-sw/controllers/WorkboxSW.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,15 @@ class WorkboxSW {
* debug build and whether to use a CDN or a specific path when importing
* other workbox-modules
*
* @param {Object=} [options]
* @param {Object} [options]
* @param {boolean} [options.debug] If true, `dev` builds are using, otherwise
* `prod` builds are used. By default, `prod` is used unless on localhost.
* @param {Function} [options.modulePathPrefix] To avoid using the CDN with
* `workbox-sw` set the path prefix of where modules should be loaded from.
* For example `modulePathPrefix: '/third_party/workbox/v3.0.0/'`.
* @param {workbox~ModulePathCallback} [options.modulePathCb] If defined,
* this callback will be responsible for determining the path of each
* workbox module.
*
* @alias workbox.setConfig
*/
Expand Down