Skip to content

Commit bc2f0a5

Browse files
vsemozhetbytMylesBorins
authored andcommittedMar 30, 2018
doc: linkify missing types
Also, alphabetize all types in type-parser.js and fix some nits in type formats. Backport-PR-URL: #19500 PR-URL: #18444 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 5bcf668 commit bc2f0a5

File tree

5 files changed

+54
-27
lines changed

5 files changed

+54
-27
lines changed
 

‎doc/api/cluster.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ It is not emitted in the worker.
265265
added: v0.7.7
266266
-->
267267

268-
* Returns: {Worker} A reference to `worker`.
268+
* Returns: {cluster.Worker} A reference to `worker`.
269269

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

‎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.
@@ -349,9 +349,9 @@ added: v0.1.98
349349
-->
350350

351351
* `options` {Object}
352-
* `input` {Readable} The [Readable][] stream to listen to. This option is
352+
* `input` {stream.Readable} The [Readable][] stream to listen to. This option is
353353
*required*.
354-
* `output` {Writable} The [Writable][] stream to write readline data to.
354+
* `output` {stream.Writable} The [Writable][] stream to write readline data to.
355355
* `completer` {Function} An optional function used for Tab autocompletion.
356356
* `terminal` {boolean} `true` if the `input` and `output` streams should be
357357
treated like a TTY, and have ANSI/VT100 escape codes written to it.
@@ -431,7 +431,7 @@ function completer(linePartial, callback) {
431431
added: v0.7.7
432432
-->
433433

434-
* `stream` {Writable}
434+
* `stream` {stream.Writable}
435435
* `x` {number}
436436
* `y` {number}
437437

@@ -443,7 +443,7 @@ given [TTY][] `stream`.
443443
added: v0.7.7
444444
-->
445445

446-
* `stream` {Readable}
446+
* `stream` {stream.Readable}
447447
* `interface` {readline.Interface}
448448

449449
The `readline.emitKeypressEvents()` method causes the given [Readable][]
@@ -469,7 +469,7 @@ if (process.stdin.isTTY)
469469
added: v0.7.7
470470
-->
471471

472-
* `stream` {Writable}
472+
* `stream` {stream.Writable}
473473
* `dx` {number}
474474
* `dy` {number}
475475

‎doc/api/repl.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -381,9 +381,9 @@ added: v0.1.91
381381

382382
* `options` {Object | string}
383383
* `prompt` {string} The input prompt to display. Defaults to `> `.
384-
* `input` {Readable} The Readable stream from which REPL input will be read.
384+
* `input` {stream.Readable} The Readable stream from which REPL input will be read.
385385
Defaults to `process.stdin`.
386-
* `output` {Writable} The Writable stream to which REPL output will be
386+
* `output` {stream.Writable} The Writable stream to which REPL output will be
387387
written. Defaults to `process.stdout`.
388388
* `terminal` {boolean} If `true`, specifies that the `output` should be
389389
treated as a TTY terminal, and have ANSI/VT100 escape codes written to it.

‎doc/api/stream.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ added: v0.11.15
385385
-->
386386

387387
* `encoding` {string} The new default encoding
388-
* Returns: `this`
388+
* Returns: {this}
389389

390390
The `writable.setDefaultEncoding()` method sets the default `encoding` for a
391391
[Writable][] stream.
@@ -771,7 +771,7 @@ readable.isPaused(); // === false
771771
added: v0.9.4
772772
-->
773773

774-
* Returns: `this`
774+
* Returns: {this}
775775

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

906-
* Returns: `this`
906+
* Returns: {this}
907907

908908
The `readable.resume()` method causes an explicitly paused Readable stream to
909909
resume emitting [`'data'`][] events, switching the stream into flowing mode.
@@ -926,7 +926,7 @@ added: v0.9.4
926926
-->
927927

928928
* `encoding` {string} The encoding to use.
929-
* Returns: `this`
929+
* Returns: {this}
930930

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

‎tools/doc/type-parser.js

+40-13
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,58 @@ const jsPrimitives = {
1414
'undefined': 'Undefined'
1515
};
1616
const jsGlobalTypes = [
17-
'Error', 'Object', 'Function', 'Array', 'TypedArray', 'Uint8Array',
18-
'Uint16Array', 'Uint32Array', 'Int8Array', 'Int16Array', 'Int32Array',
19-
'Uint8ClampedArray', 'Float32Array', 'Float64Array', 'Date', 'RegExp',
20-
'ArrayBuffer', 'DataView', 'Promise', 'EvalError', 'RangeError',
21-
'ReferenceError', 'SyntaxError', 'TypeError', 'URIError'
17+
'Array', 'ArrayBuffer', 'DataView', 'Date', 'Error', 'EvalError',
18+
'Float32Array', 'Float64Array', 'Function', 'Int16Array', 'Int32Array',
19+
'Int8Array', 'Object', 'Promise', 'RangeError', 'ReferenceError', 'RegExp',
20+
'SharedArrayBuffer', 'SyntaxError', 'TypeError', 'TypedArray', 'URIError',
21+
'Uint16Array', 'Uint32Array', 'Uint8Array', 'Uint8ClampedArray'
2222
];
2323
const typeMap = {
24+
'Iterable':
25+
'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol',
26+
'Iterator':
27+
'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterator_protocol',
28+
29+
'this':
30+
'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this',
31+
2432
'Buffer': 'buffer.html#buffer_class_buffer',
25-
'Handle': 'net.html#net_server_listen_handle_backlog_callback',
26-
'Stream': 'stream.html#stream_stream',
27-
'stream.Writable': 'stream.html#stream_class_stream_writable',
28-
'stream.Readable': 'stream.html#stream_class_stream_readable',
29-
'stream.Duplex': 'stream.html#stream_class_stream_duplex',
33+
3034
'ChildProcess': 'child_process.html#child_process_class_childprocess',
35+
3136
'cluster.Worker': 'cluster.html#cluster_class_worker',
37+
3238
'dgram.Socket': 'dgram.html#dgram_class_dgram_socket',
33-
'net.Socket': 'net.html#net_class_net_socket',
34-
'tls.TLSSocket': 'tls.html#tls_class_tls_tlssocket',
39+
40+
'Domain': 'domain.html#domain_class_domain',
41+
3542
'EventEmitter': 'events.html#events_class_eventemitter',
36-
'Timer': 'timers.html#timers_timers',
43+
44+
'fs.Stats': 'fs.html#fs_class_fs_stats',
45+
3746
'http.Agent': 'http.html#http_class_http_agent',
3847
'http.ClientRequest': 'http.html#http_class_http_clientrequest',
3948
'http.IncomingMessage': 'http.html#http_class_http_incomingmessage',
4049
'http.Server': 'http.html#http_class_http_server',
4150
'http.ServerResponse': 'http.html#http_class_http_serverresponse',
51+
52+
'Handle': 'net.html#net_server_listen_handle_backlog_callback',
53+
'net.Server': 'net.html#net_class_net_server',
54+
'net.Socket': 'net.html#net_class_net_socket',
55+
56+
'readline.Interface': 'readline.html#readline_class_interface',
57+
58+
'Stream': 'stream.html#stream_stream',
59+
'stream.Duplex': 'stream.html#stream_class_stream_duplex',
60+
'stream.Readable': 'stream.html#stream_class_stream_readable',
61+
'stream.Writable': 'stream.html#stream_class_stream_writable',
62+
63+
'Immediate': 'timers.html#timers_class_immediate',
64+
'Timeout': 'timers.html#timers_class_timeout',
65+
'Timer': 'timers.html#timers_timers',
66+
67+
'tls.TLSSocket': 'tls.html#tls_class_tls_tlssocket',
68+
4269
'URL': 'url.html#url_the_whatwg_url_api',
4370
'URLSearchParams': 'url.html#url_class_urlsearchparams'
4471
};

0 commit comments

Comments
 (0)
Please sign in to comment.