forked from arne/asdf-games
Merge branch 'typings-patch' of arne/asdf-games into master
I am bad at typescript
This commit is contained in:
commit
5e398094f0
14
lib/index.d.ts
vendored
14
lib/index.d.ts
vendored
@ -571,26 +571,28 @@ export class Camera extends Container<unknown> {
|
|||||||
update(t: number, dt: number): void;
|
update(t: number, dt: number): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface SoundOptions {
|
||||||
|
loop: boolean,
|
||||||
|
volume: number
|
||||||
|
}
|
||||||
|
|
||||||
export class Sound {
|
export class Sound {
|
||||||
|
|
||||||
src: string;
|
src: string;
|
||||||
options: {
|
options: SoundOptions;
|
||||||
loop: boolean,
|
|
||||||
volume: number
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initiates HTML5 audio element for source audio file with control methods
|
* Initiates HTML5 audio element for source audio file with control methods
|
||||||
* @param src Source audio file
|
* @param src Source audio file
|
||||||
* @param options Play settings
|
* @param options Play settings
|
||||||
*/
|
*/
|
||||||
constructor(src: String, options = {});
|
constructor(src: string, options?: SoundOptions);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts playing the audio file
|
* Starts playing the audio file
|
||||||
* @param overrides sets options for playing the sound using different setting as defined in `constructor()`
|
* @param overrides sets options for playing the sound using different setting as defined in `constructor()`
|
||||||
*/
|
*/
|
||||||
play(overrides = {}): void;
|
play(overrides?: SoundOptions): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stops playing the audio file
|
* Stops playing the audio file
|
||||||
|
Loading…
Reference in New Issue
Block a user