Options
All
  • Public
  • Public/Protected
  • All
Menu

Waitasecond - v1.11.117

Index

Functions

  • forAllImagesInElement(element: HTMLElement): Promise<void>
  • Parameters

    • element: HTMLElement

    Returns Promise<void>

  • forAnimationFrame(): Promise<number>
  • Returns Promise<number>

  • forDOMContentLoaded(): Promise<void>
  • Returns Promise<void>

  • forDocumentReady(targetReadyState?: "interactive" | "complete"): Promise<void>
  • Waits until document is loaded Creates a promise that resolves when the document.readyState is on targetReadyState

    Parameters

    • targetReadyState: "interactive" | "complete" = 'complete'

    Returns Promise<void>

  • forEver(): Promise<never>
  • 🌌 Waits until end of the universe

    Returns Promise<never>

    that never ever resolved

  • forImage(imageElement: HTMLImageElement): Promise<void>
  • Parameters

    • imageElement: HTMLImageElement

    Returns Promise<void>

  • forImmediate(): Promise<void>
  • Returns Promise<void>

  • forTime(miliseconds: number): Promise<void>
  • Parameters

    • miliseconds: number

    Returns Promise<void>

  • forTimeSynced(period: number, shift?: number): Promise<void>
  • This waiter function will sync some action to some precise time

    Parameters

    • period: number

      looping period in milliseconds

    • shift: number = 0

      according to current time in milliseconds

    Returns Promise<void>

  • forTimeout<T>(timeout: number, value: Promise<T>): Promise<T>
  • Type parameters

    • T

    Parameters

    • timeout: number
    • value: Promise<T>

    Returns Promise<T>

  • forValueDefined<T>(getValue: () => AsyncOrSync<undefined | null | T>, waiter?: () => Promise<void>, limit?: number): Promise<T>
  • Type parameters

    • T

    Parameters

    • getValue: () => AsyncOrSync<undefined | null | T>
        • (): AsyncOrSync<undefined | null | T>
        • Returns AsyncOrSync<undefined | null | T>

    • waiter: () => Promise<void> = ...
        • (): Promise<void>
        • Returns Promise<void>

    • limit: number = 1000

    Returns Promise<T>