-
-
Notifications
You must be signed in to change notification settings - Fork 237
/
vue__compiler-sfc.ts
48 lines (41 loc) · 932 Bytes
/
vue__compiler-sfc.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
interface Position {
offset: number;
line: number;
column: number;
}
interface SourceLocation {
start: Position;
end: Position;
source: string;
}
export interface SFCBlock {
type: string;
content: string;
attrs: Record<string, string | true>;
loc: SourceLocation;
lang?: string;
src?: string;
}
interface SFCDescriptor {
filename: string;
template: SFCBlock | null;
script: SFCBlock | null;
scriptSetup: SFCBlock | null;
styles: SFCBlock[];
customBlocks: SFCBlock[];
}
interface CompilerError extends SyntaxError {
code: number;
loc?: SourceLocation;
}
interface SFCParseResult {
descriptor: SFCDescriptor;
errors: CompilerError[];
}
interface SFCParserOptionsV3 {
pad?: true | 'line' | 'space';
}
export interface VueTemplateCompilerV3 {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
parse(template: string, options?: SFCParserOptionsV3): SFCParseResult;
}