@@ -12,7 +12,8 @@ import getDynamicText from 'app/utils/getDynamicText';
12
12
import overflowEllipsis from 'app/styles/overflowEllipsis' ;
13
13
import pinIcon from 'app/../images/location-pin.png' ;
14
14
import space from 'app/styles/space' ;
15
- import { EventView } from 'app/types' ;
15
+ import { EventView , Organization } from 'app/types' ;
16
+ import { ReactRouterLocation } from 'app/types/reactRouter' ;
16
17
17
18
import { QueryLink } from './styles' ;
18
19
@@ -92,12 +93,38 @@ export const ALL_VIEWS: Readonly<Array<EventView>> = deepFreeze([
92
93
} ,
93
94
] ) ;
94
95
96
+ type EventData = { [ key : string ] : any } ;
97
+
98
+ type RenderFunctionBaggage = {
99
+ organization : Organization ;
100
+ location : ReactRouterLocation ;
101
+ } ;
102
+
103
+ type RenderFunction = (
104
+ field : string ,
105
+ data : EventData ,
106
+ baggage : RenderFunctionBaggage
107
+ ) => React . ReactNode ;
108
+
109
+ type FieldFormatter = {
110
+ sortField : boolean ;
111
+ renderFunc : RenderFunction ;
112
+ } ;
113
+
114
+ type FieldFormatters = {
115
+ boolean : FieldFormatter ;
116
+ integer : FieldFormatter ;
117
+ number : FieldFormatter ;
118
+ date : FieldFormatter ;
119
+ string : FieldFormatter ;
120
+ } ;
121
+
95
122
/**
96
123
* A mapping of field types to their rendering function.
97
124
* This mapping is used when a field is not defined in SPECIAL_FIELDS
98
125
* This mapping should match the output sentry.utils.snuba:get_json_type
99
126
*/
100
- export const FIELD_FORMATTERS = {
127
+ export const FIELD_FORMATTERS : FieldFormatters = {
101
128
boolean : {
102
129
sortField : true ,
103
130
renderFunc : ( field , data , { organization, location} ) => {
0 commit comments