Skip to content

Commit 7248171

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

File tree

3 files changed

+56
-58
lines changed

3 files changed

+56
-58
lines changed

doc/api/perf_hooks.md

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

342342

343-
## Class: PerformanceObserver(callback)
343+
## Class: PerformanceObserver
344+
345+
### new PerformanceObserver(callback)
344346
<!-- YAML
345347
added: v8.5.0
346348
-->
347349

348-
* `callback` {Function} A `PerformanceObserverCallback` callback function.
350+
* `callback` {Function}
351+
* `list` {PerformanceObserverEntryList}
352+
* `observer` {PerformanceObserver}
349353

350354
`PerformanceObserver` objects provide notifications when new
351355
`PerformanceEntry` instances have been added to the Performance Timeline.
@@ -364,69 +368,16 @@ obs.observe({ entryTypes: ['mark'], buffered: true });
364368

365369
performance.mark('test');
366370
```
367-
368371
Because `PerformanceObserver` instances introduce their own additional
369372
performance overhead, instances should not be left subscribed to notifications
370373
indefinitely. Users should disconnect observers as soon as they are no
371374
longer needed.
372375

373-
### Callback: PerformanceObserverCallback(list, observer)
374-
<!-- YAML
375-
added: v8.5.0
376-
-->
377-
378-
* `list` {PerformanceObserverEntryList}
379-
* `observer` {PerformanceObserver}
380-
381-
The `PerformanceObserverCallback` is invoked when a `PerformanceObserver` is
376+
The `callback` is invoked when a `PerformanceObserver` is
382377
notified about new `PerformanceEntry` instances. The callback receives a
383378
`PerformanceObserverEntryList` instance and a reference to the
384379
`PerformanceObserver`.
385380

386-
### Class: PerformanceObserverEntryList
387-
<!-- YAML
388-
added: v8.5.0
389-
-->
390-
391-
The `PerformanceObserverEntryList` class is used to provide access to the
392-
`PerformanceEntry` instances passed to a `PerformanceObserver`.
393-
394-
#### performanceObserverEntryList.getEntries()
395-
<!-- YAML
396-
added: v8.5.0
397-
-->
398-
399-
* Returns: {PerformanceEntry[]}
400-
401-
Returns a list of `PerformanceEntry` objects in chronological order
402-
with respect to `performanceEntry.startTime`.
403-
404-
#### performanceObserverEntryList.getEntriesByName(name[, type])
405-
<!-- YAML
406-
added: v8.5.0
407-
-->
408-
409-
* `name` {string}
410-
* `type` {string}
411-
* Returns: {PerformanceEntry[]}
412-
413-
Returns a list of `PerformanceEntry` objects in chronological order
414-
with respect to `performanceEntry.startTime` whose `performanceEntry.name` is
415-
equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to
416-
`type`.
417-
418-
#### performanceObserverEntryList.getEntriesByType(type)
419-
<!-- YAML
420-
added: v8.5.0
421-
-->
422-
423-
* `type` {string}
424-
* Returns: {PerformanceEntry[]}
425-
426-
Returns a list of `PerformanceEntry` objects in chronological order
427-
with respect to `performanceEntry.startTime` whose `performanceEntry.entryType`
428-
is equal to `type`.
429-
430381
### performanceObserver.disconnect()
431382
<!-- YAML
432383
added: v8.5.0
@@ -482,6 +433,51 @@ for (let n = 0; n < 3; n++)
482433
performance.mark(`test${n}`);
483434
```
484435

436+
## Class: PerformanceObserverEntryList
437+
<!-- YAML
438+
added: v8.5.0
439+
-->
440+
441+
The `PerformanceObserverEntryList` class is used to provide access to the
442+
`PerformanceEntry` instances passed to a `PerformanceObserver`.
443+
444+
### performanceObserverEntryList.getEntries()
445+
<!-- YAML
446+
added: v8.5.0
447+
-->
448+
449+
* Returns: {PerformanceEntry[]}
450+
451+
Returns a list of `PerformanceEntry` objects in chronological order
452+
with respect to `performanceEntry.startTime`.
453+
454+
### performanceObserverEntryList.getEntriesByName(name[, type])
455+
<!-- YAML
456+
added: v8.5.0
457+
-->
458+
459+
* `name` {string}
460+
* `type` {string}
461+
* Returns: {PerformanceEntry[]}
462+
463+
Returns a list of `PerformanceEntry` objects in chronological order
464+
with respect to `performanceEntry.startTime` whose `performanceEntry.name` is
465+
equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to
466+
`type`.
467+
468+
### performanceObserverEntryList.getEntriesByType(type)
469+
<!-- YAML
470+
added: v8.5.0
471+
-->
472+
473+
* `type` {string}
474+
* Returns: {PerformanceEntry[]}
475+
476+
Returns a list of `PerformanceEntry` objects in chronological order
477+
with respect to `performanceEntry.startTime` whose `performanceEntry.entryType`
478+
is equal to `type`.
479+
480+
485481
## Examples
486482

487483
### 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
@@ -92,7 +92,7 @@ const customTypesMap = {
9292
'PerformanceNodeTiming':
9393
'perf_hooks.html#perf_hooks_class_performancenodetiming_extends_performanceentry', // eslint-disable-line max-len
9494
'PerformanceObserver':
95-
'perf_hooks.html#perf_hooks_class_performanceobserver_callback',
95+
'perf_hooks.html#perf_hooks_class_performanceobserver',
9696
'PerformanceObserverEntryList':
9797
'perf_hooks.html#perf_hooks_class_performanceobserverentrylist',
9898

0 commit comments

Comments
 (0)