docs: update docusaurus to v3 (#5625)
* update dependencies * update onboarding mdx * fixes for mdx issues * fixes for mdx compatibility * resolve mdx errors * fixes in reference * fix check errors * revert change in vale action * fix node version in action * fix summary in markdown
This commit is contained in:
@@ -35,7 +35,7 @@ v17.4.0, v16.14.0
|
||||
},
|
||||
{
|
||||
"name": "asyncResource",
|
||||
"type": "[`EventEmitterReferencingAsyncResource`](../interfaces/internal.EventEmitter.EventEmitterReferencingAsyncResource.mdx)",
|
||||
"type": "[EventEmitterReferencingAsyncResource](../interfaces/internal.EventEmitter.EventEmitterReferencingAsyncResource.mdx)",
|
||||
"description": "The underlying AsyncResource",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
@@ -53,7 +53,7 @@ v17.4.0, v16.14.0
|
||||
},
|
||||
{
|
||||
"name": "captureRejectionSymbol",
|
||||
"type": "typeof [`captureRejectionSymbol`](../../internal/classes/internal.Socket.mdx#capturerejectionsymbol)",
|
||||
"type": "typeof [captureRejectionSymbol](../../internal/classes/internal.Socket.mdx#capturerejectionsymbol)",
|
||||
"description": "Value: `Symbol.for('nodejs.rejection')` See how to write a custom `rejection handler`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
@@ -63,7 +63,7 @@ v17.4.0, v16.14.0
|
||||
{
|
||||
"name": "captureRejections",
|
||||
"type": "`boolean`",
|
||||
"description": "Value: [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) Change the default `captureRejections` option on all new `EventEmitter` objects.",
|
||||
"description": "Value: [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data\\_structures#Boolean\\_type) Change the default `captureRejections` option on all new `EventEmitter` objects.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
@@ -72,7 +72,7 @@ v17.4.0, v16.14.0
|
||||
{
|
||||
"name": "defaultMaxListeners",
|
||||
"type": "`number`",
|
||||
"description": "By default, a maximum of `10` listeners can be registered for any single event. This limit can be changed for individual `EventEmitter` instances using the `emitter.setMaxListeners(n)` method. To change the default for _all_`EventEmitter` instances, the `events.defaultMaxListeners`property can be used. If this value is not a positive number, a `RangeError`is thrown. Take caution when setting the `events.defaultMaxListeners` because the change affects _all_`EventEmitter` instances, including those created before the change is made. However, calling `emitter.setMaxListeners(n)` still has precedence over `events.defaultMaxListeners`. This is not a hard limit. The `EventEmitter` instance will allow more listeners to be added but will output a trace warning to stderr indicating that a \"possible EventEmitter memory leak\" has been detected. For any single`EventEmitter`, the `emitter.getMaxListeners()` and `emitter.setMaxListeners()`methods can be used to temporarily avoid this warning: ```js import { EventEmitter } from 'node:events'; const emitter = new EventEmitter(); emitter.setMaxListeners(emitter.getMaxListeners() + 1); emitter.once('event', () => { // do stuff emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0)); }); ``` The `--trace-warnings` command-line flag can be used to display the stack trace for such warnings. The emitted warning can be inspected with `process.on('warning')` and will have the additional `emitter`, `type`, and `count` properties, referring to the event emitter instance, the event's name and the number of attached listeners, respectively. Its `name` property is set to `'MaxListenersExceededWarning'`.",
|
||||
"description": "By default, a maximum of `10` listeners can be registered for any single event. This limit can be changed for individual `EventEmitter` instances using the `emitter.setMaxListeners(n)` method. To change the default for \\_all\\_`EventEmitter` instances, the `events.defaultMaxListeners`property can be used. If this value is not a positive number, a `RangeError`is thrown. Take caution when setting the `events.defaultMaxListeners` because the change affects \\_all\\_`EventEmitter` instances, including those created before the change is made. However, calling `emitter.setMaxListeners(n)` still has precedence over `events.defaultMaxListeners`. This is not a hard limit. The `EventEmitter` instance will allow more listeners to be added but will output a trace warning to stderr indicating that a \"possible EventEmitter memory leak\" has been detected. For any single`EventEmitter`, the `emitter.getMaxListeners()` and `emitter.setMaxListeners()`methods can be used to temporarily avoid this warning: ```js import { EventEmitter } from 'node:events'; const emitter = new EventEmitter(); emitter.setMaxListeners(emitter.getMaxListeners() + 1); emitter.once('event', () => { // do stuff emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0)); }); ``` The `--trace-warnings` command-line flag can be used to display the stack trace for such warnings. The emitted warning can be inspected with `process.on('warning')` and will have the additional `emitter`, `type`, and `count` properties, referring to the event emitter instance, the event's name and the number of attached listeners, respectively. Its `name` property is set to `'MaxListenersExceededWarning'`.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
@@ -80,7 +80,7 @@ v17.4.0, v16.14.0
|
||||
},
|
||||
{
|
||||
"name": "errorMonitor",
|
||||
"type": "typeof [`errorMonitor`](../../internal/classes/internal.Socket.mdx#errormonitor)",
|
||||
"type": "typeof [errorMonitor](../../internal/classes/internal.Socket.mdx#errormonitor)",
|
||||
"description": "This symbol shall be used to install a listener for only monitoring `'error'`events. Listeners installed using this symbol are called before the regular`'error'` listeners are called. Installing a listener using this symbol does not change the behavior once an`'error'` event is emitted. Therefore, the process will still crash if no regular `'error'` listener is installed.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
@@ -98,7 +98,7 @@ v17.4.0, v16.14.0
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "error",
|
||||
"type": "[`Error`](../../modules/internal.mdx#error)",
|
||||
"type": "[Error](../../modules/internal.mdx#error)",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
@@ -173,7 +173,7 @@ Alias for `emitter.on(eventName, listener)`.
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "EventEmitterAsyncResource",
|
||||
"type": "[`EventEmitterAsyncResource`](internal.EventEmitter.EventEmitterAsyncResource.mdx)",
|
||||
"type": "[EventEmitterAsyncResource](internal.EventEmitter.EventEmitterAsyncResource.mdx)",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
@@ -485,7 +485,7 @@ Alias for `emitter.removeListener()`.
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "EventEmitterAsyncResource",
|
||||
"type": "[`EventEmitterAsyncResource`](internal.EventEmitter.EventEmitterAsyncResource.mdx)",
|
||||
"type": "[EventEmitterAsyncResource](internal.EventEmitter.EventEmitterAsyncResource.mdx)",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
@@ -557,7 +557,7 @@ myEE.emit('foo');
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "EventEmitterAsyncResource",
|
||||
"type": "[`EventEmitterAsyncResource`](internal.EventEmitter.EventEmitterAsyncResource.mdx)",
|
||||
"type": "[EventEmitterAsyncResource](internal.EventEmitter.EventEmitterAsyncResource.mdx)",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
@@ -627,7 +627,7 @@ myEE.emit('foo');
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "EventEmitterAsyncResource",
|
||||
"type": "[`EventEmitterAsyncResource`](internal.EventEmitter.EventEmitterAsyncResource.mdx)",
|
||||
"type": "[EventEmitterAsyncResource](internal.EventEmitter.EventEmitterAsyncResource.mdx)",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
@@ -644,7 +644,7 @@ ___
|
||||
|
||||
### prependListener
|
||||
|
||||
Adds the `listener` function to the _beginning_ of the listeners array for the
|
||||
Adds the `listener` function to the \_beginning\_ of the listeners array for the
|
||||
event named `eventName`. No checks are made to see if the `listener` has
|
||||
already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple
|
||||
times.
|
||||
@@ -685,7 +685,7 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "EventEmitterAsyncResource",
|
||||
"type": "[`EventEmitterAsyncResource`](internal.EventEmitter.EventEmitterAsyncResource.mdx)",
|
||||
"type": "[EventEmitterAsyncResource](internal.EventEmitter.EventEmitterAsyncResource.mdx)",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
@@ -702,7 +702,7 @@ ___
|
||||
|
||||
### prependOnceListener
|
||||
|
||||
Adds a **one-time**`listener` function for the event named `eventName` to the _beginning_ of the listeners array. The next time `eventName` is triggered, this
|
||||
Adds a **one-time**`listener` function for the event named `eventName` to the \_beginning\_ of the listeners array. The next time `eventName` is triggered, this
|
||||
listener is removed, and then invoked.
|
||||
|
||||
```js
|
||||
@@ -741,7 +741,7 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "EventEmitterAsyncResource",
|
||||
"type": "[`EventEmitterAsyncResource`](internal.EventEmitter.EventEmitterAsyncResource.mdx)",
|
||||
"type": "[EventEmitterAsyncResource](internal.EventEmitter.EventEmitterAsyncResource.mdx)",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
@@ -849,7 +849,7 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "EventEmitterAsyncResource",
|
||||
"type": "[`EventEmitterAsyncResource`](internal.EventEmitter.EventEmitterAsyncResource.mdx)",
|
||||
"type": "[EventEmitterAsyncResource](internal.EventEmitter.EventEmitterAsyncResource.mdx)",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
@@ -883,7 +883,7 @@ listener array for the specified `eventName`, then `removeListener()` must be
|
||||
called multiple times to remove each instance.
|
||||
|
||||
Once an event is emitted, all listeners attached to it at the
|
||||
time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and _before_ the last listener finishes execution
|
||||
time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls \_after\_ emitting and \_before\_ the last listener finishes execution
|
||||
will not remove them from`emit()` in progress. Subsequent events behave as expected.
|
||||
|
||||
```js
|
||||
@@ -919,7 +919,7 @@ myEmitter.emit('event');
|
||||
```
|
||||
|
||||
Because listeners are managed using an internal array, calling this will
|
||||
change the position indices of any listener registered _after_ the listener
|
||||
change the position indices of any listener registered \_after\_ the listener
|
||||
being removed. This will not impact the order in which listeners are called,
|
||||
but it means that any copies of the listener array as returned by
|
||||
the `emitter.listeners()` method will need to be recreated.
|
||||
@@ -974,7 +974,7 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "EventEmitterAsyncResource",
|
||||
"type": "[`EventEmitterAsyncResource`](internal.EventEmitter.EventEmitterAsyncResource.mdx)",
|
||||
"type": "[EventEmitterAsyncResource](internal.EventEmitter.EventEmitterAsyncResource.mdx)",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
@@ -1017,7 +1017,7 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "EventEmitterAsyncResource",
|
||||
"type": "[`EventEmitterAsyncResource`](internal.EventEmitter.EventEmitterAsyncResource.mdx)",
|
||||
"type": "[EventEmitterAsyncResource](internal.EventEmitter.EventEmitterAsyncResource.mdx)",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
@@ -1069,7 +1069,7 @@ function example(signal) {
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "signal",
|
||||
"type": "`AbortSignal`",
|
||||
"type": "AbortSignal",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
@@ -1078,7 +1078,7 @@ function example(signal) {
|
||||
},
|
||||
{
|
||||
"name": "resource",
|
||||
"type": "(`event`: `Event`) => `void`",
|
||||
"type": "(`event`: Event) => `void`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
@@ -1139,7 +1139,7 @@ import { getEventListeners, EventEmitter } from 'node:events';
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "emitter",
|
||||
"type": "[`EventEmitter`](../../internal/interfaces/internal.EventEmitter-2.mdx) \\| [`_DOMEventTarget`](../../internal/interfaces/internal._DOMEventTarget.mdx)",
|
||||
"type": "[EventEmitter](../../internal/interfaces/internal.EventEmitter-2.mdx) \\| [_DOMEventTarget](../../internal/interfaces/internal._DOMEventTarget.mdx)",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
@@ -1210,7 +1210,7 @@ import { getMaxListeners, setMaxListeners, EventEmitter } from 'node:events';
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "emitter",
|
||||
"type": "[`EventEmitter`](../../internal/interfaces/internal.EventEmitter-2.mdx) \\| [`_DOMEventTarget`](../../internal/interfaces/internal._DOMEventTarget.mdx)",
|
||||
"type": "[EventEmitter](../../internal/interfaces/internal.EventEmitter-2.mdx) \\| [_DOMEventTarget](../../internal/interfaces/internal._DOMEventTarget.mdx)",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
@@ -1258,7 +1258,7 @@ console.log(listenerCount(myEmitter, 'event'));
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "emitter",
|
||||
"type": "[`EventEmitter`](../../internal/interfaces/internal.EventEmitter-2.mdx)",
|
||||
"type": "[EventEmitter](../../internal/interfaces/internal.EventEmitter-2.mdx)",
|
||||
"description": "The emitter to query",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
@@ -1362,7 +1362,7 @@ process.nextTick(() => ac.abort());
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "emitter",
|
||||
"type": "[`EventEmitter`](../../internal/interfaces/internal.EventEmitter-2.mdx)",
|
||||
"type": "[EventEmitter](../../internal/interfaces/internal.EventEmitter-2.mdx)",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
@@ -1380,7 +1380,7 @@ process.nextTick(() => ac.abort());
|
||||
},
|
||||
{
|
||||
"name": "options",
|
||||
"type": "[`StaticEventEmitterOptions`](../../internal/interfaces/internal.StaticEventEmitterOptions.mdx)",
|
||||
"type": "[StaticEventEmitterOptions](../../internal/interfaces/internal.StaticEventEmitterOptions.mdx)",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
@@ -1394,7 +1394,7 @@ process.nextTick(() => ac.abort());
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "AsyncIterableIterator",
|
||||
"type": "[`AsyncIterableIterator`](../../internal/interfaces/internal.AsyncIterableIterator.mdx)<`any`\\>",
|
||||
"type": "[AsyncIterableIterator](../../internal/interfaces/internal.AsyncIterableIterator.mdx)<any>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "that iterates `eventName` events emitted by the `emitter`",
|
||||
@@ -1411,7 +1411,7 @@ ___
|
||||
|
||||
### once
|
||||
|
||||
`Static` **once**(`emitter`, `eventName`, `options?`): `Promise`<`any`[]\>
|
||||
`Static **once**(emitter, eventName, options?): Promise<any[]>`
|
||||
|
||||
Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given
|
||||
event or that is rejected if the `EventEmitter` emits `'error'` while waiting.
|
||||
@@ -1495,7 +1495,7 @@ ee.emit('foo'); // Prints: Waiting for the event was canceled!
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "emitter",
|
||||
"type": "[`_NodeEventTarget`](../../internal/interfaces/internal._NodeEventTarget.mdx)",
|
||||
"type": "[_NodeEventTarget](../../internal/interfaces/internal._NodeEventTarget.mdx)",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
@@ -1513,7 +1513,7 @@ ee.emit('foo'); // Prints: Waiting for the event was canceled!
|
||||
},
|
||||
{
|
||||
"name": "options",
|
||||
"type": "[`StaticEventEmitterOptions`](../../internal/interfaces/internal.StaticEventEmitterOptions.mdx)",
|
||||
"type": "[StaticEventEmitterOptions](../../internal/interfaces/internal.StaticEventEmitterOptions.mdx)",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
@@ -1527,7 +1527,7 @@ ee.emit('foo'); // Prints: Waiting for the event was canceled!
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "`Promise`<`any`[]\\>",
|
||||
"type": "Promise<any[]>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
@@ -1540,14 +1540,14 @@ ee.emit('foo'); // Prints: Waiting for the event was canceled!
|
||||
|
||||
v11.13.0, v10.16.0
|
||||
|
||||
`Static` **once**(`emitter`, `eventName`, `options?`): `Promise`<`any`[]\>
|
||||
`Static **once**(emitter, eventName, options?): Promise<any[]>`
|
||||
|
||||
#### Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "emitter",
|
||||
"type": "[`_DOMEventTarget`](../../internal/interfaces/internal._DOMEventTarget.mdx)",
|
||||
"type": "[_DOMEventTarget](../../internal/interfaces/internal._DOMEventTarget.mdx)",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
@@ -1565,7 +1565,7 @@ v11.13.0, v10.16.0
|
||||
},
|
||||
{
|
||||
"name": "options",
|
||||
"type": "[`StaticEventEmitterOptions`](../../internal/interfaces/internal.StaticEventEmitterOptions.mdx)",
|
||||
"type": "[StaticEventEmitterOptions](../../internal/interfaces/internal.StaticEventEmitterOptions.mdx)",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
@@ -1579,7 +1579,7 @@ v11.13.0, v10.16.0
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "`Promise`<`any`[]\\>",
|
||||
"type": "Promise<any[]>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
@@ -1615,7 +1615,7 @@ setMaxListeners(5, target, emitter);
|
||||
},
|
||||
{
|
||||
"name": "eventTargets",
|
||||
"type": "([`EventEmitter`](../../internal/interfaces/internal.EventEmitter-2.mdx) \\| [`_DOMEventTarget`](../../internal/interfaces/internal._DOMEventTarget.mdx))[]",
|
||||
"type": "([EventEmitter](../../internal/interfaces/internal.EventEmitter-2.mdx) \\| [_DOMEventTarget](../../internal/interfaces/internal._DOMEventTarget.mdx))[]",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
|
||||
Reference in New Issue
Block a user