Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect games events types #40

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

lmachens
Copy link
Contributor

@lmachens lmachens commented Jul 14, 2021

This pull request has two commits.

Access overwolf.games.events.onInfoUpdates2 results info property was always an empty object. any; is a temporary solution until all possibilities are added, I already added the available features.
live_client_data and game_info should be complete.
Can you check if this is correct?

In addition, InfoUpdates2Event validates combinations of feature and info. See screenshot:

image

Calling overwolf.games.launchers.events.getInfo(10902, console.log) (when League Launcher is running) returns and object with success, status and res.
Calling the same method with an unknown ID like overwolf.games.launchers.events.getInfo(999999, console.log) returns an object with success, status and reason.
There is not error property, even if TypeScript tells me so.
Thus, I removed extends Result to remove error from the result and added status and reason. res is optional.

lmachens added 2 commits July 14, 2021 15:07
Access `overwolf.games.events.onInfoUpdates2` results `info` property was always an empty object. `[key: string]: any;` is a temporary solution until all possibilities are added. I added only [live_client_data](https://overwolf.github.io/docs/api/overwolf-games-events-lol#live_client_data) and [game_info](https://overwolf.github.io/docs/api/overwolf-games-events-lol#matchstate). Can you check if this is correct?

In addition, `extends InfoUpdate2[Feature]` gives you the correct type if you previously checked the `Feature` (see screenshots).
Calling `overwolf.games.launchers.events.getInfo(10902, console.log)` (when League Launcher is running)  returns and object with `success`, `status` and `res`.
Calling the same method with an unknown ID like  `overwolf.games.launchers.events.getInfo(999999, console.log)`  returns an object with `success`, `status` and `reason`.
There is not `error` property, even if TypeScript tells me so. 
Thus, I removed `extends Result` to remove `error` from the result and added `status` and `reason`. `res` is optional.
@lmachens lmachens changed the title Games events Fix incorrect games events types Jul 14, 2021
@lmachens
Copy link
Contributor Author

I updated this request and description due to an invalid typedef.

@lmachens
Copy link
Contributor Author

@eransharv anything I could do to move things forward?

@eransharv
Copy link
Contributor

@lmachens sorry for the delay, but this is a PR that I should check carefully as from browsing it, something not looks right. But not sure. I will be available to check it thoroughly at the beginning of next week.

@lmachens
Copy link
Contributor Author

@eransharv did you find time beginning of this week?

@eransharv
Copy link
Contributor

@lmachens sorry about the delay. I'm waiting for the result of an internal discussion regarding the game events def file. I don't have an ETA, but it's on the top of my list. So it will not take too long.

@lmachens
Copy link
Contributor Author

@eransharv any update?

@eransharv
Copy link
Contributor

@lmachens It's in my schedule for Tomorrow. I will update you by Tomorrow's EOD. Thanks for your patience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants