Skip to content

Commit e81bfbb

Browse files
committed
fix types??
1 parent 8ce1277 commit e81bfbb

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

packages/tracing-internal/src/browser/instrument.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { onCLS } from './web-vitals/getCLS';
44
import { onFID } from './web-vitals/getFID';
55
import { onLCP } from './web-vitals/getLCP';
66
import { observe } from './web-vitals/lib/observe';
7-
import type { Metric, PerformanceElementTiming } from './web-vitals/types';
7+
import type { Metric } from './web-vitals/types';
88

99
type InstrumentHandlerTypePerformanceObserver = 'longtask' | 'event' | 'element' | 'navigation' | 'paint' | 'resource';
1010

@@ -54,10 +54,6 @@ export function addPerformanceInstrumentationHandler(
5454
type: 'event',
5555
callback: (data: { entries: PerformanceEventTiming[] }) => void,
5656
): CleanupHandlerCallback;
57-
export function addPerformanceInstrumentationHandler(
58-
type: 'element',
59-
callback: (data: { entries: PerformanceElementTiming[] }) => void,
60-
): CleanupHandlerCallback;
6157
export function addPerformanceInstrumentationHandler(
6258
type: 'navigation',
6359
callback: (data: { entries: PerformanceNavigationTiming[] }) => void,
@@ -71,7 +67,7 @@ export function addPerformanceInstrumentationHandler(
7167
callback: (data: { entries: PerformanceResourceTiming[] }) => void,
7268
): CleanupHandlerCallback;
7369
export function addPerformanceInstrumentationHandler(
74-
type: 'longtask' | InstrumentHandlerTypePerformanceObserver,
70+
type: 'longtask' | 'element' | InstrumentHandlerTypePerformanceObserver,
7571
callback: (data: { entries: PerformanceEntry[] }) => void,
7672
): CleanupHandlerCallback;
7773
export function addPerformanceInstrumentationHandler(

packages/tracing-internal/src/browser/web-vitals/types.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,11 @@ export interface PerformanceEventTiming extends PerformanceEntry {
5151
target?: Element;
5252
}
5353

54+
// This is not a _full_ type, but it's enough for what we need of it
5455
export interface PerformanceElementTiming extends PerformanceEntry {
5556
element: Element;
5657
id: string;
5758
identifier: string;
58-
loadTime: DOMHighResTimeStamp;
59-
intersectionRect: DOMRectReadOnly;
60-
naturalHeight: number;
61-
naturalWidth: number;
62-
renderTime: DOMHighResTimeStamp;
63-
url: string | number;
6459
}
6560

6661
// --------------------------------------------------------------------------

0 commit comments

Comments
 (0)