forked from logue/vite-vue2-ts-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
env.d.ts
150 lines (143 loc) · 3.37 KB
/
env.d.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
/// <reference types="vite/client" />
/// <reference types="vitest" />
import type { Wrapper } from '@vue/test-utils';
import {
type ExtractPropTypes,
type ExtractDefaultPropTypes,
type DefineComponent,
} from 'vue';
import {
type ComputedOptions,
type ComponentOptionsMixin,
type MethodOptions,
} from 'vue/types/v3-component-options';
import { type EmitsOptions } from 'vue/types/v3-setup-context';
/** Vue */
declare module '*.vue' {
import { type defineComponent } from 'vue';
const Component: ReturnType<typeof defineComponent>;
export default Component;
}
/**
* Augment vue-test-utils to add support for Vue 2.7.
*
* @see {@link https://github.com/vuejs/vue-test-utils/issues/2026#issuecomment-1429963862}
*/
declare module '@vue/test-utils' {
/**
* Component declared with defineComponent
*
* @param component -
* @param options -
*/
export function mount<
PropsOrPropOptions = Record<string, any>,
RawBindings = Record<string, any>,
D = Record<string, any>,
C extends ComputedOptions = ComputedOptions,
M extends MethodOptions = MethodOptions,
Mixin extends ComponentOptionsMixin = ComponentOptionsMixin,
Extends extends ComponentOptionsMixin = ComponentOptionsMixin,
E extends EmitsOptions = Record<string, any>,
EE extends string = string,
Props = Readonly<ExtractPropTypes<PropsOrPropOptions>>,
Defaults extends Record<
string,
any
> = ExtractDefaultPropTypes<PropsOrPropOptions>,
>(
component: DefineComponent<
PropsOrPropOptions,
RawBindings,
D,
C,
M,
Mixin,
Extends,
E,
EE,
Props,
Defaults
>,
options?: any
): Wrapper<
InstanceType<
DefineComponent<
PropsOrPropOptions,
RawBindings,
D,
C,
M,
Mixin,
Extends,
EmitsOptions,
EE,
Props,
Defaults
>
>
>;
/**
* Component declared with defineComponent
*
* @param component -
* @param options -
*/
export function shallowMount<
PropsOrPropOptions = Record<string, any>,
RawBindings = Record<string, any>,
D = Record<string, any>,
C extends ComputedOptions = ComputedOptions,
M extends MethodOptions = MethodOptions,
Mixin extends ComponentOptionsMixin = ComponentOptionsMixin,
Extends extends ComponentOptionsMixin = ComponentOptionsMixin,
E extends EmitsOptions = Record<string, any>,
EE extends string = string,
Props = Readonly<ExtractPropTypes<PropsOrPropOptions>>,
Defaults extends Record<
string,
any
> = ExtractDefaultPropTypes<PropsOrPropOptions>,
>(
component: DefineComponent<
PropsOrPropOptions,
RawBindings,
D,
C,
M,
Mixin,
Extends,
E,
EE,
Props,
Defaults
>,
options?: any
): Wrapper<
InstanceType<
DefineComponent<
PropsOrPropOptions,
RawBindings,
D,
C,
M,
Mixin,
Extends,
EmitsOptions,
EE,
Props,
Defaults
>
>
>;
}
interface ImportMetaEnv {
// see https://vitejs.dev/guide/env-and-mode.html#env-files
// add .env variables.
readonly VITE_APP_TITLE: string;
readonly VITE_APP_WEBSTORAGE_NAMESPACE: string;
}
// eslint-disable-next-line no-unused-vars
interface ImportMeta {
readonly env: ImportMetaEnv;
}