c2e786473e8ca7624797235b8656bfd34acabcf42069b296464bb306c874080a8b74b9330af896d5288941be44fbd62076b11f5e7cad9708dc9320d14e1c1c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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 asyncScheduler} 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
  16. * Schedule div height animation
  17. * ```ts
  18. * // html: <div style="background: #0ff;"></div>
  19. * import { animationFrameScheduler } from 'rxjs';
  20. *
  21. * const div = document.querySelector('div');
  22. *
  23. * animationFrameScheduler.schedule(function(height) {
  24. * div.style.height = height + "px";
  25. *
  26. * this.schedule(height + 1); // `this` references currently executing Action,
  27. * // which we reschedule with new state
  28. * }, 0, 0);
  29. *
  30. * // You will see a div element growing in height
  31. * ```
  32. */
  33. export declare const animationFrameScheduler: AnimationFrameScheduler;
  34. /**
  35. * @deprecated Renamed to {@link animationFrameScheduler}. Will be removed in v8.
  36. */
  37. export declare const animationFrame: AnimationFrameScheduler;
  38. //# sourceMappingURL=animationFrame.d.ts.map