import { from , Observable } from 'rxjs' ; export class OWAudio { public static create ( url ) { const promise = new Promise < string > ( ( resolve , reject ) => { overwolf . media . audio . create ( url , result => { if ( result . success ) { resolve ( result . id ) ; } else { reject ( result . error ) ; } } ) ; } ) ; return from ( promise ) ; } public static play ( id ) { const promise = new Promise < void > ( ( resolve , reject ) => { overwolf . media . audio . play ( id , result => { if ( result . success ) { resolve ( ) ; } else { reject ( result . error ) ; } } ) ; } ) ; return from ( promise ) ; } public static stop ( id ) { const promise = new Promise < void > ( ( resolve , reject ) => { overwolf . media . audio . stopById ( id , result => { if ( result . success ) { resolve ( ) ; } else { reject ( result . error ) ; } } ) ; } ) ; return from ( promise ) ; } public static resume ( id ) { const promise = new Promise < void > ( ( resolve , reject ) => { overwolf . media . audio . resumeById ( id , result => { if ( result . success ) { resolve ( ) ; } else { reject ( result . error ) ; } } ) ; } ) ; return from ( promise ) ; } public static setVolume ( volume ) { const promise = new Promise < void > ( ( resolve , reject ) => { overwolf . media . audio . setVolume ( volume , result => { if ( result . success ) { resolve ( ) ; } else { reject ( result . error ) ; } } ) ; } ) ; return from ( promise ) ; } }