obs-websocket-community-projects / obs-websocket-js

Consumes https://github.com/obsproject/obs-websocket
MIT License
661 stars 95 forks source link

OBSWebSocket.on response object has wrong type for 'ScenesChanged' event #228

Open 2bdkid opened 3 years ago

2bdkid commented 3 years ago

Description:

It appears the OBSWebSocket.on response object for the 'ScenesChanged' event is void.

According to the protocol, the response object should have a scenes property of type OBSWebSocket.Scene[] but Typescript says there's no parameter at all, void.

import OBSWebSocket from 'obs-websocket-js';
const obs = new OBSWebSocket();
obs.connect().catch(e => console.log(e));
obs.on('ScenesChanged', ({ scenes }) => {
  // blah
});

Versions Used (if applicable):

Panger95 commented 3 years ago

I can't seem to reproduce this issue.

I have a feeling it is due to having obs.on('ScenesChanged', ({ scenes }) => { the scenes part be inside curly braces. Try removing the curly braces around scenes and see if you are still having issues.