-
Notifications
You must be signed in to change notification settings - Fork 3k
Have you considered publishing ui-router with the TypeScript definitions included? #2780
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
Comments
Actually - it looks like they're there! Do you have an example of using them in a TypeScript project? I'm wondering what these should become: (
|
Hmmm... After some experimentation I found I can do this:
Oddly this doesn't work:
Not sure why... |
Aha! It looks like the secret sauce is the However, I think I may have unearthed a problem. I'm a
I should say that usage of |
I think we have an issue reported already... yep #2693 |
Great - thanks! |
I would suggest publishing the definitions, even if this can be used with modules, for two reasons:
I'm in the second camp, so this would require me to generate the definitions as part of a build step, or type them manually. Is there any reason why this couldn't be added as a build step? |
Indeed, publishing the type definitions as a separate Currently, I'm using bower for managing frontend packages, and ui-router among others. However, typescript support in VS Code is quite limited - the type definitions get automatically loaded only from the node_modules directory, but not from the bower_components. |
I think what you need is |
@johnnyreilly could you please give me a hint on how |
Sorry I think you might be out of luck - I think using external modules might be a requirement in the context of shipping TypeScript in packages |
I'm going to confirm that we won't be separately publishing to DefinitelyTyped, nor will we be publishing non-modules typings. The maintenance of both of those are things I'm not comfortable owning. |
Hi all,
I'm very excited to read about the port to TypeScript.
I was wondering if you'd considered publishing the ui-router type definitions with ui-router itself given you're building with TS? TypeScript supports this scenario pretty well since 1.6. Doing this would mean that TypeScript users wouldn't have to separately acquire a type definition from Definitely Typed or the Typing Registry. (I'm involved with both BTW)
In case you haven't heard about publishing with typings in the box, I've previously blogged about this: http://blog.johnnyreilly.com/2015/09/authoring-npm-modules-with-typescript.html (There's probably far better content out there as well 😄 )
Any chance this might happen?
PS Great to see the work on supporting components too - looking forward to taking that functionality for a spin.
The text was updated successfully, but these errors were encountered: