close #274 implement the new state management proposal

This commit is contained in:
Yanzhen Yu
2026-04-01 12:00:00 +08:00
parent 9362baac3e
commit a31efdc169
8 changed files with 259 additions and 144 deletions

View File

@@ -1,14 +1,17 @@
import { playerConfig, actionWithDelay, eventWithTime } from '../types';
import { actionWithDelay, eventWithTime } from '../types';
export declare class Timer {
timeOffset: number;
speed: number;
private actions;
private config;
private raf;
constructor(config: playerConfig, actions?: actionWithDelay[]);
private liveMode;
constructor(actions: actionWithDelay[] | undefined, speed: number);
addAction(action: actionWithDelay): void;
addActions(actions: actionWithDelay[]): void;
start(): void;
clear(): void;
setSpeed(speed: number): void;
toggleLiveMode(mode: boolean): void;
private findActionIndex;
}
export declare function getDelay(event: eventWithTime, baselineTime: number): number;