UNPKG

cra-template-overwolf-typescript-redux

Version:

This is the official [Overwolf TypeScript Redux](https://github.com/AlbericoD/overwolf-modern-react-boilerplate) template for [Create React App](https://github.com/facebook/create-react-app).

24 lines (21 loc) 593 B
export const HEARTHSTONE_CLASS_ID = 9898; export function getHearthstoneGame(): Promise<overwolf.games.GetRunningGameInfoResult | null> { return new Promise((resolve) => { overwolf.games.getRunningGameInfo((result) => { resolve( result && result.classId === HEARTHSTONE_CLASS_ID ? result : null, ); }); }); } export function getGameInfo(): Promise<any> { return new Promise((resolve, reject) => { overwolf.games.events.getInfo((info) => { if (info.success) { resolve(info.res); } else { reject(info); } }); }); }