Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "helpers"

Index

Variables

Const markdownEscapes

markdownEscapes: any = require('markdown-escapes')

Functions

buildButtonSync

  • buildButtonSync<TButton>(button: TButton, setup?: function): StatusBarItem
  • Builds a button for the status bar.

    Type parameters

    Parameters

    • button: TButton

      The button (settings).

    • Optional setup: function
        • (newStatusBarItem: StatusBarItem, button: TButton): void
        • Parameters

          • newStatusBarItem: StatusBarItem
          • button: TButton

          Returns void

    Returns StatusBarItem

    The new status bar item.

calcBearing

  • calcBearing(lat1: number, lng1: number, lat2: number, lng2: number): number
  • Calculates the bearing between two locations.

    Parameters

    • lat1: number

      The latitude of the 1st location.

    • lng1: number

      The longitude of the 1st location.

    • lat2: number

      The latitude of the 2nd location.

    • lng2: number

      The longitude of the 2nd location.

    Returns number

    The bearing, in degree.

createExtensionDirectoryIfNeeded

  • createExtensionDirectoryIfNeeded(): Promise<boolean>
  • Creates the extension's folder in the home directory, if it does not exist.

    Returns Promise<boolean>

    The promise that indicates if directory has been created or not.

createExtensionDirectoryIfNeededSync

  • createExtensionDirectoryIfNeededSync(): boolean
  • Creates the extension's folder in the home directory, if it does not exist (synchronously).

    Returns boolean

    Indicates if directory has been created or not.

doesMatchFilterCondition

  • Checks if a conditional object does match items condition.

    Parameters

    Returns boolean

    Matches condition or not.

doesMatchPlatformCondition

  • Checks if a platform object does match the (current) platform.

    Parameters

    Returns boolean

    Matches condition or not.

errorToString

  • errorToString(err: any): string
  • Converts an error value to a string.

    Parameters

    • err: any

      The error.

    Returns string

    The error as string.

escapeMarkdown

  • escapeMarkdown(val: any): string
  • Escapes a value for handling as safe Markdown text.

    Parameters

    • val: any

      The input value.

    Returns string

    The escaped value.

executeOnEditorChangedEvents

  • executeOnEditorChangedEvents<TObj>(objs: TObj | TObj[], codeExecutor?: function): void
  • Executes the code in 'onEditorChanged' of an object.

    Type parameters

    Parameters

    • objs: TObj | TObj[]

      One or more objects.

    • Optional codeExecutor: function
        • (code: string, obj: TObj): any
        • Parameters

          • code: string
          • obj: TObj

          Returns any

    Returns void

filterConditionals

  • filterConditionals<TObj>(objs: TObj | TObj[]): TObj[]
  • Filters "conditional" items.

    Type parameters

    Parameters

    • objs: TObj | TObj[]

      The objects to check.

    Returns TObj[]

    The filtered items.

filterForPlatform

  • filterForPlatform<TObj>(objs: TObj | TObj[]): TObj[]
  • Filters "platform" items.

    Type parameters

    Parameters

    • objs: TObj | TObj[]

      The objects to check.

    Returns TObj[]

    The filtered items.

getAppsDir

  • getAppsDir(): string
  • Returns the (possible path) of the extension's global apps sub folder.

    Returns string

    The path of the extension's global apps sub folder.

getExtensionDirInHome

  • getExtensionDirInHome(): string
  • Returns the (possible path) of the extension's sub folder inside the home directory.

    Returns string

    The path of the extension's sub folder inside the home directory.

getInitialStateValue

  • getInitialStateValue(obj: WithState, defaultValue?: any): any
  • Gets the initial state value from an object.

    Parameters

    • obj: WithState

      The object with the value.

    • Default value defaultValue: any = {}

    Returns any

    The initial state value.

importValues

  • importValues<TObj>(obj: TObj, valueProvider: ego_contracts.ValueProvider, clone?: boolean): TObj
  • Imports values to an object.

    Type parameters

    Parameters

    • obj: TObj

      The object where to import the values in.

    • valueProvider: ego_contracts.ValueProvider

      The function that provides the value instances.

    • Optional clone: boolean

    Returns TObj

    The object that contains the imported values.

isVisibleForActiveEditor

  • Checks if an object is visible for an active editor.

    Parameters

    Returns boolean

    Is visible or not.

loadScriptModule

  • loadScriptModule<TModule>(file: string, fromCache?: boolean): TModule
  • Loads a module from a script.

    Type parameters

    • TModule

    Parameters

    • file: string

      The path to the script.

    • Default value fromCache: boolean = false

    Returns TModule

    The loaded module.

requireModule

  • requireModule<TModule>(id: string): TModule
  • Imports a module from the extension's context.

    Type parameters

    • TModule

    Parameters

    • id: string

      The ID of the module.

    Returns TModule

    The module.

showErrorMessage

  • showErrorMessage(err: any): Promise<string>
  • Shows an error message.

    Parameters

    • err: any

      The message to show.

    Returns Promise<string>

    The promise with the result.

toCodeButton

  • Converts a button to a button object, which can be used in code.

    Parameters

    • btn: GlobalButton

      The input object.

    • Optional valueReplacer: function
        • (val: any): string
        • Parameters

          • val: any

          Returns string

    Returns CodeButton

    The output object.

toDegree

  • toDegree(rad: number): number
  • Converts radian to degree.

    Parameters

    • rad: number

      The value, in radian.

    Returns number

    The value, in degree.

updateCommandScriptArgumentsByExecutionContext

Generated using TypeDoc