Skip to content

Commit a5e95d9

Browse files
committed
add PerformanceScriptTiming definitions
1 parent 5ba8c9d commit a5e95d9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/browser-utils/src/metrics/instrument.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ interface PerformanceEventTiming extends PerformanceEntry {
3737
interactionId?: number;
3838
}
3939

40+
interface PerformanceScriptTiming extends PerformanceEntry {
41+
sourceCharPosition: number;
42+
sourceFunctionName: string;
43+
sourceUrl: string;
44+
}
45+
4046
interface Metric {
4147
/**
4248
* The name of the metric (in acronym form).
@@ -163,6 +169,10 @@ export function addPerformanceInstrumentationHandler(
163169
type: 'event',
164170
callback: (data: { entries: ((PerformanceEntry & { target?: unknown | null }) | PerformanceEventTiming)[] }) => void,
165171
): CleanupHandlerCallback;
172+
export function addPerformanceInstrumentationHandler(
173+
type: 'long-animation-frame',
174+
callback: (data: { entries: (PerformanceEntry & {scripts?: PerformanceScriptTiming[]})[] }) => void,
175+
): CleanupHandlerCallback;
166176
export function addPerformanceInstrumentationHandler(
167177
type: InstrumentHandlerTypePerformanceObserver,
168178
callback: (data: { entries: PerformanceEntry[] }) => void,

0 commit comments

Comments
 (0)