import { PuppetScene, TimelineTrack, DialogueKeyframe, EffectKeyframe, CharacterRuntimeState, SceneAudio, SceneCamera, ActiveEffect, EasingType, TimelineTrackType, PuppetCharacterDef } from './puppetShowTypes';

export type EasingFunction = (t: number) => number;
export declare const easingFunctions: Record<EasingType, EasingFunction>;
export declare function getEasingFunction(easing: EasingType): EasingFunction;
export declare function lerp(a: number, b: number, t: number): number;
export declare function lerpPosition(a: {
    x: number;
    y: number;
}, b: {
    x: number;
    y: number;
}, t: number): {
    x: number;
    y: number;
};
export interface TimelineState {
    characterStates: Map<string, CharacterRuntimeState>;
    camera: SceneCamera;
    activeDialogue: {
        text: string;
        speakerId: string;
        typewriterProgress: number;
    } | null;
    activeEffects: ActiveEffect[];
    audioCommands: Array<{
        trackId: string;
        command: 'play' | 'pause' | 'stop';
        time: number;
    }>;
}
export interface TimelineEngineOptions {
    scene: PuppetScene;
    characterDefs: PuppetCharacterDef[];
    onAudioCommand?: (trackId: string, command: string, time: number) => void;
    typewriterSpeed?: number;
}
export declare class TimelineEngine {
    private scene;
    private characterDefs;
    private currentTime;
    private typewriterSpeed;
    private onAudioCommand?;
    constructor(options: TimelineEngineOptions);
    /**
     * Evaluate the timeline at a given time
     */
    evaluate(timeMs: number): TimelineState;
    /**
     * Get scene duration in ms
     */
    getDuration(): number;
    /**
     * Find keyframes surrounding a given time
     */
    private findSurroundingKeyframes;
    /**
     * Evaluate all character states
     */
    private evaluateAllCharacters;
    /**
     * Evaluate single character state
     */
    private evaluateCharacter;
    private createDefaultCharacterState;
    private applyAnimationTrack;
    private applyTransformTrack;
    private applyExpressionTrack;
    /**
     * Evaluate camera at time
     */
    private evaluateCamera;
    /**
     * Evaluate dialogue at time
     */
    private evaluateDialogue;
    /**
     * Evaluate effects at time
     */
    private evaluateEffects;
    /**
     * Evaluate audio commands
     */
    private evaluateAudio;
}
export declare class TimelineTrackBuilder {
    private track;
    constructor(type: TimelineTrackType, targetId: string, id?: string);
    addAnimationKeyframe(time: number, animationId: string, options?: {
        loop?: boolean;
        speed?: number;
        easing?: EasingType;
    }): this;
    addTransformKeyframe(time: number, transform: {
        position?: {
            x: number;
            y: number;
        };
        scale?: number;
        rotation?: number;
        opacity?: number;
    }, easing?: EasingType): this;
    addExpressionKeyframe(time: number, expressionId: string, options?: {
        transition?: number;
        easing?: EasingType;
    }): this;
    addDialogueKeyframe(time: number, text: string, duration: number, options?: {
        voiceOver?: string;
        style?: DialogueKeyframe['style'];
        emotion?: string;
        easing?: EasingType;
    }): this;
    addCameraKeyframe(time: number, camera: {
        position?: {
            x: number;
            y: number;
        };
        zoom?: number;
        rotation?: number;
    }, easing?: EasingType): this;
    addEffectKeyframe(time: number, effectType: EffectKeyframe['effectType'], duration: number, params?: Record<string, unknown>, easing?: EasingType): this;
    build(): TimelineTrack;
}
export declare class PuppetSceneBuilder {
    private scene;
    constructor(id: string, title: string, duration: number);
    setBackground(background: PuppetScene['background']): this;
    setCamera(camera: SceneCamera): this;
    setTransition(transition: PuppetScene['transition']): this;
    addCastMember(instanceId: string, characterId: string, options: Partial<Omit<PuppetScene['cast'][0], 'instanceId' | 'characterId'>>): this;
    addProp(instanceId: string, propId: string, options: Partial<Omit<PuppetScene['scenery'][0], 'instanceId' | 'propId'>>): this;
    addTrack(track: TimelineTrack): this;
    addAudio(audio: SceneAudio): this;
    build(): PuppetScene;
}
export declare function cloneTimeline(tracks: TimelineTrack[]): TimelineTrack[];
export declare function getTrackDuration(track: TimelineTrack): number;
export declare function getSceneDuration(scene: PuppetScene): number;
export declare function timeToFrames(timeMs: number, fps: number): number;
export declare function framesToTime(frames: number, fps: number): number;
export declare function formatTime(timeMs: number): string;
export declare function parseTime(timeStr: string): number;
//# sourceMappingURL=puppetTimeline.d.ts.map