Skip to content

Commit cb88439

Browse files
vsemozhetbytBridgeAR
authored andcommitted
doc: unify section structures
PR-URL: nodejs#20028 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent a733657 commit cb88439

3 files changed

Lines changed: 56 additions & 58 deletions

File tree

doc/api/perf_hooks.md

Lines changed: 52 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -427,12 +427,16 @@ The high resolution millisecond timestamp at which the V8 platform was
427427
initialized.
428428

429429

430-
## Class: PerformanceObserver(callback)
430+
## Class: PerformanceObserver
431+
432+
### new PerformanceObserver(callback)
431433
<!-- YAML
432434
added: v8.5.0
433435
-->
434436

435-
* `callback` {Function} A `PerformanceObserverCallback` callback function.
437+
* `callback` {Function}
438+
* `list` {PerformanceObserverEntryList}
439+
* `observer` {PerformanceObserver}
436440

437441
`PerformanceObserver` objects provide notifications when new
438442
`PerformanceEntry` instances have been added to the Performance Timeline.
@@ -451,69 +455,16 @@ obs.observe({ entryTypes: ['mark'], buffered: true });
451455

452456
performance.mark('test');
453457
```
454-
455458
Because `PerformanceObserver` instances introduce their own additional
456459
performance overhead, instances should not be left subscribed to notifications
457460
indefinitely. Users should disconnect observers as soon as they are no
458461
longer needed.
459462

460-
### Callback: PerformanceObserverCallback(list, observer)
461-
<!-- YAML
462-
added: v8.5.0
463-
-->
464-
465-
* `list` {PerformanceObserverEntryList}
466-
* `observer` {PerformanceObserver}
467-
468-
The `PerformanceObserverCallback` is invoked when a `PerformanceObserver` is
463+
The `callback` is invoked when a `PerformanceObserver` is
469464
notified about new `PerformanceEntry` instances. The callback receives a
470465
`PerformanceObserverEntryList` instance and a reference to the
471466
`PerformanceObserver`.
472467

473-
### Class: PerformanceObserverEntryList
474-
<!-- YAML
475-
added: v8.5.0
476-
-->
477-
478-
The `PerformanceObserverEntryList` class is used to provide access to the
479-
`PerformanceEntry` instances passed to a `PerformanceObserver`.
480-
481-
#### performanceObserverEntryList.getEntries()
482-
<!-- YAML
483-
added: v8.5.0
484-
-->
485-
486-
* Returns: {PerformanceEntry[]}
487-
488-
Returns a list of `PerformanceEntry` objects in chronological order
489-
with respect to `performanceEntry.startTime`.
490-
491-
#### performanceObserverEntryList.getEntriesByName(name[, type])
492-
<!-- YAML
493-
added: v8.5.0
494-
-->
495-
496-
* `name` {string}
497-
* `type` {string}
498-
* Returns: {PerformanceEntry[]}
499-
500-
Returns a list of `PerformanceEntry` objects in chronological order
501-
with respect to `performanceEntry.startTime` whose `performanceEntry.name` is
502-
equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to
503-
`type`.
504-
505-
#### performanceObserverEntryList.getEntriesByType(type)
506-
<!-- YAML
507-
added: v8.5.0
508-
-->
509-
510-
* `type` {string}
511-
* Returns: {PerformanceEntry[]}
512-
513-
Returns a list of `PerformanceEntry` objects in chronological order
514-
with respect to `performanceEntry.startTime` whose `performanceEntry.entryType`
515-
is equal to `type`.
516-
517468
### performanceObserver.disconnect()
518469
<!-- YAML
519470
added: v8.5.0
@@ -569,6 +520,51 @@ for (let n = 0; n < 3; n++)
569520
performance.mark(`test${n}`);
570521
```
571522

523+
## Class: PerformanceObserverEntryList
524+
<!-- YAML
525+
added: v8.5.0
526+
-->
527+
528+
The `PerformanceObserverEntryList` class is used to provide access to the
529+
`PerformanceEntry` instances passed to a `PerformanceObserver`.
530+
531+
### performanceObserverEntryList.getEntries()
532+
<!-- YAML
533+
added: v8.5.0
534+
-->
535+
536+
* Returns: {PerformanceEntry[]}
537+
538+
Returns a list of `PerformanceEntry` objects in chronological order
539+
with respect to `performanceEntry.startTime`.
540+
541+
### performanceObserverEntryList.getEntriesByName(name[, type])
542+
<!-- YAML
543+
added: v8.5.0
544+
-->
545+
546+
* `name` {string}
547+
* `type` {string}
548+
* Returns: {PerformanceEntry[]}
549+
550+
Returns a list of `PerformanceEntry` objects in chronological order
551+
with respect to `performanceEntry.startTime` whose `performanceEntry.name` is
552+
equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to
553+
`type`.
554+
555+
### performanceObserverEntryList.getEntriesByType(type)
556+
<!-- YAML
557+
added: v8.5.0
558+
-->
559+
560+
* `type` {string}
561+
* Returns: {PerformanceEntry[]}
562+
563+
Returns a list of `PerformanceEntry` objects in chronological order
564+
with respect to `performanceEntry.startTime` whose `performanceEntry.entryType`
565+
is equal to `type`.
566+
567+
572568
## Examples
573569

574570
### Measuring the duration of async operations

doc/api/string_decoder.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ decoder.write(Buffer.from([0x82]));
4242
console.log(decoder.end(Buffer.from([0xAC])));
4343
```
4444

45-
## Class: new StringDecoder([encoding])
45+
## Class: StringDecoder
46+
47+
### new StringDecoder([encoding])
4648
<!-- YAML
4749
added: v0.1.99
4850
-->

tools/doc/type-parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ const customTypesMap = {
9191
'PerformanceNodeTiming':
9292
'perf_hooks.html#perf_hooks_class_performancenodetiming_extends_performanceentry', // eslint-disable-line max-len
9393
'PerformanceObserver':
94-
'perf_hooks.html#perf_hooks_class_performanceobserver_callback',
94+
'perf_hooks.html#perf_hooks_class_performanceobserver',
9595
'PerformanceObserverEntryList':
9696
'perf_hooks.html#perf_hooks_class_performanceobserverentrylist',
9797

0 commit comments

Comments
 (0)