Skip to content

Fix bivariance issues in Sentry.Options TS type #4234

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 2 commits into from
Dec 6, 2021
Merged
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
6 changes: 3 additions & 3 deletions packages/types/src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export interface Options {
* @returns A sample rate between 0 and 1 (0 drops the trace, 1 guarantees it will be sent). Returning `true` is
* equivalent to returning 1 and returning `false` is equivalent to returning 0.
*/
tracesSampler?(samplingContext: SamplingContext): number | boolean;
tracesSampler?: (samplingContext: SamplingContext) => number | boolean;

/**
* A callback invoked during event submission, allowing to optionally modify
Expand All @@ -181,7 +181,7 @@ export interface Options {
* @param hint May contain additional information about the original exception.
* @returns A new event that will be sent | null.
*/
beforeSend?(event: Event, hint?: EventHint): PromiseLike<Event | null> | Event | null;
beforeSend?: (event: Event, hint?: EventHint) => PromiseLike<Event | null> | Event | null;

/**
* A callback invoked when adding a breadcrumb, allowing to optionally modify
Expand All @@ -194,5 +194,5 @@ export interface Options {
* @param breadcrumb The breadcrumb as created by the SDK.
* @returns The breadcrumb that will be added | null.
*/
beforeBreadcrumb?(breadcrumb: Breadcrumb, hint?: BreadcrumbHint): Breadcrumb | null;
beforeBreadcrumb?: (breadcrumb: Breadcrumb, hint?: BreadcrumbHint) => Breadcrumb | null;
}