Skip to content

Update TypeScript d.t.s (fixes #698) #699

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/raven.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ Raven.prototype = {
if (this._breadcrumbs.length > this._globalOptions.maxBreadcrumbs) {
this._breadcrumbs.shift();
}
return this;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consistency with other captureX methods, which are chainable.

},

addPlugin: function(plugin /*arg1, arg2, ... argN*/) {
Expand Down
14 changes: 14 additions & 0 deletions typescript/raven-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,24 @@ Raven.setUserContext({
id: '123'
});

Raven.setExtraContext({foo: 'bar'});
Raven.setTagsContext({env: 'prod'});
Raven.clearContext();
var obj:Object = Raven.getContext();
var err:Error = Raven.lastException();

Raven.captureMessage('Broken!');
Raven.captureMessage('Broken!', {tags: { key: "value" }});
Raven.captureBreadcrumb({});

Raven.setRelease('abc123');
Raven.setEnvironment('production');

Raven.setDataCallback(function (data) {});
Raven.setDataCallback(function (data, original) {});
Raven.setShouldSendCallback(function (data) {});
Raven.setShouldSendCallback(function (data, original) {});

Raven.showReportDialog({
eventId: 'abcdef123456'
});
27 changes: 27 additions & 0 deletions typescript/raven.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ interface RavenStatic {
*/
captureMessage(msg: string, options?: RavenOptions): RavenStatic;

/** Log a breadcrumb */
captureBreadcrumb(crumb: Object): RavenStatic;

/**
* Clear the user context, removing the user data that would be sent to Sentry.
*/
Expand All @@ -171,9 +174,30 @@ interface RavenStatic {
email?: string;
}): RavenStatic;

/** Merge extra attributes to be sent along with the payload. */
setExtraContext(context: Object): RavenStatic;

/** Merge tags to be sent along with the payload. */
setTagsContext(tags: Object): RavenStatic;

/** Clear all of the context. */
clearContext(): RavenStatic;

/** Get a copy of the current context. This cannot be mutated.*/
getContext(): Object;

/** Override the default HTTP data transport handler. */
setTransport(transportFunction: (options: RavenTransportOptions) => void): RavenStatic;

/** Set environment of application */
setEnvironment(environment: string): RavenStatic;

/** Set release version of application */
setRelease(release: string): RavenStatic;

/** Get the latest raw exception that was captured by Raven.*/
lastException(): Error;

/** 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;

Expand All @@ -185,6 +209,9 @@ interface RavenStatic {

/** Specify a callback function that allows you to apply your own filters to determine if the message should be sent to Sentry. */
setShouldSendCallback(data: any, orig?: any): RavenStatic;

/** Show Sentry user feedback dialog */
showReportDialog(options: Object);
}

interface RavenTransportOptions {
Expand Down