Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "utils/utils"

Index

Variables

Const FILE_PREFIX

FILE_PREFIX: string

Const RESOURCE_PREFIX

RESOURCE_PREFIX: string

Functions

GC

  • GC(): any
  • An utility function that invokes garbage collection on the JavaScript side.

    Returns any

convertString

  • convertString(value: any): any
  • Converts string value to number or boolean.

    Parameters

    • value: any

      The original value.

    Returns any

eliminateDuplicates

  • eliminateDuplicates(arr: Array<any>): Array<any>
  • Removes duplicate elements from array.

    Parameters

    • arr: Array<any>

      The array.

    Returns Array<any>

escapeRegexSymbols

  • escapeRegexSymbols(source: string): string
  • Escapes special regex symbols (., *, ^, $ and so on) in string in order to create a valid regex from it.

    Parameters

    • source: string

      The original value.

    Returns string

executeOnMainThread

  • executeOnMainThread(func: Function): any
  • Checks if the current thread is the main thread. Directly calls the passed function if it is, or dispatches it to the main thread otherwise.

    Parameters

    • func: Function

      The function to execute on the main thread.

    Returns any

getModuleName

  • getModuleName(path: string): string
  • Gets module name from path.

    Parameters

    • path: string

      The module path.

    Returns string

hasDuplicates

  • hasDuplicates(arr: Array<any>): boolean
  • Checks if array has any duplicate elements.

    Parameters

    • arr: Array<any>

      The array to be checked.

    Returns boolean

isDataURI

  • isDataURI(uri: string): boolean

isFileOrResourcePath

  • isFileOrResourcePath(path: string): boolean
  • Returns true if the specified path points to a resource or local file.

    Parameters

    • path: string

      The path.

    Returns boolean

isFontIconURI

  • isFontIconURI(uri: string): boolean
  • Returns true if the specified URI is a font icon URI like "fontIcon://&#xf1e0".

    Parameters

    • uri: string

      The URI.

    Returns boolean

mainThreadify

  • mainThreadify(func: Function): function
  • Returns a function wrapper which executes the supplied function on the main thread. The wrapper behaves like the original function and passes all of its arguments BUT discards its return value.

    Parameters

    • func: Function

      The function to execute on the main thread

    Returns function

    The wrapper function which schedules execution to the main thread

      • (...args: any[]): void
      • Parameters

        • Rest ...args: any[]

        Returns void

mergeSort

  • mergeSort(arr: Array<any>, compareFunc: function): Array<any>
  • Sorts an array by using merge sort algorithm (which ensures stable sort since the built-in Array.sort() does not promise a stable sort).

    Parameters

    • arr: Array<any>

      array to be sorted

    • compareFunc: function

      function that will be used to compare two elements of the array

        • (a: any, b: any): number
        • Parameters

          • a: any
          • b: any

          Returns number

    Returns Array<any>

openFile

  • openFile(filePath: string): boolean

openUrl

  • openUrl(url: string): boolean

releaseNativeObject

  • releaseNativeObject(object: any): any
  • Releases the reference to the wrapped native object

    Parameters

    • object: any

      The Java/Objective-C object to release.

    Returns any

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method