@@ -40,6 +40,9 @@ declare namespace Rollbar {
40
40
) => void | Promise < TResult > ;
41
41
export type MaybeError = Error | undefined | null ;
42
42
export type Level = "debug" | "info" | "warning" | "error" | "critical" ;
43
+ /**
44
+ * {@link https://docs.rollbar.com/docs/rollbarjs-configuration-reference#reference }
45
+ */
43
46
export interface Configuration {
44
47
accessToken ?: string ;
45
48
addErrorContext ?: boolean ;
@@ -52,7 +55,15 @@ declare namespace Rollbar {
52
55
captureUnhandledRejections ?: boolean ;
53
56
captureUsername ?: boolean ;
54
57
checkIgnore ?: ( isUncaught : boolean , args : LogArgument [ ] , item : object ) => boolean ;
58
+ /**
59
+ * `codeVersion` takes precedence over `code_version`, if provided.
60
+ * `client.javascript.code_version` takes precedence over both top level properties.
61
+ */
55
62
codeVersion ?: string ;
63
+ /**
64
+ * `codeVersion` takes precedence over `code_version`, if provided.
65
+ * `client.javascript.code_version` takes precedence over both top level properties.
66
+ */
56
67
code_version ?: string ;
57
68
enabled ?: boolean ;
58
69
endpoint ?: string ;
@@ -77,7 +88,7 @@ declare namespace Rollbar {
77
88
nodeSourceMaps ?: boolean ;
78
89
onSendCallback ?: ( isUncaught : boolean , args : LogArgument [ ] , item : object ) => void ;
79
90
overwriteScrubFields ?: boolean ;
80
- payload ?: object ;
91
+ payload ?: Payload ;
81
92
reportLevel ?: Level ;
82
93
rewriteFilenamePatterns ?: string [ ] ;
83
94
scrubFields ?: string [ ] ;
@@ -89,7 +100,7 @@ declare namespace Rollbar {
89
100
stackTraceLimit ?: number ;
90
101
telemetryScrubber ?: TelemetryScrubber ;
91
102
timeout ?: number ;
92
- transform ?: ( data : object , item : object ) => void ;
103
+ transform ?: ( data : object , item : object ) => void | Promise < void > ;
93
104
transmit ?: boolean ;
94
105
uncaughtErrorLevel ?: Level ;
95
106
verbose ?: boolean ;
@@ -169,4 +180,73 @@ declare namespace Rollbar {
169
180
scrub ?: ScrubType ,
170
181
truncation ?: TruncationType
171
182
}
183
+
184
+ /**
185
+ * @deprecated number is deprecated for this field
186
+ */
187
+ export type DeprecatedNumber = number ;
188
+
189
+ /**
190
+ * {@link https://docs.rollbar.com/docs/rollbarjs-configuration-reference#payload-1 }
191
+ */
192
+ export interface Payload {
193
+ person ?: {
194
+ id : string | DeprecatedNumber ;
195
+ username ?: string ;
196
+ email ?: string ;
197
+ [ property : string ] : any ;
198
+ } ,
199
+ context ?: any ;
200
+ client ?: {
201
+ javascript ?: {
202
+ /**
203
+ * Version control number (i.e. git SHA) of the current revision. Used for linking filenames in stacktraces to GitHub.
204
+ * Note: for the purposes of nesting under the payload key, only code_version will correctly set the value in the final item.
205
+ * However, if you wish to set this code version at the top level of the configuration object rather than nested under
206
+ * the payload key, we will accept both codeVersion and code_version with codeVersion given preference if both happened
207
+ * to be defined. Furthermore, if code_version is nested under the payload key this will have the final preference over
208
+ * any value set at the top level.
209
+ */
210
+ code_version ?: string | DeprecatedNumber ;
211
+ /**
212
+ * When true, the Rollbar service will attempt to find and apply source maps to all frames in the stack trace.
213
+ * @default false
214
+ */
215
+ source_map_enabled ?: boolean ;
216
+ /**
217
+ * When true, the Rollbar service will attempt to apply source maps to frames even if they are missing column numbers.
218
+ * Works best when the minified javascript file is generated using newlines instead of semicolons.
219
+ * @default false
220
+ */
221
+ guess_uncaught_frames ?: boolean ;
222
+ [ property : string ] : any ;
223
+ }
224
+ [ property : string ] : any ;
225
+ } ,
226
+ /**
227
+ * The environment that your code is running in.
228
+ * @default undefined
229
+ */
230
+ environment ?: string ;
231
+ server ?: {
232
+ /**
233
+ * @default master
234
+ */
235
+ branch ?: string ;
236
+ /**
237
+ * The hostname of the machine that rendered the page.
238
+ */
239
+ host ?: string ;
240
+ /**
241
+ * It is used in two different ways: `source maps`, and `source control`.
242
+ *
243
+ * If you are looking for more information on it please go to:
244
+ * {@link https://docs.rollbar.com/docs/source-maps}
245
+ * {@link https://docs.rollbar.com/docs/source-control}
246
+ */
247
+ root ?: string ;
248
+ [ property : string ] : any ;
249
+ } ,
250
+ [ property : string ] : any ;
251
+ }
172
252
}
0 commit comments