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

TypeScript type access #62

Open
antt0n opened this issue Jun 5, 2022 · 1 comment
Open

TypeScript type access #62

antt0n opened this issue Jun 5, 2022 · 1 comment

Comments

@antt0n
Copy link

antt0n commented Jun 5, 2022

Hello,
I'm currently working on a TypeScript project, but I have a problem: I can't export the types.
This causes a problem during compilation: I can't specify a type to which I don't have access.
My goal is simply to store an instance of a port in a class variable.
Here is an example :

import jzz from 'jzz'

class Midi {
  private _port = jzz().openMidiOut();
  private _midiOut: typeof _port; // <= This is the only solution I could find to get around the problem

  ...

  public get out() { // <= And now it's here that I have an error because of the type.
    return this._midiOut;
  }

I can indeed specify the any type to allow me to override this error, but it bothers me for the sake of clarity.
Thanks in advance for your help!

@jazz-soft
Copy link
Owner

Thanks for the notice!
I have not updated index.d.ts for quite a while due to the lack of time.
I would really appreciate if anybody could take care of the TypeScript side of the project...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants