import * as _nuxt_schema from '@nuxt/schema'; import { CookieSerializeOptions } from 'cookie-es'; import { SkewAdapter } from '../dist/runtime/adapters/types.js'; import { NuxtSkewProtectionRuntimeConfig } from '../dist/runtime/types.js'; interface ModuleOptions { /** * Storage configuration for versioned assets */ storage?: (Record & { driver: string; }); /** * How long to retain old versions (in days) * @default 30 */ retentionDays?: number; /** * Maximum number of versions to retain * @default 10 */ maxNumberOfVersions?: number; /** * Strategy for checking for version updates * - 'polling': Nuxt's native polling of builds/latest.json (default) * - 'sse': Use Server-Sent Events for real-time updates * - 'ws': Use WebSocket (requires cloudflare-durable preset or experimental.websocket) * - SkewAdapter: Third-party WebSocket provider (Pusher, Ably) * @default Static: 'polling', Node: 'sse', Cloudflare: 'ws' */ updateStrategy?: 'polling' | 'sse' | 'ws' | SkewAdapter; /** * Path prefix for the module's runtime endpoints (`/ws`, `/sse`, `/health`, * `/route`, `/subscribe-stats`, `/admin/stats`). * * Defaults to `/__skew`. Set a sub-path when the app is path-routed behind a * worker that only owns part of the host (e.g. a Pro dashboard mounted under * `/pro/*` on a host shared with a marketing app): use `/pro/__skew` so the * websocket/health requests resolve to this worker's deployment instead of * leaking to the sibling app that owns the host route. * * This is the full public path, including `app.baseURL`. When unset, it is * auto-detected: `app.baseURL: '/app/'` gives `/app/__skew`. * @default '/__skew' */ basePath?: string; /** * Cookie configuration for storing deployment version */ cookie?: false | Omit & { /** * Cookie name for storing deployment version. * * Defaults to `__nkpv`, suffixed with the mount point for a path-routed app * (e.g. `/pro/*` → `__nkpv_pro`) so apps sharing a host don't clobber each * other's cookie. Set this to override the derived name. * @default '__nkpv' (or `__nkpv_` when path-routed) */ name?: string; }; /** * Bundle old deployment assets to support users on previous versions. * When enabled, old build assets are stored and served to users who haven't refreshed. * @default true, or false when native Vercel Skew Protection is active * @note Automatically disabled when using a CDN URL or native Vercel Skew Protection */ bundleAssets?: boolean; /** * Enable or disable the module * @default true */ enabled: boolean; /** * Enable debug logging * @default false */ debug?: boolean; /** * Enable connection tracking to monitor active SSE/WebSocket connections * Exposes useActiveConnections() composable with real-time stats * @default false */ connectionTracking?: boolean; /** * Track which routes users are currently viewing * Requires connectionTracking to be enabled * @default false */ routeTracking?: boolean; /** * Track IP addresses of connected users * Requires connectionTracking to be enabled * Privacy note: IPs are only stored in memory and exposed via stats * @default false */ ipTracking?: boolean; /** * How to handle outdated chunks. * - 'prompt': Show notification, let user decide (default) * - 'immediate': Reload immediately when chunks are invalidated * - 'idle': Reload after 60 seconds without user input, or when the tab is hidden * - false: Disable automatic handling, use hooks for custom logic * @default 'prompt' */ reloadStrategy?: 'prompt' | 'immediate' | 'idle' | false; /** * Coordinate version updates across browser tabs via BroadcastChannel. * When enabled, a version update detected in one tab notifies all others. * @default true */ multiTab?: boolean; } interface ModulePublicRuntimeConfig { skewProtection: NuxtSkewProtectionRuntimeConfig; } declare const _default: _nuxt_schema.NuxtModule; export { _default as default }; export type { ModuleOptions, ModulePublicRuntimeConfig };