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.
this._stepImmediate = this._stepFn.bind(this, true)
}
+ // returns information on each runner in the timeline.
+ // (start, duration, end, and runner)
+
+ getSchedule () {
+ return this._runners.map(makeSchedule)
+ }
+
// schedules a runner on the timeline
schedule (runner, delay, when) {
if (runner == null) {
- return this._runners.map(makeSchedule)
+ return this.getSchedule()
}
// The start time for the next animation can either be given explicitly,
}\r
\r
// Timeline.js\r
+ interface ScheduledRunnerInfo {\r
+ start: number\r
+ duration: number\r
+ end: number\r
+ runner: Runner\r
+ }\r
+\r
class Timeline extends EventTarget {\r
constructor()\r
constructor(fn: Function)\r
\r
- schedule(runner?: Runner, delay?: number, when?: string): this\r
+ getSchedule(): ScheduledRunnerInfo[]\r
+ schedule(runner?: Runner, delay?: number, when?: string): ( this | ScheduledRunnerInfo[] )\r
unschedule(runner: Runner): this\r
getEndTime(): number\r
updateTime(): this\r