import { APP_UID } from '@app/config' ; import { from , Observable } from 'rxjs' ; import { SystemInfo } from './ow-types' ; export class OWUtils { public static sendKeyStroke ( key ) { overwolf . utils . sendKeyStroke ( key ) ; } public static openUrl ( url , external ) { if ( external ) { return this . openUrlInDefaultBrowser ( url ) ; } return this . openUrlInOverwolfBrowser ( url ) ; } public static openSubscriptionPage ( ) { overwolf . utils . openStore ( { page : overwolf . utils . enums . eStorePage . SubscriptionPage , uid : APP_UID } ) ; } public static openUrlInOverwolfBrowser ( url ) { overwolf . utils . openUrlInOverwolfBrowser ( url ) ; } public static openUrlInDefaultBrowser ( url ) { ( overwolf . utils . openUrlInDefaultBrowser as any ) ( url , { skip_in_game_notification : true } ) ; } public static getSystemInformation ( ) { const promise = new Promise < SystemInfo > ( ( resolve , reject ) => { overwolf . utils . getSystemInformation ( result => { if ( result . success ) { resolve ( result . systemInfo ) ; } else { reject ( result . error ) ; } } ) ; } ) ; return from ( promise ) ; } }