Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

  • arrayRandomIndex<T>(array: T[]): number
  • Returns a random array index

    Type parameters

    • T

    Parameters

    • array: T[]

      the array to get the index from

    Returns number

    a random array index

  • Calculates the bounds of the given point

    Parameters

    • point: ICoordinates

      the point to calculate the bounds from

    • radius: number

      the point radius

    Returns IBounds

    the bounds of the given point

  • cancelAnimation(): (handle: number) => void
  • Cancels the requestAnimationFrame function or a polyfill

    Returns (handle: number) => void

      • (handle: number): void
      • Cancels the requestAnimationFrame function or a polyfill

        Parameters

        • handle: number

        Returns void

  • deepExtend(destination: unknown, ...sources: unknown[]): unknown
  • Merges the whole source objects into the destination object

    Parameters

    • destination: unknown

      the destination object

    • Rest ...sources: unknown[]

      the source objects

    Returns unknown

    the merged destination object

  • Checks if a value is equal to the destination, if same type, or is in the provided array

    Type parameters

    • T

    Parameters

    • value: T

      the value to check

    • array: SingleOrMultiple<T>

      the data array or single value

    Returns boolean

    true if the value is equal to the destination, if same type, or is in the provided array

  • Checks if the given point is inside the given rectangle

    Parameters

    Returns boolean

    true if the point is inside the rectangle

  • isSsr(): boolean
  • itemFromArray<T>(array: T[], index?: number, useIndex?: boolean): T
  • Returns a random object from the given array

    Type parameters

    • T

    Parameters

    • array: T[]

      the array to get the object from

    • Optional index: number

      the index to get the object from

    • useIndex: boolean = true

      if true, the index will be used instead of a random index

    Returns T

  • loadFont(font?: string, weight?: string): Promise<void>
  • Loads a font for the canvas

    Parameters

    • Optional font: string

      font name

    • Optional weight: string

      font weight

    Returns Promise<void>

  • Executes the bounce between a particle and div bounds

    Parameters

    • particle: IParticle

      the particle to bounce

    • divBounds: IBounds

      the div bounds to bounce

    Returns void

  • singleDivModeExecute(div: DivEvent, callback: (selector: string, div: DivEvent) => void): void
  • Execute the given callback for the given div event

    Parameters

    • div: DivEvent

      the div event to execute the callback for

    • callback: (selector: string, div: DivEvent) => void

      the callback to execute

        • Parameters

          Returns void

    Returns void