sw-builder
Version:
The sw-builder package automates the creation of your Application's Service Worker, which pre-caches your build. This leads to a better overall performance and enables users to access your PWA without an Internet connection.
22 lines (21 loc) • 860 B
TypeScript
import { ITemplateName } from '../shared/types.js';
/**
* Stringifies a constant variable that contains an array.
* @param constantName
* @param elements
* @returns string
*/
declare const stringifyArrayConstant: (constantName: string, elements: string[]) => string;
/**
* Builds a Service Worker Template by name.
* @param template
* @param cacheName
* @param precacheAssets
* @returns string
* @throws
* - INVALID_TEMPLATE_NAME: if the provided template name is not supported
* - NOT_A_FILE: if the path is not recognized by the OS as a file or if it doesn't exist
* - FILE_CONTENT_IS_EMPTY_OR_INVALID: if the content of the file is empty or invalid
*/
declare const buildTemplate: (template: ITemplateName, cacheName: string, precacheAssets: string[], excludeMIMETypes: string[]) => string;
export { stringifyArrayConstant, buildTemplate, };