Interface Intervals

Interface for interval management functionality

interface Intervals {
    clear(name: string): void;
    get(name: string): undefined | Timeout;
    set(name: string, callback: () => void, interval: number): Timeout;
}

Methods

Methods

  • Clear an interval by name

    Parameters

    • name: string

      Name of the interval to clear

    Returns void

  • Get an interval by name

    Parameters

    • name: string

      Name of the interval

    Returns undefined | Timeout

  • Set a new interval

    Parameters

    • name: string

      Name for the interval

    • callback: () => void

      Function to execute

    • interval: number

      Time in milliseconds between executions

    Returns Timeout