-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
doc: argument types for console methods #11554
Conversation
doc/api/console.md
Outdated
@@ -73,6 +73,8 @@ const Console = console.Console; | |||
``` | |||
|
|||
### new Console(stdout[, stderr]) | |||
* ```stdout``` {Writable Stream} |
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.
The actual class should be Writable
, which is also used by documentations of repl
and readline
.
(Also, why triple backticks? Not that it really matters though, just out of curiosity.)
doc/api/console.md
Outdated
@@ -162,6 +167,8 @@ console.log('this will also print'); | |||
<!-- YAML | |||
added: v0.1.101 | |||
--> | |||
* ```obj``` {any} | |||
* ```options``` {Object} |
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.
FWIW, annotations for the available options, like what the documentations of child_process. execFile() does would be nice (Doesn't need to happen in this PR though)
doc/api/console.md
Outdated
@@ -101,6 +103,9 @@ new Console(process.stdout, process.stderr); | |||
<!-- YAML | |||
added: v0.1.101 | |||
--> | |||
* ```value``` {Boolean} | |||
* ```message``` {String} | |||
* ```...args``` {String} |
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.
...args
doesn't really have a type here, they can be anything of any length .
doc/api/console.md
Outdated
@@ -271,6 +286,8 @@ functionality was unintended and is no longer supported.* | |||
<!-- YAML | |||
added: v0.1.104 | |||
--> | |||
* ```message``` {String} | |||
* ```...args``` {String} |
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.
...args
here doesn't have a type either.
ba0199e
to
3e9d652
Compare
Changes made. |
doc/api/console.md
Outdated
@@ -271,6 +289,8 @@ functionality was unintended and is no longer supported.* | |||
<!-- YAML | |||
added: v0.1.104 | |||
--> | |||
* `message` {String} |
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.
Nit: maybe it's better to use any
.
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.
Actually… message
is optional too, it would be good if you could fix that in the ### console.trace(…)
line
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.
Done!
3e9d652
to
dbc241c
Compare
Landed in 87a039d, thanks for the awesome PR! |
Refs: #9399 PR-URL: #11554 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
Refs: #9399 PR-URL: #11554 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
It looks like some of these interfaces might be different on v6.x. Would someone be willing to backport? |
Checklist
Affected core subsystem(s)
documentation
Description of changes
Added argument data types to the docs for the
console
module.Issue