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

fixed index.d.ts #76

Closed
wants to merge 1 commit into from
Closed

fixed index.d.ts #76

wants to merge 1 commit into from

Conversation

spb-web
Copy link

@spb-web spb-web commented Jul 7, 2019

Type 'typeof TransportStream' is not a constructor function type.

Type 'typeof TransportStream' is not a constructor function type.
@schfkt
Copy link
Collaborator

schfkt commented Jul 16, 2019

@spb-web do you have esModuleInterop compiler option set to true in your tsconfig?

The thing is, you commit fixes the typings for the case when that option is set to true, but breaks it for the cases when that option is disabled. See yourself with this sample code: https://github.com/schfkt/graylog-test

So we need to find a way to make it work for the both cases when esModuleInterop is enabled and disabled.

@julioocamargoo
Copy link

I'm facing the same problem. Maybe a major version will be needed. esModuleInterop is a default config on TS 3.0 and seems like the community is heading this way.

@glensc
Copy link

glensc commented Jun 29, 2020

The same problem reported as an issue #82

@glensc glensc mentioned this pull request Jun 29, 2020
@scalder27
Copy link

I think this PR is needed - it's not okay when a library tells you what ts settings you should use. But as @schfkt said - we need a solution that equally works with esModuleInterop's both values.

How about this one?

import TransportStream = require('winston-transport');

@schfkt
Copy link
Collaborator

schfkt commented Jul 3, 2020

@scalder27 Thanks for the suggestion. It works for both cases: when esModuleInterop is enabled or disabled. Here's the PR with the fix: #84

@schfkt
Copy link
Collaborator

schfkt commented Jul 3, 2020

Closing this in favor of #84

@schfkt schfkt closed this Jul 3, 2020
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

Successfully merging this pull request may close these issues.

5 participants