Skip to content

Commit 0144ad5

Browse files
committed
Merge pull request DefinitelyTyped#8460 from arusakov/raven_js_module
raven-js module has been declared
2 parents 86f8d53 + ecd58a4 commit 0144ad5

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

ravenjs/ravenjs-tests.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
/// <reference path="ravenjs.d.ts" />
22

3+
import RavenJS from 'raven-js';
4+
5+
RavenJS.config('https://[email protected]/1').install();
6+
37
var options: RavenOptions = {
48
logger: 'my-logger',
59
ignoreUrls: [

ravenjs/ravenjs.d.ts

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,20 @@
55

66
declare var Raven: RavenStatic;
77

8+
declare module 'raven-js' {
9+
export default Raven;
10+
}
11+
812
interface RavenOptions {
913
/** The log level associated with this event. Default: error */
1014
level?: string;
1115

1216
/** The name of the logger used by Sentry. Default: javascript */
1317
logger?: string;
14-
18+
1519
/** The release version of the application you are monitoring with Sentry */
1620
release?: string;
17-
21+
1822
/** The name of the server or device that the client is running on */
1923
serverName?: string;
2024

@@ -36,19 +40,19 @@ interface RavenOptions {
3640
};
3741

3842
extra?: any;
39-
43+
4044
/** 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. */
4145
fingerprint?: string[];
42-
46+
4347
/** A function which allows mutation of the data payload right before being sent to Sentry */
4448
dataCallback?: (data: any) => any;
45-
49+
4650
/** A callback function that allows you to apply your own filters to determine if the message should be sent to Sentry. */
4751
shouldSendCallback?: (data: any) => boolean;
48-
52+
4953
/** By default, Raven does not truncate messages. If you need to truncate characters for whatever reason, you may set this to limit the length. */
5054
maxMessageLength?: number;
51-
55+
5256
/** Override the default HTTP data transport handler. */
5357
transport?: (options: RavenTransportOptions) => void;
5458
}
@@ -57,7 +61,7 @@ interface RavenStatic {
5761

5862
/** Raven.js version. */
5963
VERSION: string;
60-
64+
6165
Plugins: { [id: string]: RavenPlugin };
6266

6367
/*
@@ -94,7 +98,7 @@ interface RavenStatic {
9498
* @return {Raven}
9599
*/
96100
install(): RavenStatic;
97-
101+
98102
/*
99103
* Adds a plugin to Raven
100104
*
@@ -166,13 +170,13 @@ interface RavenStatic {
166170
username?: string;
167171
email?: string;
168172
}): RavenStatic;
169-
173+
170174
/** Override the default HTTP data transport handler. */
171175
setTransport(transportFunction: (options: RavenTransportOptions) => void): RavenStatic;
172-
176+
173177
/** An event id is a globally unique id for the event that was just sent. This event id can be used to find the exact event from within Sentry. */
174178
lastEventId(): string;
175-
179+
176180
/** If you need to conditionally check if raven needs to be initialized or not, you can use the isSetup function. It will return true if Raven is already initialized. */
177181
isSetup(): boolean;
178182
}

0 commit comments

Comments
 (0)