UNPKG

2.53 kBTypeScriptView Raw
1import { Options as WebpackOptions } from 'webpack'
2import { BrowserTracingOptions } from '@sentry/tracing/dist/browser/browsertracing'
3import { Options as SentryOptions } from '@sentry/types'
4import { SentryCliPluginOptions } from '@sentry/webpack-plugin'
5import { Handlers } from '@sentry/node'
6
7export type IntegrationsConfiguration = Record<string, unknown>
8
9export interface LazyConfiguration {
10 chunkName?: string
11 injectLoadHook?: boolean
12 injectMock?: boolean
13 mockApiMethods?: boolean | string[]
14 webpackPrefetch?: boolean
15 webpackPreload?: boolean
16}
17
18declare type Operation = 'activate' | 'create' | 'destroy' | 'mount' | 'update'
19/**
20 * Vue specific configuration for Tracing Integration
21 * Not exported, so have to reproduce here
22 * @see https://github.com/getsentry/sentry-javascript/blob/master/packages/integrations/src/vue.ts
23 **/
24interface TracingOptions {
25 /**
26 * Decides whether to track components by hooking into its lifecycle methods.
27 * Can be either set to `boolean` to enable/disable tracking for all of them.
28 * Or to an array of specific component names (case-sensitive).
29 */
30 trackComponents: boolean | string[]
31 /** How long to wait until the tracked root activity is marked as finished and sent of to Sentry */
32 timeout: number
33 /**
34 * List of hooks to keep track of during component lifecycle.
35 * Available hooks: 'activate' | 'create' | 'destroy' | 'mount' | 'update'
36 * Based on https://vuejs.org/v2/api/#Options-Lifecycle-Hooks
37 */
38 hooks: Operation[]
39}
40
41export interface TracingConfiguration {
42 tracesSampleRate?: number
43 vueOptions?: {
44 tracing?: boolean
45 tracingOptions?: TracingOptions
46 }
47 browserOptions?: BrowserTracingOptions
48}
49
50export interface ModuleConfiguration {
51 attachCommits?: boolean
52 clientConfig?: SentryOptions
53 clientIntegrations?: IntegrationsConfiguration
54 config?: SentryOptions
55 disableClientRelease?: boolean
56 disableClientSide?: boolean
57 disabled?: boolean
58 disableServerRelease?: boolean
59 disableServerSide?: boolean
60 dsn?: string
61 tracing?: boolean | TracingConfiguration
62 initialize?: boolean
63 lazy?: boolean | LazyConfiguration
64 logMockCalls?: boolean
65 publishRelease?: boolean
66 repo?: string
67 serverConfig?: SentryOptions
68 serverIntegrations?: IntegrationsConfiguration
69 sourceMapStyle?: WebpackOptions.Devtool
70 webpackConfig?: SentryCliPluginOptions
71 requestHandlerConfig?: Handlers.RequestHandlerOptions
72}