Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "lib/helpers"

Index

Functions

awaitEvent

  • awaitEvent(target: EventTarget, type: string): Promise<any>
  • Return a promise that resolves once an event is triggered.

    Parameters

    • target: EventTarget
    • type: string

    Returns Promise<any>

doAction

  • Does a basic action that may require confirmation and may display notifications

    Parameters

    Returns void

getImageFileThumbnailDataURL

  • getImageFileThumbnailDataURL(image: File, maxWidth?: number, maxHeight?: number): Promise<string>
  • Function which takes an image file and returns its scaled down thumbnail. A callback is provided and first called for the URL of the original image, then for the thumbnail URL.

    Parameters

    • image: File
    • Default value maxWidth: number = 400
    • Default value maxHeight: number = 400

    Returns Promise<string>

safeGet

  • safeGet(object: object, accessor: string | Array<string>, defaultValue?: any): any
  • Safely retrieves a value from a nested object. Returns defaultValue if the key is not present in the object.

    Parameters

    • object: object
    • accessor: string | Array<string>

      Dot notation or an array of keys

    • Default value defaultValue: any = null

      Value to be returned

    Returns any

    Value or defaultValue

Generated using TypeDoc