animationFrame.d.ts 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. import { AnimationFrameScheduler } from './AnimationFrameScheduler';
  2. /**
  3. *
  4. * Animation Frame Scheduler
  5. *
  6. * <span class="informal">Perform task when `window.requestAnimationFrame` would fire</span>
  7. *
  8. * When `animationFrame` scheduler is used with delay, it will fall back to {@link async} scheduler
  9. * behaviour.
  10. *
  11. * Without delay, `animationFrame` scheduler can be used to create smooth browser animations.
  12. * It makes sure scheduled task will happen just before next browser content repaint,
  13. * thus performing animations as efficiently as possible.
  14. *
  15. * @example <caption>Schedule div height animation</caption>
  16. * const div = document.querySelector('.some-div');
  17. *
  18. * Rx.Scheduler.schedule(function(height) {
  19. * div.style.height = height + "px";
  20. *
  21. * this.schedule(height + 1); // `this` references currently executing Action,
  22. * // which we reschedule with new state
  23. * }, 0, 0);
  24. *
  25. * // You will see .some-div element growing in height
  26. *
  27. *
  28. * @static true
  29. * @name animationFrame
  30. * @owner Scheduler
  31. */
  32. export declare const animationFrame: AnimationFrameScheduler;