-
Notifications
You must be signed in to change notification settings - Fork 10
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
extend type define of NodeJS.Process.env #39
Comments
The |
Even then, I never got the code you posted to work. I tried different approaches, but nothing worked on the current TypeScript release unless you're using 2.0 or something. Edit: Someone let me know if they have better luck and then we can change it from an inline type to an interface called |
I'm using typescript>2.0 ... LOL
|
Confirmed this approach works with the current 2.0.6 TypeScript release. |
I always disable that rule unfortunately, TypeScript development just kind of requires it because you can't access index signatures without it. It'd be nice if TypeScript allowed |
Yes, I guess that's true if you need to interface with a lot of external libraries. For my own code, though, I always define separate properties and use index signatures only for dynamic access. Anyways, I went ahead and made a PR with the changes, if this is still up for consideration! |
@blakeembrey why do I not see these changes when I install @types/node? Are they not published yet? |
This repo has nothing to do with NPM. Those come from DefinitelyTyped. |
@blakeembrey how do I install these types then? |
This whole organisation is used for Typings, if you aren't using Typings, you can't. We've been waiting a year for microsoft/types-publisher#4 to make it possible. |
@blakeembrey is typings still in development or @types is the official solution? |
Typings is stable and any issues will continue to be fixed, but it's in a deprecated state and I'd recommend using @types. |
installed:
registry:dt/node#6.0.0+20160907103612
current content:
may change to:
then users can extend
env
in their own .d.ts:currently this will cause
error TS2403: Subsequent variable declarations must have the same type. Variable 'env' must be of type 'any', but here has type 'IProcessEnv'
:The text was updated successfully, but these errors were encountered: