@drincs/pixi-vn
Version:
Pixi'VN is a npm package that provides various features for creating visual novels.
94 lines (87 loc) • 3.74 kB
TypeScript
import { Sound as Sound$1, IMediaInstance, SoundLibrary, IMediaContext, Filter, SoundMap } from '@pixi/sound';
import { b as SoundPlayOptions, a as SoundOptions, S as SoundGameState, d as SoundPlay, E as ExportedSound, c as SoundFilterMemory } from './SoundGameState-BG_iPwjt.js';
declare class Sound extends Sound$1 {
alias?: string;
pause(): this;
resume(): this;
destroy(): void;
stop(): this;
play(options?: string | SoundPlayOptions): IMediaInstance | Promise<IMediaInstance>;
/**
* https://github.com/pixijs/sound/blob/main/src/Sound.ts#L235
*/
static from(source: string | string[] | SoundOptions | ArrayBuffer | HTMLAudioElement | AudioBuffer): Sound;
}
declare class SoundManager extends SoundLibrary {
constructor();
get context(): IMediaContext;
get filtersAll(): Filter[];
set filtersAll(filtersAll: Filter[]);
get supported(): boolean;
/**
* https://github.com/pixijs/sound/blob/main/src/SoundLibrary.ts#L187
*/
private getOptions;
add(alias: string, options: SoundOptions | string): Sound;
/**
* @deprecated: Use `add(alias: string, options: Options | string | ArrayBuffer | AudioBuffer | HTMLAudioElement | Sound): Sound;` instead.
*/
add(map: any, globalOptions?: SoundOptions): SoundMap;
get useLegacy(): boolean;
set useLegacy(legacy: boolean);
get disableAutoPause(): boolean;
set disableAutoPause(autoPause: boolean);
remove(alias: string): this;
get volumeAll(): number;
set volumeAll(volume: number);
get speedAll(): number;
set speedAll(speed: number);
togglePauseAll(): boolean;
pauseAll(): this;
resumeAll(): this;
toggleMuteAll(): boolean;
muteAll(): this;
unmuteAll(): this;
removeAll(): this;
stopAll(): this;
exists(alias: string, assert?: boolean): boolean;
isPlaying(): boolean;
find(alias: string): Sound;
play(alias: string, options?: SoundPlayOptions | string): IMediaInstance | Promise<IMediaInstance>;
stop(alias: string): Sound;
pause(alias: string): Sound;
resume(alias: string): Sound;
volume(alias: string, volume?: number): number;
speed(alias: string, speed?: number): number;
duration(alias: string): number;
close(): this;
clear(): void;
export(): SoundGameState;
removeOldSoundAndExport(): SoundGameState;
restore(data: object): void;
}
declare class SoundManagerStatic {
private constructor();
static soundAliasesOrder: string[];
static soundsPlaying: {
[key: string]: SoundPlay;
};
static sounds: {
[key: string]: Sound;
};
}
declare const sound: SoundManager;
declare const soundUtils_ExportedSound: typeof ExportedSound;
type soundUtils_Sound = Sound;
declare const soundUtils_Sound: typeof Sound;
declare const soundUtils_SoundFilterMemory: typeof SoundFilterMemory;
declare const soundUtils_SoundGameState: typeof SoundGameState;
type soundUtils_SoundManagerStatic = SoundManagerStatic;
declare const soundUtils_SoundManagerStatic: typeof SoundManagerStatic;
declare const soundUtils_SoundOptions: typeof SoundOptions;
declare const soundUtils_SoundPlayOptions: typeof SoundPlayOptions;
declare const soundUtils_sound: typeof sound;
declare namespace soundUtils {
export { soundUtils_ExportedSound as ExportedSound, soundUtils_Sound as Sound, soundUtils_SoundFilterMemory as SoundFilterMemory, soundUtils_SoundGameState as SoundGameState, soundUtils_SoundManagerStatic as SoundManagerStatic, soundUtils_SoundOptions as SoundOptions, soundUtils_SoundPlayOptions as SoundPlayOptions, soundUtils_sound as sound };
}
export { SoundManager as S, sound as a, Sound as b, SoundManagerStatic as c, soundUtils as s };