acronweb-cookies
Version:
A modern, GDPR-compliant cookie consent plugin for React and Next.js applications
69 lines • 1.98 kB
TypeScript
export interface CookieConsentProps {
language?: 'el' | 'en';
firebaseConfig?: FirebaseConfig;
onAccept?: (consent: boolean) => void;
onDecline?: () => void;
customContent?: {
el?: Partial<ContentType>;
en?: Partial<ContentType>;
};
privacyUrl?: string;
showPoweredBy?: boolean;
theme?: 'light' | 'dark' | 'auto';
position?: 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right' | 'center';
autoHide?: boolean;
autoHideDelay?: number;
}
export interface ContentType {
title: string;
description: string;
accept: string;
learnMore: string;
decline: string;
}
export interface FirebaseConfig {
apiKey: string;
authDomain: string;
projectId: string;
storageBucket: string;
messagingSenderId: string;
appId: string;
}
export interface UserConsent {
id: string;
consent: boolean;
timestamp: Date;
language: string;
userAgent: string;
ipAddress?: string;
country?: string;
city?: string;
}
export interface CookieSettings {
necessary: boolean;
analytics: boolean;
marketing: boolean;
preferences: boolean;
}
export interface CookieConsentState {
isVisible: boolean;
isLoaded: boolean;
isMobile: boolean;
consent: boolean | null;
settings: CookieSettings;
}
export interface CookieManager {
setConsent: (consent: boolean, settings?: Partial<CookieSettings>) => void;
getConsent: () => boolean | null;
clearConsent: () => void;
setCookie: (name: string, value: string, options?: any) => void;
getCookie: (name: string) => string | undefined;
removeCookie: (name: string) => void;
saveToFirebase: (consent: UserConsent) => Promise<void>;
}
export interface FirebaseService {
initialize: (config: FirebaseConfig) => void;
saveConsent: (consent: UserConsent) => Promise<void>;
getConsent: (userId: string) => Promise<UserConsent | null>;
}
//# sourceMappingURL=index.d.ts.map