lineas-romero-cookies-consent 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +41 -0
- package/package.json +5 -2
package/index.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// index.d.ts
|
|
2
|
+
|
|
3
|
+
export interface CookieCategory {
|
|
4
|
+
id: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
enabled?: boolean;
|
|
8
|
+
readonly?: boolean;
|
|
9
|
+
cookiePatterns?: string[];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface UserPreferences {
|
|
13
|
+
[categoryId: string]: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface CookieConsentConfig {
|
|
17
|
+
siteName?: string;
|
|
18
|
+
cookieName?: string;
|
|
19
|
+
cookieExpiresDays?: number;
|
|
20
|
+
autoClear?: boolean;
|
|
21
|
+
categories: CookieCategory[];
|
|
22
|
+
onAccept?: (preferences: UserPreferences) => void;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface ConsentAPI {
|
|
26
|
+
getConfig(): CookieConsentConfig;
|
|
27
|
+
hasStoredConsent(): boolean;
|
|
28
|
+
getPreferences(): UserPreferences;
|
|
29
|
+
acceptAll(): UserPreferences;
|
|
30
|
+
rejectAll(): UserPreferences;
|
|
31
|
+
setPreferences(preferences: UserPreferences): UserPreferences;
|
|
32
|
+
clearCategoryCookies(categoryId: string): void;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Función principal
|
|
36
|
+
export function initCookieConsent(config: CookieConsentConfig): ConsentAPI;
|
|
37
|
+
|
|
38
|
+
// Presets exportados
|
|
39
|
+
export const nextJsConfig: CookieConsentConfig;
|
|
40
|
+
export const wpApartamentosConfig: CookieConsentConfig;
|
|
41
|
+
export const visitLaGraciosaConfig: CookieConsentConfig;
|
package/package.json
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lineas-romero-cookies-consent",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Gestor en vanilla JS + CSS para granular las cookies de las páginas de LR, Apartamentos y Visit La Graciosa de manera manual.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
|
-
"dist"
|
|
7
|
+
"dist",
|
|
8
|
+
"index.d.ts"
|
|
8
9
|
],
|
|
10
|
+
"types": "./index.d.ts",
|
|
9
11
|
"main": "./dist/lineas-romero-cookies-consent.umd.cjs",
|
|
10
12
|
"module": "./dist/lineas-romero-cookies-consent.js",
|
|
11
13
|
"exports": {
|
|
12
14
|
".": {
|
|
15
|
+
"types": "./index.d.ts",
|
|
13
16
|
"import": "./dist/lineas-romero-cookies-consent.js",
|
|
14
17
|
"require": "./dist/lineas-romero-cookies-consent.umd.cjs"
|
|
15
18
|
},
|