Skip to content
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

@sentry/browser root captureException & captureMessage arg types update #4211

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -5,16 +5,28 @@ declare module '@sentry/browser' {
declare export function addBreadcrumb(breadcrumb: Breadcrumb): void;
declare export function captureException(
message: mixed,
severity?: $Values<typeof Severity>,
captureContext?: CaptureContext,
): void;
declare export function captureMessage(
message: mixed,
severity?: $Values<typeof Severity>,
captureContext?: CaptureContext | $Values<typeof Severity>,
): void;
declare export function configureScope((Scope) => void): void;
declare export function getCurrentHub(): Hub;
declare export function getHubFromCarrier(carrier: Carrier): Hub;

declare export type CaptureContext = Scope | $Shape<ScopeContext> | ((scope: Scope) => Scope)

declare export type ScopeContext = {
user?: User;
level: $Values<typeof Severity>;
extra: { [key: string]: any, ... };
contexts: {| [key: string]: { ... } |};
tags: { [key: string]: string, ... };
fingerprint?: $ReadOnlyArray<string>;
requestSession: RequestSession;
}

declare export class Hub {
constructor(client: BrowserClient<Options>): Hub;
isOlderThan(version: number): boolean;
Expand Down