Skip to content

Commit c39b7e1

Browse files
authored
Update TypeScript d.t.s (fixes #698) (#699)
1 parent 05223dd commit c39b7e1

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

src/raven.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ Raven.prototype = {
381381
if (this._breadcrumbs.length > this._globalOptions.maxBreadcrumbs) {
382382
this._breadcrumbs.shift();
383383
}
384+
return this;
384385
},
385386

386387
addPlugin: function(plugin /*arg1, arg2, ... argN*/) {

typescript/raven-tests.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,24 @@ Raven.setUserContext({
4646
id: '123'
4747
});
4848

49+
Raven.setExtraContext({foo: 'bar'});
50+
Raven.setTagsContext({env: 'prod'});
51+
Raven.clearContext();
52+
var obj:Object = Raven.getContext();
53+
var err:Error = Raven.lastException();
54+
4955
Raven.captureMessage('Broken!');
5056
Raven.captureMessage('Broken!', {tags: { key: "value" }});
57+
Raven.captureBreadcrumb({});
58+
59+
Raven.setRelease('abc123');
60+
Raven.setEnvironment('production');
5161

5262
Raven.setDataCallback(function (data) {});
5363
Raven.setDataCallback(function (data, original) {});
5464
Raven.setShouldSendCallback(function (data) {});
5565
Raven.setShouldSendCallback(function (data, original) {});
66+
67+
Raven.showReportDialog({
68+
eventId: 'abcdef123456'
69+
});

typescript/raven.d.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ interface RavenStatic {
154154
*/
155155
captureMessage(msg: string, options?: RavenOptions): RavenStatic;
156156

157+
/** Log a breadcrumb */
158+
captureBreadcrumb(crumb: Object): RavenStatic;
159+
157160
/**
158161
* Clear the user context, removing the user data that would be sent to Sentry.
159162
*/
@@ -171,9 +174,30 @@ interface RavenStatic {
171174
email?: string;
172175
}): RavenStatic;
173176

177+
/** Merge extra attributes to be sent along with the payload. */
178+
setExtraContext(context: Object): RavenStatic;
179+
180+
/** Merge tags to be sent along with the payload. */
181+
setTagsContext(tags: Object): RavenStatic;
182+
183+
/** Clear all of the context. */
184+
clearContext(): RavenStatic;
185+
186+
/** Get a copy of the current context. This cannot be mutated.*/
187+
getContext(): Object;
188+
174189
/** Override the default HTTP data transport handler. */
175190
setTransport(transportFunction: (options: RavenTransportOptions) => void): RavenStatic;
176191

192+
/** Set environment of application */
193+
setEnvironment(environment: string): RavenStatic;
194+
195+
/** Set release version of application */
196+
setRelease(release: string): RavenStatic;
197+
198+
/** Get the latest raw exception that was captured by Raven.*/
199+
lastException(): Error;
200+
177201
/** 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. */
178202
lastEventId(): string;
179203

@@ -185,6 +209,9 @@ interface RavenStatic {
185209

186210
/** Specify a callback function that allows you to apply your own filters to determine if the message should be sent to Sentry. */
187211
setShouldSendCallback(data: any, orig?: any): RavenStatic;
212+
213+
/** Show Sentry user feedback dialog */
214+
showReportDialog(options: Object);
188215
}
189216

190217
interface RavenTransportOptions {

0 commit comments

Comments
 (0)