Options
All
  • Public
  • Public/Protected
  • All
Menu

Module helpers

Index

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Type aliases

FastGlobEntryItem

FastGlobEntryItem: string | IFastGlobEntry

FastGlobOptions

FastGlobOptions: FastGlob.Options

ForEachAsyncAction

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

Action for 'forEachAsync()' function.

param

The current item.

param

The zero based index.

param

The array of all elements.

returns

The result.

Type parameters

  • T

  • TResult

Type declaration

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

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

      Returns TResult | PromiseLike<TResult>

HTTPRequestBody

HTTPRequestBody: string | Buffer | NodeJS.ReadableStream

A possible value for a HTTP request body.

HTTPRequestOptions

HTTPRequestOptions: HTTP.RequestOptions | HTTPs.RequestOptions

HTTP(s) request options.

HTTPRequestURL

HTTPRequestURL: string | vscode.Uri | URL.Url

A possible value for a HTTP request URL.

InvokeAfterAction

InvokeAfterAction<TResult>: (...args: any[]) => TResult | PromiseLike<TResult>

An action for 'invokeAfter()' function.

param

The arguments for the action.

returns

The result of the action.

Type parameters

  • TResult = any

Type declaration

    • (...args: any[]): TResult | PromiseLike<TResult>
    • Parameters

      • Rest ...args: any[]

      Returns TResult | PromiseLike<TResult>

LogAction

LogAction: (context: LogContext) => any

A log action.

param

The log context.

Type declaration

LogFilter

LogFilter: (context: LogContext) => any

A log filter.

Type declaration

OpenAndShowTextDocumentOptions

OpenAndShowTextDocumentOptions: string | { content?: string; language?: string }

Options for 'openAndShowTextDocument()' function.

ProgressResult

ProgressResult<TResult>: TResult | PromiseLike<TResult>

A progress result.

Type parameters

  • TResult = any

ProgressTask

ProgressTask<TResult>: (context: ProgressContext) => ProgressResult<TResult>

A progress task.

param

The underlying context.

returns

The result.

Type parameters

  • TResult = any

Type declaration

SendToBrowserItemCallback

SendToBrowserItemCallback: (message: any) => any

Type declaration

    • (message: any): any
    • Parameters

      • message: any

      Returns any

SimpleCompletedAction

SimpleCompletedAction<TResult>: (err: any, result?: TResult) => void

Describes a simple 'completed' action.

param

The occurred error.

param

The result.

Type parameters

  • TResult

Type declaration

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

      • err: any
      • Optional result: TResult

      Returns void

StringNormalizer

StringNormalizer<TStr>: (str: TStr) => string

Normalizes a string.

param

The value to normalize.

returns

The normalized string.

Type parameters

  • TStr = string

Type declaration

    • (str: TStr): string
    • Parameters

      • str: TStr

      Returns string

TypedLogAction

TypedLogAction: (msg: any, tag?: string) => Logger

A typed log action.

param

The message to log.

param

An additional, optional tag.

returns

The logger instance.

chainable

Type declaration

    • (msg: any, tag?: string): Logger
    • Parameters

      • msg: any
      • Optional tag: string

      Returns Logger

WorkflowAction

WorkflowAction<TPrev, TNext>: (prevValue: TPrev, context: WorkflowActionContext) => TNext | PromiseLike<TNext>

A workflow action.

param

The previous value.

param

The current context.

Type parameters

  • TPrev

  • TNext

Type declaration

WorkspaceWatcher

WorkspaceWatcher<TWorkspace>: (event: WorkspaceWatcherEvent, folder: vscode.WorkspaceFolder, workspace?: TWorkspace) => WorkspaceWatcherResult<TWorkspace> | PromiseLike<WorkspaceWatcherResult>

A workspace watcher.

param

The event.

param

The underlying folder.

param

The workspace to remove.

Type parameters

Type declaration

WorkspaceWatcherCompleteAction

WorkspaceWatcherCompleteAction<TWorkspace>: (err: any, event: WorkspaceWatcherEvent, folder: vscode.WorkspaceFolder, workspace?: TWorkspace) => void | PromiseLike<void>

A workspace watcher 'complete action'.

param

The error (if occurred).

param

The event.

param

The underlying folder.

param

The workspace to remove.

Type parameters

  • TWorkspace

Type declaration

    • (err: any, event: WorkspaceWatcherEvent, folder: vscode.WorkspaceFolder, workspace?: TWorkspace): void | PromiseLike<void>
    • Parameters

      Returns void | PromiseLike<void>

WorkspaceWatcherResult

WorkspaceWatcherResult<TWorkspace>: TWorkspace | void | null | undefined

Possible results of a workspace watcher.

Type parameters

Variables

Const EVENTS

EVENTS: NodeJS.EventEmitter

Stores the global event emitter.

Const EVENT_DISPOSED

EVENT_DISPOSED: "disposed" = "disposed"

Name of the event, when an object has been disposed.

Const EVENT_DISPOSER

EVENT_DISPOSER: vscode.Disposable

Disposes the event emitter, stored in 'EVENTS'.

Const EVENT_DISPOSING

EVENT_DISPOSING: "disposing" = "disposing"

Name of an event, when an object is going to be disposed.

Const IS_AIX

IS_AIX: boolean

Is AIX or not.

Const IS_FREE_BSD

IS_FREE_BSD: boolean

Is Free BSD or not.

Const IS_LINUX

IS_LINUX: boolean

Is Linux or not.

Const IS_MAC

IS_MAC: boolean

Is Sun OS or not.

Const IS_OPEN_BSD

IS_OPEN_BSD: boolean

Is Open BSD or not.

Const IS_SUNOS

IS_SUNOS: boolean

Is Sun OS or not.

Const IS_WINDOWS

IS_WINDOWS: boolean

Is Windows or not.

Const NO_CUSTOM_RESULT

NO_CUSTOM_RESULT: unique symbol

A symbol that indicates that 'IWorkflowActionContext.result' will NOT be used as result value of 'IWorkflowBuilder.start()'.

Const QUEUE

QUEUE: PQueue<default, DefaultAddOptions>

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

Const SESSION

SESSION: {}

Stores global data for the current extension session.

Type declaration

  • [key: string]: any

Const SESSION_DISPOSER

SESSION_DISPOSER: vscode.Disposable

Disposes 'SESSION', by removing its data.

Functions

DELETE

GET

  • Does a HTTP 'GET' request.

    Parameters

    Returns Promise<HTTPRequestResult>

    The promsie with the HTTP response / result.

PATCH

POST

PUT

applyFuncFor

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

    Type parameters

    • TFunc: Function = Function

    Parameters

    • func: TFunc

      The function.

    • thisArgs: any

    Returns TFunc

    The wrapped function.

asArray

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

    Type parameters

    • T

    Parameters

    • val: T | T[] | ReadonlyArray<T>

      The value.

    • Optional removeEmpty: boolean

    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.

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.

buildButtonSync

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

    Type parameters

    Parameters

    • button: TButton

      The button (settings).

    • Optional setup: (newStatusBarItem: vscode.StatusBarItem, button: TButton) => void
        • (newStatusBarItem: vscode.StatusBarItem, button: TButton): void
        • Parameters

          • newStatusBarItem: vscode.StatusBarItem
          • button: TButton

          Returns void

    Returns vscode.StatusBarItem

    The new status bar item.

buildWorkflow

  • Starts building a workflows.

    Parameters

    • Optional initialValue: any

    Returns WorkflowBuilder<undefined>

    The new workflow builder.

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.

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.

    • Optional useNewObjectForFunctions: boolean

    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: (t: T) => U): number
  • Compares values by using a selector.

    Type parameters

    • T

    • U

    Parameters

    • x: T

      The left value.

    • y: T

      The right value.

    • selector: (t: T) => U

      The selector.

        • (t: T): U
        • Parameters

          • t: T

          Returns U

    Returns number

    The "sort value".

createChromeClient

createCompletedAction

  • createCompletedAction<TResult>(resolve: (value?: TResult | PromiseLike<TResult>) => void, reject?: (reason: any) => void): SimpleCompletedAction<TResult>
  • Creates a simple 'completed' callback for a promise.

    Type parameters

    • TResult = any

    Parameters

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

      The 'succeeded' callback.

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

          • Optional value: TResult | PromiseLike<TResult>

          Returns void

    • Optional reject: (reason: any) => void

      The 'error' callback.

        • (reason: any): void
        • Parameters

          • reason: any

          Returns void

    Returns SimpleCompletedAction<TResult>

    The created action.

createDevToolsClient

  • Creates a new instance of a client, which can connect to a DevTools compatible browser like Google Chrome.

    Parameters

    Returns DevToolsClient

    The new client instance.

createDirectoryIfNeeded

  • createDirectoryIfNeeded(dir: string): Promise<boolean>
  • Creates a directory (if needed).

    Parameters

    • dir: string

      The path of the directory to create.

    Returns Promise<boolean>

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

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.

createGitClient

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

    Parameters

    • Optional cwd: string
    • Optional path: string

    Returns Promise<vscode_helpers_scm_git.GitClient>

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

createGitClientSync

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

    Parameters

    • Optional cwd: string
    • Optional path: string

    Returns vscode_helpers_scm_git.GitClient

    The client or (false) if no client found.

createInterval

  • createInterval(callback: Function, ms: number, ...args: any[]): vscode.Disposable
  • Creates a disposable interval.

    Parameters

    • callback: Function

      The callback.

    • ms: number

      The interval in milliseconds.

    • Rest ...args: any[]

    Returns vscode.Disposable

    The disposable for the interval.

createLogger

  • Creates a new logger instance.

    Parameters

    Returns ActionLogger

    The new logger.

createQueue

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

    Type parameters

    • TOpts: QueueAddOptions = QueueAddOptions

    Parameters

    • Optional opts: TOpts

    Returns PQueue<default, DefaultAddOptions>

    The new queue.

createTimeout

  • createTimeout(callback: Function, ms: number, ...args: any[]): vscode.Disposable
  • Creates a disposable timeout.

    Parameters

    • callback: Function

      The callback.

    • ms: number

      The timeout in milliseconds.

    • Rest ...args: any[]

    Returns vscode.Disposable

    The disposable for the timeout.

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.

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.

execFile

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

    Parameters

    • command: string

      The thing / command to execute.

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

    Returns Promise<ExecFileResult>

    The promise with the result.

executeOnEditorChangedEvents

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

    Type parameters

    Parameters

    • objs: TObj | TObj[]

      One or more objects.

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

          • code: string
          • obj: TObj

          Returns any

    Returns void

exists

  • exists(path: string | Buffer): Promise<boolean>
  • Promise version of 'FS.exists()' function.

    Parameters

    • path: string | Buffer

      The path.

    Returns Promise<boolean>

    The promise that indicates if path exists or not.

fastGlob

  • fastGlob(patterns: string | string[], opts?: FastGlob.Options): Promise<FastGlobEntryItem[]>
  • Fast version of 'node-glob'.

    Parameters

    • patterns: string | string[]

      One or more patterns to search for.

    • Optional opts: FastGlob.Options

    Returns Promise<FastGlobEntryItem[]>

    Promise with the found files / directories.

fastGlobSync

  • fastGlobSync(patterns: string | string[], opts?: FastGlob.Options): FastGlobEntryItem[]
  • Fast version of 'node-glob' (sync).

    Parameters

    • patterns: string | string[]

      One or more patterns to search for.

    • Optional opts: FastGlob.Options

    Returns FastGlobEntryItem[]

    The found files / directories.

filterConditionals

  • filterConditionals<TObj>(objs: TObj | TObj[]): TObj[]

filterExtensionNotifications

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.

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.

from

  • from<T>(seq?: Sequence<T>): IEnumerable<T>
  • Creates a new sequence.

    Type parameters

    • T = any

    Parameters

    • Optional seq: Sequence<T>

      The input data.

    Returns IEnumerable<T>

    The new sequence.

fromMarkdown

  • fromMarkdown(md: any, opts?: Marked.MarkedOptions): string
  • Generates HTML from Markdown.

    Parameters

    • md: any

      The value with Markdown data.

    • Optional opts: Marked.MarkedOptions

    Returns string

    The generated HTML.

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.

getExtensionNotifications

  • Returns the notifications for an extension.

    Parameters

    • url: HTTPRequestURL

      The URL of the JSON file, which contains the notifications.

    Returns Promise<ExtensionNotification[]>

    The promise with the notifications.

getExtensionRoot

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

    Returns string

    The root directory of the extension.

getInitialStateValue

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

    Parameters

    • obj: WithState

      The object with the value.

    • defaultValue: any = {}

    Returns any

    The initial state value.

getPackageFile

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

    Parameters

    • Optional packageJson: string

    Returns Promise<PackageFile>

    The promise with the meta data of the file.

getPackageFileSync

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

    Parameters

    • Optional packageJson: string

    Returns PackageFile

    The meta data of the file.

glob

  • glob(patterns: string | string[], opts?: Glob.IOptions): Promise<string[]>
  • Promise version of 'Glob()' function.

    Parameters

    • patterns: string | string[]

      One or more patterns.

    • Optional opts: Glob.IOptions

    Returns Promise<string[]>

    The promise with the matches.

globSync

  • globSync(patterns: string | string[], opts?: Glob.IOptions): string[]
  • Multi pattern version of 'Glob.sync()' function.

    Parameters

    • patterns: string | string[]

      One or more patterns.

    • Optional opts: Glob.IOptions

    Returns string[]

    The matches.

guid

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

    Parameters

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

    Returns string

importValues

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

    Type parameters

    Parameters

    • obj: TObj

      The object where to import the values in.

    • valueProvider: ValueProvider

      The function that provides the value instances.

    • Optional clone: boolean

    Returns TObj

    The object that contains the imported values.

invokeAfter

  • invokeAfter<TResult>(action: InvokeAfterAction<TResult>, ms?: number, ...args: any[]): Promise<TResult>
  • Invokes an action after a timeout.

    Type parameters

    • TResult = any

    Parameters

    • action: InvokeAfterAction<TResult>

      The action to invoke.

    • Optional ms: number
    • Rest ...args: any[]

    Returns Promise<TResult>

    The promise with the result.

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.

isBlockDevice

  • isBlockDevice(path: string, useLSTAT?: boolean): Promise<boolean>
  • Checks if a path exists and is a block device.

    Parameters

    • path: string

      The path to check.

    • Optional useLSTAT: boolean

    Returns Promise<boolean>

    The promise with the value that indicates if condition matches or not.

isBlockDeviceSync

  • isBlockDeviceSync(path: string, useLSTAT?: boolean): boolean
  • Checks if a path exists and is a block device.

    Parameters

    • path: string

      The path to check.

    • Optional useLSTAT: boolean

    Returns boolean

    A value that indicates if condition matches or not.

isCharacterDevice

  • isCharacterDevice(path: string, useLSTAT?: boolean): Promise<boolean>
  • Checks if a path exists and is a character device.

    Parameters

    • path: string

      The path to check.

    • Optional useLSTAT: boolean

    Returns Promise<boolean>

    The promise with the value that indicates if condition matches or not.

isCharacterDeviceSync

  • isCharacterDeviceSync(path: string, useLSTAT?: boolean): boolean
  • Checks if a path exists and is a character device.

    Parameters

    • path: string

      The path to check.

    • Optional useLSTAT: boolean

    Returns boolean

    A value that indicates if condition matches or not.

isDirectory

  • isDirectory(path: string, useLSTAT?: boolean): Promise<boolean>
  • Checks if a path exists and is a directory.

    Parameters

    • path: string

      The path to check.

    • Optional useLSTAT: boolean

    Returns Promise<boolean>

    The promise with the value that indicates if condition matches or not.

isDirectorySync

  • isDirectorySync(path: string, useLSTAT?: boolean): boolean
  • Checks if a path exists and is a directory.

    Parameters

    • path: string

      The path to check.

    • Optional useLSTAT: boolean

    Returns boolean

    A value that indicates if condition matches 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.

isFIFO

  • isFIFO(path: string, useLSTAT?: boolean): Promise<boolean>
  • Checks if a path exists and is FIFO.

    Parameters

    • path: string

      The path to check.

    • Optional useLSTAT: boolean

    Returns Promise<boolean>

    The promise with the value that indicates if condition matches or not.

isFIFOSync

  • isFIFOSync(path: string, useLSTAT?: boolean): boolean
  • Checks if a path exists and is FIFO.

    Parameters

    • path: string

      The path to check.

    • Optional useLSTAT: boolean

    Returns boolean

    A value that indicates if condition matches or not.

isFile

  • isFile(path: string, useLSTAT?: boolean): Promise<boolean>
  • Checks if a path exists and is a file.

    Parameters

    • path: string

      The path to check.

    • Optional useLSTAT: boolean

    Returns Promise<boolean>

    The promise with the value that indicates if condition matches or not.

isFileSync

  • isFileSync(path: string, useLSTAT?: boolean): boolean
  • Checks if a path exists and is a file.

    Parameters

    • path: string

      The path to check.

    • Optional useLSTAT: boolean

    Returns boolean

    A value that indicates if condition matches or not.

isSocket

  • isSocket(path: string, useLSTAT?: boolean): Promise<boolean>
  • Checks if a path exists and is a socket.

    Parameters

    • path: string

      The path to check.

    • Optional useLSTAT: boolean

    Returns Promise<boolean>

    The promise with the value that indicates if condition matches or not.

isSocketSync

  • isSocketSync(path: string, useLSTAT?: boolean): boolean
  • Checks if a path exists and is a socket.

    Parameters

    • path: string

      The path to check.

    • Optional useLSTAT: boolean

    Returns boolean

    A value that indicates if condition matches or not.

isSymbolicLink

  • isSymbolicLink(path: string, useLSTAT?: boolean): Promise<boolean>
  • Checks if a path exists and is a symbolic link.

    Parameters

    • path: string

      The path to check.

    • Optional useLSTAT: boolean

    Returns Promise<boolean>

    The promise with the value that indicates if condition matches or not.

isSymbolicLinkSync

  • isSymbolicLinkSync(path: string, useLSTAT?: boolean): boolean
  • Checks if a path exists and is a symbolic link.

    Parameters

    • path: string

      The path to check.

    • Optional useLSTAT: boolean

    Returns boolean

    A value that indicates if condition matches or not.

isVisibleForActiveEditor

loadModule

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

    Type parameters

    • TModule = any

    Parameters

    • file: string

      The path to the script.

    • Optional fromCache: boolean

    Returns TModule

    The loaded module.

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.

    • fromCache: boolean = false

    Returns TModule

    The loaded module.

makeNonDisposable

  • makeNonDisposable<TObj>(obj: TObj, throwOnDispose?: boolean): TObj
  • Clones an object and makes it non disposable.

    Type parameters

    • TObj: Disposable<TObj>

    Parameters

    • obj: TObj

      The object to clone.

    • Optional throwOnDispose: boolean

    Returns TObj

    The cloned object.

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<vscode.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.

range

  • range(start: number, count?: number): IEnumerable<number>
  • Creates a range of numbers.

    Parameters

    • start: number

      The start value.

    • Optional count: number

    Returns IEnumerable<number>

    The new sequence.

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.

registerWorkspaceWatcher

repeat

  • repeat<T>(item: T, count?: number): IEnumerable<T>
  • Creates a range of numbers.

    Type parameters

    • T = any

    Parameters

    • item: T

      The item to repeat.

    • Optional count: number

    Returns IEnumerable<T>

    The new sequence.

request

  • Does a HTTP request.

    Parameters

    Returns Promise<HTTPRequestResult>

    The promsie with the HTTP response / result.

requireModule

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

    Type parameters

    • TModule = any

    Parameters

    • id: string

      The ID of the module.

    Returns TModule

    The module.

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.

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.

size

  • size(path: string | Buffer, useLSTAT?: boolean): Promise<number>
  • Returns the size of a file system element.

    Parameters

    • path: string | Buffer

      The path to the element.

    • Optional useLSTAT: boolean

    Returns Promise<number>

    The promise with the size.

sizeSync

  • sizeSync(path: string | Buffer, useLSTAT?: boolean): number
  • Returns the size of a file system element (sync).

    Parameters

    • path: string | Buffer

      The path to the element.

    • Optional useLSTAT: boolean

    Returns number

    The size.

sleep

  • sleep(ms?: number): Promise<void>
  • Waits a number of milliseconds.

    Parameters

    • Optional ms: number

    Returns Promise<void>

startWatch

  • Creates and starts a new stop watch.

    Returns StopWatch

    The new, started watch.

tempFile

  • tempFile<TResult>(action: (file: string) => TResult | PromiseLike<TResult>, opts?: TempFileOptions): Promise<TResult>
  • Invokes an action for a temp file.

    Type parameters

    • TResult = any

    Parameters

    • action: (file: string) => TResult | PromiseLike<TResult>

      The action to invoke.

        • (file: string): TResult | PromiseLike<TResult>
        • Parameters

          • file: string

          Returns TResult | PromiseLike<TResult>

    • Optional opts: TempFileOptions

    Returns Promise<TResult>

    The promise with the result of the action.

tempFileSync

  • tempFileSync<TResult>(action: (file: string) => TResult, opts?: TempFileOptions): TResult
  • Invokes an action for a temp file (sync).

    Type parameters

    • TResult = any

    Parameters

    • action: (file: string) => TResult

      The action to invoke.

        • (file: string): TResult
        • Parameters

          • file: string

          Returns TResult

    • Optional opts: TempFileOptions

    Returns TResult

    The result of the action.

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.

    • Optional normalize: boolean

    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.

    • Optional defaultVal: boolean

    Returns boolean

    'val' as boolean.

toCodeButton

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

    Parameters

    • btn: GlobalButton

      The input object.

    • Optional valueReplacer: (val: any) => string
        • (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.

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.

    • Optional defaultVal: string

    Returns string

    'val' as string.

tryClearInterval

  • tryClearInterval(intervalId: NodeJS.Timer): boolean
  • Tries to clear an interval.

    Parameters

    • intervalId: NodeJS.Timer

      The interval (ID).

    Returns boolean

    Operation was successfull or not.

tryClearTimeout

  • tryClearTimeout(timeoutId: NodeJS.Timer): boolean
  • Tries to clear a timeout.

    Parameters

    • timeoutId: NodeJS.Timer

      The timeout (ID).

    Returns boolean

    Operation was successfull or not.

tryCreateGitClient

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

    Parameters

    • Optional cwd: string
    • Optional path: string

    Returns Promise<vscode_helpers_scm_git.GitClient | false>

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

tryCreateGitClientSync

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

    Parameters

    • Optional cwd: string
    • Optional path: string

    Returns vscode_helpers_scm_git.GitClient | false

    The client or (false) if no client found.

tryDispose

  • tryDispose(obj: vscode.Disposable): boolean
  • Tries to dispose an object.

    Parameters

    • obj: vscode.Disposable

      The object to dispose.

    Returns boolean

    Operation was successful or not.

tryDisposeAndDelete

  • tryDisposeAndDelete(obj: any, key: PropertyKey, alwaysDelete?: boolean): false | vscode.Disposable
  • Tries to dispose an object inside another, parent object and deletes it there.

    Parameters

    • obj: any

      The "other" / parent object.

    • key: PropertyKey

      The key inside 'obj', where the disposable object is stored and should be removed.

    • Optional alwaysDelete: boolean

    Returns false | vscode.Disposable

    The disposed and removed object or (false) if failed.

tryRemoveAllListeners

  • tryRemoveAllListeners(obj: NodeJS.EventEmitter, ev?: string | symbol): boolean
  • Tries to remove all listeners from an event emitter.

    Parameters

    • obj: NodeJS.EventEmitter

      The emitter.

    • Optional ev: string | symbol

    Returns boolean

    Operation was successfull or not.

tryRemoveListener

  • tryRemoveListener(obj: NodeJS.EventEmitter, ev: string | symbol, listener: (...args: any[]) => void): boolean
  • Tries to remove a listener from an event emitter.

    Parameters

    • obj: NodeJS.EventEmitter

      The emitter.

    • ev: string | symbol

      The event.

    • listener: (...args: any[]) => void

      The listener.

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

          • Rest ...args: any[]

          Returns void

    Returns boolean

    Operation was successfull or not.

updateCommandScriptArgumentsByExecutionContext

using

  • using<TObj, TResult>(obj: TObj, func: (o: TObj, ...args: any[]) => TResult | PromiseLike<TResult>, ...args: any[]): Promise<TResult>
  • Invokes a function for a disposable object and keeps sure, that this object will be disposed, even on error.

    Type parameters

    • TObj: Disposable<TObj> = Disposable

    • TResult = any

    Parameters

    • obj: TObj

      The object.

    • func: (o: TObj, ...args: any[]) => TResult | PromiseLike<TResult>

      The function to invoke.

        • (o: TObj, ...args: any[]): TResult | PromiseLike<TResult>
        • Parameters

          • o: TObj
          • Rest ...args: any[]

          Returns TResult | PromiseLike<TResult>

    • Rest ...args: any[]

    Returns Promise<TResult>

    Promise The promise with the result of the function.

usingSync

  • usingSync<TObj, TResult>(obj: TObj, func: (o: TObj, ...args: any[]) => TResult, ...args: any[]): TResult
  • Invokes a function for a disposable object sync and keeps sure, that this object will be disposed, even on error.

    Type parameters

    • TObj: Disposable<TObj> = Disposable

    • TResult = any

    Parameters

    • obj: TObj

      The object.

    • func: (o: TObj, ...args: any[]) => TResult

      The function to invoke.

        • (o: TObj, ...args: any[]): TResult
        • Parameters

          • o: TObj
          • Rest ...args: any[]

          Returns TResult

    • Rest ...args: any[]

    Returns TResult

    TResult The result of the function.

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.

waitWhile

  • waitWhile(predicate: () => boolean | PromiseLike<boolean>, opts?: WaitWhileOptions): Promise<boolean>
  • Waits while a predicate matches.

    Parameters

    • predicate: () => boolean | PromiseLike<boolean>

      The predicate.

        • (): boolean | PromiseLike<boolean>
        • Returns boolean | PromiseLike<boolean>

    • Optional opts: WaitWhileOptions

    Returns Promise<boolean>

    The promise that indicates if timeout reached (false) or not (true).

withProgress

  • Runs a task with progress information.

    Type parameters

    • TResult = any

    Parameters

    Returns Promise<TResult>

    The promise with the result.

Generated using TypeDoc