import { NextConfig } from 'next'; import { RuntimeCaching, WebpackInjectManifestOptions, WebpackPartial } from 'workbox-build'; import { GenerateSWConfig } from 'workbox-webpack-plugin'; declare const defaultCache: RuntimeCaching[]; type Impossible = { [P in K]?: never; }; type SharedWorkboxOptionsKeys = keyof GenerateSWConfig & keyof WebpackInjectManifestOptions; interface WebpackOptions { /** * One or more specifiers used to exclude assets from the precache manifest. * This is interpreted following * [the same rules](https://webpack.js.org/configuration/module/#condition) * as `webpack`'s standard `exclude` option. * If not provided, the default value is `[/\/_next\/static\/.*(?> { /** * Whether to add an unconditional call to [`skipWaiting()`](https://developers.google.com/web/fundamentals/primers/service-workers/lifecycle#skip_the_waiting_phase) * to the generated service worker. If `false`, then a `message` listener will * be added instead, allowing client pages to trigger `skipWaiting()` by * calling `postMessage({type: 'SKIP_WAITING'})` on a waiting service worker. * @default true */ skipWaiting?: GenerateSWConfig["skipWaiting"]; /** * Whether or not the service worker should [start controlling](https://developers.google.com/web/fundamentals/primers/service-workers/lifecycle#clientsclaim) * any existing clients as soon as it activates. * @default true */ clientsClaim?: GenerateSWConfig["clientsClaim"]; /** * Whether or not Workbox should attempt to identify and delete any precaches * created by older, incompatible versions. * @default true */ cleanUpOutdatedCaches?: GenerateSWConfig["cleanupOutdatedCaches"]; /** * Any search parameter names that match against one of the RegExp in this * array will be removed before looking for a precache match. This is useful * if your users might request URLs that contain, for example, URL parameters * used to track the source of the traffic. If not provided, the default value * is `[/^utm_/, /^fbclid$/]`. * @default * ```js * [/^utm_/, /^fbclid$/] * ``` * */ ignoreURLParametersMatching?: GenerateSWConfig["ignoreURLParametersMatching"]; } type InjectManifestOptions = WebpackInjectManifestOptions & WebpackOptions & Impossible>; type WorkboxOptions = GenerateSWOptions | InjectManifestOptions; interface PluginOptions { /** * Cache every `` and `