export interface RpgMusicTransitionOptions { volume?: number; mapVolume?: number; fadeInMs?: number; fadeOutMs?: number; exitDelayMs?: number; } type MusicHost = { getSound(id: string): any | Promise; createSound(src: string, options: { loop: boolean; volume: number; }): any; }; /** * Controls temporary music layers without stopping map ambience or sound * effects. The map renderer consumes `mapVolume` reactively. */ export declare class RpgMusicManager { private readonly host; readonly mapVolume: import('canvasengine').WritableSignal; /** Optional owner key used by systems when several sources have equal priority. */ contextId?: string; private currentId?; private currentSound?; private pendingId?; /** Track asked by the last `enter`, until `leave` or a reset: repeated calls for it are no-ops. */ private targetId?; private mapId?; private mapSound?; private readonly sounds; private revision; private configuredOutputGain; private readonly ducks; private suspensions; private readonly pausedSounds; private get outputGain(); private currentBaseVolume; private timers; constructor(host: MusicHost); get overrideId(): string | undefined; /** Play the map BGM through the same Howler owner as temporary music. */ setMap(src: string | null | undefined): void; enter(id: string | undefined, options?: RpgMusicTransitionOptions): Promise; leave(options?: RpgMusicTransitionOptions): void; reset(): void; /** Clear title or battle music while preserving the current map track. */ resetOverride(): void; setOutputGain(value: number): void; /** * Temporarily attenuate music without changing saved volume preferences. * The strongest active attenuation wins. Call the returned function to release it. * @param gain Multiplier between 0 and 1. * @returns Idempotent release callback. * @example const restore = engine.music.duck(0.15); restore(); */ duck(gain: number): () => void; private refreshOutputGain; /** Pause music until the returned idempotent release callback is called. * Tracks resume at their previous position; newer map tracks replace old ones. * @returns Callback that releases this pause without changing saved preferences. * @example const resume = engine.music.pause(); resume(); */ pause(): () => void; private playSound; private resolve; private fadeOutThenRestoreMap; private fade; private readVolume; private setVolume; private setLoop; private fadeMapVolume; private setMapVolume; private schedule; private clearTimers; } export {};