diff --git a/packages/replay-internal/src/types/performance.ts b/packages/replay-internal/src/types/performance.ts index fa996254a12c..f598581c93ab 100644 --- a/packages/replay-internal/src/types/performance.ts +++ b/packages/replay-internal/src/types/performance.ts @@ -110,11 +110,11 @@ export interface WebVitalData { /** * The recording id of the web vital nodes. -1 if not found */ - nodeIds: number[] | undefined; + nodeIds?: number[]; /** * The layout shifts of a CLS metric */ - attributions: { value: number; nodeIds: number[] | undefined }[] | undefined; + attributions?: { value: number; nodeIds: number[] | undefined }[]; } /** diff --git a/packages/replay-internal/src/util/createPerformanceEntries.ts b/packages/replay-internal/src/util/createPerformanceEntries.ts index 52f2f19ec15b..c28e69caee00 100644 --- a/packages/replay-internal/src/util/createPerformanceEntries.ts +++ b/packages/replay-internal/src/util/createPerformanceEntries.ts @@ -58,11 +58,6 @@ interface LayoutShiftAttribution { currentRect: DOMRectReadOnly; } -interface Attribution { - value: number; - nodeIds: number[] | undefined; -} - /** * Handler creater for web vitals */ @@ -206,7 +201,7 @@ function isLayoutShift(entry: PerformanceEntry): entry is LayoutShift { * Add a CLS event to the replay based on a CLS metric. */ export function getCumulativeLayoutShift(metric: Metric): ReplayPerformanceEntry { - const layoutShifts: Attribution[] = []; + const layoutShifts: WebVitalData['attributions'] = []; const nodes: Node[] = []; for (const entry of metric.entries) { if (isLayoutShift(entry)) { @@ -252,7 +247,7 @@ function getWebVital( metric: Metric, name: string, nodes: Node[] | undefined, - attributions?: Attribution[], + attributions?: WebVitalData['attributions'], ): ReplayPerformanceEntry { const value = metric.value; const rating = metric.rating;