-
Notifications
You must be signed in to change notification settings - Fork 885
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
Can't use custom levels in multistream with TypeScript #1595
Comments
Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests. |
@mcollina I'm quite new to TS, and not sure what would be the best practice, to fix this issue. |
I can submit a PR, is it removing the type checking for that one so users can add custom levels or map the custom levels values to the type? |
@mcollina @VladimirMikulic Please correct me, if I'm wrong, but I think this issue still exists, I can still only get around this problem by using |
I see the very same error |
Would you like to send a Pull Request to address this issue? Remember to add unit tests. |
cc @kibertoad |
@mcollina, Could I help with this bug? I have an idea in mind. |
thx @simoneb |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
The following code worked totally fine in JS, but I'm currently in the process of converting my NodeJS app to typescript.
I would like to use custom levels in multistream with TypeScript, but the definitions are not allowing me to do so.
I have this file, where I prepare and configure pino to use it in different parts of my application:
However, I get the following error where I define
streams
:Type '"network"' is not assignable to type 'Level | undefined'.ts(2322)
The reason is that in pino.d.ts, Level is explicitly defined to be
"fatal" | "error" | "warn" | "info" | "debug" | "trace"
and no matter how many times and different approaches I tried to override/extend the definition, none of my attempts worked.The text was updated successfully, but these errors were encountered: