(element, policyId = 'default')
| 8 | * @return {!Promise<import('#core/constants/consent-state').CONSENT_POLICY_STATE|null>} |
| 9 | */ |
| 10 | export function getConsentPolicyState(element, policyId = 'default') { |
| 11 | return Services.consentPolicyServiceForDocOrNull(element).then( |
| 12 | (consentPolicy) => { |
| 13 | if (!consentPolicy) { |
| 14 | return null; |
| 15 | } |
| 16 | return consentPolicy.whenPolicyResolved(/** @type {string} */ (policyId)); |
| 17 | } |
| 18 | ); |
| 19 | } |
| 20 | |
| 21 | /** |
| 22 | * Returns a promise that resolves to a sharedData retrieved from consent |
no test coverage detected