timer.d.ts 637 B

12345678910111213141516171819
  1. import type { TimerMap } from './clock';
  2. export type TimerStatus = 'pending' | 'resolved' | 'rejected';
  3. export declare class Timer {
  4. #private;
  5. readonly type: TimerType;
  6. constructor(clock: TimerMap, type: TimerType);
  7. get status(): TimerStatus;
  8. start: () => Promise<void>;
  9. done: () => void;
  10. }
  11. export declare class TimerType {
  12. readonly id: symbol;
  13. readonly name: string;
  14. readonly timeout: number;
  15. constructor(name: string, timeout?: number);
  16. create: (clock: TimerMap) => Timer;
  17. }
  18. export declare const createTimer: (name: string, timeout?: number) => TimerType;
  19. //# sourceMappingURL=timer.d.ts.map