Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "index"

Index

Type aliases

ForEachAsyncAction

ForEachAsyncAction: function

Action for 'forEachAsync()' function.

param

The current item.

param

The zero based index.

param

The array of all elements.

returns

The result.

Type declaration

    • (item: T, index: number, array: T[]): TResult | PromiseLike<TResult>
    • Parameters

      • item: T
      • index: number
      • array: T[]

      Returns TResult | PromiseLike<TResult>

OpenAndShowTextDocumentOptions

OpenAndShowTextDocumentOptions: string | object

Options for 'openAndShowTextDocument()' function.

SimpleCompletedAction

SimpleCompletedAction: function

Describes a simple 'completed' action.

param

The occurred error.

param

The result.

Type declaration

    • (err: any, result?: TResult): void
    • Parameters

      • err: any
      • Optional result: TResult

      Returns void

StringNormalizer

StringNormalizer: function

Normalizes a string.

param

The value to normalize.

returns

The normalized string.

Type declaration

    • (str: TStr): string
    • Parameters

      • str: TStr

      Returns string

Variables

Const IS_AIX

IS_AIX: boolean = process.platform === 'aix'

Is AIX or not.

Const IS_FREE_BSD

IS_FREE_BSD: boolean = process.platform === 'freebsd'

Is Free BSD or not.

Const IS_LINUX

IS_LINUX: boolean = process.platform === 'linux'

Is Linux or not.

Const IS_MAC

IS_MAC: boolean = process.platform === 'darwin'

Is Sun OS or not.

Const IS_OPEN_BSD

IS_OPEN_BSD: boolean = process.platform === 'openbsd'

Is Open BSD or not.

Const IS_SUNOS

IS_SUNOS: boolean = process.platform === 'sunos'

Is Sun OS or not.

Const IS_WINDOWS

IS_WINDOWS: boolean = process.platform === 'win32'

Is Windows or not.

Const IsBinaryFile

IsBinaryFile: any = require("isbinaryfile")

Const MergeDeep

MergeDeep: any = require('merge-deep')

Const QUEUE

QUEUE: PQueue<DefaultAddOptions> = new PQueue({autoStart: true,concurrency: 1,})

Global execution queue, which only allows one execution at the same time.

Const SESSION

SESSION: object

Stores global data for the current extension session.

Type declaration

  • [key: string]: any

Let extensionRoot

extensionRoot: string

Functions

applyFuncFor

  • applyFuncFor<TFunc>(func: TFunc, thisArgs: any): TFunc
  • Applies a function for a specific object / value.

    Type parameters

    • TFunc: Function

    Parameters

    • func: TFunc

      The function.

    • thisArgs: any

    Returns TFunc

    The wrapped function.

asArray

  • asArray<T>(val: T | T[], removeEmpty?: boolean): T[]
  • Returns a value as array.

    Type parameters

    • T

    Parameters

    • val: T | T[]

      The value.

    • Default value removeEmpty: boolean = true

    Returns T[]

    The value as (new) array.

asBuffer

  • asBuffer(val: any, enc?: string, maxDepth?: number): Promise<Buffer>
  • Returns a value as buffer.

    Parameters

    • val: any

      The value to convert / cast.

    • Optional enc: string

      The custom encoding for the string parsers.

    • Optional maxDepth: number

    Returns Promise<Buffer>

    The promise with the buffer.

asBufferInner

  • asBufferInner(val: any, enc?: string, funcDepth?: number, maxDepth?: number): Promise<Buffer>
  • Parameters

    • val: any
    • Optional enc: string
    • Optional funcDepth: number
    • Optional maxDepth: number

    Returns Promise<Buffer>

asLocalTime

  • asLocalTime(val: any): Moment.Moment
  • Returns a value as local Moment instance.

    Parameters

    • val: any

      The input value.

    Returns Moment.Moment

    The output value.

asUTC

  • asUTC(val: any): Moment.Moment
  • Returns a value as UTC Moment instance.

    Parameters

    • val: any

      The input value.

    Returns Moment.Moment

    The output value.

cloneObject

  • cloneObject<T>(val: T): T
  • Clones an object / value deep.

    Type parameters

    • T

    Parameters

    • val: T

      The value / object to clone.

    Returns T

    The cloned value / object.

cloneObjectFlat

  • cloneObjectFlat<T>(val: T, useNewObjectForFunctions?: boolean): T
  • Clones an value flat.

    Type parameters

    • T

    Parameters

    • val: T

      The object to clone.

    • Default value useNewObjectForFunctions: boolean = true

    Returns T

    The cloned object.

compareValues

  • compareValues<T>(x: T, y: T): number
  • Compares two values for a sort operation.

    Type parameters

    • T

    Parameters

    • x: T

      The left value.

    • y: T

      The right value.

    Returns number

    The "sort value".

compareValuesBy

  • compareValuesBy<T, U>(x: T, y: T, selector: function): number
  • Compares values by using a selector.

    Type parameters

    • T

    • U

    Parameters

    • x: T

      The left value.

    • y: T

      The right value.

    • selector: function

      The selector.

        • (t: T): U
        • Parameters

          • t: T

          Returns U

    Returns number

    The "sort value".

createChromeClient

createCompletedAction

  • Creates a simple 'completed' callback for a promise.

    Type parameters

    • TResult

    Parameters

    • resolve: function

      The 'succeeded' callback.

        • (value?: TResult | PromiseLike<TResult>): void
        • Parameters

          • Optional value: TResult | PromiseLike<TResult>

          Returns void

    • Optional reject: function

      The 'error' callback.

        • (reason: any): void
        • Parameters

          • reason: any

          Returns void

    Returns SimpleCompletedAction<TResult>

    The created action.

createDevToolsClient

createGitClient

  • createGitClient(cwd?: string, path?: string): Promise<GitClient>
  • Creates a Git client.

    Parameters

    • Optional cwd: string
    • Optional path: string

    Returns Promise<GitClient>

    The promise with the client or (false) if no client found.

createGitClientSync

  • createGitClientSync(cwd?: string, path?: string): GitClient
  • Creates a Git client (sync).

    Parameters

    • Optional cwd: string
    • Optional path: string

    Returns GitClient

    The client or (false) if no client found.

createQueue

  • createQueue<TOpts>(opts?: TOpts): PQueue<DefaultAddOptions>
  • Creates a new queue.

    Type parameters

    • TOpts: QueueAddOptions

    Parameters

    • Optional opts: TOpts

    Returns PQueue<DefaultAddOptions>

    The new queue.

doesMatch

  • doesMatch(val: any, patterns: string | string[], options?: Minimatch.IOptions): boolean
  • Handles a value as string and checks if it does match at least one (minimatch) pattern.

    Parameters

    • val: any

      The value to check.

    • patterns: string | string[]

      One or more patterns.

    • Optional options: Minimatch.IOptions

    Returns boolean

    Does match or not.

execFile

  • execFile(command: string, args?: any[], opts?: ExecFileOptions): Promise<ExecFileResult>
  • Executes a file.

    Parameters

    • command: string

      The thing / command to execute.

    • Optional args: any[]
    • Optional opts: ExecFileOptions

    Returns Promise<ExecFileResult>

    The promise with the result.

forEachAsync

  • forEachAsync<T, TResult>(items: Enumerable.Sequence<T>, action: ForEachAsyncAction<T, TResult>, thisArg?: any): Promise<TResult>
  • Async 'forEach'.

    Type parameters

    • T

    • TResult

    Parameters

    • items: Enumerable.Sequence<T>

      The items to iterate.

    • action: ForEachAsyncAction<T, TResult>

      The item action.

    • Optional thisArg: any

    Returns Promise<TResult>

    The result of the last action call.

format

  • format(formatStr: any, ...args: any[]): string
  • Formats a string.

    Parameters

    • formatStr: any

      The value that represents the format string.

    • Rest ...args: any[]

    Returns string

    The formated string.

formatArray

  • formatArray(formatStr: any, args: Enumerable.Sequence<any>): string
  • Formats a string.

    Parameters

    • formatStr: any

      The value that represents the format string.

    • args: Enumerable.Sequence<any>

    Returns string

    The formated string.

getExtensionRoot

  • getExtensionRoot(): string
  • Gets the root directory of the extension.

    Returns string

    The root directory of the extension.

getPackageFile

  • getPackageFile(packageJson?: string): Promise<PackageFile>
  • Loads the package file (package.json) of the extension.

    Parameters

    • Default value packageJson: string = "../package.json"

    Returns Promise<PackageFile>

    The promise with the meta data of the file.

getPackageFilePath

  • getPackageFilePath(packageJson?: string): string
  • Parameters

    • Optional packageJson: string

    Returns string

getPackageFileSync

  • getPackageFileSync(packageJson?: string): PackageFile
  • Loads the package file (package.json) of the extension sync.

    Parameters

    • Default value packageJson: string = "../package.json"

    Returns PackageFile

    The meta data of the file.

guid

  • guid(ver?: string, ...args: any[]): string
  • Alias for 'uuid'.

    Parameters

    • Optional ver: string
    • Rest ...args: any[]

    Returns string

isBinaryContent

  • isBinaryContent(data: Buffer): Promise<boolean>
  • Checks if data is binary or text content.

    Parameters

    • data: Buffer

      The data to check.

    Returns Promise<boolean>

    The promise that indicates if content is binary or not.

isBinaryContentSync

  • isBinaryContentSync(data: Buffer): boolean
  • Checks if data is binary or text content (sync).

    Parameters

    • data: Buffer

      The data to check.

    Returns boolean

    Content is binary or not.

isEmptyString

  • isEmptyString(val: any): boolean
  • Checks if the string representation of a value is empty or contains whitespaces only.

    Parameters

    • val: any

      The value to check.

    Returns boolean

    Is empty or not.

loadModule

  • loadModule<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.

normalizeString

  • Normalizes a value as string so that is comparable.

    Parameters

    Returns string

    The normalized value.

now

  • now(timezone?: string): Moment.Moment
  • Returns the current time.

    Parameters

    • Optional timezone: string

    Returns Moment.Moment

    The current time.

openAndShowTextDocument

  • Opens and shows a new text document / editor.

    Parameters

    Returns Promise<TextEditor>

    The promise with the new, opened text editor.

randomBytes

  • randomBytes(size: number): Promise<Buffer>
  • Promise version of 'crypto.randomBytes()' function.

    Parameters

    • size: number

      The size of the result.

    Returns Promise<Buffer>

    The buffer with the random bytes.

readAll

  • readAll(stream: Stream.Readable, enc?: string): Promise<Buffer>
  • Reads the content of a stream.

    Parameters

    • stream: Stream.Readable

      The stream.

    • Optional enc: string

    Returns Promise<Buffer>

    The promise with the content.

setExtensionRoot

  • setExtensionRoot(path: string): string
  • Sets the root directory of the extension.

    Parameters

    • path: string

      The path of the extension.

    Returns string

    The new value.

toArray

  • toArray<T>(seq: Enumerable.Sequence<T>, normalize?: boolean): T[]
  • Returns a sequence object as new array.

    Type parameters

    • T

    Parameters

    • seq: Enumerable.Sequence<T>

      The input object.

    • Default value normalize: boolean = true

    Returns T[]

    The input object as array.

toBooleanSafe

  • toBooleanSafe(val: any, defaultVal?: boolean): boolean
  • Returns a value as boolean, which is not (null) and (undefined).

    Parameters

    • val: any

      The value to convert.

    • Default value defaultVal: boolean = false

    Returns boolean

    'val' as boolean.

toEOL

  • toEOL(eol?: vscode.EndOfLine): string
  • Converts an EOL enum value to a string.

    Parameters

    • Optional eol: vscode.EndOfLine

    Returns string

    string The EOL string.

toStringSafe

  • toStringSafe(val: any, defaultVal?: string): string
  • Returns a value as string, which is not (null) and (undefined).

    Parameters

    • val: any

      The value to convert.

    • Default value defaultVal: string = ""

    Returns string

    'val' as string.

tryCreateGitClient

  • tryCreateGitClient(cwd?: string, path?: string): Promise<GitClient | false>
  • Tries to create a Git client.

    Parameters

    • Optional cwd: string
    • Optional path: string

    Returns Promise<GitClient | false>

    The promise with the client or (false) if no client found.

tryCreateGitClientSync

  • tryCreateGitClientSync(cwd?: string, path?: string): GitClient | false
  • Tries to create a Git client (sync).

    Parameters

    • Optional cwd: string
    • Optional path: string

    Returns GitClient | false

    The client or (false) if no client found.

utcNow

  • utcNow(): Moment.Moment
  • Returns the current UTC time.

    Returns Moment.Moment

    The current UTC time.

uuid

  • uuid(ver?: string, ...args: any[]): string
  • Generates a new unique ID.

    Parameters

    • Optional ver: string
    • Rest ...args: any[]

    Returns string

    The generated ID.

Object literals

Const SESSION_DISPOSER

SESSION_DISPOSER: object

Disposes 'SESSION', by removing its data.

dispose

  • dispose(): void

Generated using TypeDoc