Documentation
    Preparing search index...

    Interface TimerLike

    The timer seam behind AssetManagerOptions.timeoutSeconds.

    Injected rather than reached for, like every other IO in this module, so a unit test can expire a deadline without a wall clock and without fake global timers. globalThis satisfies it structurally and is the default.

    Milliseconds appear here and nowhere else. Every fourJS API is in seconds (§7a) — AssetManagerOptions.timeoutSeconds included — but setTimeout is a platform primitive whose unit is fixed, so the conversion happens at this boundary and the boundary says so in the parameter name.

    interface TimerLike {
        clearTimeout(handle: unknown): void;
        setTimeout(callback: () => void, delayMilliseconds: number): unknown;
    }
    Index
    • Cancels a pending callback; a stale handle is a no-op.

      Parameters

      • handle: unknown

      Returns void

    • Schedules callback after delayMilliseconds, returning a handle for TimerLike.clearTimeout.

      Parameters

      • callback: () => void
      • delayMilliseconds: number

      Returns unknown