Skip to content

Commit 26b0c53

Browse files
committed
fix PerformancePaintTiming type error
1 parent 96d3372 commit 26b0c53

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

packages/replay/src/createPerformanceEntry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { WINDOW } from '@sentry/browser';
22
import { browserPerformanceTimeOrigin } from '@sentry/utils';
33
import { record } from 'rrweb';
44

5-
import { AllPerformanceEntry } from './types';
5+
import { AllPerformanceEntry, PerformancePaintTiming } from './types';
66
import { isIngestHost } from './util/isIngestHost';
77

88
export interface ReplayPerformanceEntry {

packages/replay/src/types.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ export interface WorkerRequest {
3535

3636
declare global {
3737
const __SENTRY_REPLAY_VERSION__: string;
38-
39-
// PerformancePaintTiming is only available since TS 4.4, so for now we just define this here
40-
// see: https://github.com/microsoft/TypeScript/blob/main/lib/lib.dom.d.ts#L10564
41-
type PerformancePaintTiming = PerformanceEntry;
4238
// @ts-ignore declare again, this _should_ be there but somehow is not available in worker context
4339
type PerformanceNavigationTiming = PerformanceEntry;
4440
}
4541

42+
// PerformancePaintTiming is only available with TS 4.4 and newer
43+
// Therefore, we're exporting it here to make it available in older versions
44+
export type PerformancePaintTiming = PerformanceEntry;
45+
4646
/**
4747
* The response from the worker
4848
*/

packages/replay/src/util/dedupePerformanceEntries.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import type { PerformancePaintTiming } from '../types';
2+
13
const NAVIGATION_ENTRY_KEYS: Array<keyof PerformanceNavigationTiming> = [
24
'name',
35
'type',

0 commit comments

Comments
 (0)