Skip to content

Commit d052e7e

Browse files
authored
Update TypeScript language file for setDataCallback/setShouldSendCallback (#639)
1 parent a92b060 commit d052e7e

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

typescript/raven-tests.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,8 @@ Raven.setUserContext({
4848

4949
Raven.captureMessage('Broken!');
5050
Raven.captureMessage('Broken!', {tags: { key: "value" }});
51+
52+
Raven.setDataCallback(function (data) {});
53+
Raven.setDataCallback(function (data, original) {});
54+
Raven.setShouldSendCallback(function (data) {});
55+
Raven.setShouldSendCallback(function (data, original) {});

typescript/raven.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,12 @@ export interface RavenStatic {
176176

177177
/** 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. */
178178
isSetup(): boolean;
179+
180+
/** Specify a function that allows mutation of the data payload right before being sent to Sentry. */
181+
setDataCallback(data: any, orig?: any): RavenStatic;
182+
183+
/** Specify a callback function that allows you to apply your own filters to determine if the message should be sent to Sentry. */
184+
setShouldSendCallback(data: any, orig?: any): RavenStatic;
179185
}
180186

181187
interface RavenTransportOptions {

0 commit comments

Comments
 (0)