deno.land / x / deno_temme@v1.0.0 / parser / parser.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
export type Literal = string | number | boolean | null | RegExp
export interface Capture { name: string filterList: Filter[] // 当用户没有提供 modifier 时,解析结果中该字段为 null modifier: Modifier}
export interface Filter { isArrayFilter: boolean name: string args: Literal[]}
export interface Modifier { name: string args: Literal[]}
export type TemmeSelector = | ParentRefSelector | NormalSelector | Assignment | SnippetDefine | SnippetExpand | FilterDefine | ModifierDefine | ProcedureDefine
export type ExpandedTemmeSelector = | ParentRefSelector | NormalSelector | Assignment | SnippetDefine | FilterDefine | ModifierDefine | ProcedureDefine
export interface NormalSelector { type: 'normal-selector' sections: Section[] // 当用户没有提供 procedure 时,该字段为 null procedure: Procedure // 当用户没有提供 arrayCapture 时,该字段为 null arrayCapture: Capture children: TemmeSelector[]}
export interface ParentRefSelector { type: 'parent-ref-selector' section: Section // 当用户没有提供 procedure 时,该字段为 null procedure: Procedure}
export interface Procedure { name: string args: (Literal | Capture)[]}
export interface Assignment { type: 'assignment' capture: Capture value: Literal}
export interface SnippetDefine { type: 'snippet-define' name: string selectors: TemmeSelector[]}
export interface SnippetExpand { type: 'snippet-expand' name: string}
export interface FilterDefine { type: 'filter-define' name: string argsPart: string code: string}
export interface ModifierDefine { type: 'modifier-define' name: string argsPart: string code: string}
export interface ProcedureDefine { type: 'procedure-define' name: string argsPart: string code: string}
export interface Section { combinator: Combinator element: string qualifiers: Qualifier[]}
export type Combinator = ' ' | '>' | '+' | '~'
export type Qualifier = IdQualifier | ClassQualifier | AttributeQualifier | PseudoQualifier
export interface IdQualifier { type: 'id-qualifier' id: string}
export interface ClassQualifier { type: 'class-qualifier' className: string}
export type AttributeOperator = '=' | '~=' | '|=' | '*=' | '^=' | '$='
export interface AttributeQualifier { type: 'attribute-qualifier' attribute: string operator: AttributeOperator value: string | Capture}
export interface PseudoQualifier { type: 'pseudo-qualifier' name: string content: string}
export interface TemmeParser { parse(temmeSelectorString: string): TemmeSelector[]}
declare const parser: TemmeParser;
export default parser;
deno_temme

Version Info

Tagged at
a year ago