Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type Aliases

BindEventsCallback: ((eventsHub: GdprManagerEventHub, manager: GdprManager) => void)

Type declaration

    • (eventsHub: GdprManagerEventHub, manager: GdprManager): void
    • Parameters

      • eventsHub: GdprManagerEventHub
      • manager: GdprManager

      Returns void

StoreErrorHandler: ((didStore: boolean, error?: Error) => void)

Type declaration

    • (didStore: boolean, error?: Error): void
    • Parameters

      • didStore: boolean
      • Optional error: Error

      Returns void

Functions

  • setupButtonsListeners(manager: GdprManager, gdprSavior: GdprSavior, hooks: SetupButtonListenersHooks, restoreFactory: GdprManagerFactory, updateCheckboxState: (() => void)): void
  • setupCheckboxListeners(manager: GdprManager, managerCheckbox: HTMLInputElement, parsedGuards: GuardParseResult[], hadManager: boolean, updateCheckboxState: (() => void)): void
  • Add listeners to the change event of the manager's and guards' checkboxes

    Parameters

    • manager: GdprManager

      The manager to handle state changes for

    • managerCheckbox: HTMLInputElement

      The global manager toggle checkbox

    • parsedGuards: GuardParseResult[]

      The guards that have been parsed from the DOM

    • hadManager: boolean

      Whether the manager came from the savior instead of the factory

    • updateCheckboxState: (() => void)

      Callback used to trigger an update of the checkbox's state

        • (): void
        • Returns void

    Returns void

  • setupInHeadActivation<ItemType>(manager: GdprManager, itemSelector: string, setupItemHook: ((item: ItemType) => void)): void
  • Setup item activation in the <head> tag (i.e. to execute code when the corresponding guard is enabled)

    Type Parameters

    • ItemType extends HTMLElement<ItemType> = HTMLElement

    Parameters

    • manager: GdprManager

      The manager to attach the activation logic to

    • itemSelector: string

      The selector to query all the related items (must include [data-gdpr-on-enable])

    • setupItemHook: ((item: ItemType) => void)

      The function to call to set up the item before putting it in the DOM

        • (item: ItemType): void
        • Parameters

          • item: ItemType

          Returns void

    Returns void

  • setupScriptActivation(manager: GdprManager): void
  • Setup scripts activation logic to load them when the corresponding guard is enabled (type must initially be text and the src attribute mst be present)

    Parameters

    • manager: GdprManager

      The manager to attach the activation logic to

    Returns void

  • setupStyleSheetsActivation(manager: GdprManager): void
  • Setup stylesheets activation logic to load them when the corresponding guard is enabled (rel attribute must be different from stylesheet and the href attribute must be present)

    Parameters

    • manager: GdprManager

      The manager to attach the activation logic to

    Returns void