-
-
Notifications
You must be signed in to change notification settings - Fork 501
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
feat: initial VEC Footpedal support #2944
Conversation
@@ -26,6 +26,7 @@ import { getStreamDeckDeviceInfo } from '@elgato-stream-deck/node' | |||
import { usb } from 'usb' | |||
// @ts-ignore | |||
import shuttleControlUSB from 'shuttle-control-usb' | |||
import vecFootpedal from 'vec-footpedal' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This causes:
lib/Surface/Controller.js:29:26 - error TS7016: Could not find a declaration file for module 'vec-footpedal'. '/home/runner/work/companion/companion/node_modules/vec-footpedal/index.js' implicitly has an 'any' type.
Trynpm i --save-dev @types/vec-footpedal
if it exists or add a new declaration (.d.ts) file containingdeclare module 'vec-footpedal';
29 import vecFootpedal from 'vec-footpedal'
~~~~~~~~~~~~~~~Found 1 error in lib/Surface/Controller.js:29
But I can't work out how e.g. Contour Shuttle doesn't cause the same thing...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The // @ts-ignore
on line 27 (the line before the import) is what allows it to work.
It would be really good to have typings enabled, but I guess that isn't required for this PR seeing as that one doesn't have it either.
import vecFootpedal from 'vec-footpedal' | |
// @ts-ignore | |
import vecFootpedal from 'vec-footpedal' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great thanks, couldn't see the wood for the trees!
If there's an example typing (for a non TS library) I can steal I can add one for one or indeed both in due course (but yes ideally after this PR is in). Presumably ideally the typing gets added to the source package so everyone benefits?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe https://github.com/bitfocus/node-infinitton-idisplay/blob/infinitton-idisplay/index.d.ts or https://github.com/node-hid/node-hid/blob/master/nodehid.d.ts are useful examples?
Ideally the EventEmitter
would be typed too, I think that can be done without a library now, but I haven't tried it
Co-authored-by: Julian Waller <git@julusian.co.uk>
Co-authored-by: Julian Waller <git@julusian.co.uk>
Closes #2919