@didomi/react-native 1.0.0 → 1.4.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.
@@ -1,315 +1,355 @@
1
1
  import { DidomiEventType } from './DidomiTypes';
2
2
  export declare const Didomi: {
3
3
  /**
4
- Initialize the Didomi SDK
5
-
6
- @param apiKey: Public API key of the organization from the Didomi Console.
7
- @param localConfigurationPath: Path to your local config file. Defaults to didomi_config.json if null.
8
- @param remoteConfigurationURL: URL to a remote configuration file to load during initialization. This parameter is not used yet. Set it to null for now.
9
- @param providerId: Your provider ID (if any).
10
- @param disableDidomiRemoteConfig: Whether to disable loading the remove configuration from the Didomi config. Keep this to "false" for loading configuration from the Didomi Console.
11
- @param languageCode: Language in which the consent UI should be displayed. By default, the consent UI is displayed in the language configured in the device settings. This property allows you to override the default setting and specify a language to display the UI in. String containing the language code e.g.: "es", "fr", etc.
12
- @param noticeId: Notice id for the remote configuration.
13
- */
4
+ * Initialize the Didomi SDK
5
+ *
6
+ * @param apiKey: Public API key of the organization from the Didomi Console.
7
+ * @param localConfigurationPath: Path to your local config file. Defaults to didomi_config.json if null.
8
+ * @param remoteConfigurationURL: URL to a remote configuration file to load during initialization. This parameter is not used yet. Set it to null for now.
9
+ * @param providerId: Your provider ID (if any).
10
+ * @param disableDidomiRemoteConfig: Whether to disable loading the remove configuration from the Didomi config. Keep this to "false" for loading configuration from the Didomi Console.
11
+ * @param languageCode: Language in which the consent UI should be displayed. By default, the consent UI is displayed in the language configured in the device settings. This property allows you to override the default setting and specify a language to display the UI in. String containing the language code e.g.: "es", "fr", etc.
12
+ * @param noticeId: Notice id for the remote configuration.
13
+ */
14
14
  initialize: (apiKey: string, localConfigurationPath?: string | undefined, remoteConfigurationUrl?: string | undefined, providerId?: string | undefined, disableDidomiRemoteConfig?: boolean, languageCode?: string | undefined, noticeId?: string | undefined) => void;
15
15
  /**
16
- -Provide the objects required to display UI elements
16
+ * Listen to SDK ready state
17
+ * */
18
+ onReady: () => Promise<void>;
19
+ /**
20
+ * Listen to SDK errors
21
+ * */
22
+ onError: () => Promise<any>;
23
+ /**
24
+ Provide the objects required to display UI elements
17
25
  */
18
26
  setupUI: () => Promise<void>;
19
27
  /**
20
- Set the minimum level of messages to log
21
-
22
- Messages with a level below `minLevel` will not be logged.
23
- Levels are standard levels from `OSLogType` (https://developer.apple.com/documentation/os/logging/choosing_the_log_level_for_a_message):
24
- - OSLogType.info (1)
25
- - OSLogType.debug (2)
26
- - OSLogType.error (16)
27
- - OSLogType.fault (17)
28
-
29
- We recommend setting `OSLogType.error` (16) in production
30
-
31
- @param minLevel: Minimum level of messages to log
32
- */
28
+ * Set the minimum level of messages to log
29
+ * You can decide what level of messages should be logged by the SDK by calling the setLogLevel function before initialize
30
+ *
31
+ * Messages with a level below `minLevel` will not be logged.
32
+ *
33
+ * For iOS:
34
+ * Levels are standard levels from `OSLogType` (https://developer.apple.com/documentation/os/logging/choosing_the_log_level_for_a_message):
35
+ * - OSLogType.info (1)
36
+ * - OSLogType.debug (2)
37
+ * - OSLogType.error (16)
38
+ * - OSLogType.fault (17)
39
+ *
40
+ * We recommend setting `OSLogType.error` (16) in production
41
+ *
42
+ * For Android:
43
+ * Use the standard log levels supported by android.util.Log: VERBOSE, DEBUG, INFO, WARN and ERROR.
44
+ * (https://developer.android.com/reference/android/util/Log#constants_1)
45
+ *
46
+ * We recommend setting `Log.INFO` (4) in production
47
+ *
48
+ * @param minLevel: Minimum level of messages to log
49
+ */
33
50
  setLogLevel: (level: number) => Promise<number>;
34
51
  /**
35
- Add an event listener
36
- @param listener:
37
- */
52
+ * Add an event listener
53
+ * @param listener:
54
+ */
38
55
  addEventListener: (eventType: DidomiEventType, callback: (data: any) => void) => void;
39
56
  /**
40
- Remove an event listener
41
- @param listener:
42
- */
57
+ * Remove an event listener
58
+ * @param listener:
59
+ */
43
60
  removeEventListener: (eventType: DidomiEventType, callback: (data: any) => void) => void;
44
61
  /**
45
- Remove all event listeners
46
- */
62
+ * Remove all event listeners
63
+ */
47
64
  removeAllEventListeners: () => void;
48
65
  /**
49
- Method used to get an array of disabled purposes.
50
- @returns: array of disabled purposes.
51
- */
66
+ * Method used to get an array of disabled purposes.
67
+ * @returns: array of disabled purposes.
68
+ */
52
69
  getDisabledPurposes: () => Promise<any[]>;
53
70
  /**
54
- Method used to get a set of disabled purpose IDs.
55
- @returns: set that contains the IDs of disabled purposes.
56
- */
71
+ * Method used to get a set of disabled purpose IDs.
72
+ * @returns: set that contains the IDs of disabled purposes.
73
+ */
57
74
  getDisabledPurposeIds: () => Promise<any[]>;
58
75
  /**
59
- Method used to get an array of disabled vendors.
60
- @returns: array of disabled vendors.
61
- */
76
+ * Method used to get an array of disabled vendors.
77
+ * @returns: array of disabled vendors.
78
+ */
62
79
  getDisabledVendors: () => Promise<any[]>;
63
80
  /**
64
- Method used to get a set of disabled vendor IDs.
65
- @returns: set that contains the IDs of disabled vendors.
66
- */
81
+ * Method used to get a set of disabled vendor IDs.
82
+ * @returns: set that contains the IDs of disabled vendors.
83
+ */
67
84
  getDisabledVendorIds: () => Promise<any[]>;
68
85
  /**
69
- Method used to get an array of enabled purposes.
70
- @returns: array of enabled purposes.
71
- */
86
+ * Method used to get an array of enabled purposes.
87
+ * @returns: array of enabled purposes.
88
+ */
72
89
  getEnabledPurposes: () => Promise<any[]>;
73
90
  /**
74
- Method used to get a set of enabled purpose IDs.
75
- @returns: set that contains the IDs of enabled purposes.
76
- */
91
+ * Method used to get a set of enabled purpose IDs.
92
+ * @returns: set that contains the IDs of enabled purposes.
93
+ */
77
94
  getEnabledPurposeIds: () => Promise<any[]>;
78
95
  /**
79
- Method used to get an array of enabled vendors.
80
- @returns: array of enabled vendors.
81
- */
96
+ * Method used to get an array of enabled vendors.
97
+ * @returns: array of enabled vendors.
98
+ */
82
99
  getEnabledVendors: () => Promise<any[]>;
83
100
  /**
84
- Method used to get a set of enabled vendor IDs.
85
- @returns: set that contains the IDs of enabled vendors.
86
- */
101
+ * Method used to get a set of enabled vendor IDs.
102
+ * @returns: set that contains the IDs of enabled vendors.
103
+ */
87
104
  getEnabledVendorIds: () => Promise<any[]>;
88
105
  /**
89
- Get JavaScript to embed into a WebView to pass the consent status from the app
90
- to the Didomi Web SDK embedded into the WebView
91
- Inject the returned JavaScript into a WebView
92
- @param extra: Extra JavaScript to inject in the returned code
93
- @returns: JavaScript code to inject in a WebView
94
- */
95
- getJavaScriptForWebView: () => Promise<string>;
106
+ * Get JavaScript to embed into a WebView to pass the consent status from the app
107
+ * to the Didomi Web SDK embedded into the WebView
108
+ * Inject the returned JavaScript into a WebView
109
+ * @param extra: Extra JavaScript to inject in the returned code
110
+ * @returns: JavaScript code to inject in a WebView
111
+ */
112
+ getJavaScriptForWebView: (extra?: string | null | undefined) => Promise<string>;
96
113
  getQueryStringForWebView: () => Promise<string>;
97
114
  /**
98
- Method used to get a Purpose based on its ID.
99
- @param purposeId: purpose ID used in the search.
100
- @returns: purpose found in the array.
101
- */
102
- getPurpose: (purposeId: string) => Promise<any[]>;
115
+ * Method used to get a Purpose based on its ID.
116
+ * @param purposeId: purpose ID used in the search.
117
+ * @returns: purpose found in the array.
118
+ */
119
+ getPurpose: (purposeId: string) => Promise<any>;
103
120
  /**
104
- Method used to get an array of required purposes.
105
-
106
- @returns: array of required purposes.
107
- */
121
+ * Method used to get an array of required purposes.
122
+ *
123
+ * @returns: array of required purposes.
124
+ */
108
125
  getRequiredPurposes: () => Promise<any[]>;
109
126
  /**
110
- Get the configured purpose IDs
111
- @returns: set of purpose IDs.
112
- */
127
+ * Get the configured purpose IDs
128
+ * @returns: set of purpose IDs.
129
+ */
113
130
  getRequiredPurposeIds: () => Promise<any[]>;
114
131
  /**
115
- Method used to get an array of required vendors.
116
- @returns: array of required vendors.
117
- */
132
+ * Method used to get an array of required vendors.
133
+ * @returns: array of required vendors.
134
+ */
118
135
  getRequiredVendors: () => Promise<any[]>;
119
136
  /**
120
- Get the configured vendor IDs
121
- @returns: set of vendor IDs.
122
- */
137
+ * Get the configured vendor IDs
138
+ * @returns: set of vendor IDs.
139
+ */
123
140
  getRequiredVendorIds: () => Promise<any[]>;
124
141
  /**
125
- Method used to get a dictionary/map in the form of { "en": "Key in English", "fr": "Key in French." }
126
- for a given key.
127
- @param key: used to find its corresponding value in the dictionary/map.
128
- @returns: dictionary containing the different translations for a given key.
129
- */
142
+ * Method used to get a dictionary/map in the form of { "en": "Key in English", "fr": "Key in French." }
143
+ * for a given key.
144
+ * @param key: used to find its corresponding value in the dictionary/map.
145
+ * @returns: dictionary containing the different translations for a given key.
146
+ */
130
147
  getText: (key: string) => Promise<any[]>;
131
148
  /**
132
- Method used to get a translated text based on the key being passed.
133
- The language and the source of this translated text will depend on the availability of the translation for the specific key.
134
- The language being used will be either the selected language of the SDK (based on device Locale and other parameters) or the language specified by app developers as the default language being used by the SDK. The source can be either the `didomi_config.json` file which can be either local or remote, or the `didomi_master_config.json` file which is bundled within the SDK.
135
-
136
- These are the attempts performed by the SDK to try to find a translation for the specific key:
137
- - Get translated value in user locale (selected language) from `didomi_config.json` (either local or remote).
138
- - Get translated value in default locale (from the config) from `didomi_config.json` (either local or remote).
139
- - Get translated value in user locale (selected language) from `didomi_master_config.json` (bundled within the Didomi SDK).
140
- - Get translated value in default locale (from the config) from `didomi_master_config.json` (bundled within the Didomi SDK).
141
-
142
- If no translation can be found after these 4 attempts, the key will be returned.
143
-
144
- App developers can provide these translated texts through the `didomi_config.json` file (locally or remotely) in 3 different ways:
145
- - Custom texts for the consent notice: https://developers.didomi.io/cmp/mobile-sdk/consent-notice/customize-the-notice#texts
146
- - Custom texts for the preferences: https://developers.didomi.io/cmp/mobile-sdk/consent-notice/customize-the-preferences-popup#text
147
- - Custom texts for custom notices: https://developers.didomi.io/cmp/mobile-sdk/consent-notice/customize-the-theme#translatable-texts-for-custom-notices
148
-
149
- @param key: used to find its corresponding value in one of the different sources.
150
- @returns: a translated string if a translation was found, the same key that was passed otherwise.
151
- */
149
+ * Method used to get a translated text based on the key being passed.
150
+ * The language and the source of this translated text will depend on the availability of the translation for the specific key.
151
+ * The language being used will be either the selected language of the SDK (based on device Locale and other parameters) or the language specified by app developers as the default language being used by the SDK. The source can be either the `didomi_config.json` file which can be either local or remote, or the `didomi_master_config.json` file which is bundled within the SDK.
152
+ *
153
+ * These are the attempts performed by the SDK to try to find a translation for the specific key:
154
+ * - Get translated value in user locale (selected language) from `didomi_config.json` (either local or remote).
155
+ * - Get translated value in default locale (from the config) from `didomi_config.json` (either local or remote).
156
+ * - Get translated value in user locale (selected language) from `didomi_master_config.json` (bundled within the Didomi SDK).
157
+ * - Get translated value in default locale (from the config) from `didomi_master_config.json` (bundled within the Didomi SDK).
158
+ *
159
+ * If no translation can be found after these 4 attempts, the key will be returned.
160
+ *
161
+ * App developers can provide these translated texts through the `didomi_config.json` file (locally or remotely) in 3 different ways:
162
+ * - Custom texts for the consent notice: https://developers.didomi.io/cmp/mobile-sdk/consent-notice/customize-the-notice#texts
163
+ * - Custom texts for the preferences: https://developers.didomi.io/cmp/mobile-sdk/consent-notice/customize-the-preferences-popup#text
164
+ * - Custom texts for custom notices: https://developers.didomi.io/cmp/mobile-sdk/consent-notice/customize-the-theme#translatable-texts-for-custom-notices
165
+ *
166
+ * @param key: used to find its corresponding value in one of the different sources.
167
+ * @returns: a translated string if a translation was found, the same key that was passed otherwise.
168
+ */
152
169
  getTranslatedText: (key: string) => Promise<string>;
153
170
  /**
154
- Get the user consent status for a specific purpose
155
- @param purposeId: The purpose ID to check consent for
156
- @returns: The user consent status for the specified purpose
157
- */
171
+ * Get the user consent status for a specific purpose
172
+ * @param purposeId: The purpose ID to check consent for
173
+ * @returns: The user consent status for the specified purpose
174
+ * @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
175
+ * getUserStatus().getPurposes().getConsent().getEnabled() or
176
+ * getUserStatus().getPurposes().getConsent().getDisabled().
177
+ */
158
178
  getUserConsentStatusForPurpose: (purposeId: string) => Promise<boolean>;
159
179
  /**
160
- Get the user consent status for a specific vendor
161
- @param vendorId: The vendor ID to check consent for
162
- @returns: The user consent status for the specified vendor
163
- */
180
+ * Get the user consent status for a specific vendor
181
+ * @param vendorId: The vendor ID to check consent for
182
+ * @returns: The user consent status for the specified vendor
183
+ * @deprecated use {@link #getUserStatus()} instead. Search the vendorId in
184
+ * getUserStatus().getVendors().getConsent().getEnabled() or
185
+ * getUserStatus().getVendors().getConsent().getDisabled().
186
+ */
164
187
  getUserConsentStatusForVendor: (vendorId: string) => Promise<boolean>;
165
188
  /**
166
- Get the user consent status for a specific vendor and all its purposes
167
- @param vendorId: The ID of the vendor
168
- @returns: The user consent status corresponding to the specified vendor and all its required purposes.
169
- */
189
+ * Get the user consent status for a specific vendor and all its purposes
190
+ * @param vendorId: The ID of the vendor
191
+ * @returns: The user consent status corresponding to the specified vendor and all its required purposes.
192
+ * @deprecated use {@link #getUserStatus()} instead. The result of this method has been replaced
193
+ * by getUserStatus().getVendors().getGlobalConsent().getEnabled() or
194
+ * getUserStatus().getVendors().getGlobalConsent().getDisabled().
195
+ */
170
196
  getUserConsentStatusForVendorAndRequiredPurposes: (vendorId: string) => Promise<boolean>;
171
197
  /**
172
- Get the user legitimate interest status for a specific purpose.
173
- @param purposeId: purpose ID.
174
- @returns: LI status of a purpose.
175
- */
198
+ * Get the user legitimate interest status for a specific purpose.
199
+ * @param purposeId: purpose ID.
200
+ * @returns: LI status of a purpose.
201
+ * @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
202
+ * getUserStatus().getPurposes().getLegitimateInterest().getEnabled() or
203
+ * getUserStatus().getPurposes().getLegitimateInterest().getDisabled().
204
+ */
176
205
  getUserLegitimateInterestStatusForPurpose: (purposeId: string) => Promise<boolean>;
177
206
  /**
178
- Get the user legitimate interest status for a specific vendor.
179
- @param vendorId: vendor ID.
180
- @returns: LI status of a vendor.
181
- */
207
+ * Get the user legitimate interest status for a specific vendor.
208
+ * @param vendorId: vendor ID.
209
+ * @returns: LI status of a vendor.
210
+ * @deprecated use {@link #getUserStatus()} instead. Search the vendorId in
211
+ * getUserStatus().getVendors().getLegitimateInterest().getEnabled() or
212
+ * getUserStatus().getVendors().getLegitimateInterest().getDisabled().
213
+ */
182
214
  getUserLegitimateInterestForVendor: (vendorId: string) => Promise<boolean>;
183
215
  /**
184
- Get the user LI status for a specific vendor and all its purposes.
185
- @param vendorId: vendor ID.
186
- @returns: The user LI status corresponding to the specified vendor and all its required purposes.
187
- */
216
+ * Get the user LI status for a specific vendor and all its purposes.
217
+ * @param vendorId: vendor ID.
218
+ * @returns: The user LI status corresponding to the specified vendor and all its required purposes.
219
+ * @deprecated use {@link #getUserStatus()} instead. Search the purposeId in
220
+ * getUserStatus().getVendors().getGlobalLegitimateInterest().getEnabled() or
221
+ * getUserStatus().getVendors().getGlobalLegitimateInterest().getDisabled().
222
+ */
188
223
  getUserLegitimateInterestStatusForVendorAndRequiredPurposes: (vendorId: string) => boolean;
189
224
  /**
190
- Get the user consent and legitimate interest status for a specific vendor.
191
- @param vendorId: vendor ID.
192
- @returns: status that represents both consent and legitimate interest status of a vendor.
193
- */
225
+ * Get the user consent status.
226
+ * @returns: status that represents user consent.
227
+ */
228
+ getUserStatus: () => Promise<any>;
229
+ /**
230
+ * Get the user consent and legitimate interest status for a specific vendor.
231
+ * @param vendorId: vendor ID.
232
+ * @returns: status that represents both consent and legitimate interest status of a vendor.
233
+ * @deprecated use {@link #getUserStatus()} instead. Search the vendorId in
234
+ * getUserStatus().getVendors().getGlobal().getEnabled() or
235
+ * getUserStatus().getVendors().getGlobal().getDisabled().
236
+ */
194
237
  getUserStatusForVendor: (vendorId: string) => Promise<boolean>;
195
238
  /**
196
- Method used to get a Vendor based on its ID.
197
- @param vendorId: vendor ID used in the search.
198
- @returns: vendor found in the array.
199
- */
200
- getVendor: (vendorId: string) => Promise<any[]>;
239
+ * Method used to get a Vendor based on its ID.
240
+ * @param vendorId: vendor ID used in the search.
241
+ * @returns: vendor found in the array.
242
+ */
243
+ getVendor: (vendorId: string) => Promise<any>;
201
244
  /**
202
- - Hide the notice if it is currently displayed
203
- */
245
+ * Hide the notice if it is currently displayed
246
+ */
204
247
  hideNotice: () => Promise<void>;
205
248
  /**
206
- - Hide the preferences popup for purposes
207
- */
249
+ * Hide the preferences popup for purposes
250
+ */
208
251
  hidePreferences: () => Promise<void>;
209
252
  /**
210
- Determine if consent is required for the user. The rules are (OR):
211
- - The user country is in the EU.
212
- - The company is from the EU.
213
- - The user country is unknown and the app has chosen to collect consent when unknown.
214
- @returns: **true** if consent is required, **false** if it is not required.
215
- */
253
+ * Determine if consent is required for the user. The rules are (OR):
254
+ * - The user country is in the EU.
255
+ * - The company is from the EU.
256
+ * - The user country is unknown and the app has chosen to collect consent when unknown.
257
+ * @returns: **true** if consent is required, **false** if it is not required.
258
+ */
216
259
  isConsentRequired: () => Promise<boolean>;
217
260
  /**
218
- Determine if consent information is available for all purposes and vendors that are required
219
- @returns: **true** if consent is required and consent information is available, **false** otherwise.
220
- */
261
+ * Determine if consent information is available for all purposes and vendors that are required
262
+ * @returns: **true** if consent is required and consent information is available, **false** otherwise.
263
+ */
221
264
  isUserConsentStatusPartial: () => Promise<boolean>;
222
265
  /**
223
- Check if the consent notice is currently displayed
224
- @returns: **true** if the notice is displayed, **false** if is not.
225
- */
266
+ * Check if the consent notice is currently displayed
267
+ * @returns: **true** if the notice is displayed, **false** if is not.
268
+ */
226
269
  isNoticeVisible: () => Promise<boolean>;
227
270
  /**
228
- Method used to check if the Preferences view is visible.
229
- @returns: **true** if Preferences view is visible, **false** otherwise.
230
- */
271
+ * Method used to check if the Preferences view is visible.
272
+ * @returns: **true** if Preferences view is visible, **false** otherwise.
273
+ */
231
274
  isPreferencesVisible: () => Promise<boolean>;
232
275
  isError: () => Promise<boolean>;
233
276
  /**
234
- Is the Didomi SDK ready?
235
- */
277
+ * Is the Didomi SDK ready?
278
+ */
236
279
  isReady: () => Promise<boolean>;
237
280
  /**
238
- Set user information with authentication
239
-
240
- @param id Organization user ID
241
- @param algorithm Algorithm used for computing the digest
242
- @param secretId ID of the secret used for computing the digest
243
- @param salt Salt used for computing the digest (optional)
244
- @param digest Digest of the organization user ID and secret
245
- */
281
+ * Set user information with authentication
282
+ *
283
+ * @param id Organization user ID
284
+ * @param algorithm Algorithm used for computing the digest
285
+ * @param secretId ID of the secret used for computing the digest
286
+ * @param salt Salt used for computing the digest (optional)
287
+ * @param digest Digest of the organization user ID and secret
288
+ */
246
289
  setUser: (organizationUserId: string, organizationUserIdAuthAlgorithm: string, organizationUserIdAuthSid: string, organizationUserIdAuthSalt: string, organizationUserIdAuthDigest: string) => Promise<void>;
247
290
  /**
248
- - Show the consent notice (if required, not disabled in the config and not already displayed)
249
- */
291
+ * Show the consent notice (if required, not disabled in the config and not already displayed)
292
+ */
250
293
  showNotice: () => Promise<void>;
251
294
  /**
252
- Show the preferences screen when/if the SDK is ready. By default the purposes list will be displayed.
253
- @param controller: view controller from where preferences will be presented.
254
- @param view: a value from `Didomi.Views`. It can be `.purposes` or `.vendors` (`ViewsPurposes` or `ViewsVendors` in Objective-C)
255
- */
295
+ * Show the preferences screen when/if the SDK is ready. By default the purposes list will be displayed.
296
+ * @param view: It can be `purposes` or `vendors`
297
+ */
256
298
  showPreferences: (view?: string | undefined) => Promise<void>;
257
299
  /**
258
- Remove all consents for the user
259
- */
300
+ * Remove all consents for the user
301
+ */
260
302
  reset: () => Promise<void>;
261
303
  /**
262
- Method that allows to enable consent and legitimate interest for all the required purposes.
263
- @returns: **true** if consent status has been updated, **false** otherwise.
264
- */
304
+ * Method that allows to enable consent and legitimate interest for all the required purposes.
305
+ * @returns: **true** if consent status has been updated, **false** otherwise.
306
+ */
265
307
  setUserAgreeToAll: () => Promise<boolean>;
266
308
  /**
267
- Set the user consent status.
268
- @param enabledPurposeIds: set containing **enabled purpose ids**
269
- @param disabledPurposeIds: set containing **disabled purpose ids**
270
- @param enabledVendorIds: set containing **enabled vendor ids**
271
- @param disabledVendorIds: set containing **disabled purpose ids**
272
- @returns: **true** if consent status has been updated, **false** otherwise.
273
- */
309
+ * Set the user consent status.
310
+ * @param enabledPurposeIds: set containing **enabled purpose ids**
311
+ * @param disabledPurposeIds: set containing **disabled purpose ids**
312
+ * @param enabledVendorIds: set containing **enabled vendor ids**
313
+ * @param disabledVendorIds: set containing **disabled purpose ids**
314
+ * @returns: **true** if consent status has been updated, **false** otherwise.
315
+ */
274
316
  setUserConsentStatus: (enabledPurposeIds: string[], disabledPurposeIds: string[], enabledVendorIds: string[], disabledVendorIds: string[]) => Promise<boolean>;
275
317
  /**
276
- Method that allows to disable consent and legitimate interest for all the required purposes and vendors.
277
- @returns: **true** if consent status has been updated, **false** otherwise.
278
- */
318
+ * Method that allows to disable consent and legitimate interest for all the required purposes and vendors.
319
+ * @returns: **true** if consent status has been updated, **false** otherwise.
320
+ */
279
321
  setUserDisagreeToAll: () => Promise<boolean>;
280
322
  /**
281
- Set the user status for purposes and vendors for consent and legitimate interest.
282
- @params purposesConsentStatus: boolean used to determine if consent will be enabled or disabled for all purposes.
283
- @params purposesLIStatus: boolean used to determine if legitimate interest will be enabled or disabled for all purposes.
284
- @params vendorsConsentStatus: boolean used to determine if consent will be enabled or disabled for all vendors.
285
- @params vendorsLIStatus: boolean used to determine if legitimate interest will be enabled or disabled for all vendors.
286
- @returns: **true** if consent status has been updated, **false** otherwise.
287
- */
323
+ * Set the user status for purposes and vendors for consent and legitimate interest.
324
+ * @param purposesConsentStatus: boolean used to determine if consent will be enabled or disabled for all purposes.
325
+ * @param purposesLIStatus: boolean used to determine if legitimate interest will be enabled or disabled for all purposes.
326
+ * @param vendorsConsentStatus: boolean used to determine if consent will be enabled or disabled for all vendors.
327
+ * @param vendorsLIStatus: boolean used to determine if legitimate interest will be enabled or disabled for all vendors.
328
+ * @returns: **true** if consent status has been updated, **false** otherwise.
329
+ */
288
330
  setUserStatus: (purposesConsentStatus: boolean, purposesLIStatus: boolean, vendorsConsentStatus: boolean, vendorsLIStatus: boolean) => Promise<boolean>;
289
331
  /**
290
- Set the user status for purposes and vendors for consent and legitimate interest.
291
-
292
- @param enabledConsentPurposeIds: List of purpose IDs to enable for consent.
293
- @param disabledConsentPurposeIds: List of purpose IDs to disable for consent.
294
- @param enabledLIPurposeIds: List of purpose IDs to enable for LI.
295
- @param disabledLIPurposeIds: List of purpose IDs to disable for LI.
296
- @param enabledConsentVendorIds: List of vendor IDs to enable for consent.
297
- @param disabledConsentVendorIds: List of vendor IDs to disable for consent.
298
- @param enabledLIVendorIds: List of vendor IDs to enable for LI.
299
- @param disabledLIVendorIds: List of vendor IDs to disable for LI.
300
- */
332
+ * Set the user status for purposes and vendors for consent and legitimate interest.
333
+ * @param enabledConsentPurposeIds: List of purpose IDs to enable for consent.
334
+ * @param disabledConsentPurposeIds: List of purpose IDs to disable for consent.
335
+ * @param enabledLIPurposeIds: List of purpose IDs to enable for LI.
336
+ * @param disabledLIPurposeIds: List of purpose IDs to disable for LI.
337
+ * @param enabledConsentVendorIds: List of vendor IDs to enable for consent.
338
+ * @param disabledConsentVendorIds: List of vendor IDs to disable for consent.
339
+ * @param enabledLIVendorIds: List of vendor IDs to enable for LI.
340
+ * @param disabledLIVendorIds: List of vendor IDs to disable for LI.
341
+ */
301
342
  setUserStatusSets: (enabledConsentPurposeIds: string[], disabledConsentPurposeIds: string[], enabledLIPurposeIds: string[], disabledLIPurposeIds: string[], enabledConsentVendorIds: string[], disabledConsentVendorIds: string[], enabledLIVendorIds: string[], disabledLIVendorIds: string[]) => Promise<boolean>;
302
343
  /**
303
- Check if the consent should be collected depending on if we have any consents or if we have some consents but the number of days before displaying the notice again has not expired yet
304
- @returns: A boolean depending if the consent should be collected or not
305
- */
344
+ * Check if the consent should be collected depending on if we have any consents or if we have some consents but the number of days before displaying the notice again has not expired yet
345
+ * @returns: A boolean depending if the consent should be collected or not
346
+ */
306
347
  shouldConsentBeCollected: () => Promise<boolean>;
307
348
  /**
308
- Method used to update the selected language of the Didomi SDK and any property that depends on it.
309
- In most cases this method doesn't need to be called. It would only be required for those apps that allow language change on-the-fly, i.e.: from within the app rather than from the device settings.
310
- In order to update the language of the views displayed by the Didomi SDK, this method needs to be called before these views are displayed.
311
-
312
- @param languageCode: string containing the language code e.g.: "es", "fr", etc.
313
- */
349
+ * Method used to update the selected language of the Didomi SDK and any property that depends on it.
350
+ * In most cases this method doesn't need to be called. It would only be required for those apps that allow language change on-the-fly, i.e.: from within the app rather than from the device settings.
351
+ * In order to update the language of the views displayed by the Didomi SDK, this method needs to be called before these views are displayed.
352
+ * @param languageCode: string containing the language code e.g.: "es", "fr", etc.
353
+ */
314
354
  updateSelectedLanguage: (languageCode: string) => Promise<void>;
315
355
  };
@@ -7,4 +7,6 @@ export declare const DidomiListener: {
7
7
  reset: () => void;
8
8
  addEventListener: (eventType: DidomiEventType, callback: (data: any) => void) => void;
9
9
  removeEventListener: (eventType: DidomiEventType, callback: (data: any) => void) => void;
10
+ onReady: () => Promise<void>;
11
+ onError: () => Promise<any>;
10
12
  };
@@ -9,6 +9,8 @@ export declare enum DidomiEventType {
9
9
  NOTICE_CLICK_MORE_INFO = "on_notice_click_more_info",
10
10
  NOTICE_CLICK_VIEW_VENDORS = "on_notice_click_view_vendors",
11
11
  NOTICE_CLICK_PRIVACY_POLICY = "on_notice_click_privacy_policy",
12
+ HIDE_PREFERENCES = "on_hide_preferences",
13
+ SHOW_PREFERENCES = "on_show_preferences",
12
14
  PREFERENCES_CLICK_AGREE_TO_ALL = "on_preferences_click_agree_to_all",
13
15
  PREFERENCES_CLICK_DISAGREE_TO_ALL = "on_preferences_click_disagree_to_all",
14
16
  PREFERENCES_CLICK_PURPOSE_AGREE = "on_preferences_click_purpose_agree",
@@ -68,3 +70,29 @@ export interface Map<T> {
68
70
  [index: string]: T;
69
71
  [index: number]: T;
70
72
  }
73
+ export interface UserStatus {
74
+ purposes: UserStatusPurposes;
75
+ vendors: UserStatusVendors;
76
+ userId: string;
77
+ created: string;
78
+ updated: string;
79
+ consentString: string;
80
+ additionalConsent: string;
81
+ }
82
+ export interface UserStatusPurposes {
83
+ global: UserStatusIds;
84
+ consent: UserStatusIds;
85
+ legitimateInterest: UserStatusIds;
86
+ essential: UserStatusIds;
87
+ }
88
+ export interface UserStatusVendors {
89
+ global: UserStatusIds;
90
+ globalConsent: UserStatusIds;
91
+ globalLegitimateInterest: UserStatusIds;
92
+ consent: UserStatusIds;
93
+ legitimateInterest: UserStatusIds;
94
+ }
95
+ export interface UserStatusIds {
96
+ disabled: string[];
97
+ enabled: string[];
98
+ }