import Emittery from 'emittery';
import type { StreamAudioPlayInfo } from '@/types';
type FramePlayerConfig = {
    fps?: number;
};
export default class FramePlayer extends Emittery {
    private blendShapes;
    private audioBuffer;
    private audioBufferReadIndex;
    private static readonly AUDIO_BUFFER_CLEANUP_THRESHOLD;
    private get unreadAudioCount();
    private playInfo;
    private fps;
    isPlaying: boolean;
    private isInited;
    private isIntervalStarted;
    private time;
    private idx;
    private playShapeFn;
    private lastBlendShapeLength;
    private lastBlendShape;
    private lastTimedFrameAt;
    private lastShapeReceivedAt;
    private isTransitioningToIdle;
    private transitionProgress;
    private static readonly TRANSITION_DURATION_MS;
    private static readonly TRANSITION_FRAMES;
    private static readonly MAX_SYNC_DRIFT_MS;
    private static readonly END_GRACE_MS;
    private static readonly REBASE_COOLDOWN_MS;
    private lastRebaseAt;
    private audioManager;
    private timerId;
    private callbackMap;
    private isAudioEnded;
    private audioStreamEndedTime;
    private static readonly DELAYED_PACKET_THRESHOLD_MS;
    private waitingForAudio;
    private isAudioMuted;
    private isAppendingAudio;
    private isDestroyed;
    private totalAudioBytesReceived;
    private totalBlendShapesReceived;
    private actualFps;
    private playbackStartTime;
    private framesPlayedSinceStart;
    private useAudioOffsetSync;
    private timedBlendShapes;
    private firstAudioOffset;
    private lastPlayedOffset;
    private totalWaitTime;
    private waitStartTime;
    private audioPlaybackStartTime;
    private isAudioPlaybackStarted;
    private firstAudioDataTime;
    private isFirstAudioDataReceived;
    private externalAudioTimeProvider;
    private playAudioThroughAudioManager;
    private hasReceivedRealShape;
    private usingDefaultShape;
    private defaultShapeFrameCount;
    private planBDelayTimer;
    private static readonly PLAN_B_DELAY_MS;
    private quickStartMode;
    constructor(config: FramePlayerConfig | undefined, playShapeFn: (bs: number[], idx: number) => void);
    private checkStartPlay;
    startIntervalFPS(onFrame: (time: number) => void): void;
    addShapes(blendShapes: number[][], audioOffset?: number): void;
    addBinaryAudio(buffer: ArrayBuffer): void;
    private startPlaybackPlanA;
    private startPlaybackPlanB;
    markAudioStreamEnded(): void;
    private resetSyncState;
    clear(): Promise<void>;
    private appendAudio;
    play(): Promise<void>;
    startMouthCloseTransition(): number;
    private findAndPlayFrame;
    private playTimedBlendShape;
    private playTransitionFrame;
    private finishPlayback;
    getPlayInfo(): StreamAudioPlayInfo;
    setAudioRate(rate: number): Promise<void>;
    setExternalAudioTimeProvider(provider: (() => number) | null): void;
    setPlayAudioThroughAudioManager(enable: boolean): void;
    setAudioMuted(muted: boolean): Promise<void>;
    duckAudio(tempGain: number, durationMs: number): void;
    enableAudio(): Promise<void>;
    private autoResetForNewTTS;
    prepareForNewTTS(quickStart?: boolean): void;
    getPlayingStatus(): boolean;
    getBlendShapes(): number[][];
    registerCallback(key: any, fn: (...args: any[]) => void): void;
    invokeCallback(key: string, ...args: any[]): void;
    destroy(): Promise<void>;
}
export {};
//# sourceMappingURL=framePlayer.d.ts.map