Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "timers/index"

Index

Type aliases

InvokeAfterAction

InvokeAfterAction: function

An action for 'invokeAfter()' function.

param

The arguments for the action.

returns

The result of the action.

Type declaration

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

      • Rest ...args: any[]

      Returns TResult | PromiseLike<TResult>

Functions

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.

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.

invokeAfter

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

    Type parameters

    • TResult

    Parameters

    • action: InvokeAfterAction<TResult>

      The action to invoke.

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

    Returns Promise<TResult>

    The promise with the result.

sleep

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

    Parameters

    • Optional ms: number

    Returns Promise<void>

startWatch

tryClearInterval

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

    Parameters

    • intervalId: Timer

      The interval (ID).

    Returns boolean

    Operation was successfull or not.

tryClearTimeout

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

    Parameters

    • timeoutId: Timer

      The timeout (ID).

    Returns boolean

    Operation was successfull or not.

waitWhile

  • Waits while a predicate matches.

    Parameters

    • predicate: function

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

Generated using TypeDoc