@blotoutio/providers-blotout-consent-sdk 1.45.0

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 ADDED
@@ -0,0 +1,60 @@
1
+ declare module '@blotoutio/providers-blotout-consent-sdk'
2
+
3
+ /// <reference types="@blotoutio/providers/blotout-consent/config" />
4
+
5
+ declare global {
6
+ type ConsentPreferences = {
7
+ necessary: boolean
8
+ functional: boolean
9
+ analytics: boolean
10
+ marketing: boolean
11
+ performance: boolean
12
+ }
13
+
14
+ const registryKey: unique symbol
15
+
16
+ type UIImplementation = {
17
+ init: (params: {
18
+ destination: string
19
+ blotoutConsentAPI: BlotoutConsentAPI
20
+ config: ConsentBannerConfig
21
+ theme: BannerTheme
22
+ defaultConsentState: ConsentPreferences
23
+ contained: boolean
24
+ }) => void
25
+ }
26
+
27
+ type ConsentAPIPayload = {
28
+ consent_action:
29
+ | 'INITIAL_LOAD'
30
+ | 'GRANTED'
31
+ | 'DENIED'
32
+ | 'WITHDRAWN'
33
+ | 'GPC_OPT_OUT'
34
+ | 'CUSTOM_PREFERENCE'
35
+ | 'DSAR_DELETE_COMPLETED'
36
+ user_preferences: string // JSON stringified ConsentPreferences
37
+ tcf_string?: string | null
38
+ }
39
+
40
+ type DSARRequestType = 'DO_NOT_SELL' | 'DELETE_DATA'
41
+
42
+ type DSARPayload = {
43
+ request_type: DSARRequestType
44
+ request_data: Record<string, string>
45
+ }
46
+
47
+ type BlotoutConsentAPI = {
48
+ update: (payload: ConsentAPIPayload) => Promise<void>
49
+ submitDSAR: (payload: DSARPayload) => Promise<void>
50
+ getConsentCategories: () => Promise<ConsentPreferences | null>
51
+ }
52
+
53
+ interface Window {
54
+ [registryKey]: {
55
+ ui?: UIImplementation
56
+ blotoutConsentAPI?: BlotoutConsentAPI
57
+ showBanner?: () => void
58
+ }
59
+ }
60
+ }