Skip to content

Commit 8416fed

Browse files
authored
ref: Added breadcrumbCallback and sentry breadcrumb TS typings (#1133)
1 parent 30c0da4 commit 8416fed

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

typescript/raven-tests.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ var options: Raven.RavenOptions = {
2424
xhr: false,
2525
console: false,
2626
dom: true,
27-
location: false
27+
location: false,
28+
sentry: true
29+
},
30+
breadcrumbCallback: function (data) {
31+
return data
2832
}
2933
};
3034

@@ -60,7 +64,7 @@ var err:Error = Raven.lastException();
6064

6165
Raven.captureMessage('Broken!');
6266
Raven.captureMessage('Broken!', {tags: { key: "value" }});
63-
+Raven.captureMessage('Broken!', { stacktrace: true });
67+
Raven.captureMessage('Broken!', { stacktrace: true });
6468
Raven.captureMessage('Warning', { level: 'warning' });
6569
Raven.captureBreadcrumb({
6670
message: "This is a breadcrumb message."
@@ -78,4 +82,4 @@ Raven.showReportDialog({
7882
eventId: 'abcdef123456'
7983
});
8084

81-
Raven.setDSN('https://public@sentry.io/2');
85+
Raven.setDSN('https://public@sentry.io/2');

typescript/raven.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ declare module Raven {
7575
/** By default, Raven captures as many as 100 breadcrumb entries. If you find this too noisy, you can reduce this number by setting maxBreadcrumbs. Note that this number cannot be set higher than the default of 100. */
7676
maxBreadcrumbs?: number;
7777

78+
/** A function that allows filtering or mutating breadcrumb payloads. Return false to throw away the breadcrumb. */
79+
breadcrumbCallback?: (data: any) => any;
80+
7881
/**
7982
* A sampling rate to apply to events. A value of 0.0 will send no events, and a value of 1.0 will send all events (default).
8083
*/
@@ -283,6 +286,7 @@ declare module Raven {
283286
console?: boolean;
284287
dom?: boolean;
285288
location?: boolean;
289+
sentry?: boolean;
286290
}
287291

288292
type LogLevel = "critical" | "error" | "warning" | "info" | "debug";

0 commit comments

Comments
 (0)