diff --git a/src/lib/pwa-register.d.ts b/src/lib/pwa-register.d.ts deleted file mode 100644 index ac20d3c..0000000 --- a/src/lib/pwa-register.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -declare module 'virtual:pwa-register/vue' { - import type { Ref } from 'vue' - - export interface RegisterSWOptions { - immediate?: boolean - onNeedRefresh?: () => void - onOfflineReady?: () => void - onRegistered?: (registration: ServiceWorkerRegistration | undefined) => void - onRegisterError?: (error: any) => void - } - - export function useRegisterSW(options?: RegisterSWOptions): { - needRefresh: Ref - offlineReady: Ref - updateServiceWorker: (reloadPage?: boolean) => Promise - } - } \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 7ac3815..62ba0f0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,7 +16,7 @@ "allowSyntheticDefaultImports": true, "sourceMap": true, "baseUrl": "src", - "types": ["vite/client"], + "types": ["vite/client", "vite-plugin-pwa/vue"], "lib": ["esnext", "dom", "dom.iterable", "scripthost"] }, "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "tests/**/*.ts", "tests/**/*.tsx"], diff --git a/vite.config.ts b/vite.config.ts index 0853646..1f35f1a 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -33,7 +33,7 @@ export default defineConfig({ VitePWA({ includeAssets: ["Logo.svg", "favicon.ico", "robots.txt", "apple-touch-icon.png"], workbox: { - globPatterns: ['**/*.{js,css,html,ico,png,svg}'] + globPatterns: ["**/*.{js,css,html,ico,png,svg}"] }, manifest: { name: projInfo.title,