You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I'm trying to get webmidi to work with typescript, but until now I've failed (I'm new to typescript, npm and packaging though). I installed webmidi using npm, but when I use:
import * as webmidi from "webmidi";
WebMidi.enable(function (err) {
if (err) {
console.log("WebMidi could not be enabled.", err);
} else {
console.log("WebMidi enabled!");
}
});
I get an error that WebMidi is not defined, and when I try webmidi.enable it tells me that webmidi.enable is not a function. I tried different tools (gulp, parcel, webpackage) but can't find a solution.. does anyone have a simple working demo setup? Thanks for any help.
The text was updated successfully, but these errors were encountered:
@danigb has submitted a PR for the README.md file with more details on how to use WebMidi.js with TypeScript. I just merged it. Check out the TypeScript section. It should help you!
P.S. Given the above, I'm going to close the issue. If you still have trouble, feel free to reopen it.
I tentatively added a types directory with d.ts files for all current classes (this is what the TypeScript compiler outputted). Is the usual practice to have a single index.d.ts file? In any case, if you want to give it go, be my guest!
Hi,
I'm trying to get webmidi to work with typescript, but until now I've failed (I'm new to typescript, npm and packaging though). I installed webmidi using npm, but when I use:
I get an error that WebMidi is not defined, and when I try webmidi.enable it tells me that webmidi.enable is not a function. I tried different tools (gulp, parcel, webpackage) but can't find a solution.. does anyone have a simple working demo setup? Thanks for any help.
The text was updated successfully, but these errors were encountered: