Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "frontend-packages/headless-content-unblocker/src/visual/createVisual"

Index

Type aliases

BlockerMountCallback

BlockerMountCallback<ExtendedBlockerDefinition>: (data: { blockedNode: HTMLElement; blocker: ExtendedBlockerDefinition; connectedCounter: number; container: HTMLDivElement; onClick: SetVisualAsLastClickedVisual; paintMode: BlockerMountPaintMode; thumbnail?: VisualThumbnail }) => void

Type parameters

Type declaration

BlockerMountPaintMode

BlockerMountPaintMode: "instantInViewport" | "idleCallback" | "instant"

SetVisualAsLastClickedVisual

SetVisualAsLastClickedVisual: (event?: { stopPropagation: () => void }) => void

Type declaration

    • (event?: { stopPropagation: () => void }): void
    • Parameters

      • Optional event: { stopPropagation: () => void }
        • stopPropagation: () => void
            • (): void
            • Returns void

      Returns void

VisualConfiguration

VisualConfiguration: { id: number; isVisual: boolean; shouldForceToShowVisual?: boolean }

Type declaration

  • id: number
  • isVisual: boolean
  • Optional shouldForceToShowVisual?: boolean

VisualThumbnail

VisualThumbnail: { embedId?: string; fileMd5?: string; forceRatio?: number; height: number; hide?: ("title" | "overlay")[]; title?: string; titleType?: "center" | "top"; url: string; width: number }

Type declaration

  • Optional embedId?: string
  • Optional fileMd5?: string
  • Optional forceRatio?: number
  • height: number
  • Optional hide?: ("title" | "overlay")[]
  • Optional title?: string
  • Optional titleType?: "center" | "top"

    Defaults to top.

  • url: string
  • width: number

Variables

Let connectedCounterPreserve

connectedCounterPreserve: number = 0

Let lastClickedConnectedCounter

lastClickedConnectedCounter: number = undefined

Save the identifier for the last clicked content blocker so we can dispatch in our event if it is the clicked one. This is useful e.g. to delegate the click event further and start a video.

Functions

createVisual

  • createVisual<BlockerConfiguration>(__namedParameters: { blocker: BlockerConfiguration; dependantVisibilityContainers: string[]; mount: BlockerMountCallback<BlockerConfiguration>; node: HTMLElement; setVisualParentIfClassOfParent: Record<string, string | number | false | true> }): HTMLDivElement
  • Create visual content blocker for a given node.

    Returns undefined when the container cannot be created.

    Type parameters

    Parameters

    • __namedParameters: { blocker: BlockerConfiguration; dependantVisibilityContainers: string[]; mount: BlockerMountCallback<BlockerConfiguration>; node: HTMLElement; setVisualParentIfClassOfParent: Record<string, string | number | false | true> }
      • blocker: BlockerConfiguration
      • dependantVisibilityContainers: string[]
      • mount: BlockerMountCallback<BlockerConfiguration>
      • node: HTMLElement
      • setVisualParentIfClassOfParent: Record<string, string | number | false | true>

    Returns HTMLDivElement

getLastClickedConnectedCounter

  • getLastClickedConnectedCounter(): number
  • Returns number

setLastClickedConnectedCounter

  • setLastClickedConnectedCounter(connectedCounter: number): void
  • Parameters

    • connectedCounter: number

    Returns void

Generated using TypeDoc