| 1 | // `vite-plugin-pwa` is an optional peer dependency (only needed when the `pwa` |
| 2 | // option is enabled), so declare the subset of `virtual:pwa-register` we use |
| 3 | // inline instead of `/// <reference types="vite-plugin-pwa/client" />`. When |
| 4 | // PWA is off, the CLI serves a no-op stub for this module. |
| 5 | declare module 'virtual:pwa-register' { |
| 6 | export interface RegisterSWOptions { |
| 7 | immediate?: boolean |
| 8 | onNeedRefresh?: () => void |
| 9 | onOfflineReady?: () => void |
| 10 | onRegisteredSW?: (swScriptUrl: string, registration: ServiceWorkerRegistration | undefined) => void |
| 11 | onRegisterError?: (error: any) => void |
| 12 | } |
| 13 | |
| 14 | export function registerSW(options?: RegisterSWOptions): (reloadPage?: boolean) => Promise<void> |
| 15 | } |
| 16 | |
| 17 | declare module '*.md' { |
| 18 | // with unplugin-vue-markdown, markdowns can be treat as Vue components |
| 19 | import type { ComponentOptions } from 'vue' |
| 20 | |
| 21 | const component: ComponentOptions |
| 22 | export default component |
| 23 | } |
| 24 | |
| 25 | declare module 'mermaid/dist/mermaid.esm.mjs' { |
| 26 | import Mermaid from 'mermaid/dist/mermaid.d.ts' |
| 27 | |
| 28 | export default Mermaid |
| 29 | } |
| 30 |