UNPKG

@sentry/wizard

Version:

Sentry wizard helping you to configure your project

28 lines (27 loc) 1.5 kB
import { ProxifiedModule } from 'magicast'; import * as t from '@babel/types'; export declare function addSentryInit({ dsn }: { dsn: string; }): Promise<void>; export declare function addSentryInitWithSdkImport(js: string, { dsn }: { dsn: string; }): string; export declare function doesJsCodeIncludeSdkSentryImport(js: string, { sdkPackageName }: { sdkPackageName: string; }): boolean; export declare function getSentryInitColoredCodeSnippet(dsn: string): string; export declare function getSentryInitPlainTextSnippet(dsn: string): 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;