Defines interface for a system clock. This enables us to instead use a test/MockClock.MockClock for testing.

interface SystemClock {
    cancelAnimFrame(requestID): void;
    cancelCallback(timeoutID): void;
    requestAnimFrame(callback): number;
    scheduleCallback(callback, delay_ms): number;
    systemTime(): number;
}

Implemented by

Methods

  • cancels a pending scheduled callback.

    Parameters

    • timeoutID: number

      the ID of the scheduled callback

    Returns void

  • requests that the callback be executed before the next repaint.

    Parameters

    • callback: (() => void)

      the function to be called

        • (): void
        • Returns void

    Returns number

    the request ID

  • schedules a callback to be executed in the future.

    Parameters

    • callback: (() => void)

      the function to be called

        • (): void
        • Returns void

    • delay_ms: number

      number of milliseconds to wait before executing the callback

    Returns number

    the ID of the callback

  • Returns the current time as given by the system clock, in seconds.

    Returns number

    the current time as given by the system clock, in seconds

Generated using TypeDoc