export type RpgAudioChannel = "master" | "music" | "sfx" | "ui"; export type RpgUiAudioEvent = "navigate" | "confirm" | "cancel" | "open" | "close" | "error" | "typewriter"; export type RpgAudioCue = string | string[] | false | { id: string | string[]; volume?: number; cooldownMs?: number; }; export interface RpgAudioPreferences { master: number; music: number; sfx: number; ui: number; } export interface RpgUiAudioTheme { navigate?: RpgAudioCue; confirm?: RpgAudioCue; cancel?: RpgAudioCue; open?: RpgAudioCue; close?: RpgAudioCue; error?: RpgAudioCue; /** Dialogue character cue. Set false to silence it independently of other UI sounds. */ typewriter?: RpgAudioCue; } export interface RpgAudioPosition { x: number; y: number; } /** Options accepted by the established `engine.playSound()` API. */ export interface RpgPlaySoundOptions { /** Per-play volume between 0 and 1, before channel and master gains. */ volume?: number; /** Repeat the sound until it is stopped. */ loop?: boolean; /** Mixer channel used for this sound. Defaults to `sfx`. */ channel?: Exclude; /** World-space source position used for attenuation and stereo panning. */ position?: RpgAudioPosition; /** World-space listener position, normally the current player. */ listener?: RpgAudioPosition; /** Distance at which the sound becomes silent. Defaults to 640 pixels. */ maxDistance?: number; /** Maximum stereo pan between 0 and 1. Defaults to 0.75. */ panStrength?: number; } /** Internal project configuration shared by RPGJS and Studio. */ export interface RpgSoundConfiguration { projectId?: string; ui?: RpgUiAudioTheme; } type AudioStorage = Pick; type AudioHost = { getSound(id: string): any | Promise; addSound(sound: { id: string; src: string; }): any; onPreferencesChange?(preferences: RpgAudioPreferences): void; }; /** Central audio controller for channels, semantic UI cues and spatial SFX. */ export declare class RpgAudioManager { private readonly host; private readonly storage; private readonly preferences; private readonly cooldowns; private storageKey; private uiTheme; constructor(host: AudioHost, storage?: AudioStorage | undefined); configure(config?: RpgSoundConfiguration): void; channelGain(channel: RpgAudioChannel): number; getVolume(channel: RpgAudioChannel): number; setVolume(channel: RpgAudioChannel, value: number): void; playUi(event: RpgUiAudioEvent): Promise; play(cue: RpgAudioCue | undefined, options?: RpgPlaySoundOptions): Promise; private resolveSpatial; private load; private applyPreferences; private persist; } export {};