@@ -122,129 +122,127 @@ declare namespace Raven {
122
122
123
123
Plugins : { [ id : string ] : RavenPlugin } ;
124
124
125
- /*
126
- * Allow Raven to be configured as soon as it is loaded
127
- * It uses a global RavenConfig = {dsn: '...', config: {}}
128
- *
129
- * @return undefined
130
- */
125
+ /**
126
+ * Allow Raven to be configured as soon as it is loaded
127
+ * It uses a global RavenConfig = {dsn: '...', config: {}}
128
+ *
129
+ * @return undefined
130
+ */
131
131
afterLoad ( ) : void ;
132
132
133
- /*
134
- * Allow multiple versions of Raven to be installed.
135
- * Strip Raven from the global context and returns the instance.
136
- *
137
- * @return {Raven }
138
- */
133
+ /**
134
+ * Allow multiple versions of Raven to be installed.
135
+ * Strip Raven from the global context and returns the instance.
136
+ *
137
+ * @return {Raven }
138
+ */
139
139
noConflict ( ) : RavenStatic ;
140
140
141
- /*
142
- * Configure Raven with a DSN and extra options
143
- *
144
- * @param {string } dsn The public Sentry DSN
145
- * @param {object } options Optional set of global options [optional]
146
- * @return {Raven }
147
- */
141
+ /**
142
+ * Configure Raven with a DSN and extra options
143
+ *
144
+ * @param {string } dsn The public Sentry DSN
145
+ * @param {object } options Optional set of global options [optional]
146
+ * @return {Raven }
147
+ */
148
148
config ( dsn : string , options ?: RavenOptions ) : RavenStatic ;
149
149
150
- /*
151
- * Installs a global window.onerror error handler
152
- * to capture and report uncaught exceptions.
153
- * At this point, install() is required to be called due
154
- * to the way TraceKit is set up.
155
- *
156
- * @return {Raven }
157
- */
150
+ /**
151
+ * Installs a global window.onerror error handler
152
+ * to capture and report uncaught exceptions.
153
+ * At this point, install() is required to be called due
154
+ * to the way TraceKit is set up.
155
+ *
156
+ * @return {Raven }
157
+ */
158
158
install ( ) : RavenStatic ;
159
159
160
- /*
161
- * Adds a plugin to Raven
162
- *
163
- * @return {Raven }
164
- */
160
+ /**
161
+ * Adds a plugin to Raven
162
+ *
163
+ * @return {Raven }
164
+ */
165
165
addPlugin ( plugin : RavenPlugin , ...pluginArgs : any [ ] ) : RavenStatic ;
166
166
167
- /*
168
- * Wrap code within a context so Raven can capture errors
169
- * reliably across domains that is executed immediately.
170
- *
171
- * @param {object } options A specific set of options for this context [optional]
172
- * @param {function } func The callback to be immediately executed within the context
173
- * @param {array } args An array of arguments to be called with the callback [optional]
174
- */
167
+ /**
168
+ * Wrap code within a context so Raven can capture errors
169
+ * reliably across domains that is executed immediately.
170
+ *
171
+ * @param {object } options A specific set of options for this context [optional]
172
+ * @param {function } func The callback to be immediately executed within the context
173
+ * @param {array } args An array of arguments to be called with the callback [optional]
174
+ */
175
175
context ( func : Function , ...args : any [ ] ) : void ;
176
176
context ( options : RavenOptions , func : Function , ...args : any [ ] ) : void ;
177
177
178
- /*
179
- * Wrap code within a context and returns back a new function to be executed
180
- *
181
- * @param {object } options A specific set of options for this context [optional]
182
- * @param {function } func The function to be wrapped in a new context
183
- * @return {function } The newly wrapped functions with a context
184
- */
178
+ /**
179
+ * Wrap code within a context and returns back a new function to be executed
180
+ *
181
+ * @param {object } options A specific set of options for this context [optional]
182
+ * @param {function } func The function to be wrapped in a new context
183
+ * @return {function } The newly wrapped functions with a context
184
+ */
185
185
wrap ( func : Function ) : Function ;
186
186
wrap ( options : RavenOptions , func : Function ) : Function ;
187
187
wrap < T extends Function > ( func : T ) : T ;
188
188
wrap < T extends Function > ( options : RavenOptions , func : T ) : T ;
189
189
190
- /*
191
- * Uninstalls the global error handler.
192
- *
193
- * @return {Raven }
194
- */
190
+ /**
191
+ * Uninstalls the global error handler.
192
+ *
193
+ * @return {Raven }
194
+ */
195
195
uninstall ( ) : RavenStatic ;
196
196
197
- /*
198
- * Manually capture an exception and send it over to Sentry
199
- *
200
- * @param {error|ErrorEvent|string } ex An exception to be logged
201
- * @param {object } options A specific set of options for this error [optional]
202
- * @return {Raven }
203
- */
197
+ /**
198
+ * Manually capture an exception and send it over to Sentry
199
+ *
200
+ * @param {error|ErrorEvent|string } ex An exception to be logged
201
+ * @param {object } options A specific set of options for this error [optional]
202
+ * @return {Raven }
203
+ */
204
204
captureException (
205
205
ex : Error | ErrorEvent | string ,
206
206
options ?: RavenOptions
207
207
) : RavenStatic ;
208
208
209
- /*
210
- * Manually send a message to Sentry
211
- *
212
- * @param {string } msg A plain message to be captured in Sentry
213
- * @param {object } options A specific set of options for this message [optional]
214
- * @return {Raven }
215
- */
209
+ /**
210
+ * Manually send a message to Sentry
211
+ *
212
+ * @param {string } msg A plain message to be captured in Sentry
213
+ * @param {object } options A specific set of options for this message [optional]
214
+ * @return {Raven }
215
+ */
216
216
captureMessage ( msg : string , options ?: RavenOptions ) : RavenStatic ;
217
217
218
218
/** Log a breadcrumb */
219
219
captureBreadcrumb ( crumb : Breadcrumb ) : RavenStatic ;
220
220
221
- /*
222
- * Set/Clear a user to be sent along with the payload.
223
- *
224
- * @param {object } user An object representing user data [optional]
225
- * If user is undefined, the current user context will be removed.
226
- * @return {Raven }
227
- */
228
- setUserContext ( user ?: {
229
- [ key : string ] : any ;
230
- } ) : RavenStatic ;
231
-
232
- /*
233
- * Merge extra attributes to be sent along with the payload.
234
- *
235
- * @param {object } context A set of data to be merged with the current extra context data [optional]
236
- * If context is undefined, the current extra context data will be removed.
237
- * @return {Raven }
238
- */
221
+ /**
222
+ * Set/Clear a user to be sent along with the payload.
223
+ *
224
+ * @param {object } user An object representing user data [optional]
225
+ * If user is undefined, the current user context will be removed.
226
+ * @return {Raven }
227
+ */
228
+ setUserContext ( user ?: { [ key : string ] : any } ) : RavenStatic ;
229
+
230
+ /**
231
+ * Merge extra attributes to be sent along with the payload.
232
+ *
233
+ * @param {object } context A set of data to be merged with the current extra context data [optional]
234
+ * If context is undefined, the current extra context data will be removed.
235
+ * @return {Raven }
236
+ */
239
237
setExtraContext ( context ?: Object ) : RavenStatic ;
240
238
241
- /*
242
- * Merge tags to be sent along with the payload.
243
- *
244
- * @param {object } tags A set of data to be merged with the current tag context data [optional]
245
- * If tags is undefined, the current tag context data will be removed.
246
- * @return {Raven }
247
- */
239
+ /**
240
+ * Merge tags to be sent along with the payload.
241
+ *
242
+ * @param {object } tags A set of data to be merged with the current tag context data [optional]
243
+ * If tags is undefined, the current tag context data will be removed.
244
+ * @return {Raven }
245
+ */
248
246
setTagsContext ( tags ?: Object ) : RavenStatic ;
249
247
250
248
/** Clear all of the context. */
@@ -285,11 +283,11 @@ declare namespace Raven {
285
283
/** Show Sentry user feedback dialog */
286
284
showReportDialog ( options ?: Object ) : void ;
287
285
288
- /*
289
- * Configure Raven DSN
290
- *
291
- * @param {string } dsn The public Sentry DSN
292
- */
286
+ /**
287
+ * Configure Raven DSN
288
+ *
289
+ * @param {string } dsn The public Sentry DSN
290
+ */
293
291
setDSN ( dsn : string ) : void ;
294
292
}
295
293
@@ -329,5 +327,14 @@ declare namespace Raven {
329
327
sentry ?: boolean ;
330
328
}
331
329
332
- type LogLevel = 'critical' | 'error' | 'warning' | 'info' | 'debug' | 'warn' | 'log' ;
330
+ /** Event/Breadcrumb Severity. `critical` is for Breadcrumbs only and `fatal` is for Events only. */
331
+ type LogLevel =
332
+ | 'critical'
333
+ | 'fatal'
334
+ | 'error'
335
+ | 'warning'
336
+ | 'info'
337
+ | 'debug'
338
+ | 'warn'
339
+ | 'log' ;
333
340
}
0 commit comments