-
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
Improve TS types #1099
Improve TS types #1099
Conversation
Fix index type
@@ -71,7 +71,7 @@ | |||
"bunyan": "^1.8.14", | |||
"docsify-cli": "^4.4.1", | |||
"eslint": "^7.17.0", | |||
"eslint-config-standard": "^16.0.2", | |||
"eslint-config-standard": "^16.0.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
npm 7 was screaming at me about failing to resolve dependencies unless I bumped this.
@@ -50,7 +50,6 @@ declare namespace P { | |||
/** | |||
* Holds the current log format version (as output in the v property of each log record). | |||
*/ | |||
const LOG_VERSION: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this no longer seems to exist
|
||
interface BaseLogger extends EventEmitter { | ||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
none of these fields seem to exist anymore on a logger instance (version is exposed as a separate exported constant, though)
@@ -870,6 +806,63 @@ declare namespace P { | |||
* Noop function. | |||
*/ | |||
silent: LogFn; | |||
} | |||
|
|||
interface LoggerExtras extends EventEmitter { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a huge fan of the name, open for better suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@mcollina Any chance you could release new RC? |
@mcollina Are there any pending changes before we can publish a new RC? |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
While working on fastify/fastify#3101 I've noticed following things:
Logger
is not correct, as all members of an object must conform to the string index signature (see https://stackoverflow.com/questions/57371839/merge-typescript-record-or-dictionary-like-type-with-fixed-key-typings)