typed-typings / npm-ldapjs

Typings for https://github.com/mcavage/node-ldapjs
ISC License
3 stars 2 forks source link

Incompatible with @types/node #6

Closed akdor1154 closed 7 years ago

akdor1154 commented 7 years ago

@types/node (the typings from definitelytyped) specify tls connection options as ConnectionOptions from 'tls', however typings' env-node specifies the same thing as TLSConnectionOptions from 'tls'.

As a result this package cannot be used with @types/node. This is the single definition preventing use - my fork at akdor1154/npm-ldapjs can be installed without any typings types installed, however I assume this fork no longer works with typings due to my simple 'fix' of s/TLSConnectionOptions/ConnectionOptions.

Is there any way for this package to be compatible with both?

blakeembrey commented 7 years ago

Unfortunately, no. I believe you're referring to https://github.com/types/npm-ldapjs/blob/679663089ebdf59a4194f5e03271465ccbf4fe8b/lib/client/client.d.ts#L3 (which is TLSSocketOptions and not connection options). You can make a PR to DefinitelyTyped to fix it, because the equivalent interface is actually unnamed on DefinitelyTyped (see https://github.com/DefinitelyTyped/DefinitelyTyped/blob/37bd54827abff2c86e0ea28d7ba49f7760237cc8/node/node.d.ts#L2802).

blakeembrey commented 7 years ago

Let me know if I got the interface name wrong, I just did a search and didn't find any other usage of tls.

akdor1154 commented 7 years ago

@blakeembrey are you able to continue the chat on the typescript gitter or should I reply here?

blakeembrey commented 7 years ago

I just checked the conversation on Gitter and didn't see anything that needed attention. I'm usually better at responding async. I see the bug with this library is using the wrong interface. Given that, I'm not sure there's anyway to make it compatible with DefinitelyTyped without breaking env~node now. You could try renaming the interface with DefinitelyTyped to be ConnectOptions instead of TLSConnectionOptions(at the very least, it'd be making DefinitelyTyped more consistent as the method _is_ calledconnectand notconnection` - also DefinitelyTyped is centralised, so you know it will or won't break other people).

akdor1154 commented 7 years ago

Cool, thanks for the response. Is there any game plan for making env-node and @types/node compatible / integrated in the mid to far future?

blakeembrey commented 7 years ago

Yes, we're waiting for TypeScript. See https://github.com/Microsoft/types-publisher/issues/4. You're welcome to chime in, you're not alone in waiting 😄

akdor1154 commented 7 years ago

woo thanks

felixfbecker commented 7 years ago

@akdor1154 Is there any reason you want to "mix" npm and registry typings? Normally I would recommend one or the other.

If there is anything wrong in these typings let me know