-
Notifications
You must be signed in to change notification settings - Fork 18
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 support no longer seems to work? #40
Comments
I have to admit that I've not familiar with namespaces in TypeScript, and see now that all the documentation on it use CamelCase naming. Does your code work if you lowercase |
Yeah, changing my code to
Reverting the commit above makes it work again. I assume (as I am also no TypesFile expert) that by calling the namespace Now I'm pretty sure that's not technically true :) but that's how I think of it. |
The mopidy namespace is not exported. |
One question on the above though. This seems a bit limiting and not quite right. I used to be able to do this before the change: import Mopidy from 'mopidy'
const mopidy = new Mopidy({
webSocketUrl: `ws://${mopidyUrl}:${mopidyPort}/mopidy/ws/`
})
const track: Mopidy.models.TlTrack = mopidy.playback.getCurrentTrack() Now I'd have to do something like: import Mopidy, { mopidy } from 'mopidy'
const mopidyInstance = new Mopidy({
webSocketUrl: `ws://${mopidyUrl}:${mopidyPort}/mopidy/ws/`
})
const track: mopidy.models.TlTrack = mopidyInstance.playback.getCurrentTrack() Have I missed something. |
I still don't feel entirely up to speed on external TypeScript declarations, but given that:
I'm leaning towards reverting at least the top-most namespace to be named On an aside, I'd love to have a TypeScript linter and to have an example using TypeScript in the repo so that I have an easy way of testing these changes before releasing them. PRs welcome! |
I know DefinitelyTyped require tests for the definition file, but TBH I'm not super sure how that works. I'll look into it though, as something like that sounds like what you're looking for. |
Fixed by #45. |
@jodal It looks like this commit seems to have broken things? unless it's just for me? This is change where the namespaces were switched from
PascalCase
tolowercase
:Lowercase namespace names
These are the lines in question:
The text was updated successfully, but these errors were encountered: