cookiebanner-finally
Version:
Headless cookie banner library for Next.js with shadcn philosophy
42 lines (38 loc) • 936 B
text/typescript
/**
* Cookie consent categories
*/
export enum ConsentCategory {
Necessary = 'necessary',
Preferences = 'preferences',
Analytics = 'analytics',
Marketing = 'marketing'
}
/**
* Cookie consent preferences
*/
export interface ConsentPreferences {
[]: boolean; // Always true
[]: boolean;
[]: boolean;
[]: boolean;
lastUpdated?: string;
}
/**
* Default consent preferences
*/
export const DEFAULT_CONSENT_PREFERENCES: ConsentPreferences = {
[]: true, // Necessary cookies are always allowed
[]: false,
[]: false,
[]: false
};
/**
* Script definition
*/
export interface Script {
id: string;
category: ConsentCategory;
src?: string;
content?: string;
attributes?: Record<string, string>;
}