index.js.flow 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // @flow
  2. import type { Scheduler, Task, ScheduledTask, Timeline, Timer, Clock, Time, Delay, Period, Offset } from '@most/types'
  3. declare export function newScheduler (timer: Timer, timeline: Timeline): Scheduler
  4. declare export function newScheduler (timer: Timer): (timeline: Timeline) => Scheduler
  5. declare export function newDefaultScheduler (): Scheduler
  6. declare export function schedulerRelativeTo (offset: Offset, scheduler: Scheduler): Scheduler
  7. declare export function schedulerRelativeTo (offset: Offset): (scheduler: Scheduler) => Scheduler
  8. declare export function newClockTimer (clock: Clock): Timer
  9. declare export function newTimeline (): Timeline
  10. declare export function newPlatformClock (): Clock
  11. declare export function newPerformanceClock (): Clock
  12. declare export function newDateClock (): Clock
  13. declare export function newHRTimeClock (): Clock
  14. declare export function clockRelativeTo (clock: Clock): Clock
  15. declare export function currentTime (scheduler: Scheduler): Time
  16. declare export function asap (task: Task, scheduler: Scheduler): ScheduledTask
  17. declare export function asap (task: Task): (scheduler: Scheduler) => ScheduledTask
  18. declare export function delay (delay: Delay, task: Task, scheduler: Scheduler): ScheduledTask
  19. declare export function delay (delay: Delay): (task: Task, scheduler: Scheduler) => ScheduledTask
  20. declare export function delay (delay: Delay, task: Task): (scheduler: Scheduler) => ScheduledTask
  21. declare export function delay (delay: Delay): (task: Task) => (scheduler: Scheduler) => ScheduledTask
  22. declare export function periodic (period: Period, task: Task, scheduler: Scheduler): ScheduledTask
  23. declare export function periodic (period: Period): (task: Task, scheduler: Scheduler) => ScheduledTask
  24. declare export function periodic (period: Period, task: Task): (scheduler: Scheduler) => ScheduledTask
  25. declare export function periodic (period: Period): (task: Task) => (scheduler: Scheduler) => ScheduledTask
  26. declare export function cancelTask (scheduledTask: ScheduledTask): void
  27. declare export function cancelAllTasks (predicate: (ScheduledTask) => boolean, scheduler: Scheduler): void
  28. declare export function cancelAllTasks (predicate: (ScheduledTask) => boolean): (Scheduler) => void