From ecd58a45b5efbda83ed11575b84a374d0b0c0f40 Mon Sep 17 00:00:00 2001 From: Alexander Rusakov Date: Wed, 9 Mar 2016 16:46:10 +0300 Subject: [PATCH] raven-js module has been declared --- ravenjs/ravenjs-tests.ts | 4 ++++ ravenjs/ravenjs.d.ts | 28 ++++++++++++++++------------ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/ravenjs/ravenjs-tests.ts b/ravenjs/ravenjs-tests.ts index f83cc527b..db0ddd693 100644 --- a/ravenjs/ravenjs-tests.ts +++ b/ravenjs/ravenjs-tests.ts @@ -1,5 +1,9 @@ /// +import RavenJS from 'raven-js'; + +RavenJS.config('https://public@getsentry.com/1').install(); + var options: RavenOptions = { logger: 'my-logger', ignoreUrls: [ diff --git a/ravenjs/ravenjs.d.ts b/ravenjs/ravenjs.d.ts index df96cb9be..51b6baae6 100644 --- a/ravenjs/ravenjs.d.ts +++ b/ravenjs/ravenjs.d.ts @@ -5,16 +5,20 @@ declare var Raven: RavenStatic; +declare module 'raven-js' { + export default Raven; +} + interface RavenOptions { /** The log level associated with this event. Default: error */ level?: string; /** The name of the logger used by Sentry. Default: javascript */ logger?: string; - + /** The release version of the application you are monitoring with Sentry */ release?: string; - + /** The name of the server or device that the client is running on */ serverName?: string; @@ -36,19 +40,19 @@ interface RavenOptions { }; extra?: any; - + /** 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. */ fingerprint?: string[]; - + /** A function which allows mutation of the data payload right before being sent to Sentry */ dataCallback?: (data: any) => any; - + /** A callback function that allows you to apply your own filters to determine if the message should be sent to Sentry. */ shouldSendCallback?: (data: any) => boolean; - + /** By default, Raven does not truncate messages. If you need to truncate characters for whatever reason, you may set this to limit the length. */ maxMessageLength?: number; - + /** Override the default HTTP data transport handler. */ transport?: (options: RavenTransportOptions) => void; } @@ -57,7 +61,7 @@ interface RavenStatic { /** Raven.js version. */ VERSION: string; - + Plugins: { [id: string]: RavenPlugin }; /* @@ -94,7 +98,7 @@ interface RavenStatic { * @return {Raven} */ install(): RavenStatic; - + /* * Adds a plugin to Raven * @@ -166,13 +170,13 @@ interface RavenStatic { username?: string; email?: string; }): RavenStatic; - + /** Override the default HTTP data transport handler. */ setTransport(transportFunction: (options: RavenTransportOptions) => void): RavenStatic; - + /** 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. */ lastEventId(): string; - + /** 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. */ isSetup(): boolean; }