1
1
import type { customEvent } from '@sentry-internal/rrweb' ;
2
- import type { Breadcrumb , FetchBreadcrumbData , XhrBreadcrumbData } from '@sentry/types' ;
2
+ import type { Breadcrumb , FetchBreadcrumbData , XhrBreadcrumbData } from '@sentry/types' ;
3
3
4
4
import type { AllEntryData } from '../types' ;
5
5
6
- interface BaseReplayFrame < T = undefined | Record < string , any > > {
6
+ interface BaseReplayFrame {
7
7
timestamp : number ;
8
8
/**
9
9
* For compatibility reasons
10
10
*/
11
11
type : string ;
12
12
category : string ;
13
- data ?: T ;
13
+ data ?: Record < string , any > ;
14
14
message ?: string ;
15
15
}
16
16
@@ -29,40 +29,45 @@ interface ConsoleFrameData {
29
29
logger : string ;
30
30
arguments ?: any [ ] ;
31
31
}
32
- interface ConsoleFrame extends BaseReplayFrame < ConsoleFrameData > {
32
+ interface ConsoleFrame extends BaseReplayFrame {
33
33
category : 'console' ;
34
34
level : Breadcrumb [ 'level' ] ;
35
35
message : string ;
36
+ data : ConsoleFrameData ;
36
37
}
37
38
38
39
type ClickFrameData = BaseDomFrameData ;
39
- interface ClickFrame extends BaseReplayFrame < ClickFrameData > {
40
+ interface ClickFrame extends BaseReplayFrame {
40
41
category : 'ui.click' ;
41
42
message : string ;
43
+ data : ClickFrameData ;
42
44
}
43
45
44
- interface FetchFrame extends BaseReplayFrame < FetchBreadcrumbData > {
46
+ interface FetchFrame extends BaseReplayFrame {
45
47
category : 'fetch' ;
46
48
type : 'http' ;
49
+ data : FetchBreadcrumbData ;
47
50
}
48
51
49
52
interface InputFrame extends BaseReplayFrame {
50
53
category : 'ui.input' ;
51
54
message : string ;
52
55
}
53
56
54
- interface XhrFrame extends BaseReplayFrame < XhrBreadcrumbData > {
57
+ interface XhrFrame extends BaseReplayFrame {
55
58
category : 'xhr' ;
56
59
type : 'http' ;
60
+ data : XhrBreadcrumbData ;
57
61
}
58
62
59
63
/* Crumbs from Replay */
60
64
interface MutationFrameData {
61
65
count : number ;
62
66
limit : boolean ;
63
67
}
64
- interface MutationFrame extends BaseReplayFrame < MutationFrameData > {
68
+ interface MutationFrame extends BaseReplayFrame {
65
69
category : 'replay.mutations' ;
70
+ data : MutationFrameData ;
66
71
}
67
72
68
73
interface KeyboardEventFrameData extends BaseDomFrameData {
@@ -72,14 +77,16 @@ interface KeyboardEventFrameData extends BaseDomFrameData {
72
77
altKey : boolean ;
73
78
key : string ;
74
79
}
75
- interface KeyboardEventFrame extends BaseReplayFrame < KeyboardEventFrameData > {
80
+ interface KeyboardEventFrame extends BaseReplayFrame {
76
81
category : 'ui.keyDown' ;
82
+ data : KeyboardEventFrameData ;
77
83
}
78
84
79
- interface BlurFrame extends BaseReplayFrame < undefined > {
85
+ interface BlurFrame extends BaseReplayFrame {
80
86
category : 'ui.blur' ;
81
87
}
82
- interface FocusFrame extends BaseReplayFrame < undefined > {
88
+
89
+ interface FocusFrame extends BaseReplayFrame {
83
90
category : 'ui.focus' ;
84
91
}
85
92
@@ -88,11 +95,23 @@ interface SlowClickFrameData extends ClickFrameData {
88
95
timeAfterClickFs : number ;
89
96
endReason : string ;
90
97
}
91
- interface SlowClickFrame extends BaseReplayFrame < SlowClickFrameData > {
98
+ interface SlowClickFrame extends BaseReplayFrame {
92
99
category : 'ui.slowClickDetected' ;
93
- }
94
-
95
- export type CrumbFrame = ConsoleFrame | ClickFrame | FetchFrame | InputFrame | XhrFrame | KeyboardEventFrame | BlurFrame | FocusFrame | SlowClickFrame | MutationFrame | BaseReplayFrame ;
100
+ data : SlowClickFrameData ;
101
+ }
102
+
103
+ export type CrumbFrame =
104
+ | ConsoleFrame
105
+ | ClickFrame
106
+ | FetchFrame
107
+ | InputFrame
108
+ | XhrFrame
109
+ | KeyboardEventFrame
110
+ | BlurFrame
111
+ | FocusFrame
112
+ | SlowClickFrame
113
+ | MutationFrame
114
+ | BaseReplayFrame ;
96
115
97
116
export interface SpanFrame {
98
117
op : string ;
0 commit comments