Skip to content

Commit acf0f4e

Browse files
committed
Revert "Update raven option typings (#811)"
This reverts commit 508121f.
1 parent ce0acb5 commit acf0f4e

File tree

1 file changed

+31
-92
lines changed

1 file changed

+31
-92
lines changed

typescript/raven.d.ts

+31-92
Original file line numberDiff line numberDiff line change
@@ -6,80 +6,25 @@ declare var Raven: RavenStatic;
66

77
export = Raven;
88

9-
interface BreadcrumbSettings {
10-
/* Whether to collect XHR calls, defaults to true */
11-
xhr?: boolean;
12-
13-
/* Whether to collect console logs, defaults to true */
14-
console?: boolean;
15-
16-
/* Whether to collect dom events, defaults to true */
17-
dom?: boolean;
9+
interface RavenOptions {
10+
/** The log level associated with this event. Default: error */
11+
level?: string;
1812

19-
/* Whether to record window location and navigation, defaults to true */
20-
location?: boolean;
21-
}
13+
/** The name of the logger used by Sentry. Default: javascript */
14+
logger?: string;
2215

23-
interface CommonRavenOptions {
2416
/** The environment of the application you are monitoring with Sentry */
2517
environment?: string;
2618

2719
/** The release version of the application you are monitoring with Sentry */
2820
release?: string;
2921

30-
/** Additional data to be tagged onto the error. */
31-
tags?: {
32-
[id: string]: string;
33-
};
34-
35-
/** Exra metadata to collect */
36-
extra?: any;
37-
38-
/** The name of the logger used by Sentry. Default: javascript */
39-
logger?: string;
40-
}
41-
42-
interface RavenOptions extends CommonRavenOptions {
43-
44-
/** The name of the server or device that the client is running on */
45-
server_name?: string;
46-
47-
/** The log level associated with this event. Default: error */
48-
level?: string;
49-
50-
/** set to true to get the strack trace of your message */
51-
stacktrace?: boolean;
52-
53-
/** In some cases you may see issues where Sentry groups multiple events together when they should be separate entities. In other cases, Sentry simply doesn’t group events together because they’re so sporadic that they never look the same. */
54-
fingerprint?: string[];
55-
56-
/** Number of frames to trim off the stacktrace, defaults to 1 */
57-
trimHeadFrames?: number;
58-
59-
/** The name of the device platform. Default: "javascript" */
60-
platform?: string;
61-
}
62-
63-
interface RavenGlobalOptions extends CommonRavenOptions {
64-
6522
/** The name of the server or device that the client is running on */
6623
serverName?: string;
6724

68-
/** set to true to get the strack trace of your message */
69-
stacktrace?: boolean;
70-
7125
/** List of messages to be fitlered out before being sent to Sentry. */
7226
ignoreErrors?: (RegExp | string)[];
7327

74-
/** Configures which breadcrumbs are collected automatically */
75-
autoBreadcrumbs?: boolean | BreadcrumbSettings;
76-
77-
/** Whether to collect errors on the window via TraceKit.collectWindowErrors. Defaults to true. */
78-
collectWindowErrors?: boolean;
79-
80-
/** Max number of breadcrumbs to collect, defaults to 100 */
81-
maxBreadcrumbs?: number;
82-
8328
/** Similar to ignoreErrors, but will ignore errors from whole urls patching a regex pattern. */
8429
ignoreUrls?: (RegExp | string)[];
8530

@@ -89,36 +34,30 @@ interface RavenGlobalOptions extends CommonRavenOptions {
8934
/** An array of regex patterns to indicate which urls are a part of your app. */
9035
includePaths?: (RegExp | string)[];
9136

92-
/** Maximum amount of stack frames to collect, defaults to infinity */
93-
stackTraceLimit?: number;
37+
/** Additional data to be tagged onto the error. */
38+
tags?: {
39+
[id: string]: string;
40+
};
9441

95-
/** Override the default HTTP data transport handler. */
96-
transport?: (options: RavenTransportOptions) => void;
42+
/** set to true to get the strack trace of your message */
43+
stacktrace?: boolean;
9744

98-
/** By default, Raven does not truncate messages. If you need to truncate characters for whatever reason, you may set this to limit the length. */
99-
maxMessageLength?: number;
45+
extra?: any;
10046

101-
/** A callback function that allows you to apply your own filters to determine if the message should be sent to Sentry. */
102-
shouldSendCallback?: (data: any) => boolean;
47+
/** In some cases you may see issues where Sentry groups multiple events together when they should be separate entities. In other cases, Sentry simply doesn’t group events together because they’re so sporadic that they never look the same. */
48+
fingerprint?: string[];
10349

10450
/** A function which allows mutation of the data payload right before being sent to Sentry */
10551
dataCallback?: (data: any) => any;
106-
}
10752

108-
interface RavenWrapOptions extends RavenOptions {
109-
/**
110-
* Whether to run the wrap recursively, defaults to false.
111-
*/
112-
deep?: boolean;
113-
}
53+
/** A callback function that allows you to apply your own filters to determine if the message should be sent to Sentry. */
54+
shouldSendCallback?: (data: any) => boolean;
55+
56+
/** By default, Raven does not truncate messages. If you need to truncate characters for whatever reason, you may set this to limit the length. */
57+
maxMessageLength?: number;
11458

115-
/**
116-
* General details about the user to be logged to Sentry.
117-
*/
118-
interface RavenUserContext {
119-
id?: string;
120-
username?: string;
121-
email?: string;
59+
/** Override the default HTTP data transport handler. */
60+
transport?: (options: RavenTransportOptions) => void;
12261
}
12362

12463
interface RavenStatic {
@@ -151,7 +90,7 @@ interface RavenStatic {
15190
* @param {object} options Optional set of of global options [optional]
15291
* @return {Raven}
15392
*/
154-
config(dsn: string, options?: RavenGlobalOptions): RavenStatic;
93+
config(dsn: string, options?: RavenOptions): RavenStatic;
15594

15695
/*
15796
* Installs a global window.onerror error handler
@@ -179,7 +118,7 @@ interface RavenStatic {
179118
* @param {array} args An array of arguments to be called with the callback [optional]
180119
*/
181120
context(func: Function, ...args: any[]): void;
182-
context(options: RavenWrapOptions, func: Function, ...args: any[]): void;
121+
context(options: RavenOptions, func: Function, ...args: any[]): void;
183122

184123
/*
185124
* Wrap code within a context and returns back a new function to be executed
@@ -189,9 +128,9 @@ interface RavenStatic {
189128
* @return {function} The newly wrapped functions with a context
190129
*/
191130
wrap(func: Function): Function;
192-
wrap(options: RavenWrapOptions, func: Function): Function;
131+
wrap(options: RavenOptions, func: Function): Function;
193132
wrap<T extends Function>(func: T): T;
194-
wrap<T extends Function>(options: RavenWrapOptions, func: T): T;
133+
wrap<T extends Function>(options: RavenOptions, func: T): T;
195134

196135
/*
197136
* Uninstalls the global error handler.
@@ -232,7 +171,11 @@ interface RavenStatic {
232171
* @param {object} user An object representing user data [optional]
233172
* @return {Raven}
234173
*/
235-
setUserContext(user: RavenUserContext): RavenStatic;
174+
setUserContext(user: {
175+
id?: string;
176+
username?: string;
177+
email?: string;
178+
}): RavenStatic;
236179

237180
/** Merge extra attributes to be sent along with the payload. */
238181
setExtraContext(context: Object): RavenStatic;
@@ -274,11 +217,7 @@ interface RavenStatic {
274217
setShouldSendCallback(data: any, orig?: any): RavenStatic;
275218

276219
/** Show Sentry user feedback dialog */
277-
showReportDialog(options?: {
278-
eventId?: number,
279-
dsn?: string,
280-
user?: RavenUserContext,
281-
}): void;
220+
showReportDialog(options: Object): void;
282221
}
283222

284223
interface RavenTransportOptions {

0 commit comments

Comments
 (0)