@web3-storage/toucan-js
Version:
Cloudflare Workers client for Sentry (fork)
83 lines • 2.75 kB
TypeScript
/**
* Parts of code taken from: https://github.com/getsentry/sentry-javascript/blob/06d6bd87971b22dcaba99b03e1f885158c7dd66f/packages/hub/src/scope.ts
*/
import { Scope as SentryScope } from '@sentry/hub';
import { Extra, Extras, Primitive, User } from '@sentry/types';
import { Breadcrumb, Event } from './types';
declare class SentryScopeAdapter extends SentryScope {
/**
* Applies the current context to the event.
*
* @param event Event
*/
applyToEventSync(event: Event): Event;
/**
* Inherit values from the parent scope.
* @param scope to clone.
*/
static clone(scope?: SentryScopeAdapter): SentryScopeAdapter;
}
export declare class Scope {
private adapter;
constructor();
/**
* Sets the breadcrumbs in the scope
*
* @param breadcrumb
* @param maxBreadcrumbs
*/
addBreadcrumb(breadcrumb: Breadcrumb, maxBreadcrumbs?: number | undefined): SentryScopeAdapter;
/**
* Set key:value that will be sent as tags data with the event.
*
* @param key String key of tag
* @param value Primitive value of tag
*/
setTag(key: string, value: Primitive): void;
/**
* Set an object that will be merged sent as tags data with the event.
*
* @param tags Tags context object to merge into current context.
*/
setTags(tags: {
[key: string]: Primitive;
}): void;
/**
* Set key:value that will be sent as extra data with the event.
*
* @param key String key of extra
* @param extra Extra value of extra
*/
setExtra(key: string, extra: Extra): void;
/**
* Set an object that will be merged sent as extra data with the event.
*
* @param extras Extras context object to merge into current context.
*/
setExtras(extras: Extras): void;
/**
* Overrides the Sentry default grouping. See https://docs.sentry.io/data-management/event-grouping/sdk-fingerprinting/
*
* @param fingerprint Array of strings used to override the Sentry default grouping.
*/
setFingerprint(fingerprint: string[]): void;
/**
* Updates user context information for future events.
*
* @param user — User context object to be set in the current context. Pass null to unset the user.
*/
setUser(user: User | null): void;
/**
* Applies the current context to the event.
*
* @param event Event
*/
applyToEvent(event: Event): Event;
/**
* Inherit values from the parent scope.
* @param scope to clone.
*/
static clone(scope?: Scope): Scope;
}
export {};
//# sourceMappingURL=scope.d.ts.map