1 | import { Seconds } from "../type/Units.js";
|
2 | import { Timeline, TimelineEvent } from "./Timeline.js";
|
3 | export type BasicPlaybackState = "started" | "stopped";
|
4 | export type PlaybackState = BasicPlaybackState | "paused";
|
5 | export interface StateTimelineEvent extends TimelineEvent {
|
6 | state: PlaybackState;
|
7 | }
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | export declare class StateTimeline<AdditionalOptions extends Record<string, any> = Record<string, any>> extends Timeline<StateTimelineEvent & AdditionalOptions> {
|
14 | readonly name: string;
|
15 | |
16 |
|
17 |
|
18 | private _initial;
|
19 | constructor(initial?: PlaybackState);
|
20 | /**
|
21 | * Returns the scheduled state scheduled before or at
|
22 | * the given time.
|
23 | * @param time The time to query.
|
24 | * @return The name of the state input in setStateAtTime.
|
25 | */
|
26 | getValueAtTime(time: Seconds): PlaybackState;
|
27 | /**
|
28 | * Add a state to the timeline.
|
29 | * @param state The name of the state to set.
|
30 | * @param time The time to query.
|
31 | * @param options Any additional options that are needed in the timeline.
|
32 | */
|
33 | setStateAtTime(state: PlaybackState, time: Seconds, options?: AdditionalOptions): this;
|
34 | /**
|
35 | * Return the event before the time with the given state
|
36 | * @param state The state to look for
|
37 | * @param time When to check before
|
38 | * @return The event with the given state before the time
|
39 | */
|
40 | getLastState(state: PlaybackState, time: number): (StateTimelineEvent & AdditionalOptions) | undefined;
|
41 | /**
|
42 | * Return the event after the time with the given state
|
43 | * @param state The state to look for
|
44 | * @param time When to check from
|
45 | * @return The event with the given state after the time
|
46 | */
|
47 | getNextState(state: PlaybackState, time: number): (StateTimelineEvent & AdditionalOptions) | undefined;
|
48 | }
|