@types/workbox-sw
Version:
TypeScript definitions for workbox-sw
61 lines (50 loc) • 3.59 kB
Markdown
# Installation
> `npm install --save /workbox-sw`
# Summary
This package contains type definitions for workbox-sw (https://github.com/GoogleChrome/workbox).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/workbox-sw.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/workbox-sw/index.d.ts)
````ts
import * as WorkboxBackgroundSync from "workbox-background-sync";
import * as WorkboxBroadcastUpdate from "workbox-broadcast-update";
import * as WorkboxCacheableResponse from "workbox-cacheable-response";
import * as WorkboxCore from "workbox-core";
import * as WorkboxExpiration from "workbox-expiration";
import * as WorkboxGoogleAnalytics from "workbox-google-analytics";
import * as WorkboxNavigationPreload from "workbox-navigation-preload";
import * as WorkboxPrecaching from "workbox-precaching";
import * as WorkboxRangeRequests from "workbox-range-requests";
import * as WorkboxRouting from "workbox-routing";
import * as WorkboxStrategies from "workbox-strategies";
import * as WorkboxStreams from "workbox-streams";
declare global {
namespace workbox {
const backgroundSync: typeof WorkboxBackgroundSync;
const broadcastUpdate: typeof WorkboxBroadcastUpdate;
const cacheableResponse: typeof WorkboxCacheableResponse;
const core: typeof WorkboxCore;
const expiration: typeof WorkboxExpiration;
const googleAnalytics: typeof WorkboxGoogleAnalytics;
const navigationPreload: typeof WorkboxNavigationPreload;
const precaching: typeof WorkboxPrecaching;
const rangeRequests: typeof WorkboxRangeRequests;
const routing: typeof WorkboxRouting;
const strategies: typeof WorkboxStrategies;
const streams: typeof WorkboxStreams;
function loadModule(moduleName: string): void;
function setConfig(options?: WorkboxOptions): void;
interface WorkboxOptions {
debug?: boolean | undefined;
modulePathCb?: ModulePathCallback | undefined;
modulePathPrefix?: string | undefined;
}
type ModulePathCallback = (moduleName: string, debug: boolean) => string;
}
}
````
### Additional Details
* Last updated: Tue, 07 Nov 2023 20:08:00 GMT
* Dependencies: [/workbox-background-sync](https://npmjs.com/package/@types/workbox-background-sync), [/workbox-broadcast-update](https://npmjs.com/package/@types/workbox-broadcast-update), [/workbox-build](https://npmjs.com/package/@types/workbox-build), [/workbox-cacheable-response](https://npmjs.com/package/@types/workbox-cacheable-response), [/workbox-core](https://npmjs.com/package/@types/workbox-core), [/workbox-expiration](https://npmjs.com/package/@types/workbox-expiration), [/workbox-google-analytics](https://npmjs.com/package/@types/workbox-google-analytics), [/workbox-navigation-preload](https://npmjs.com/package/@types/workbox-navigation-preload), [/workbox-precaching](https://npmjs.com/package/@types/workbox-precaching), [/workbox-range-requests](https://npmjs.com/package/@types/workbox-range-requests), [/workbox-routing](https://npmjs.com/package/@types/workbox-routing), [/workbox-strategies](https://npmjs.com/package/@types/workbox-strategies), [/workbox-streams](https://npmjs.com/package/@types/workbox-streams)
# Credits
These definitions were written by [Frederik Wessberg](https://github.com/wessberg), and [Jason Kwok](https://github.com/JasonHK).