- Implemented a service worker (sw.js) that handles installation, activation, and fetch events. - Added caching logic for public assets and a fallback for offline navigation. - Created unit tests (sw.test.ts) to validate service worker behavior, including asset caching, navigation handling, and activation logic. - Ensured that private API routes and third-party requests are excluded from caching.
28 lines
519 B
TypeScript
28 lines
519 B
TypeScript
// Generated by `bun init`
|
|
|
|
declare module "*.svg" {
|
|
/**
|
|
* A path to the SVG file
|
|
*/
|
|
const path: `${string}.svg`;
|
|
export = path;
|
|
}
|
|
|
|
declare module "*.css" {}
|
|
declare module "*.webmanifest" {
|
|
const content: string;
|
|
export default content;
|
|
}
|
|
declare module "*.png" {
|
|
const path: string;
|
|
export default path;
|
|
}
|
|
|
|
declare module "*.module.css" {
|
|
/**
|
|
* A record of class names to their corresponding CSS module classes
|
|
*/
|
|
const classes: { readonly [key: string]: string };
|
|
export = classes;
|
|
}
|