doc: linkify missing types

Also, alphabetize all types in type-parser.js
and fix some nits in type formats.

PR-URL: https://github.com/nodejs/node/pull/18444
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Vse Mozhet Byt 2018-01-30 00:15:53 +02:00
parent 83d0f4c92b
commit fd3a0cfb7c
11 changed files with 65 additions and 36 deletions

View File

@ -86,7 +86,7 @@ added: v8.1.0
* `before` {Function} The [`before` callback][]. * `before` {Function} The [`before` callback][].
* `after` {Function} The [`after` callback][]. * `after` {Function} The [`after` callback][].
* `destroy` {Function} The [`destroy` callback][]. * `destroy` {Function} The [`destroy` callback][].
* Returns: `{AsyncHook}` Instance used for disabling and enabling hooks * Returns: {AsyncHook} Instance used for disabling and enabling hooks
Registers functions to be called for different lifetime events of each async Registers functions to be called for different lifetime events of each async
operation. operation.

View File

@ -267,7 +267,7 @@ changes:
description: This method now returns a reference to `worker`. description: This method now returns a reference to `worker`.
--> -->
* Returns: {Worker} A reference to `worker`. * Returns: {cluster.Worker} A reference to `worker`.
In a worker, this function will close all servers, wait for the `'close'` event on In a worker, this function will close all servers, wait for the `'close'` event on
those servers, and then disconnect the IPC channel. those servers, and then disconnect the IPC channel.

View File

@ -78,8 +78,8 @@ const { Console } = console;
``` ```
### new Console(stdout[, stderr]) ### new Console(stdout[, stderr])
* `stdout` {Writable} * `stdout` {stream.Writable}
* `stderr` {Writable} * `stderr` {stream.Writable}
Creates a new `Console` with one or two writable stream instances. `stdout` is a Creates a new `Console` with one or two writable stream instances. `stdout` is a
writable stream to print log or info output. `stderr` is used for warning or writable stream to print log or info output. `stderr` is used for warning or

View File

@ -798,7 +798,7 @@ changes:
* `path` {string|Buffer|URL} * `path` {string|Buffer|URL}
* `mode` {integer} **Default:** `fs.constants.F_OK` * `mode` {integer} **Default:** `fs.constants.F_OK`
* Returns: `undefined` * Returns: {undefined}
Synchronously tests a user's permissions for the file or directory specified by Synchronously tests a user's permissions for the file or directory specified by
`path`. The `mode` argument is an optional integer that specifies the `path`. The `mode` argument is an optional integer that specifies the

View File

@ -770,7 +770,7 @@ they respectively default to:
added: v8.4.0 added: v8.4.0
--> -->
* Extends: {Duplex} * Extends: {stream.Duplex}
Each instance of the `Http2Stream` class represents a bidirectional HTTP/2 Each instance of the `Http2Stream` class represents a bidirectional HTTP/2
communications stream over an `Http2Session` instance. Any single `Http2Session` communications stream over an `Http2Session` instance. Any single `Http2Session`

View File

@ -659,7 +659,7 @@ changes:
* `module` {Object} * `module` {Object}
* `filename` {string} * `filename` {string}
* `flags` {os.constants.dlopen}. Defaults to `os.constants.dlopen.RTLD_LAZY`. * `flags` {os.constants.dlopen} Defaults to `os.constants.dlopen.RTLD_LAZY`.
The `process.dlopen()` method allows to dynamically load shared The `process.dlopen()` method allows to dynamically load shared
objects. It is primarily used by `require()` to load objects. It is primarily used by `require()` to load

View File

@ -323,7 +323,7 @@ Interface's `input` *as if it were provided by the user*.
added: v0.7.7 added: v0.7.7
--> -->
* `stream` {Writable} * `stream` {stream.Writable}
* `dir` {number} * `dir` {number}
* `-1` - to the left from cursor * `-1` - to the left from cursor
* `1` - to the right from cursor * `1` - to the right from cursor
@ -338,7 +338,7 @@ in a specified direction identified by `dir`.
added: v0.7.7 added: v0.7.7
--> -->
* `stream` {Writable} * `stream` {stream.Writable}
The `readline.clearScreenDown()` method clears the given [TTY][] stream from The `readline.clearScreenDown()` method clears the given [TTY][] stream from
the current position of the cursor down. the current position of the cursor down.
@ -362,9 +362,9 @@ changes:
--> -->
* `options` {Object} * `options` {Object}
* `input` {Readable} The [Readable][] stream to listen to. This option is * `input` {stream.Readable} The [Readable][] stream to listen to. This option is
*required*. *required*.
* `output` {Writable} The [Writable][] stream to write readline data to. * `output` {stream.Writable} The [Writable][] stream to write readline data to.
* `completer` {Function} An optional function used for Tab autocompletion. * `completer` {Function} An optional function used for Tab autocompletion.
* `terminal` {boolean} `true` if the `input` and `output` streams should be * `terminal` {boolean} `true` if the `input` and `output` streams should be
treated like a TTY, and have ANSI/VT100 escape codes written to it. treated like a TTY, and have ANSI/VT100 escape codes written to it.
@ -444,7 +444,7 @@ function completer(linePartial, callback) {
added: v0.7.7 added: v0.7.7
--> -->
* `stream` {Writable} * `stream` {stream.Writable}
* `x` {number} * `x` {number}
* `y` {number} * `y` {number}
@ -456,7 +456,7 @@ given [TTY][] `stream`.
added: v0.7.7 added: v0.7.7
--> -->
* `stream` {Readable} * `stream` {stream.Readable}
* `interface` {readline.Interface} * `interface` {readline.Interface}
The `readline.emitKeypressEvents()` method causes the given [Readable][] The `readline.emitKeypressEvents()` method causes the given [Readable][]
@ -482,7 +482,7 @@ if (process.stdin.isTTY)
added: v0.7.7 added: v0.7.7
--> -->
* `stream` {Writable} * `stream` {stream.Writable}
* `dx` {number} * `dx` {number}
* `dy` {number} * `dy` {number}

View File

@ -412,9 +412,9 @@ changes:
* `options` {Object|string} * `options` {Object|string}
* `prompt` {string} The input prompt to display. Defaults to `> ` * `prompt` {string} The input prompt to display. Defaults to `> `
(with a trailing space). (with a trailing space).
* `input` {Readable} The Readable stream from which REPL input will be read. * `input` {stream.Readable} The Readable stream from which REPL input will be read.
Defaults to `process.stdin`. Defaults to `process.stdin`.
* `output` {Writable} The Writable stream to which REPL output will be * `output` {stream.Writable} The Writable stream to which REPL output will be
written. Defaults to `process.stdout`. written. Defaults to `process.stdout`.
* `terminal` {boolean} If `true`, specifies that the `output` should be * `terminal` {boolean} If `true`, specifies that the `output` should be
treated as a TTY terminal, and have ANSI/VT100 escape codes written to it. treated as a TTY terminal, and have ANSI/VT100 escape codes written to it.

View File

@ -394,7 +394,7 @@ changes:
--> -->
* `encoding` {string} The new default encoding * `encoding` {string} The new default encoding
* Returns: `this` * Returns: {this}
The `writable.setDefaultEncoding()` method sets the default `encoding` for a The `writable.setDefaultEncoding()` method sets the default `encoding` for a
[Writable][] stream. [Writable][] stream.
@ -533,7 +533,7 @@ A Writable stream in object mode will always ignore the `encoding` argument.
added: v8.0.0 added: v8.0.0
--> -->
* Returns: `this` * Returns: {this}
Destroy the stream, and emit the passed error. After this call, the Destroy the stream, and emit the passed error. After this call, the
writable stream has ended. Implementors should not override this method, writable stream has ended. Implementors should not override this method,
@ -824,7 +824,7 @@ readable.isPaused(); // === false
added: v0.9.4 added: v0.9.4
--> -->
* Returns: `this` * Returns: {this}
The `readable.pause()` method will cause a stream in flowing mode to stop The `readable.pause()` method will cause a stream in flowing mode to stop
emitting [`'data'`][] events, switching out of flowing mode. Any data that emitting [`'data'`][] events, switching out of flowing mode. Any data that
@ -973,7 +973,7 @@ the status of the `highWaterMark`.
added: v0.9.4 added: v0.9.4
--> -->
* Returns: `this` * Returns: {this}
The `readable.resume()` method causes an explicitly paused Readable stream to The `readable.resume()` method causes an explicitly paused Readable stream to
resume emitting [`'data'`][] events, switching the stream into flowing mode. resume emitting [`'data'`][] events, switching the stream into flowing mode.
@ -996,7 +996,7 @@ added: v0.9.4
--> -->
* `encoding` {string} The encoding to use. * `encoding` {string} The encoding to use.
* Returns: `this` * Returns: {this}
The `readable.setEncoding()` method sets the character encoding for The `readable.setEncoding()` method sets the character encoding for
data read from the Readable stream. data read from the Readable stream.

View File

@ -126,7 +126,7 @@ is updated whenever the `'resize'` event is emitted.
added: REPLACEME added: REPLACEME
--> -->
* `env` {object} A object containing the environment variables to check. * `env` {Object} A object containing the environment variables to check.
Defaults to `process.env`. Defaults to `process.env`.
* Returns: {number} * Returns: {number}

View File

@ -13,13 +13,13 @@ const jsPrimitives = {
'undefined': 'Undefined' 'undefined': 'Undefined'
}; };
const jsGlobalTypes = [ const jsGlobalTypes = [
'Error', 'Object', 'Function', 'Array', 'TypedArray', 'Uint8Array', 'Array', 'ArrayBuffer', 'AsyncFunction', 'DataView', 'Date', 'Error',
'Uint16Array', 'Uint32Array', 'Int8Array', 'Int16Array', 'Int32Array', 'EvalError', 'Float32Array', 'Float64Array', 'Function', 'Generator',
'Uint8ClampedArray', 'Float32Array', 'Float64Array', 'Date', 'RegExp', 'GeneratorFunction', 'Int16Array', 'Int32Array', 'Int8Array', 'Map', 'Object',
'ArrayBuffer', 'DataView', 'Promise', 'EvalError', 'RangeError', 'Promise', 'Proxy', 'RangeError', 'ReferenceError', 'RegExp', 'Set',
'ReferenceError', 'SyntaxError', 'TypeError', 'URIError', 'Proxy', 'Map', 'SharedArrayBuffer', 'SyntaxError', 'TypeError', 'TypedArray', 'URIError',
'Set', 'WeakMap', 'WeakSet', 'Generator', 'GeneratorFunction', 'Uint16Array', 'Uint32Array', 'Uint8Array', 'Uint8ClampedArray', 'WeakMap',
'AsyncFunction', 'SharedArrayBuffer' 'WeakSet'
]; ];
const typeMap = { const typeMap = {
'Iterable': 'Iterable':
@ -27,39 +27,68 @@ const typeMap = {
'Iterator': 'Iterator':
`${jsDocPrefix}Reference/Iteration_protocols#The_iterator_protocol`, `${jsDocPrefix}Reference/Iteration_protocols#The_iterator_protocol`,
'this': `${jsDocPrefix}Reference/Operators/this`,
'AsyncHook': 'async_hooks.html#async_hooks_async_hooks_createhook_callbacks',
'Buffer': 'buffer.html#buffer_class_buffer', 'Buffer': 'buffer.html#buffer_class_buffer',
'ChildProcess': 'child_process.html#child_process_class_childprocess', 'ChildProcess': 'child_process.html#child_process_class_childprocess',
'cluster.Worker': 'cluster.html#cluster_class_worker', 'cluster.Worker': 'cluster.html#cluster_class_worker',
'crypto.constants': 'crypto.html#crypto_crypto_constants_1',
'dgram.Socket': 'dgram.html#dgram_class_dgram_socket', 'dgram.Socket': 'dgram.html#dgram_class_dgram_socket',
'Domain': 'domain.html#domain_class_domain',
'EventEmitter': 'events.html#events_class_eventemitter', 'EventEmitter': 'events.html#events_class_eventemitter',
'fs.Stats': 'fs.html#fs_class_fs_stats',
'http.Agent': 'http.html#http_class_http_agent', 'http.Agent': 'http.html#http_class_http_agent',
'http.ClientRequest': 'http.html#http_class_http_clientrequest', 'http.ClientRequest': 'http.html#http_class_http_clientrequest',
'http.IncomingMessage': 'http.html#http_class_http_incomingmessage', 'http.IncomingMessage': 'http.html#http_class_http_incomingmessage',
'http.Server': 'http.html#http_class_http_server', 'http.Server': 'http.html#http_class_http_server',
'http.ServerResponse': 'http.html#http_class_http_serverresponse', 'http.ServerResponse': 'http.html#http_class_http_serverresponse',
'ClientHttp2Stream': 'http2.html#http2_class_clienthttp2stream',
'HTTP2 Headers Object': 'http2.html#http2_headers_object', 'HTTP2 Headers Object': 'http2.html#http2_headers_object',
'HTTP2 Settings Object': 'http2.html#http2_settings_object', 'HTTP2 Settings Object': 'http2.html#http2_settings_object',
'http2.Http2ServerRequest': 'http2.html#http2_class_http2_http2serverrequest',
'Handle': 'net.html#net_server_listen_handle_backlog_callback', 'http2.Http2ServerResponse':
'net.Socket': 'net.html#net_class_net_socket', 'http2.html#http2_class_http2_http2serverresponse',
'Http2Server': 'http2.html#http2_class_http2server',
'Http2Session': 'http2.html#http2_class_http2session',
'Http2Stream': 'http2.html#http2_class_http2stream',
'ServerHttp2Stream': 'http2.html#http2_class_serverhttp2stream', 'ServerHttp2Stream': 'http2.html#http2_class_serverhttp2stream',
'Handle': 'net.html#net_server_listen_handle_backlog_callback',
'net.Server': 'net.html#net_class_net_server',
'net.Socket': 'net.html#net_class_net_socket',
'os.constants.dlopen': 'os.html#os_dlopen_constants',
'PerformanceObserver':
'perf_hooks.html#perf_hooks_class_performanceobserver_callback',
'PerformanceObserverEntryList':
'perf_hooks.html#perf_hooks_class_performanceobserverentrylist',
'readline.Interface': 'readline.html#readline_class_interface',
'Stream': 'stream.html#stream_stream', 'Stream': 'stream.html#stream_stream',
'stream.Duplex': 'stream.html#stream_class_stream_duplex',
'stream.Readable': 'stream.html#stream_class_stream_readable', 'stream.Readable': 'stream.html#stream_class_stream_readable',
'stream.Writable': 'stream.html#stream_class_stream_writable', 'stream.Writable': 'stream.html#stream_class_stream_writable',
'stream.Duplex': 'stream.html#stream_class_stream_duplex',
'tls.TLSSocket': 'tls.html#tls_class_tls_tlssocket',
'Immediate': 'timers.html#timers_class_immediate',
'Timeout': 'timers.html#timers_class_timeout',
'Timer': 'timers.html#timers_timers', 'Timer': 'timers.html#timers_timers',
'tls.Server': 'tls.html#tls_class_tls_server',
'tls.TLSSocket': 'tls.html#tls_class_tls_tlssocket',
'URL': 'url.html#url_the_whatwg_url_api', 'URL': 'url.html#url_the_whatwg_url_api',
'URLSearchParams': 'url.html#url_class_urlsearchparams' 'URLSearchParams': 'url.html#url_class_urlsearchparams'
}; };