Skip to content

Commit 1091dfc

Browse files
vsemozhetbytMylesBorins
authored andcommitted
doc: linkify missing types
Also, alphabetize all types in type-parser.js and fix some nits in type formats. Backport-PR-URL: #19498 PR-URL: #18444 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent e42ab10 commit 1091dfc

File tree

9 files changed

+65
-31
lines changed

9 files changed

+65
-31
lines changed

doc/api/async_hooks.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ added: v8.1.0
8686
* `before` {Function} The [`before` callback][].
8787
* `after` {Function} The [`after` callback][].
8888
* `destroy` {Function} The [`destroy` callback][].
89-
* Returns: `{AsyncHook}` Instance used for disabling and enabling hooks
89+
* Returns: {AsyncHook} Instance used for disabling and enabling hooks
9090

9191
Registers functions to be called for different lifetime events of each async
9292
operation.

doc/api/cluster.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ changes:
267267
description: This method now returns a reference to `worker`.
268268
-->
269269

270-
* Returns: {Worker} A reference to `worker`.
270+
* Returns: {cluster.Worker} A reference to `worker`.
271271

272272
In a worker, this function will close all servers, wait for the `'close'` event on
273273
those servers, and then disconnect the IPC channel.

doc/api/console.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ const { Console } = console;
7878
```
7979

8080
### new Console(stdout[, stderr])
81-
* `stdout` {Writable}
82-
* `stderr` {Writable}
81+
* `stdout` {stream.Writable}
82+
* `stderr` {stream.Writable}
8383

8484
Creates a new `Console` with one or two writable stream instances. `stdout` is a
8585
writable stream to print log or info output. `stderr` is used for warning or

doc/api/fs.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ changes:
577577

578578
* `path` {string|Buffer|URL}
579579
* `mode` {integer} **Default:** `fs.constants.F_OK`
580-
* Returns: `undefined`
580+
* Returns: {undefined}
581581

582582
Synchronously tests a user's permissions for the file or directory specified by
583583
`path`. The `mode` argument is an optional integer that specifies the

doc/api/http2.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ client.
589589
added: v8.4.0
590590
-->
591591

592-
* Extends: {Duplex}
592+
* Extends: {stream.Duplex}
593593

594594
Each instance of the `Http2Stream` class represents a bidirectional HTTP/2
595595
communications stream over an `Http2Session` instance. Any single `Http2Session`
@@ -1308,7 +1308,7 @@ an `Http2Session` object. If no listener is registered for this event, an
13081308
added: v8.5.0
13091309
-->
13101310

1311-
* `socket` {http2.ServerHttp2Stream}
1311+
* `socket` {ServerHttp2Stream}
13121312

13131313
If an `ServerHttp2Stream` emits an `'error'` event, it will be forwarded here.
13141314
The stream will already be destroyed when this event is triggered.

doc/api/readline.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ Interface's `input` *as if it were provided by the user*.
323323
added: v0.7.7
324324
-->
325325

326-
* `stream` {Writable}
326+
* `stream` {stream.Writable}
327327
* `dir` {number}
328328
* `-1` - to the left from cursor
329329
* `1` - to the right from cursor
@@ -338,7 +338,7 @@ in a specified direction identified by `dir`.
338338
added: v0.7.7
339339
-->
340340

341-
* `stream` {Writable}
341+
* `stream` {stream.Writable}
342342

343343
The `readline.clearScreenDown()` method clears the given [TTY][] stream from
344344
the current position of the cursor down.
@@ -362,9 +362,9 @@ changes:
362362
-->
363363

364364
* `options` {Object}
365-
* `input` {Readable} The [Readable][] stream to listen to. This option is
365+
* `input` {stream.Readable} The [Readable][] stream to listen to. This option is
366366
*required*.
367-
* `output` {Writable} The [Writable][] stream to write readline data to.
367+
* `output` {stream.Writable} The [Writable][] stream to write readline data to.
368368
* `completer` {Function} An optional function used for Tab autocompletion.
369369
* `terminal` {boolean} `true` if the `input` and `output` streams should be
370370
treated like a TTY, and have ANSI/VT100 escape codes written to it.
@@ -444,7 +444,7 @@ function completer(linePartial, callback) {
444444
added: v0.7.7
445445
-->
446446

447-
* `stream` {Writable}
447+
* `stream` {stream.Writable}
448448
* `x` {number}
449449
* `y` {number}
450450

@@ -456,7 +456,7 @@ given [TTY][] `stream`.
456456
added: v0.7.7
457457
-->
458458

459-
* `stream` {Readable}
459+
* `stream` {stream.Readable}
460460
* `interface` {readline.Interface}
461461

462462
The `readline.emitKeypressEvents()` method causes the given [Readable][]
@@ -482,7 +482,7 @@ if (process.stdin.isTTY)
482482
added: v0.7.7
483483
-->
484484

485-
* `stream` {Writable}
485+
* `stream` {stream.Writable}
486486
* `dx` {number}
487487
* `dy` {number}
488488

doc/api/repl.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -388,9 +388,9 @@ changes:
388388
* `options` {Object|string}
389389
* `prompt` {string} The input prompt to display. Defaults to `> `
390390
(with a trailing space).
391-
* `input` {Readable} The Readable stream from which REPL input will be read.
391+
* `input` {stream.Readable} The Readable stream from which REPL input will be read.
392392
Defaults to `process.stdin`.
393-
* `output` {Writable} The Writable stream to which REPL output will be
393+
* `output` {stream.Writable} The Writable stream to which REPL output will be
394394
written. Defaults to `process.stdout`.
395395
* `terminal` {boolean} If `true`, specifies that the `output` should be
396396
treated as a TTY terminal, and have ANSI/VT100 escape codes written to it.

doc/api/stream.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ changes:
394394
-->
395395

396396
* `encoding` {string} The new default encoding
397-
* Returns: `this`
397+
* Returns: {this}
398398

399399
The `writable.setDefaultEncoding()` method sets the default `encoding` for a
400400
[Writable][] stream.
@@ -525,7 +525,7 @@ A Writable stream in object mode will always ignore the `encoding` argument.
525525
added: v8.0.0
526526
-->
527527

528-
* Returns: `this`
528+
* Returns: {this}
529529

530530
Destroy the stream, and emit the passed error. After this call, the
531531
writable stream has ended. Implementors should not override this method,
@@ -810,7 +810,7 @@ readable.isPaused(); // === false
810810
added: v0.9.4
811811
-->
812812

813-
* Returns: `this`
813+
* Returns: {this}
814814

815815
The `readable.pause()` method will cause a stream in flowing mode to stop
816816
emitting [`'data'`][] events, switching out of flowing mode. Any data that
@@ -950,7 +950,7 @@ event has been emitted will return `null`. No runtime error will be raised.
950950
added: v0.9.4
951951
-->
952952

953-
* Returns: `this`
953+
* Returns: {this}
954954

955955
The `readable.resume()` method causes an explicitly paused Readable stream to
956956
resume emitting [`'data'`][] events, switching the stream into flowing mode.
@@ -973,7 +973,7 @@ added: v0.9.4
973973
-->
974974

975975
* `encoding` {string} The encoding to use.
976-
* Returns: `this`
976+
* Returns: {this}
977977

978978
The `readable.setEncoding()` method sets the character encoding for
979979
data read from the Readable stream.

tools/doc/type-parser.js

+44-10
Original file line numberDiff line numberDiff line change
@@ -13,48 +13,82 @@ const jsPrimitives = {
1313
'undefined': 'Undefined'
1414
};
1515
const jsGlobalTypes = [
16-
'Error', 'Object', 'Function', 'Array', 'TypedArray', 'Uint8Array',
17-
'Uint16Array', 'Uint32Array', 'Int8Array', 'Int16Array', 'Int32Array',
18-
'Uint8ClampedArray', 'Float32Array', 'Float64Array', 'Date', 'RegExp',
19-
'ArrayBuffer', 'DataView', 'Promise', 'EvalError', 'RangeError',
20-
'ReferenceError', 'SyntaxError', 'TypeError', 'URIError', 'Proxy', 'Map',
21-
'Set', 'WeakMap', 'WeakSet', 'Generator', 'GeneratorFunction',
22-
'AsyncFunction', 'SharedArrayBuffer'
16+
'Array', 'ArrayBuffer', 'AsyncFunction', 'DataView', 'Date', 'Error',
17+
'EvalError', 'Float32Array', 'Float64Array', 'Function', 'Generator',
18+
'GeneratorFunction', 'Int16Array', 'Int32Array', 'Int8Array', 'Map', 'Object',
19+
'Promise', 'Proxy', 'RangeError', 'ReferenceError', 'RegExp', 'Set',
20+
'SharedArrayBuffer', 'SyntaxError', 'TypeError', 'TypedArray', 'URIError',
21+
'Uint16Array', 'Uint32Array', 'Uint8Array', 'Uint8ClampedArray', 'WeakMap',
22+
'WeakSet'
2323
];
2424
const typeMap = {
2525
'Iterable':
2626
`${jsDocPrefix}Reference/Iteration_protocols#The_iterable_protocol`,
2727
'Iterator':
2828
`${jsDocPrefix}Reference/Iteration_protocols#The_iterator_protocol`,
2929

30+
'this': `${jsDocPrefix}Reference/Operators/this`,
31+
32+
'AsyncHook': 'async_hooks.html#async_hooks_async_hooks_createhook_callbacks',
33+
3034
'Buffer': 'buffer.html#buffer_class_buffer',
3135

3236
'ChildProcess': 'child_process.html#child_process_class_childprocess',
3337

3438
'cluster.Worker': 'cluster.html#cluster_class_worker',
3539

40+
'crypto.constants': 'crypto.html#crypto_crypto_constants_1',
41+
3642
'dgram.Socket': 'dgram.html#dgram_class_dgram_socket',
3743

44+
'Domain': 'domain.html#domain_class_domain',
45+
3846
'EventEmitter': 'events.html#events_class_eventemitter',
3947

48+
'fs.Stats': 'fs.html#fs_class_fs_stats',
49+
4050
'http.Agent': 'http.html#http_class_http_agent',
4151
'http.ClientRequest': 'http.html#http_class_http_clientrequest',
4252
'http.IncomingMessage': 'http.html#http_class_http_incomingmessage',
4353
'http.Server': 'http.html#http_class_http_server',
4454
'http.ServerResponse': 'http.html#http_class_http_serverresponse',
4555

56+
'ClientHttp2Stream': 'http2.html#http2_class_clienthttp2stream',
57+
'HTTP2 Headers Object': 'http2.html#http2_headers_object',
58+
'HTTP2 Settings Object': 'http2.html#http2_settings_object',
59+
'http2.Http2ServerRequest': 'http2.html#http2_class_http2_http2serverrequest',
60+
'http2.Http2ServerResponse':
61+
'http2.html#http2_class_http2_http2serverresponse',
62+
'Http2Server': 'http2.html#http2_class_http2server',
63+
'Http2Session': 'http2.html#http2_class_http2session',
64+
'Http2Stream': 'http2.html#http2_class_http2stream',
65+
'ServerHttp2Stream': 'http2.html#http2_class_serverhttp2stream',
66+
4667
'Handle': 'net.html#net_server_listen_handle_backlog_callback',
68+
'net.Server': 'net.html#net_class_net_server',
4769
'net.Socket': 'net.html#net_class_net_socket',
4870

71+
'os.constants.dlopen': 'os.html#os_dlopen_constants',
72+
73+
'PerformanceObserver':
74+
'perf_hooks.html#perf_hooks_class_performanceobserver_callback',
75+
'PerformanceObserverEntryList':
76+
'perf_hooks.html#perf_hooks_class_performanceobserverentrylist',
77+
78+
'readline.Interface': 'readline.html#readline_class_interface',
79+
4980
'Stream': 'stream.html#stream_stream',
81+
'stream.Duplex': 'stream.html#stream_class_stream_duplex',
5082
'stream.Readable': 'stream.html#stream_class_stream_readable',
5183
'stream.Writable': 'stream.html#stream_class_stream_writable',
52-
'stream.Duplex': 'stream.html#stream_class_stream_duplex',
53-
54-
'tls.TLSSocket': 'tls.html#tls_class_tls_tlssocket',
5584

85+
'Immediate': 'timers.html#timers_class_immediate',
86+
'Timeout': 'timers.html#timers_class_timeout',
5687
'Timer': 'timers.html#timers_timers',
5788

89+
'tls.Server': 'tls.html#tls_class_tls_server',
90+
'tls.TLSSocket': 'tls.html#tls_class_tls_tlssocket',
91+
5892
'URL': 'url.html#url_the_whatwg_url_api',
5993
'URLSearchParams': 'url.html#url_class_urlsearchparams'
6094
};

0 commit comments

Comments
 (0)