Skip to content

Update TypeScript language file for setDataCallback/setShouldSendCallback #639

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
Jul 5, 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
5 changes: 5 additions & 0 deletions typescript/raven-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,8 @@ Raven.setUserContext({

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

Raven.setDataCallback(function (data) {});
Raven.setDataCallback(function (data, original) {});
Raven.setShouldSendCallback(function (data) {});
Raven.setShouldSendCallback(function (data, original) {});
6 changes: 6 additions & 0 deletions typescript/raven.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,12 @@ export interface RavenStatic {

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

/** Specify a function that allows mutation of the data payload right before being sent to Sentry. */
setDataCallback(data: any, orig?: any): 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;
}

interface RavenTransportOptions {
Expand Down