• Create the API functions and make them available through window.consentApi.

    There is also a stub implementation:

    ((a,b)=>{a[b]||(a[b]={unblockSync:()=>undefined},["consentSync"].forEach(c=>a[b][c]=()=>({cookie:null,consentGiven:!1,cookieOptIn:!0})),["consent","consentAll","unblock"].forEach(c=>a[b][c]=(...d)=>new Promise(e=>a.addEventListener(b,()=>{a[b][c](...d).then(e)},{once:!0}))))})(window,"consentApi");
    

    Parameters

    Returns {
        consent: ((...args) => Promise<{
            consentGiven: boolean;
            cookie: Service;
            cookieOptIn: boolean;
        }>);
        consentAll: ((...args) => Promise<{
            consentGiven: boolean;
            cookie: Service;
            cookieOptIn: boolean;
        }[]>);
        consentSync: ((...args) => {
            consentGiven: boolean;
            cookie: Service;
            cookieOptIn: boolean;
        });
        unblock: ((...args) => Promise<void>);
        unblockSync: ((...args) => BlockerDefinition);
        wrapFn: ((...args) => Fn | Fn[]);
    }

    • consent: ((...args) => Promise<{
          consentGiven: boolean;
          cookie: Service;
          cookieOptIn: boolean;
      }>)
        • (...args): Promise<{
              consentGiven: boolean;
              cookie: Service;
              cookieOptIn: boolean;
          }>
        • Parameters

          • Rest ...args: [typeOrIdOrUniqueName: string | number, name?: string, host?: string]

          Returns Promise<{
              consentGiven: boolean;
              cookie: Service;
              cookieOptIn: boolean;
          }>

    • consentAll: ((...args) => Promise<{
          consentGiven: boolean;
          cookie: Service;
          cookieOptIn: boolean;
      }[]>)
        • (...args): Promise<{
              consentGiven: boolean;
              cookie: Service;
              cookieOptIn: boolean;
          }[]>
        • Parameters

          • Rest ...args: [technicalDefinitions: [typeOrIdOrUniqueName: string | number, name?: string, host?: string][]]

          Returns Promise<{
              consentGiven: boolean;
              cookie: Service;
              cookieOptIn: boolean;
          }[]>

    • consentSync: ((...args) => {
          consentGiven: boolean;
          cookie: Service;
          cookieOptIn: boolean;
      })
        • (...args): {
              consentGiven: boolean;
              cookie: Service;
              cookieOptIn: boolean;
          }
        • Parameters

          • Rest ...args: [typeOrIdOrUniqueName: string | number, name?: string, host?: string]

          Returns {
              consentGiven: boolean;
              cookie: Service;
              cookieOptIn: boolean;
          }

          • consentGiven: boolean

            This variable defines whether a valid consent has generally been given. This does not refer to the technical information that you have passed as arguments. For example: If the user clicks "Continue without Consent", this variable is set to true. The variable is false if the user has not yet given consent and the cookie banner is displayed.

          • cookie: Service

            If the website operator has defined a cookie or service with the information you requested, it will be returned here.

          • cookieOptIn: boolean

            This variable defines whether the technical information has been accepted.

            Attention: This variable is also true if no service (see cookie) is found.

    • unblock: ((...args) => Promise<void>)
        • (...args): Promise<void>
        • Parameters

          • Rest ...args: [urlOrElement: string | HTMLElement, options?: Options]

          Returns Promise<void>

    • unblockSync: ((...args) => BlockerDefinition)
        • (...args): BlockerDefinition
        • Parameters

          • Rest ...args: [url: string]

          Returns BlockerDefinition

    • wrapFn: ((...args) => Fn | Fn[])
        • (...args): Fn | Fn[]
        • Parameters

          • Rest ...args: [fn: Fn | FnOverwriteObject | FnOverwriteObject[], checkExecution: Promise<any> | ((args) => boolean | Promise<any>) | ["consent", typeOrIdOrUniqueName: string | number, name?: string, host?: string] | ["consentAll", technicalDefinitions: [typeOrIdOrUniqueName: string | number, name?: string, host?: string][]] | ["consentSync", typeOrIdOrUniqueName: string | number, name?: string, host?: string] | ["unblock", urlOrElement: string | HTMLElement, options?: Options] | "functionBody", settings: {
                failedSyncReturnValue?: boolean;
                skipRetry?: boolean;
            }]

          Returns Fn | Fn[]