• 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<void>);
        consentAll: ((...args) => Promise<void[]>);
        consentSync: ((...args) => {
            consentGiven: boolean;
            cookie: Service;
            cookieOptIn: boolean;
        });
        unblock: ((...args) => Promise<void>);
        unblockSync: ((...args) => BlockerDefinition);
        wrapFn: ((...args) => Fn | Fn[]);
    }

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

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

          Returns Promise<void>

    • consentAll: ((...args) => Promise<void[]>)
        • (...args): Promise<void[]>
        • Parameters

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

          Returns Promise<void[]>

    • 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
          • cookie: Service
          • cookieOptIn: boolean
    • 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<void>) | ["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[]