-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Copy pathtypes.ts
156 lines (136 loc) · 4.66 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
/* eslint-disable @typescript-eslint/no-explicit-any */
import type { BrowserOptions } from '@sentry/browser';
// This is not great, but kinda necessary to make it work with Vue@2 and Vue@3 at the same time.
export interface Vue {
config: {
errorHandler?: any;
warnHandler?: any;
silent?: boolean;
};
mixin: (mixins: Partial<Record<Hook, any>>) => void;
}
export type ViewModel = {
_isVue?: boolean;
__isVue?: boolean;
$root: ViewModel;
$parent?: ViewModel;
$props: { [key: string]: any };
$options?: {
name?: string;
propsData?: { [key: string]: any };
_componentTag?: string;
__file?: string;
__name?: string;
};
};
export interface VueOptions {
/** Vue constructor to be used inside the integration (as imported by `import Vue from 'vue'` in Vue2) */
Vue?: Vue;
/**
* Vue app instance(s) to be used inside the integration (as generated by `createApp` in Vue3).
*/
app?: Vue | Vue[];
/**
* When set to `false`, Sentry will suppress reporting of all props data
* from your Vue components for privacy concerns.
*/
attachProps: boolean;
/**
* When set to `true`, original Vue's `logError` will be called as well.
* https://github.com/vuejs/vue/blob/c2b1cfe9ccd08835f2d99f6ce60f67b4de55187f/src/core/util/error.js#L38-L48
*/
logErrors: boolean;
/**
* By default, Sentry attaches an error handler to capture exceptions and report them to Sentry.
* When `attachErrorHandler` is set to `false`, automatic error reporting is disabled.
*
* Usually, this option should stay enabled, unless you want to set up Sentry error reporting yourself.
* For example, the Sentry Nuxt SDK does not attach an error handler as it's using the error hooks provided by Nuxt.
*
* @default true
*/
attachErrorHandler: boolean;
/** {@link TracingOptions} */
tracingOptions?: Partial<TracingOptions>;
/**
* Decides whether to track components by hooking into its lifecycle methods.
* Can be either set to `boolean` to enable/disable tracking for all of them.
* Or to an array of specific component names (case-sensitive).
*
* @deprecated Use tracingOptions
*/
trackComponents: boolean | string[];
/**
* How long to wait until the tracked root activity is marked as finished and sent of to Sentry
*
* @deprecated Use tracingOptions
*/
timeout: number;
/**
* List of hooks to keep track of during component lifecycle.
* Available hooks: 'activate' | 'create' | 'destroy' | 'mount' | 'unmount' | 'update'
* Based on https://vuejs.org/v2/api/#Options-Lifecycle-Hooks
*
* @deprecated Use tracingOptions
*/
hooks: Operation[];
}
export interface Options extends BrowserOptions, VueOptions {
/**
* @deprecated Use `vueIntegration` tracingOptions
*/
tracingOptions?: Partial<TracingOptions>;
/**
* Decides whether to track components by hooking into its lifecycle methods.
* Can be either set to `boolean` to enable/disable tracking for all of them.
* Or to an array of specific component names (case-sensitive).
*
* @deprecated Use `vueIntegration` tracingOptions
*/
trackComponents: boolean | string[];
/**
* How long to wait until the tracked root activity is marked as finished and sent of to Sentry
*
* @deprecated Use `vueIntegration` tracingOptions
*/
timeout: number;
/**
* List of hooks to keep track of during component lifecycle.
* Available hooks: 'activate' | 'create' | 'destroy' | 'mount' | 'unmount' | 'update'
* Based on https://vuejs.org/v2/api/#Options-Lifecycle-Hooks
*
* @deprecated Use `vueIntegration` tracingOptions
*/
hooks: Operation[];
}
/** Vue specific configuration for Tracing Integration */
export interface TracingOptions {
/**
* Decides whether to track components by hooking into its lifecycle methods.
* Can be either set to `boolean` to enable/disable tracking for all of them.
* Or to an array of specific component names (case-sensitive).
*/
trackComponents: boolean | string[];
/** How long to wait until the tracked root activity is marked as finished and sent of to Sentry */
timeout: number;
/**
* List of hooks to keep track of during component lifecycle.
* Available hooks: 'activate' | 'create' | 'destroy' | 'mount' | 'unmount' | 'update'
* Based on https://vuejs.org/v2/api/#Options-Lifecycle-Hooks
*/
hooks: Operation[];
}
export type Hook =
| 'activated'
| 'beforeCreate'
| 'beforeDestroy'
| 'beforeUnmount'
| 'beforeMount'
| 'beforeUpdate'
| 'created'
| 'deactivated'
| 'destroyed'
| 'unmounted'
| 'mounted'
| 'updated';
export type Operation = 'activate' | 'create' | 'destroy' | 'mount' | 'update' | 'unmount';