-
-
Notifications
You must be signed in to change notification settings - Fork 6
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 no exported member 'SMF' #21
Comments
update: Fixed it.
|
I am using TypeScript in my project and have encountered the same problem. The require() solution however unfortunately does not work for me. var JZZ = require('jzz') works fine but var SMF = require('jzz-midi-smf') throws Could not find a declaration file for module 'jzz-midi-smf'. I assume because index.d.ts is missing. I know it is a lot of work to convert the js to TS but is there some online generator to do it? |
Use this for smf , rest of the code is above, ignore the smf import |
I now get The new keyword also did not work with/without. |
Use SMF (in capitals) and ignore the warning. |
Call SMF(JZZ); as shown in the example. |
I still get the same error no change. I assume the error is in the import and TS can't find the package to load. |
I was able to get it the typescript errors are just cosmetic. On a different note is there a way to access the array of available midi in and out ports? And/Or recreate this function that updates on port change to get a dropdown menu of available ports?
If not it is no big deal. I appreciate the work you have done on this library. I didn't see it in the docs but could revealing midiAccess.inputs.values() allow this? |
You can use other libraries to get the names of midi inputs and midi outputs
|
for getting a list of available outputs you will need to request access to midi, then the browser gives you the inputs and outputs to you:
you will want i.name I believe. I found a solve for in browser typescript react. It is very close to the instructions , except it needs a type.d.ts file
This step will give a complete running copy with a save file in the browser. Using react and vite. I wish something was on the main page for quick-start. It took me a few hours to find the docs and put everything together.
You will need a midi out to hear |
another issue is that Typescript goes berserk when type at start is not type at end. I resolved with creating a type specifically for SMF which allows testing to continue with jest and not error out:
|
I'm getting an error when I copy paste the example :
Module '"jzz-midi-smf"' has no exported member 'SMF'
I did 'import JZZ from "jzz" and that gets live audio working.
I could not get the jzz-midi-smf to work though.
I'm using Typescript/ Nodejs, compiling down in react and phaser and rendering to the browser.
I did notice this one: jazz-soft/JZZ#62
I might be able to help out if there is no quick solution to this.
The text was updated successfully, but these errors were encountered: