Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "frontend-packages/headless-content-unblocker/src/checker/findAndUnblock"

Index

Type aliases

FindAndUnblockOptions

FindAndUnblockOptions<ExtendedBlockerDefinition>: { checker: BlockerCheckerCallback<ExtendedBlockerDefinition>; customInitiators?: (ownerDocument: Document, defaultView: typeof window) => void; delegateClick?: Parameters<typeof delegateClick>[1]; mode?: "unblock" | "skip" | "busy"; overwriteAttributeValue?: Parameters<typeof transformToOriginalAttribute>[0]["overwriteAttributeValue"]; priorityUnblocked?: (unblocked: ReturnType<typeof findBlockedNodes>, priority: number) => void; transactionClosed?: (unblocked: ReturnType<typeof findBlockedNodes>) => void; visual?: Omit<Parameters<typeof createVisual>[0], "node" | "blocker" | "mount"> & { busy?: (contentBlocker: HTMLElement) => void; mount: BlockerMountCallback<ExtendedBlockerDefinition>; unmount?: (contentBlocker: HTMLElement) => void } }

Type parameters

Type declaration

  • checker: BlockerCheckerCallback<ExtendedBlockerDefinition>
  • Optional customInitiators?: (ownerDocument: Document, defaultView: typeof window) => void
      • (ownerDocument: Document, defaultView: typeof window): void
      • Parameters

        • ownerDocument: Document
        • defaultView: typeof window

        Returns void

  • Optional delegateClick?: Parameters<typeof delegateClick>[1]
  • Optional mode?: "unblock" | "skip" | "busy"

    unblock: Unblocks as expected in respect to checker.

    skip: The unblocking mechanism will be skipped and only visuals are created. This can be useful if you want to time between interactive and complete document.ready state.

    In other words: Show visual content blockers in interactive state, and unblock in complete state.

    Use this in conjunction with BANNER_PRE_DECISION_SHOW_INTERACTIVE_EVENT and APPLY_INTERACTIVE_EVENT event.

  • Optional overwriteAttributeValue?: Parameters<typeof transformToOriginalAttribute>[0]["overwriteAttributeValue"]
  • Optional priorityUnblocked?: (unblocked: ReturnType<typeof findBlockedNodes>, priority: number) => void

    A priority step got unblocked. This allows e.g. to execute code after div elements got unblocked and before a script get's included.

      • Parameters

        Returns void

  • Optional transactionClosed?: (unblocked: ReturnType<typeof findBlockedNodes>) => void

    All transactions inclusive initiators (e.g. $(document).ready()) are executed.

  • Optional visual?: Omit<Parameters<typeof createVisual>[0], "node" | "blocker" | "mount"> & { busy?: (contentBlocker: HTMLElement) => void; mount: BlockerMountCallback<ExtendedBlockerDefinition>; unmount?: (contentBlocker: HTMLElement) => void }

Functions

findAndUnblock

  • findAndUnblock<ExtendedBlockerDefinition>(__namedParameters: { checker: BlockerCheckerCallback<ExtendedBlockerDefinition>; customInitiators: (ownerDocument: Document, defaultView: typeof window) => void; delegateClickSelectors: { nextSibling?: DelegateClickElement[]; parentNextSibling?: DelegateClickElement[]; same?: DelegateClickElement[] }; mode: "busy" | "unblock" | "skip"; overwriteAttributeValue: (value: string, originalAttribute: string) => string; priorityUnblocked: (unblocked: ReturnType<typeof findBlockedNodes>, priority: number) => void; transactionClosed: (unblocked: ReturnType<typeof findBlockedNodes>) => void; visual: Omit<{ blocker: BlockerConfiguration; dependantVisibilityContainers?: string[]; mount: BlockerMountCallback<BlockerConfiguration>; node: HTMLElement; setVisualParentIfClassOfParent?: Parameters<typeof findVisualParent>[1] }, "node" | "blocker" | "mount"> & { busy?: (contentBlocker: HTMLElement) => void; mount: BlockerMountCallback<ExtendedBlockerDefinition>; unmount?: (contentBlocker: HTMLElement) => void } }): Promise<void>
  • Refresh the DOM content depending on acceptance. It covers the following things:

    • Get all available blocked content
    • Unblock blocked content depending on acceptance
    • All other blocked content gets a visual content-blocker (if possible)

    Type parameters

    Parameters

    • __namedParameters: { checker: BlockerCheckerCallback<ExtendedBlockerDefinition>; customInitiators: (ownerDocument: Document, defaultView: typeof window) => void; delegateClickSelectors: { nextSibling?: DelegateClickElement[]; parentNextSibling?: DelegateClickElement[]; same?: DelegateClickElement[] }; mode: "busy" | "unblock" | "skip"; overwriteAttributeValue: (value: string, originalAttribute: string) => string; priorityUnblocked: (unblocked: ReturnType<typeof findBlockedNodes>, priority: number) => void; transactionClosed: (unblocked: ReturnType<typeof findBlockedNodes>) => void; visual: Omit<{ blocker: BlockerConfiguration; dependantVisibilityContainers?: string[]; mount: BlockerMountCallback<BlockerConfiguration>; node: HTMLElement; setVisualParentIfClassOfParent?: Parameters<typeof findVisualParent>[1] }, "node" | "blocker" | "mount"> & { busy?: (contentBlocker: HTMLElement) => void; mount: BlockerMountCallback<ExtendedBlockerDefinition>; unmount?: (contentBlocker: HTMLElement) => void } }
      • checker: BlockerCheckerCallback<ExtendedBlockerDefinition>
      • customInitiators: (ownerDocument: Document, defaultView: typeof window) => void
          • (ownerDocument: Document, defaultView: typeof window): void
          • Parameters

            • ownerDocument: Document
            • defaultView: typeof window

            Returns void

      • delegateClickSelectors: { nextSibling?: DelegateClickElement[]; parentNextSibling?: DelegateClickElement[]; same?: DelegateClickElement[] }
      • mode: "busy" | "unblock" | "skip"
      • overwriteAttributeValue: (value: string, originalAttribute: string) => string
          • (value: string, originalAttribute: string): string
          • Parameters

            • value: string
            • originalAttribute: string

            Returns string

      • priorityUnblocked: (unblocked: ReturnType<typeof findBlockedNodes>, priority: number) => void
          • Parameters

            Returns void

      • transactionClosed: (unblocked: ReturnType<typeof findBlockedNodes>) => void
      • visual: Omit<{ blocker: BlockerConfiguration; dependantVisibilityContainers?: string[]; mount: BlockerMountCallback<BlockerConfiguration>; node: HTMLElement; setVisualParentIfClassOfParent?: Parameters<typeof findVisualParent>[1] }, "node" | "blocker" | "mount"> & { busy?: (contentBlocker: HTMLElement) => void; mount: BlockerMountCallback<ExtendedBlockerDefinition>; unmount?: (contentBlocker: HTMLElement) => void }

    Returns Promise<void>

insertChildAtIndex

  • insertChildAtIndex(container: HTMLElement, child: HTMLElement, index: number): void
  • Parameters

    • container: HTMLElement
    • child: HTMLElement
    • index: number

    Returns void

Generated using TypeDoc