Type alias TimeoutOverrideFn

TimeoutOverrideFn: (<TArgs>(callback, ms?, ...args) => number | any)

The signature of the override timeout function used to create a new timeout instance, it follows the same signature as the native setTimeout API.

Type declaration

    • <TArgs>(callback, ms?, ...args): number | any
    • Type Parameters

      • TArgs extends any[]

      Parameters

      • callback: ((...args) => void)

        A function to be executed after the timer expires.

          • (...args): void
          • Parameters

            Returns void

      • Optional ms: number

        The time, in milliseconds that the timer should wait before the specified function or code is executed. If this parameter is omitted, a value of 0 is used, meaning execute "immediately", or more accurately, the next event cycle.

      • Rest ...args: TArgs

        Additional arguments which are passed through to the function specified by callback.

      Returns number | any

Since

0.4.4

Returns

The returned timeoutID is a positive integer value which identifies the timer created by the call to setTimeout(). This value can be passed to clearTimeout() to cancel the timeout.