/** * Types for the PWA install/update module. */ /** * The `beforeinstallprompt` event fired by Chromium browsers when a PWA meets * the install criteria. Not part of the standard DOM lib types, so declared here. */ export interface BeforeInstallPromptEvent extends Event { readonly platforms: string[]; readonly userChoice: Promise<{ outcome: "accepted" | "dismissed"; platform: string; }>; prompt(): Promise; } /** Result of an install prompt request. */ export type InstallOutcome = "accepted" | "dismissed" | "unavailable"; /** * How the app can (or cannot) be installed in the current context: * - `installable` — a deferred `beforeinstallprompt` is available (Chromium) * - `ios` — iOS Safari: no programmatic prompt, needs manual "Add to Home Screen" * - `installed` — already running as an installed/standalone app * - `unsupported` — no install path available (yet) */ export type InstallPlatform = "installable" | "ios" | "installed" | "unsupported"; /** * Text overrides for the built-in `` dialog. Defaults are * German and deliberately terse (mobile). Empty string hides a content line. */ export interface PwaUpdatePromptTexts { /** Dialog title. Default: "Neue Version verfügbar". */ title?: string; /** * First content line. Default: * "Aktualisieren lädt die Seite neu (aktuelle Eingaben gehen verloren)." */ hint?: string; /** * Second content line. Default: * "Mit „Später“ kommt die neue Version beim nächsten Start." */ detail?: string; /** Confirm button (keep short — footer buttons wrap on mobile). Default: "Aktualisieren". */ confirm?: string; /** Cancel button. Default: "Später". */ later?: string; } /** * App configuration for the PWA update flow * (`startInit({ pwaUpdateConfigParam })`). */ export interface PwaUpdateConfig extends PwaUpdateOptions { /** * Render the built-in update dialog from the shell. `false` hides it (the * update service itself keeps running — e.g. for a fully custom UI via * `_renderUpdatePrompt()`). Default: true. */ enabled?: boolean; /** Text overrides for the built-in dialog. */ texts?: PwaUpdatePromptTexts; } /** Options for `pwaUpdateService.activate()`. */ export interface PwaUpdateOptions { /** * Minutes between proactive service-worker update checks. `0` disables the * periodic check (the start and visibility triggers remain). Default: 60. */ checkIntervalMinutes?: number; /** * Apply an update that is already **waiting when the app starts** without * asking — the one moment guaranteed free of user input state (costs a * single immediate reload before any interaction). Updates discovered * later in the session always go through `updateAvailable` + explicit * `applyUpdate()` instead. Default: true. */ autoApplyOnStart?: boolean; } //# sourceMappingURL=types.d.ts.map