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

TypeScript definition for EventHandlersDataMap doesn't include error #203

Closed
roncli opened this issue May 31, 2020 · 0 comments
Closed

TypeScript definition for EventHandlersDataMap doesn't include error #203

roncli opened this issue May 31, 2020 · 0 comments

Comments

@roncli
Copy link

roncli commented May 31, 2020

Description:

The TypeScript definition for EventHandlersDataMap does not include a key for error, resulting in Visual Studio Code showing an error on this statement:

obs.on("error", (err) => {
    console.log(err);
});

The error:

Argument of type '"error"' is not assignable to parameter of type '"ConnectionOpened" | "ConnectionClosed" | "AuthenticationSuccess" | "AuthenticationFailure" | "SwitchScenes" | "ScenesChanged" | "SceneCollectionChanged" | "SceneCollectionListChanged" | ... 43 more ... | "StudioModeSwitched"'.

I think that just adding error: Error; to EventHandlersDataMap in index.d.ts should resolve it, but am not familiar enough with TS to know if that actually is a valid solution.

Versions Used (if applicable):

  • obs-websocket-js version: v4.0.1
  • obs-websocket plugin version: n/a
  • obs-studio version: n/a
  • node version: v14.3.0
czenker added a commit to czenker/obs-websocket-js that referenced this issue Nov 21, 2020
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

No branches or pull requests

2 participants