import * as vue from 'vue'; import { InjectionKey, Ref, PropType } from 'vue'; /** * Consent SDK Types * * DSGVO/TTDSG-konforme Typdefinitionen für das Consent Management System. */ /** * Standard-Consent-Kategorien nach IAB TCF 2.2 */ type ConsentCategory = 'essential' | 'functional' | 'analytics' | 'marketing' | 'social'; /** * Consent-Status pro Kategorie */ type ConsentCategories = Record; /** * Consent-Status pro Vendor */ type ConsentVendors = Record; /** * Aktueller Consent-Zustand */ interface ConsentState { /** Consent pro Kategorie */ categories: ConsentCategories; /** Consent pro Vendor (optional, für granulare Kontrolle) */ vendors: ConsentVendors; /** Zeitstempel der letzten Aenderung */ timestamp: string; /** SDK-Version bei Erstellung */ version: string; /** Eindeutige Consent-ID vom Backend */ consentId?: string; /** Ablaufdatum */ expiresAt?: string; /** IAB TCF String (falls aktiviert) */ tcfString?: string; } /** * Minimaler Consent-Input fuer setConsent() */ type ConsentInput = Partial | { categories?: Partial; vendors?: ConsentVendors; }; /** * UI-Position des Banners */ type BannerPosition = 'bottom' | 'top' | 'center'; /** * Banner-Layout */ type BannerLayout = 'bar' | 'modal' | 'floating'; /** * Farbschema */ type BannerTheme = 'light' | 'dark' | 'auto'; /** * UI-Konfiguration */ interface ConsentUIConfig { /** Position des Banners */ position?: BannerPosition; /** Layout-Typ */ layout?: BannerLayout; /** Farbschema */ theme?: BannerTheme; /** Pfad zu Custom CSS */ customCss?: string; /** z-index fuer Banner */ zIndex?: number; /** Scroll blockieren bei Modal */ blockScrollOnModal?: boolean; /** Custom Container-ID */ containerId?: string; } /** * Consent-Verhaltens-Konfiguration */ interface ConsentBehaviorConfig { /** Muss Nutzer interagieren? */ required?: boolean; /** "Alle ablehnen" Button sichtbar */ rejectAllVisible?: boolean; /** "Alle akzeptieren" Button sichtbar */ acceptAllVisible?: boolean; /** Einzelne Kategorien waehlbar */ granularControl?: boolean; /** Einzelne Vendors waehlbar */ vendorControl?: boolean; /** Auswahl speichern */ rememberChoice?: boolean; /** Speicherdauer in Tagen */ rememberDays?: number; /** Nur in EU anzeigen (Geo-Targeting) */ geoTargeting?: boolean; /** Erneut nachfragen nach X Tagen */ recheckAfterDays?: number; } /** * TCF 2.2 Konfiguration */ interface TCFConfig { /** TCF aktivieren */ enabled?: boolean; /** CMP ID */ cmpId?: number; /** CMP Version */ cmpVersion?: number; } /** * PWA-spezifische Konfiguration */ interface PWAConfig { /** Offline-Unterstuetzung aktivieren */ offlineSupport?: boolean; /** Bei Reconnect synchronisieren */ syncOnReconnect?: boolean; /** Cache-Strategie */ cacheStrategy?: 'stale-while-revalidate' | 'network-first' | 'cache-first'; } /** * Haupt-Konfiguration fuer ConsentManager */ interface ConsentConfig { /** API-Endpunkt fuer Consent-Backend */ apiEndpoint: string; /** Site-ID */ siteId: string; /** Sprache (ISO 639-1) */ language?: string; /** Fallback-Sprache */ fallbackLanguage?: string; /** UI-Konfiguration */ ui?: ConsentUIConfig; /** Consent-Verhaltens-Konfiguration */ consent?: ConsentBehaviorConfig; /** Aktive Kategorien */ categories?: ConsentCategory[]; /** TCF 2.2 Konfiguration */ tcf?: TCFConfig; /** PWA-Konfiguration */ pwa?: PWAConfig; /** Callback bei Consent-Aenderung */ onConsentChange?: (consent: ConsentState) => void; /** Callback wenn Banner angezeigt wird */ onBannerShow?: () => void; /** Callback wenn Banner geschlossen wird */ onBannerHide?: () => void; /** Callback bei Fehler */ onError?: (error: Error) => void; /** Debug-Modus aktivieren */ debug?: boolean; } /** * Event-Typen */ type ConsentEventType = 'init' | 'change' | 'accept_all' | 'reject_all' | 'save_selection' | 'banner_show' | 'banner_hide' | 'settings_open' | 'settings_close' | 'vendor_enable' | 'vendor_disable' | 'error'; /** * Event-Listener Callback */ type ConsentEventCallback = (data: T) => void; /** * Event-Daten fuer verschiedene Events */ type ConsentEventData = { init: ConsentState | null; change: ConsentState; accept_all: ConsentState; reject_all: ConsentState; save_selection: ConsentState; banner_show: undefined; banner_hide: undefined; settings_open: undefined; settings_close: undefined; vendor_enable: string; vendor_disable: string; error: Error; }; /** * ConsentManager - Hauptklasse fuer das Consent Management * * DSGVO/TTDSG-konformes Consent Management fuer Web, PWA und Mobile. */ /** * ConsentManager - Zentrale Klasse fuer Consent-Verwaltung */ declare class ConsentManager { private config; private storage; private scriptBlocker; private api; private events; private currentConsent; private initialized; private bannerVisible; private deviceFingerprint; constructor(config: ConsentConfig); /** * SDK initialisieren */ init(): Promise; /** * Pruefen ob Consent fuer Kategorie vorhanden */ hasConsent(category: ConsentCategory): boolean; /** * Pruefen ob Consent fuer Vendor vorhanden */ hasVendorConsent(vendorId: string): boolean; /** * Aktuellen Consent-State abrufen */ getConsent(): ConsentState | null; /** * Consent setzen */ setConsent(input: ConsentInput): Promise; /** * Alle Kategorien akzeptieren */ acceptAll(): Promise; /** * Alle nicht-essentiellen Kategorien ablehnen */ rejectAll(): Promise; /** * Alle Einwilligungen widerrufen */ revokeAll(): Promise; /** * Consent-Daten exportieren (DSGVO Art. 20) */ exportConsent(): Promise; /** * Pruefen ob Consent-Abfrage noetig */ needsConsent(): boolean; /** * Banner anzeigen */ showBanner(): void; /** * Banner verstecken */ hideBanner(): void; /** * Einstellungs-Modal oeffnen */ showSettings(): void; /** * Pruefen ob Banner sichtbar */ isBannerVisible(): boolean; /** * Event-Listener registrieren */ on(event: T, callback: ConsentEventCallback): () => void; /** * Event-Listener entfernen */ off(event: T, callback: ConsentEventCallback): void; /** * Konfiguration zusammenfuehren */ private mergeConfig; /** * Consent-Input normalisieren */ private normalizeConsentInput; /** * Consent anwenden (Skripte aktivieren/blockieren) */ private applyConsent; /** * Google Consent Mode v2 aktualisieren */ private updateGoogleConsentMode; /** * Pruefen ob Consent abgelaufen */ private isConsentExpired; /** * Event emittieren */ private emit; /** * Fehler behandeln */ private handleError; /** * Debug-Logging */ private log; /** * SDK-Version abrufen */ static getVersion(): string; } declare const CONSENT_KEY: InjectionKey; interface ConsentContext { manager: Ref; consent: Ref; isInitialized: Ref; isLoading: Ref; isBannerVisible: Ref; needsConsent: Ref; hasConsent: (category: ConsentCategory) => boolean; acceptAll: () => Promise; rejectAll: () => Promise; saveSelection: (categories: Partial) => Promise; showBanner: () => void; hideBanner: () => void; showSettings: () => void; } /** * Haupt-Composable fuer Consent-Zugriff * * @example * ```vue * * ``` */ declare function useConsent(): ConsentContext; /** * Consent-Provider einrichten (in App.vue aufrufen) * * @example * ```vue * * ``` */ declare function provideConsent(config: ConsentConfig): ConsentContext; /** * ConsentProvider - Wrapper-Komponente * * @example * ```vue * * * * ``` */ declare const ConsentProvider: vue.DefineComponent; required: true; }; }>, () => vue.VNode[] | undefined, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly; required: true; }; }>> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>; /** * ConsentGate - Zeigt Inhalt nur bei Consent * * @example * ```vue * * * * * ``` */ declare const ConsentGate: vue.DefineComponent; required: true; }; }>, () => vue.VNode[] | null | undefined, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly; required: true; }; }>> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>; /** * ConsentPlaceholder - Placeholder fuer blockierten Inhalt * * @example * ```vue * * ``` */ declare const ConsentPlaceholder: vue.DefineComponent; required: true; }; message: { type: StringConstructor; default: string; }; buttonText: { type: StringConstructor; default: string; }; }>, () => vue.VNode, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly; required: true; }; message: { type: StringConstructor; default: string; }; buttonText: { type: StringConstructor; default: string; }; }>> & Readonly<{}>, { message: string; buttonText: string; }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>; /** * ConsentBanner - Cookie-Banner Komponente * * @example * ```vue * * * * ``` */ declare const ConsentBanner: vue.DefineComponent<{}, () => vue.VNode | vue.VNode[] | null, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>; /** * Vue Plugin fuer globale Installation * * @example * ```ts * import { createApp } from 'vue'; * import { ConsentPlugin } from '@breakpilot/consent-sdk/vue'; * * const app = createApp(App); * app.use(ConsentPlugin, { * apiEndpoint: 'https://consent.example.com/api/v1', * siteId: 'site_abc123', * }); * ``` */ declare const ConsentPlugin: { install(app: { provide: (key: symbol | string, value: unknown) => void; }, config: ConsentConfig): void; }; export { CONSENT_KEY, ConsentBanner, type ConsentContext, ConsentGate, ConsentPlaceholder, ConsentPlugin, ConsentProvider, provideConsent, useConsent };