diff --git a/types/usercentrics-browser-ui/integration-interfaces.d.ts b/types/usercentrics-browser-ui/integration-interfaces.d.ts index c9342d52de05e2..e4c277d70727bc 100644 --- a/types/usercentrics-browser-ui/integration-interfaces.d.ts +++ b/types/usercentrics-browser-ui/integration-interfaces.d.ts @@ -25,8 +25,13 @@ export interface BaseTCFUserDecision { /** Indicates if the user gave consent (true) or denied consent (false) */ consent?: boolean; - /** The id of the purpose/vendor the consent decision belongs to */ - id: number; + /** + * The id of the purpose/vendor the consent decision belongs to. + * Note: Different pages in the Usercentrics docs disagree on the type, so both are allowed: + * https://usercentrics.com/docs/web/implementation/ui/interfaces/#basetcfuserdecision (number) + * https://usercentrics.com/docs/web/features/api/control-functionality/#updatecategoriesconsents (string) + */ + id: number | string; } /** diff --git a/types/usercentrics-browser-ui/usercentrics-browser-ui-tests.ts b/types/usercentrics-browser-ui/usercentrics-browser-ui-tests.ts index 60ddbfc7af298a..a6c7910430540b 100644 --- a/types/usercentrics-browser-ui/usercentrics-browser-ui-tests.ts +++ b/types/usercentrics-browser-ui/usercentrics-browser-ui-tests.ts @@ -16,4 +16,18 @@ async function getConsentSettingsFromUsercentrics() { // $ExpectType boolean await window._ucCmp.isConsentRequired(); + + /* + Adding serviceConsents example data from the docs and one with id of type number + Note: Different pages in the Usercentrics docs disagree on the type, so both are allowed: + https://usercentrics.com/docs/web/implementation/ui/interfaces/#basetcfuserdecision (number) + https://usercentrics.com/docs/web/features/api/control-functionality/#updatecategoriesconsents (string) + */ + const serviceConsents = [ + { id: "HkocEodjb7", consent: true }, + { id: "S1_9Vsuj-Q", consent: false }, + { id: 12345567, consent: false }, + ]; + + await window._ucCmp.updateServicesConsents(serviceConsents); }