Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "frontend-packages/react-cookie-banner/src/types/bannerContext"

Index

Type aliases

BannerContextActionProps

BannerContextActionProps: { openBanner: (e?: MouseEvent) => void; openHistory: (e?: MouseEvent) => void; revokeConsent: (successMessage?: string, e?: MouseEvent) => void }

Type declaration

  • openBanner: (e?: MouseEvent) => void

    Banner action to open banner.

      • (e?: MouseEvent): void
      • Parameters

        • Optional e: MouseEvent

        Returns void

  • openHistory: (e?: MouseEvent) => void

    Banner action to open consent history.

      • (e?: MouseEvent): void
      • Parameters

        • Optional e: MouseEvent

        Returns void

  • revokeConsent: (successMessage?: string, e?: MouseEvent) => void

    Banner action to revoke consent.

      • (successMessage?: string, e?: MouseEvent): void
      • Parameters

        • Optional successMessage: string
        • Optional e: MouseEvent

        Returns void

BannerContextContainerProps

BannerContextContainerProps: { activeAction: "history" | "revoke" | "change"; animationVisible: boolean; essentialGroup: string; gotHiddenDueLegal: (state: boolean) => void; individualPrivacyOpen: boolean; onClose: () => void; pageId: number; pageRequestUuid4: string; skipOverlay: boolean; updateIndividualPrivacyOpen: (state: boolean) => void; visible: boolean }

Type declaration

  • activeAction: "history" | "revoke" | "change"
  • animationVisible: boolean
  • essentialGroup: string

    Slug of essential group. This could be usually calculated from available groups, but for performance reasons pass the slug here.

  • gotHiddenDueLegal: (state: boolean) => void

    This action is fired when the cookie banner got hidden due to legal settings.

      • (state: boolean): void
      • Parameters

        • state: boolean

        Returns void

  • individualPrivacyOpen: boolean

    Indicates if the individual privacy (checkboxes, tables, ...) is open.

  • onClose: () => void

    Banner was visually visible, and got closed.

      • (): void
      • Returns void

  • pageId: number

    Current page id. Needed for isHiddenDueLegal functionality.

  • pageRequestUuid4: string

    Unique request id. This is used for the unique container div (anti-ad-block system) and should be regenerated for each page request (or x days, when using page cache).

  • skipOverlay: boolean

    Use this in your frontend when the overlay is server-side rendered. The server-side rendered needs to have the id of the pageRequestUuid4 value.

  • updateIndividualPrivacyOpen: (state: boolean) => void
      • (state: boolean): void
      • Parameters

        • state: boolean

        Returns void

  • visible: boolean

BannerContextHistoryProps

BannerContextHistoryProps: { fetchHistory: () => Promise<BannerContextHistoryProps["history"]>; history: BannerHistoryEntry[]; selectHistoryEntry?: (groups: VisualServiceGroup[], consent: ConsentProps["groups"], tcf?: BannerHistoryEntry["tcf"]) => void }

Type declaration

  • fetchHistory: () => Promise<BannerContextHistoryProps["history"]>

    Fetch and set the history. You also need to return the history, so the initial selection can be done reactively.

      • (): Promise<BannerContextHistoryProps["history"]>
      • Returns Promise<BannerContextHistoryProps["history"]>

  • history: BannerHistoryEntry[]

    Consent history management. The selectHistoryEntry method allows you to set the current showed state in the individual privacy policy dialog.

  • Optional selectHistoryEntry?: (groups: VisualServiceGroup[], consent: ConsentProps["groups"], tcf?: BannerHistoryEntry["tcf"]) => void
      • (groups: VisualServiceGroup[], consent: ConsentProps["groups"], tcf?: BannerHistoryEntry["tcf"]): void
      • Parameters

        • groups: VisualServiceGroup[]
        • consent: ConsentProps["groups"]
        • Optional tcf: BannerHistoryEntry["tcf"]

        Returns void

BannerContextI18nProps

BannerContextI18nProps: { andSeparator: string; closeWithoutSaving: string; headerTitlePrivacyPolicyHistory: string; historyLabel: string; historySelectNone: string; tcf: { declarations: Record<keyof Omit<Declarations, "stacks">, { desc: string; title: string }>; filterNoVendors: string; filterText: string; hideMore: string; listOfServicesAppendix: string; nonStandard: string; nonStandardDesc: string; showMore: string; tcfStandard: string; tcfStandardDesc: string; vendorList: string; vendors: string } }

Type declaration

  • andSeparator: string
  • closeWithoutSaving: string
  • headerTitlePrivacyPolicyHistory: string
  • historyLabel: string
  • historySelectNone: string
  • tcf: { declarations: Record<keyof Omit<Declarations, "stacks">, { desc: string; title: string }>; filterNoVendors: string; filterText: string; hideMore: string; listOfServicesAppendix: string; nonStandard: string; nonStandardDesc: string; showMore: string; tcfStandard: string; tcfStandardDesc: string; vendorList: string; vendors: string }
    • declarations: Record<keyof Omit<Declarations, "stacks">, { desc: string; title: string }>
    • filterNoVendors: string
    • filterText: string
    • hideMore: string
    • listOfServicesAppendix: string
    • nonStandard: string
    • nonStandardDesc: string
    • showMore: string
    • tcfStandard: string
    • tcfStandardDesc: string
    • vendorList: string
    • vendors: string

BannerContextImitateProps

BannerContextImitateProps: { buttonClicked: ClickableButtonsNamed; isConsentRecord: boolean }

Type declaration

  • buttonClicked: ClickableButtonsNamed

    If this is set, the given button will be framed and marked as "clicked" (for preview purposes).

  • isConsentRecord: boolean

    Determines if the current consent is a record from the database.

BannerContextProps

All properties needed for our whole cookie banner. All properties are optional as no default is defined at time of context creation.

BannerContextSaveActionProps

BannerContextSaveActionProps: { didGroupFirstChange: boolean; onSave?: (markAsDoNotTrack: boolean, buttonClicked: ClickableButtonsNamed) => void; previewCheckboxActiveState: boolean; refreshSiteAfterSave?: number | false; updateCookieChecked: (group: number, id: number, state: boolean) => void; updateGroupChecked: (id: number, state: boolean) => void }

Type declaration

  • didGroupFirstChange: boolean

    See option "Allow to choose service groups directly in the first view of the cookie banner".

  • Optional onSave?: (markAsDoNotTrack: boolean, buttonClicked: ClickableButtonsNamed) => void
  • previewCheckboxActiveState: boolean

    Only needed in customize mode. When hovering the checkbox active state options, all checkboxes should be simulated as "checked".

  • Optional refreshSiteAfterSave?: number | false

    Refresh the complete site after saving the consent. This is defined in milliseconds.

  • updateCookieChecked: (group: number, id: number, state: boolean) => void
      • (group: number, id: number, state: boolean): void
      • Parameters

        • group: number
        • id: number
        • state: boolean

        Returns void

  • updateGroupChecked: (id: number, state: boolean) => void
      • (id: number, state: boolean): void
      • Parameters

        • id: number
        • state: boolean

        Returns void

BannerContextTcfProps

BannerContextTcfProps: { tcf: { gvl: GVL; metadata: TcfMetadata; model: TCModel; original: Tcf }; tcfFilterBy: TcfDeclarationFilter; updateTcfFilterBy: (state: TcfDeclarationFilter) => void }

Type declaration

BannerHistoryEntry

BannerHistoryEntry: { created: string; decision: ConsentProps["groups"]; groups: VisualServiceGroup[]; id: number; isDoNotTrack: boolean; isForwarded: boolean; isUnblock: boolean; tcf?: { tcf: Tcf; tcfMeta: TcfMetadata; tcfString: string } | BannerContextTcfProps["tcf"]; uuid: string }

Type declaration

  • created: string
  • decision: ConsentProps["groups"]
  • groups: VisualServiceGroup[]
  • id: number
  • isDoNotTrack: boolean
  • isForwarded: boolean
  • isUnblock: boolean
  • Optional tcf?: { tcf: Tcf; tcfMeta: TcfMetadata; tcfString: string } | BannerContextTcfProps["tcf"]
  • uuid: string

ClickableButtonsNamed

ClickableButtonsNamed: "none" | "main_all" | "main_essential" | "main_close_icon" | "main_custom" | "ind_all" | "ind_essential" | "ind_close_icon" | "ind_custom" | "shortcode_revoke" | "unblock"

Generated using TypeDoc