File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -24,9 +24,10 @@ export class PerformanceObserverSink<T>
2424 #flushThreshold: number ;
2525 #sink: Sink < T , unknown > ;
2626 #observer: PerformanceObserver | undefined ;
27- #observedTypes: EntryType [ ] = [ 'mark' , 'measure' ] ;
28- #getEntries = ( list : PerformanceObserverEntryList ) =>
29- this . #observedTypes. flatMap ( t => list . getEntriesByType ( t ) ) ;
27+ readonly #observedTypes: EntryType [ ] = [ 'mark' , 'measure' ] ;
28+ #getEntries = ( list : {
29+ getEntriesByType : ( t : EntryType ) => PerformanceEntry [ ] ;
30+ } ) => this . #observedTypes. flatMap ( t => list . getEntriesByType ( t ) ) ;
3031 #observedCount: number = 0 ;
3132
3233 constructor ( options : PerformanceObserverOptions < T > ) {
Original file line number Diff line number Diff line change @@ -40,6 +40,10 @@ declare module 'node:perf_hooks' {
4040 duration ?: number ;
4141 }
4242
43+ export interface PerformanceObserverEntryList {
44+ getEntriesByType : ( type : EntryType ) => PerformanceEntry [ ] ;
45+ }
46+
4347 const performance : {
4448 mark : ( name : string , options ?: PerformanceMarkOptions ) => PerformanceMark ;
4549
@@ -48,5 +52,7 @@ declare module 'node:perf_hooks' {
4852 startOrOptions ?: string | number | PerformanceMeasureOptions ,
4953 end ?: string | number ,
5054 ) => PerformanceMeasure ;
55+
56+ getEntriesByType : ( type : EntryType ) => PerformanceEntry [ ] ;
5157 } ;
5258}
You can’t perform that action at this time.
0 commit comments