]> source.dussan.org Git - svg.js.git/commit
It was difficult to use the zero-parameter form of Timeline.schedule() with TypeScrip...
authorpragdave <dave@pragdave.me>
Thu, 7 May 2020 18:51:16 +0000 (13:51 -0500)
committerpragdave <dave@pragdave.me>
Thu, 7 May 2020 18:51:16 +0000 (13:51 -0500)
commitd5097965aa2cc2726e241333d8d6d0fa090717eb
tree35b57230a852cbaf498654210104fa10d7816564
parentc8cb22863bf8c3ac157f6098be9154908aea9ec2
It was difficult to use the zero-parameter form of Timeline.schedule() with TypeScript. The .d.ts file didn't include the retuen type for a list of runner infos, and adding it still m,ade it harder than it should be to iterate over it type safely. In this commit I

1. Added the type information for `ScheduledRunnerInfo`, and updated the Timeline types to include it as a retuen type for `schedule`

2. Added a new function to Timeline, `getSchedule`, that simply returns the runner list. This seems to be cleaner than having the original `schedule` that can return two wildly different things.

I didn't remove the old functionality.
src/animation/Timeline.js
svg.js.d.ts