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

feat: initial VEC Footpedal support #2944

Merged
merged 4 commits into from
Jul 9, 2024

Conversation

peternewman
Copy link
Contributor

Closes #2919

@@ -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'
Copy link
Contributor Author

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.
Try npm i --save-dev @types/vec-footpedal if it exists or add a new declaration (.d.ts) file containing declare 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...

Copy link
Member

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.

Suggested change
import vecFootpedal from 'vec-footpedal'
// @ts-ignore
import vecFootpedal from 'vec-footpedal'

Copy link
Contributor Author

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?

Copy link
Member

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>
@peternewman peternewman requested a review from Julusian July 9, 2024 17:11
@Julusian Julusian added this to the v3.4 milestone Jul 9, 2024
@Julusian Julusian merged commit daad9b5 into bitfocus:develop Jul 9, 2024
4 of 5 checks passed
Julusian added a commit that referenced this pull request Jul 9, 2024
Co-authored-by: Julian Waller <git@julusian.co.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants