Skip to content

Commit b182e2e

Browse files
oyydtargos
authored andcommitted
doc: add types and their corresponding return values
This commit supplements some types and their corresponding return values in docs, including `AsyncResource`, `DiffieHellman`, `ECDH`, `https.Server`, `repl.REPLServer`. PR-URL: #23998 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 762679e commit b182e2e

File tree

6 files changed

+22
-1
lines changed

6 files changed

+22
-1
lines changed

doc/api/async_hooks.md

+2
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@ alternative.
704704

705705
#### asyncResource.emitDestroy()
706706

707+
* Returns: {AsyncResource} A reference to `asyncResource`.
708+
707709
Call all `destroy` hooks. This should only ever be called once. An error will
708710
be thrown if it is called more than once. This **must** be manually called. If
709711
the resource is left to be collected by the GC then the `destroy` hooks will

doc/api/crypto.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -1533,6 +1533,7 @@ changes:
15331533
* `generator` {number | string | Buffer | TypedArray | DataView} **Default:**
15341534
`2`
15351535
* `generatorEncoding` {string}
1536+
* Returns: {DiffieHellman}
15361537

15371538
Creates a `DiffieHellman` key exchange object using the supplied `prime` and an
15381539
optional specific `generator`.
@@ -1556,6 +1557,7 @@ added: v0.5.0
15561557
* `primeLength` {number}
15571558
* `generator` {number | string | Buffer | TypedArray | DataView} **Default:**
15581559
`2`
1560+
* Returns: {DiffieHellman}
15591561

15601562
Creates a `DiffieHellman` key exchange object and generates a prime of
15611563
`primeLength` bits using an optional specific numeric `generator`.
@@ -1566,6 +1568,7 @@ If `generator` is not specified, the value `2` is used.
15661568
added: v0.11.14
15671569
-->
15681570
* `curveName` {string}
1571+
* Returns: {ECDH}
15691572

15701573
Creates an Elliptic Curve Diffie-Hellman (`ECDH`) key exchange object using a
15711574
predefined curve specified by the `curveName` string. Use
@@ -1818,7 +1821,7 @@ console.log(curves); // ['Oakley-EC2N-3', 'Oakley-EC2N-4', ...]
18181821
added: v0.7.5
18191822
-->
18201823
* `groupName` {string}
1821-
* Returns: {Object}
1824+
* Returns: {DiffieHellman}
18221825

18231826
Creates a predefined `DiffieHellman` key exchange object. The
18241827
supported groups are: `'modp1'`, `'modp2'`, `'modp5'` (defined in

doc/api/https.md

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ This class is a subclass of `tls.Server` and emits events same as
2828
added: v0.1.90
2929
-->
3030
* `callback` {Function}
31+
* Returns: {https.Server}
3132

3233
See [`server.close()`][`http.close()`] from the HTTP module for details.
3334

@@ -49,6 +50,7 @@ added: v0.11.2
4950
-->
5051
* `msecs` {number} **Default:** `120000` (2 minutes)
5152
* `callback` {Function}
53+
* Returns: {https.Server}
5254

5355
See [`http.Server#setTimeout()`][].
5456

@@ -75,6 +77,7 @@ added: v0.3.4
7577
* `options` {Object} Accepts `options` from [`tls.createServer()`][],
7678
[`tls.createSecureContext()`][] and [`http.createServer()`][].
7779
* `requestListener` {Function} A listener to be added to the `'request'` event.
80+
* Returns: {https.Server}
7881

7982
```js
8083
// curl -k https://localhost:8000/

doc/api/repl.md

+1
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,7 @@ changes:
499499
* `breakEvalOnSigint` - Stop evaluating the current piece of code when
500500
`SIGINT` is received, i.e. `Ctrl+C` is pressed. This cannot be used together
501501
with a custom `eval` function. **Default:** `false`.
502+
* Returns: {repl.REPLServer}
502503

503504
The `repl.start()` method creates and starts a [`repl.REPLServer`][] instance.
504505

doc/api/tls.md

+5
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ added: v0.3.2
378378

379379
* `callback` {Function} A listener callback that will be registered to listen
380380
for the server instance's `'close'` event.
381+
* Returns: {tls.Server}
381382

382383
The `server.close()` method stops the server from accepting new connections.
383384

@@ -926,6 +927,7 @@ changes:
926927
* ...: [`tls.createSecureContext()`][] options that are used if the
927928
`secureContext` option is missing, otherwise they are ignored.
928929
* `callback` {Function}
930+
* Returns: {tls.TLSSocket}
929931

930932
The `callback` function, if specified, will be added as a listener for the
931933
[`'secureConnect'`][] event.
@@ -1000,6 +1002,7 @@ added: v0.11.3
10001002
* `path` {string} Default value for `options.path`.
10011003
* `options` {Object} See [`tls.connect()`][].
10021004
* `callback` {Function} See [`tls.connect()`][].
1005+
* Returns: {tls.TLSSocket}
10031006

10041007
Same as [`tls.connect()`][] except that `path` can be provided
10051008
as an argument instead of an option.
@@ -1015,6 +1018,7 @@ added: v0.11.3
10151018
* `host` {string} Default value for `options.host`.
10161019
* `options` {Object} See [`tls.connect()`][].
10171020
* `callback` {Function} See [`tls.connect()`][].
1021+
* Returns: {tls.TLSSocket}
10181022

10191023
Same as [`tls.connect()`][] except that `port` and `host` can be provided
10201024
as arguments instead of options.
@@ -1191,6 +1195,7 @@ changes:
11911195
* ...: Any [`tls.createSecureContext()`][] option can be provided. For
11921196
servers, the identity options (`pfx` or `key`/`cert`) are usually required.
11931197
* `secureConnectionListener` {Function}
1198+
* Returns: {tls.Server}
11941199

11951200
Creates a new [`tls.Server`][]. The `secureConnectionListener`, if provided, is
11961201
automatically set as a listener for the [`'secureConnection'`][] event.

tools/doc/type-parser.js

+7
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ const customTypesMap = {
3636
`${jsDocPrefix}Reference/Iteration_protocols#The_iterator_protocol`,
3737

3838
'AsyncHook': 'async_hooks.html#async_hooks_async_hooks_createhook_callbacks',
39+
'AsyncResource': 'async_hooks.html#async_hooks_class_asyncresource',
3940

4041
'Buffer': 'buffer.html#buffer_class_buffer',
4142

@@ -45,6 +46,8 @@ const customTypesMap = {
4546

4647
'Cipher': 'crypto.html#crypto_class_cipher',
4748
'Decipher': 'crypto.html#crypto_class_decipher',
49+
'DiffieHellman': 'crypto.html#crypto_class_diffiehellman',
50+
'ECDH': 'crypto.html#crypto_class_ecdh',
4851
'Hash': 'crypto.html#crypto_class_hash',
4952
'Hmac': 'crypto.html#crypto_class_hmac',
5053
'Sign': 'crypto.html#crypto_class_sign',
@@ -83,6 +86,8 @@ const customTypesMap = {
8386
'Http2Stream': 'http2.html#http2_class_http2stream',
8487
'ServerHttp2Stream': 'http2.html#http2_class_serverhttp2stream',
8588

89+
'https.Server': 'https.html#https_class_https_server',
90+
8691
'module': 'modules.html#modules_the_module_object',
8792

8893
'Handle': 'net.html#net_server_listen_handle_backlog_callback',
@@ -101,6 +106,8 @@ const customTypesMap = {
101106

102107
'readline.Interface': 'readline.html#readline_class_interface',
103108

109+
'repl.REPLServer': 'repl.html#repl_class_replserver',
110+
104111
'Stream': 'stream.html#stream_stream',
105112
'stream.Duplex': 'stream.html#stream_class_stream_duplex',
106113
'stream.Readable': 'stream.html#stream_class_stream_readable',

0 commit comments

Comments
 (0)