import * as _nuxt_schema from '@nuxt/schema'; import { NetworkBlockerModuleConfig, PolicyConfig, CookiePolicyConfig, TranslationConfig } from '../dist/runtime/utils/types.js'; interface ModuleOptions { /** * c15t backend mode. * - 'hosted': consent.io managed backend * - 'offline': browser-local storage, no backend * - 'self-hosted': your own c15t backend instance */ mode: 'hosted' | 'offline' | 'self-hosted'; /** * Backend URL for hosted or self-hosted mode. * e.g. 'https://my-instance.c15t.dev' */ backendURL?: string; /** * Consent categories to present to the user. * @default ['necessary', 'measurement', 'marketing'] */ consentCategories?: Array<'necessary' | 'functionality' | 'measurement' | 'marketing' | 'experience'>; /** * Override the detected country code, bypassing geo-detection. * Useful in dev/test to simulate specific jurisdictions. * @example 'DE' — always show GDPR banner */ countryOverride?: string; /** * Enable iframe blocking. Iframes with data-category="marketing" * etc. will be blocked until consent is granted. * @default true */ iframeBlocking?: boolean; /** * Block outgoing network requests (fetch + XMLHttpRequest) that target * third-party tracking endpoints until the matching consent category is * granted. Complements iframe and script blocking by catching beacons * fired from already-loaded code. * * To register an `onRequestBlocked` callback, call `setNetworkBlocker()` * from `useC15t()` at runtime — nuxt.config values must be serializable. * * @example * ```ts * networkBlocker: { * rules: [ * { id: 'ga', domain: 'google-analytics.com', category: 'measurement' }, * { id: 'fb', domain: 'facebook.com', category: 'marketing', pathIncludes: '/tr' }, * ], * } * ``` */ networkBlocker?: NetworkBlockerModuleConfig; /** * Regional policy packs evaluated in offline mode. * Each pack defines the consent model (opt-in / opt-out / none), categories, * and UI to show for a matched country/region. c15t picks the first * matching pack using region > country > default precedence. * * Ignored when `mode !== 'offline'`. In hosted mode the backend resolves * the appropriate pack based on visitor location. * * Use `policyPackPresets` from `c15t` for built-in packs (GDPR, CCPA, * Quebec, IAB TCF, no-banner fallback) or provide custom `PolicyConfig[]`. * * @example * ```ts * import { policyPackPresets } from 'c15t' * * export default defineNuxtConfig({ * c15t: { * mode: 'offline', * policyPacks: [ * policyPackPresets.europeOptIn(), * policyPackPresets.californiaOptOut(), * policyPackPresets.worldNoBanner(), * ], * }, * }) * ``` * * @see https://c15t.com/docs/frameworks/javascript/policy-packs */ policyPacks?: PolicyConfig[]; /** * Enable Nuxt Scripts integration. Only takes effect when * @nuxt/scripts is installed. * @default true */ nuxtScripts?: boolean; /** * Cookie policy table configuration. * Drives the component and useCookiePolicy() composable. */ cookiePolicy?: CookiePolicyConfig; /** * Translation overrides for consent UI text. * Merged with c15t's built-in English translations at runtime. * * Large translation bundles are shipped via a virtual template * (not runtimeConfig) so they can be tree-shaken and don't bloat * the SSR payload. */ translations?: TranslationConfig; /** * Inject a prefetch script into that starts the consent API * request early, before the main JS bundle loads. Only applies to * hosted/self-hosted modes. * @default true */ prefetchScript?: boolean; /** * CSP nonce to apply to the injected prefetch