d49420a01d3e04b24d0fc89b5bbd86118c63b3d446be8709d4328f6fc8851debf99863642e7734a3e267415a807da1174a3822548ebc5c9b7b88af112e809e 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import { AsyncAction } from './AsyncAction';
  2. import { Subscription } from '../Subscription';
  3. import { AsyncScheduler } from './AsyncScheduler';
  4. import { SchedulerAction } from '../types';
  5. import { TimerHandle } from './timerHandle';
  6. export declare class VirtualTimeScheduler extends AsyncScheduler {
  7. maxFrames: number;
  8. /** @deprecated Not used in VirtualTimeScheduler directly. Will be removed in v8. */
  9. static frameTimeFactor: number;
  10. /**
  11. * The current frame for the state of the virtual scheduler instance. The difference
  12. * between two "frames" is synonymous with the passage of "virtual time units". So if
  13. * you record `scheduler.frame` to be `1`, then later, observe `scheduler.frame` to be at `11`,
  14. * that means `10` virtual time units have passed.
  15. */
  16. frame: number;
  17. /**
  18. * Used internally to examine the current virtual action index being processed.
  19. * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.
  20. */
  21. index: number;
  22. /**
  23. * This creates an instance of a `VirtualTimeScheduler`. Experts only. The signature of
  24. * this constructor is likely to change in the long run.
  25. *
  26. * @param schedulerActionCtor The type of Action to initialize when initializing actions during scheduling.
  27. * @param maxFrames The maximum number of frames to process before stopping. Used to prevent endless flush cycles.
  28. */
  29. constructor(schedulerActionCtor?: typeof AsyncAction, maxFrames?: number);
  30. /**
  31. * Prompt the Scheduler to execute all of its queued actions, therefore
  32. * clearing its queue.
  33. */
  34. flush(): void;
  35. }
  36. export declare class VirtualAction<T> extends AsyncAction<T> {
  37. protected scheduler: VirtualTimeScheduler;
  38. protected work: (this: SchedulerAction<T>, state?: T) => void;
  39. protected index: number;
  40. protected active: boolean;
  41. constructor(scheduler: VirtualTimeScheduler, work: (this: SchedulerAction<T>, state?: T) => void, index?: number);
  42. schedule(state?: T, delay?: number): Subscription;
  43. protected requestAsyncId(scheduler: VirtualTimeScheduler, id?: any, delay?: number): TimerHandle;
  44. protected recycleAsyncId(scheduler: VirtualTimeScheduler, id?: any, delay?: number): TimerHandle | undefined;
  45. protected _execute(state: T, delay: number): any;
  46. private static sortActions;
  47. }
  48. //# sourceMappingURL=VirtualTimeScheduler.d.ts.map