-
Notifications
You must be signed in to change notification settings - Fork 9
/
types.ts
105 lines (97 loc) 路 2.1 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
import type { ParserPlugin } from '@babel/parser'
export interface Options {
/**
* Add a string prefix to the console log.
*
* @defaultValue ''
*/
prefix?: string
/**
* Add a string suffix to the console log.
*
* @defaultValue ''
*/
suffix?: string
/**
* Whether to disable the launch editor feature.
*
* @defaultValue false
*/
disableLaunchEditor?: boolean
/**
* Whether to disable the highlight output feature.
*
* @defaultValue false
*/
disableHighlight?: boolean
/**
* The specific service port of launch editor server.
*
* @defaultValue 3070
*/
port?: number
/**
* Whether to show extended path name when the file's (or folder's) name contains an element in the array.
*
* @remarks
*
* Consider a project includes these files:
*
* /views/Feature1/index.vue
*
* /views/Feature2/index.vue
*
* Set extendedPathFileNames as ['index'] can show the extended path name in the console output.
*
* @defaultValue `[]`
*
*/
extendedPathFileNames?: string[]
/**
* The specific editor to launch.
*
* All available editors: https://github.com/yyx990803/launch-editor#supported-editors
*
* Linked issues:#33
*
* @defaultValue undefined
*
*/
specifiedEditor?: string | undefined
/**
* Babel parser plugins. `typescript` and `jsx` are enabled by default.
*
* https://babeljs.io/docs/en/babel-parser#plugins
*
* @defaultValue ['typescript', 'jsx']
*/
babelParserPlugins?: ParserPlugin[]
/**
* Whether to pass server logs to the client.
*
* Set it to `false` to disable.
*
* @defaultValue true
*/
passServerLogs?: boolean
}
export interface GenContext {
options: Options
originalLine: number
originalColumn: number
argsName: string
argType: string
id: string
}
export type Compiler = 'vanilla' | 'vue3' | 'vue2' | 'svelte'
export interface Context {
code: string
id: string
options: Options
}
export interface CompileResult {
script: string
offset: number
line: number
}
export type TCMethod = 'log' | 'error' | 'warn' | 'info'