import { Tick } from './nextTick' ; export type Animation = { run ( task ) : void ; stop ( ) : void ; } ; export function Animation ( ) { const tick = Tick ( ) ; function run ( task ) { tick . run ( ( interval ) => { run ( task ) ; task ( interval ) ; } ) ; } function stop ( ) { tick . stop ( ) ; } return { run , stop } ; }