@sentry/wizard
Version:
Sentry wizard helping you to configure your project
35 lines (34 loc) • 2.1 kB
TypeScript
import { ProxifiedModule } from 'magicast';
import * as t from '@babel/types';
export declare const sessionReplaySampleRate = 0.1;
export declare const sessionReplayOnErrorSampleRate = 1;
export declare function addSentryInit({ dsn, enableSessionReplay, enableFeedbackWidget, }: {
dsn: string;
enableSessionReplay?: boolean;
enableFeedbackWidget?: boolean;
}): Promise<void>;
export declare function addSentryInitWithSdkImport(js: string, { dsn, enableSessionReplay, enableFeedbackWidget, }: {
dsn: string;
enableSessionReplay?: boolean;
enableFeedbackWidget?: boolean;
}): string;
export declare function doesJsCodeIncludeSdkSentryImport(js: string, { sdkPackageName }: {
sdkPackageName: string;
}): boolean;
export declare function getSentryInitColoredCodeSnippet(dsn: string, enableSessionReplay?: boolean, enableFeedbackWidget?: boolean): string;
export declare function getSentryInitPlainTextSnippet(dsn: string, enableSessionReplay?: boolean, enableFeedbackWidget?: boolean): string;
export declare function getSentryIntegrationsPlainTextSnippet(enableSessionReplay?: boolean, enableFeedbackWidget?: boolean): string;
/**
* This step should be executed after `addSentryInit`
*/
export declare function wrapRootComponent(): Promise<void>;
export declare enum SentryWrapResult {
NotFound = "RootComponentNotFound",
AlreadyWrapped = "AlreadyWrapped",
Success = "Success"
}
export declare function checkAndWrapRootComponent(mod: ProxifiedModule): SentryWrapResult;
export declare function getDefaultExport(program: t.Program): t.Identifier | t.CallExpression | t.ObjectExpression | t.FunctionDeclaration | t.ArrowFunctionExpression | t.ClassDeclaration | undefined;
export declare function wrapWithSentry(configObj: t.Identifier | t.CallExpression | t.ObjectExpression | t.FunctionDeclaration | t.ArrowFunctionExpression | t.ClassDeclaration): t.CallExpression;
export declare function replaceDefaultExport(program: t.Program, wrappedDefaultExport: t.CallExpression): boolean;
export declare function doesContainSentryWrap(program: t.Program): boolean;