eslint-plugin-templ 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +7 -0
- package/README.md +53 -0
- package/dist/html-source-code.d.ts +116 -0
- package/dist/html-source-code.d.ts.map +1 -0
- package/dist/html-source-code.js +270 -0
- package/dist/html-source-code.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/parse-for-eslint.d.ts +4 -0
- package/dist/parse-for-eslint.d.ts.map +1 -0
- package/dist/parse-for-eslint.js +70 -0
- package/dist/parse-for-eslint.js.map +1 -0
- package/dist/run-templ-ast-to-json-binary.d.ts +2 -0
- package/dist/run-templ-ast-to-json-binary.d.ts.map +1 -0
- package/dist/run-templ-ast-to-json-binary.js +33 -0
- package/dist/run-templ-ast-to-json-binary.js.map +1 -0
- package/dist/templ-ast-to-eslint-ast.d.ts +7 -0
- package/dist/templ-ast-to-eslint-ast.d.ts.map +1 -0
- package/dist/templ-ast-to-eslint-ast.js +218 -0
- package/dist/templ-ast-to-eslint-ast.js.map +1 -0
- package/dist/templ-ast.d.ts +804 -0
- package/dist/templ-ast.d.ts.map +1 -0
- package/dist/templ-ast.js +207 -0
- package/dist/templ-ast.js.map +1 -0
- package/dist/templ-language.d.ts +24 -0
- package/dist/templ-language.d.ts.map +1 -0
- package/dist/templ-language.js +33 -0
- package/dist/templ-language.js.map +1 -0
- package/package.json +82 -0
|
@@ -0,0 +1,804 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schemas for templ AST structure
|
|
3
|
+
*
|
|
4
|
+
* These schemas define the runtime validation and TypeScript types for the JSON
|
|
5
|
+
* output from templ-ast-to-json. They serve as the source of truth for the
|
|
6
|
+
* "from" types in the conversion to ESLint AST.
|
|
7
|
+
*/
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
/**
|
|
10
|
+
* Validates that unknown JSON is a valid templ AST array.
|
|
11
|
+
* Throws an error with exhaustive validation messages if invalid.
|
|
12
|
+
*
|
|
13
|
+
* @param value - The unknown value to validate
|
|
14
|
+
* @throws {Error} If validation fails, with detailed error messages for all issues
|
|
15
|
+
*/
|
|
16
|
+
export declare function validateTemplAST(value: unknown): asserts value is TemplAST;
|
|
17
|
+
export declare const TemplPositionSchema: z.ZodObject<{
|
|
18
|
+
Index: z.ZodNumber;
|
|
19
|
+
Line: z.ZodNumber;
|
|
20
|
+
Col: z.ZodNumber;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
export declare const TemplRangeSchema: z.ZodObject<{
|
|
23
|
+
From: z.ZodObject<{
|
|
24
|
+
Index: z.ZodNumber;
|
|
25
|
+
Line: z.ZodNumber;
|
|
26
|
+
Col: z.ZodNumber;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
To: z.ZodObject<{
|
|
29
|
+
Index: z.ZodNumber;
|
|
30
|
+
Line: z.ZodNumber;
|
|
31
|
+
Col: z.ZodNumber;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
export declare const TemplExpressionSchema: z.ZodObject<{
|
|
35
|
+
Value: z.ZodString;
|
|
36
|
+
Range: z.ZodObject<{
|
|
37
|
+
From: z.ZodObject<{
|
|
38
|
+
Index: z.ZodNumber;
|
|
39
|
+
Line: z.ZodNumber;
|
|
40
|
+
Col: z.ZodNumber;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
To: z.ZodObject<{
|
|
43
|
+
Index: z.ZodNumber;
|
|
44
|
+
Line: z.ZodNumber;
|
|
45
|
+
Col: z.ZodNumber;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
export declare const TemplAttributeSchema: z.ZodObject<{
|
|
50
|
+
Key: z.ZodObject<{
|
|
51
|
+
Name: z.ZodString;
|
|
52
|
+
NameRange: z.ZodObject<{
|
|
53
|
+
From: z.ZodObject<{
|
|
54
|
+
Index: z.ZodNumber;
|
|
55
|
+
Line: z.ZodNumber;
|
|
56
|
+
Col: z.ZodNumber;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
To: z.ZodObject<{
|
|
59
|
+
Index: z.ZodNumber;
|
|
60
|
+
Line: z.ZodNumber;
|
|
61
|
+
Col: z.ZodNumber;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
}, z.core.$strip>;
|
|
65
|
+
Value: z.ZodOptional<z.ZodString>;
|
|
66
|
+
Expression: z.ZodOptional<z.ZodObject<{
|
|
67
|
+
Value: z.ZodString;
|
|
68
|
+
Range: z.ZodObject<{
|
|
69
|
+
From: z.ZodObject<{
|
|
70
|
+
Index: z.ZodNumber;
|
|
71
|
+
Line: z.ZodNumber;
|
|
72
|
+
Col: z.ZodNumber;
|
|
73
|
+
}, z.core.$strip>;
|
|
74
|
+
To: z.ZodObject<{
|
|
75
|
+
Index: z.ZodNumber;
|
|
76
|
+
Line: z.ZodNumber;
|
|
77
|
+
Col: z.ZodNumber;
|
|
78
|
+
}, z.core.$strip>;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
}, z.core.$strip>>;
|
|
81
|
+
SingleQuote: z.ZodOptional<z.ZodBoolean>;
|
|
82
|
+
}, z.core.$strip>;
|
|
83
|
+
export declare const TemplStringExpressionSchema: z.ZodObject<{
|
|
84
|
+
Range: z.ZodObject<{
|
|
85
|
+
From: z.ZodObject<{
|
|
86
|
+
Index: z.ZodNumber;
|
|
87
|
+
Line: z.ZodNumber;
|
|
88
|
+
Col: z.ZodNumber;
|
|
89
|
+
}, z.core.$strip>;
|
|
90
|
+
To: z.ZodObject<{
|
|
91
|
+
Index: z.ZodNumber;
|
|
92
|
+
Line: z.ZodNumber;
|
|
93
|
+
Col: z.ZodNumber;
|
|
94
|
+
}, z.core.$strip>;
|
|
95
|
+
}, z.core.$strip>;
|
|
96
|
+
Value: z.ZodString;
|
|
97
|
+
TrailingSpace: z.ZodString;
|
|
98
|
+
}, z.core.$strip>;
|
|
99
|
+
export declare const TemplGoExpressionSchema: z.ZodObject<{
|
|
100
|
+
Expression: z.ZodObject<{
|
|
101
|
+
Value: z.ZodString;
|
|
102
|
+
Range: z.ZodObject<{
|
|
103
|
+
From: z.ZodObject<{
|
|
104
|
+
Index: z.ZodNumber;
|
|
105
|
+
Line: z.ZodNumber;
|
|
106
|
+
Col: z.ZodNumber;
|
|
107
|
+
}, z.core.$strip>;
|
|
108
|
+
To: z.ZodObject<{
|
|
109
|
+
Index: z.ZodNumber;
|
|
110
|
+
Line: z.ZodNumber;
|
|
111
|
+
Col: z.ZodNumber;
|
|
112
|
+
}, z.core.$strip>;
|
|
113
|
+
}, z.core.$strip>;
|
|
114
|
+
}, z.core.$strip>;
|
|
115
|
+
TrailingSpace: z.ZodString;
|
|
116
|
+
}, z.core.$strip>;
|
|
117
|
+
export declare const TemplCallExpressionSchema: z.ZodObject<{
|
|
118
|
+
Expression: z.ZodObject<{
|
|
119
|
+
Value: z.ZodString;
|
|
120
|
+
Range: z.ZodObject<{
|
|
121
|
+
From: z.ZodObject<{
|
|
122
|
+
Index: z.ZodNumber;
|
|
123
|
+
Line: z.ZodNumber;
|
|
124
|
+
Col: z.ZodNumber;
|
|
125
|
+
}, z.core.$strip>;
|
|
126
|
+
To: z.ZodObject<{
|
|
127
|
+
Index: z.ZodNumber;
|
|
128
|
+
Line: z.ZodNumber;
|
|
129
|
+
Col: z.ZodNumber;
|
|
130
|
+
}, z.core.$strip>;
|
|
131
|
+
}, z.core.$strip>;
|
|
132
|
+
}, z.core.$strip>;
|
|
133
|
+
Children: z.ZodNull;
|
|
134
|
+
Range: z.ZodObject<{
|
|
135
|
+
From: z.ZodObject<{
|
|
136
|
+
Index: z.ZodNumber;
|
|
137
|
+
Line: z.ZodNumber;
|
|
138
|
+
Col: z.ZodNumber;
|
|
139
|
+
}, z.core.$strip>;
|
|
140
|
+
To: z.ZodObject<{
|
|
141
|
+
Index: z.ZodNumber;
|
|
142
|
+
Line: z.ZodNumber;
|
|
143
|
+
Col: z.ZodNumber;
|
|
144
|
+
}, z.core.$strip>;
|
|
145
|
+
}, z.core.$strip>;
|
|
146
|
+
}, z.core.$strip>;
|
|
147
|
+
export declare const TemplWhitespaceSchema: z.ZodObject<{
|
|
148
|
+
Value: z.ZodString;
|
|
149
|
+
}, z.core.$strip>;
|
|
150
|
+
export declare const TemplTextSchema: z.ZodObject<{
|
|
151
|
+
Range: z.ZodObject<{
|
|
152
|
+
From: z.ZodObject<{
|
|
153
|
+
Index: z.ZodNumber;
|
|
154
|
+
Line: z.ZodNumber;
|
|
155
|
+
Col: z.ZodNumber;
|
|
156
|
+
}, z.core.$strip>;
|
|
157
|
+
To: z.ZodObject<{
|
|
158
|
+
Index: z.ZodNumber;
|
|
159
|
+
Line: z.ZodNumber;
|
|
160
|
+
Col: z.ZodNumber;
|
|
161
|
+
}, z.core.$strip>;
|
|
162
|
+
}, z.core.$strip>;
|
|
163
|
+
Value: z.ZodString;
|
|
164
|
+
TrailingSpace: z.ZodString;
|
|
165
|
+
}, z.core.$strip>;
|
|
166
|
+
export declare const TemplDocTypeSchema: z.ZodObject<{
|
|
167
|
+
Value: z.ZodString;
|
|
168
|
+
}, z.core.$strip>;
|
|
169
|
+
export declare const TemplHTMLCommentSchema: z.ZodObject<{
|
|
170
|
+
Contents: z.ZodString;
|
|
171
|
+
Range: z.ZodObject<{
|
|
172
|
+
From: z.ZodObject<{
|
|
173
|
+
Index: z.ZodNumber;
|
|
174
|
+
Line: z.ZodNumber;
|
|
175
|
+
Col: z.ZodNumber;
|
|
176
|
+
}, z.core.$strip>;
|
|
177
|
+
To: z.ZodObject<{
|
|
178
|
+
Index: z.ZodNumber;
|
|
179
|
+
Line: z.ZodNumber;
|
|
180
|
+
Col: z.ZodNumber;
|
|
181
|
+
}, z.core.$strip>;
|
|
182
|
+
}, z.core.$strip>;
|
|
183
|
+
}, z.core.$strip>;
|
|
184
|
+
export declare const TemplGoCommentSchema: z.ZodObject<{
|
|
185
|
+
Contents: z.ZodString;
|
|
186
|
+
Multiline: z.ZodBoolean;
|
|
187
|
+
Range: z.ZodObject<{
|
|
188
|
+
From: z.ZodObject<{
|
|
189
|
+
Index: z.ZodNumber;
|
|
190
|
+
Line: z.ZodNumber;
|
|
191
|
+
Col: z.ZodNumber;
|
|
192
|
+
}, z.core.$strip>;
|
|
193
|
+
To: z.ZodObject<{
|
|
194
|
+
Index: z.ZodNumber;
|
|
195
|
+
Line: z.ZodNumber;
|
|
196
|
+
Col: z.ZodNumber;
|
|
197
|
+
}, z.core.$strip>;
|
|
198
|
+
}, z.core.$strip>;
|
|
199
|
+
}, z.core.$strip>;
|
|
200
|
+
export declare const TemplGoCodeSchema: z.ZodObject<{
|
|
201
|
+
Expression: z.ZodObject<{
|
|
202
|
+
Value: z.ZodString;
|
|
203
|
+
Range: z.ZodObject<{
|
|
204
|
+
From: z.ZodObject<{
|
|
205
|
+
Index: z.ZodNumber;
|
|
206
|
+
Line: z.ZodNumber;
|
|
207
|
+
Col: z.ZodNumber;
|
|
208
|
+
}, z.core.$strip>;
|
|
209
|
+
To: z.ZodObject<{
|
|
210
|
+
Index: z.ZodNumber;
|
|
211
|
+
Line: z.ZodNumber;
|
|
212
|
+
Col: z.ZodNumber;
|
|
213
|
+
}, z.core.$strip>;
|
|
214
|
+
}, z.core.$strip>;
|
|
215
|
+
}, z.core.$strip>;
|
|
216
|
+
TrailingSpace: z.ZodString;
|
|
217
|
+
Multiline: z.ZodBoolean;
|
|
218
|
+
}, z.core.$strip>;
|
|
219
|
+
export declare const TemplChildrenExpressionSchema: z.ZodObject<{}, z.core.$strip>;
|
|
220
|
+
export declare const TemplConstantCSSPropertySchema: z.ZodObject<{
|
|
221
|
+
Name: z.ZodString;
|
|
222
|
+
Value: z.ZodString;
|
|
223
|
+
}, z.core.$strip>;
|
|
224
|
+
export declare const TemplExpressionCSSPropertySchema: z.ZodObject<{
|
|
225
|
+
Name: z.ZodString;
|
|
226
|
+
Value: z.ZodObject<{
|
|
227
|
+
Expression: z.ZodObject<{
|
|
228
|
+
Value: z.ZodString;
|
|
229
|
+
Range: z.ZodObject<{
|
|
230
|
+
From: z.ZodObject<{
|
|
231
|
+
Index: z.ZodNumber;
|
|
232
|
+
Line: z.ZodNumber;
|
|
233
|
+
Col: z.ZodNumber;
|
|
234
|
+
}, z.core.$strip>;
|
|
235
|
+
To: z.ZodObject<{
|
|
236
|
+
Index: z.ZodNumber;
|
|
237
|
+
Line: z.ZodNumber;
|
|
238
|
+
Col: z.ZodNumber;
|
|
239
|
+
}, z.core.$strip>;
|
|
240
|
+
}, z.core.$strip>;
|
|
241
|
+
}, z.core.$strip>;
|
|
242
|
+
TrailingSpace: z.ZodString;
|
|
243
|
+
}, z.core.$strip>;
|
|
244
|
+
}, z.core.$strip>;
|
|
245
|
+
export declare const TemplCSSPropertySchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
246
|
+
Name: z.ZodString;
|
|
247
|
+
Value: z.ZodString;
|
|
248
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
249
|
+
Name: z.ZodString;
|
|
250
|
+
Value: z.ZodObject<{
|
|
251
|
+
Expression: z.ZodObject<{
|
|
252
|
+
Value: z.ZodString;
|
|
253
|
+
Range: z.ZodObject<{
|
|
254
|
+
From: z.ZodObject<{
|
|
255
|
+
Index: z.ZodNumber;
|
|
256
|
+
Line: z.ZodNumber;
|
|
257
|
+
Col: z.ZodNumber;
|
|
258
|
+
}, z.core.$strip>;
|
|
259
|
+
To: z.ZodObject<{
|
|
260
|
+
Index: z.ZodNumber;
|
|
261
|
+
Line: z.ZodNumber;
|
|
262
|
+
Col: z.ZodNumber;
|
|
263
|
+
}, z.core.$strip>;
|
|
264
|
+
}, z.core.$strip>;
|
|
265
|
+
}, z.core.$strip>;
|
|
266
|
+
TrailingSpace: z.ZodString;
|
|
267
|
+
}, z.core.$strip>;
|
|
268
|
+
}, z.core.$strip>]>;
|
|
269
|
+
export declare const TemplCSSTemplateSchema: z.ZodObject<{
|
|
270
|
+
Range: z.ZodObject<{
|
|
271
|
+
From: z.ZodObject<{
|
|
272
|
+
Index: z.ZodNumber;
|
|
273
|
+
Line: z.ZodNumber;
|
|
274
|
+
Col: z.ZodNumber;
|
|
275
|
+
}, z.core.$strip>;
|
|
276
|
+
To: z.ZodObject<{
|
|
277
|
+
Index: z.ZodNumber;
|
|
278
|
+
Line: z.ZodNumber;
|
|
279
|
+
Col: z.ZodNumber;
|
|
280
|
+
}, z.core.$strip>;
|
|
281
|
+
}, z.core.$strip>;
|
|
282
|
+
Name: z.ZodString;
|
|
283
|
+
Expression: z.ZodObject<{
|
|
284
|
+
Value: z.ZodString;
|
|
285
|
+
Range: z.ZodObject<{
|
|
286
|
+
From: z.ZodObject<{
|
|
287
|
+
Index: z.ZodNumber;
|
|
288
|
+
Line: z.ZodNumber;
|
|
289
|
+
Col: z.ZodNumber;
|
|
290
|
+
}, z.core.$strip>;
|
|
291
|
+
To: z.ZodObject<{
|
|
292
|
+
Index: z.ZodNumber;
|
|
293
|
+
Line: z.ZodNumber;
|
|
294
|
+
Col: z.ZodNumber;
|
|
295
|
+
}, z.core.$strip>;
|
|
296
|
+
}, z.core.$strip>;
|
|
297
|
+
}, z.core.$strip>;
|
|
298
|
+
Properties: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
299
|
+
Name: z.ZodString;
|
|
300
|
+
Value: z.ZodString;
|
|
301
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
302
|
+
Name: z.ZodString;
|
|
303
|
+
Value: z.ZodObject<{
|
|
304
|
+
Expression: z.ZodObject<{
|
|
305
|
+
Value: z.ZodString;
|
|
306
|
+
Range: z.ZodObject<{
|
|
307
|
+
From: z.ZodObject<{
|
|
308
|
+
Index: z.ZodNumber;
|
|
309
|
+
Line: z.ZodNumber;
|
|
310
|
+
Col: z.ZodNumber;
|
|
311
|
+
}, z.core.$strip>;
|
|
312
|
+
To: z.ZodObject<{
|
|
313
|
+
Index: z.ZodNumber;
|
|
314
|
+
Line: z.ZodNumber;
|
|
315
|
+
Col: z.ZodNumber;
|
|
316
|
+
}, z.core.$strip>;
|
|
317
|
+
}, z.core.$strip>;
|
|
318
|
+
}, z.core.$strip>;
|
|
319
|
+
TrailingSpace: z.ZodString;
|
|
320
|
+
}, z.core.$strip>;
|
|
321
|
+
}, z.core.$strip>]>>;
|
|
322
|
+
}, z.core.$strip>;
|
|
323
|
+
export declare const TemplScriptTemplateSchema: z.ZodObject<{
|
|
324
|
+
Range: z.ZodObject<{
|
|
325
|
+
From: z.ZodObject<{
|
|
326
|
+
Index: z.ZodNumber;
|
|
327
|
+
Line: z.ZodNumber;
|
|
328
|
+
Col: z.ZodNumber;
|
|
329
|
+
}, z.core.$strip>;
|
|
330
|
+
To: z.ZodObject<{
|
|
331
|
+
Index: z.ZodNumber;
|
|
332
|
+
Line: z.ZodNumber;
|
|
333
|
+
Col: z.ZodNumber;
|
|
334
|
+
}, z.core.$strip>;
|
|
335
|
+
}, z.core.$strip>;
|
|
336
|
+
Name: z.ZodObject<{
|
|
337
|
+
Value: z.ZodString;
|
|
338
|
+
Range: z.ZodObject<{
|
|
339
|
+
From: z.ZodObject<{
|
|
340
|
+
Index: z.ZodNumber;
|
|
341
|
+
Line: z.ZodNumber;
|
|
342
|
+
Col: z.ZodNumber;
|
|
343
|
+
}, z.core.$strip>;
|
|
344
|
+
To: z.ZodObject<{
|
|
345
|
+
Index: z.ZodNumber;
|
|
346
|
+
Line: z.ZodNumber;
|
|
347
|
+
Col: z.ZodNumber;
|
|
348
|
+
}, z.core.$strip>;
|
|
349
|
+
}, z.core.$strip>;
|
|
350
|
+
}, z.core.$strip>;
|
|
351
|
+
Parameters: z.ZodObject<{
|
|
352
|
+
Value: z.ZodString;
|
|
353
|
+
Range: z.ZodObject<{
|
|
354
|
+
From: z.ZodObject<{
|
|
355
|
+
Index: z.ZodNumber;
|
|
356
|
+
Line: z.ZodNumber;
|
|
357
|
+
Col: z.ZodNumber;
|
|
358
|
+
}, z.core.$strip>;
|
|
359
|
+
To: z.ZodObject<{
|
|
360
|
+
Index: z.ZodNumber;
|
|
361
|
+
Line: z.ZodNumber;
|
|
362
|
+
Col: z.ZodNumber;
|
|
363
|
+
}, z.core.$strip>;
|
|
364
|
+
}, z.core.$strip>;
|
|
365
|
+
}, z.core.$strip>;
|
|
366
|
+
Value: z.ZodString;
|
|
367
|
+
}, z.core.$strip>;
|
|
368
|
+
export declare const TemplFileGoExpressionSchema: z.ZodObject<{
|
|
369
|
+
Expression: z.ZodObject<{
|
|
370
|
+
Value: z.ZodString;
|
|
371
|
+
Range: z.ZodObject<{
|
|
372
|
+
From: z.ZodObject<{
|
|
373
|
+
Index: z.ZodNumber;
|
|
374
|
+
Line: z.ZodNumber;
|
|
375
|
+
Col: z.ZodNumber;
|
|
376
|
+
}, z.core.$strip>;
|
|
377
|
+
To: z.ZodObject<{
|
|
378
|
+
Index: z.ZodNumber;
|
|
379
|
+
Line: z.ZodNumber;
|
|
380
|
+
Col: z.ZodNumber;
|
|
381
|
+
}, z.core.$strip>;
|
|
382
|
+
}, z.core.$strip>;
|
|
383
|
+
}, z.core.$strip>;
|
|
384
|
+
BeforePackage: z.ZodBoolean;
|
|
385
|
+
}, z.core.$strip>;
|
|
386
|
+
/**
|
|
387
|
+
* Inferred TypeScript types from Zod schemas
|
|
388
|
+
*
|
|
389
|
+
* Note: For recursive types (TemplChild, TemplElementNode), we define explicit
|
|
390
|
+
* TypeScript interfaces instead of using z.infer to enable better type narrowing
|
|
391
|
+
* and discriminated unions.
|
|
392
|
+
*/
|
|
393
|
+
export type TemplPosition = z.infer<typeof TemplPositionSchema>;
|
|
394
|
+
export type TemplRange = z.infer<typeof TemplRangeSchema>;
|
|
395
|
+
export type TemplExpression = z.infer<typeof TemplExpressionSchema>;
|
|
396
|
+
export type TemplAttribute = z.infer<typeof TemplAttributeSchema>;
|
|
397
|
+
export type TemplStringExpression = z.infer<typeof TemplStringExpressionSchema>;
|
|
398
|
+
export type TemplGoExpression = z.infer<typeof TemplGoExpressionSchema>;
|
|
399
|
+
export type TemplCallExpression = z.infer<typeof TemplCallExpressionSchema>;
|
|
400
|
+
export type TemplWhitespace = z.infer<typeof TemplWhitespaceSchema>;
|
|
401
|
+
export type TemplText = z.infer<typeof TemplTextSchema>;
|
|
402
|
+
export type TemplDocType = z.infer<typeof TemplDocTypeSchema>;
|
|
403
|
+
export type TemplHTMLComment = z.infer<typeof TemplHTMLCommentSchema>;
|
|
404
|
+
export type TemplGoComment = z.infer<typeof TemplGoCommentSchema>;
|
|
405
|
+
export type TemplGoCode = z.infer<typeof TemplGoCodeSchema>;
|
|
406
|
+
export type TemplChildrenExpression = z.infer<typeof TemplChildrenExpressionSchema>;
|
|
407
|
+
export type TemplConstantCSSProperty = z.infer<typeof TemplConstantCSSPropertySchema>;
|
|
408
|
+
export type TemplExpressionCSSProperty = z.infer<typeof TemplExpressionCSSPropertySchema>;
|
|
409
|
+
export type TemplCSSProperty = z.infer<typeof TemplCSSPropertySchema>;
|
|
410
|
+
export type TemplCSSTemplate = z.infer<typeof TemplCSSTemplateSchema>;
|
|
411
|
+
export type TemplScriptTemplate = z.infer<typeof TemplScriptTemplateSchema>;
|
|
412
|
+
export type TemplFileGoExpression = z.infer<typeof TemplFileGoExpressionSchema>;
|
|
413
|
+
export interface TemplElementNode {
|
|
414
|
+
Name: string;
|
|
415
|
+
Attributes: TemplAttribute[] | null;
|
|
416
|
+
IndentAttrs: boolean;
|
|
417
|
+
Children: TemplChild[];
|
|
418
|
+
IndentChildren: boolean;
|
|
419
|
+
TrailingSpace: string;
|
|
420
|
+
NameRange: TemplRange;
|
|
421
|
+
Range: TemplRange;
|
|
422
|
+
}
|
|
423
|
+
export interface TemplElseIfExpression {
|
|
424
|
+
Expression: TemplExpression;
|
|
425
|
+
Then: TemplChild[];
|
|
426
|
+
Range: TemplRange;
|
|
427
|
+
}
|
|
428
|
+
export interface TemplIfExpression {
|
|
429
|
+
Expression: TemplExpression;
|
|
430
|
+
Then: TemplChild[];
|
|
431
|
+
ElseIfs: TemplElseIfExpression[] | null;
|
|
432
|
+
Else: TemplChild[] | null;
|
|
433
|
+
Range: TemplRange;
|
|
434
|
+
}
|
|
435
|
+
export interface TemplCaseExpression {
|
|
436
|
+
Expression: TemplExpression;
|
|
437
|
+
Children: TemplChild[];
|
|
438
|
+
}
|
|
439
|
+
export interface TemplSwitchExpression {
|
|
440
|
+
Expression: TemplExpression;
|
|
441
|
+
Cases: TemplCaseExpression[];
|
|
442
|
+
Range: TemplRange;
|
|
443
|
+
}
|
|
444
|
+
export interface TemplForExpression {
|
|
445
|
+
Expression: TemplExpression;
|
|
446
|
+
Children: TemplChild[];
|
|
447
|
+
Range: TemplRange;
|
|
448
|
+
}
|
|
449
|
+
export interface TemplElementExpression {
|
|
450
|
+
Expression: TemplExpression;
|
|
451
|
+
Children: TemplChild[] | null;
|
|
452
|
+
Range: TemplRange;
|
|
453
|
+
}
|
|
454
|
+
export interface TemplScriptContents {
|
|
455
|
+
Value: string | null;
|
|
456
|
+
GoCode: TemplGoCode | null;
|
|
457
|
+
InsideStringLiteral: boolean;
|
|
458
|
+
}
|
|
459
|
+
export interface TemplScriptElement {
|
|
460
|
+
Attributes: TemplAttribute[] | null;
|
|
461
|
+
Contents: TemplScriptContents[];
|
|
462
|
+
Range: TemplRange;
|
|
463
|
+
}
|
|
464
|
+
export interface TemplRawElement {
|
|
465
|
+
Name: string;
|
|
466
|
+
Attributes: TemplAttribute[] | null;
|
|
467
|
+
Contents: string;
|
|
468
|
+
Range: TemplRange;
|
|
469
|
+
}
|
|
470
|
+
export type TemplChild = TemplStringExpression | TemplGoExpression | TemplGoCode | TemplCallExpression | TemplElementExpression | TemplElementNode | TemplWhitespace | TemplText | TemplDocType | TemplHTMLComment | TemplGoComment | TemplIfExpression | TemplForExpression | TemplSwitchExpression | TemplChildrenExpression | TemplScriptElement | TemplRawElement;
|
|
471
|
+
export declare const TemplElementNodeSchema: z.ZodType<TemplElementNode>;
|
|
472
|
+
export declare const TemplElseIfExpressionSchema: z.ZodType<TemplElseIfExpression>;
|
|
473
|
+
export declare const TemplIfExpressionSchema: z.ZodType<TemplIfExpression>;
|
|
474
|
+
export declare const TemplCaseExpressionSchema: z.ZodType<TemplCaseExpression>;
|
|
475
|
+
export declare const TemplSwitchExpressionSchema: z.ZodType<TemplSwitchExpression>;
|
|
476
|
+
export declare const TemplForExpressionSchema: z.ZodType<TemplForExpression>;
|
|
477
|
+
export declare const TemplElementExpressionSchema: z.ZodType<TemplElementExpression>;
|
|
478
|
+
export declare const TemplScriptContentsSchema: z.ZodType<TemplScriptContents>;
|
|
479
|
+
export declare const TemplScriptElementSchema: z.ZodType<TemplScriptElement>;
|
|
480
|
+
export declare const TemplRawElementSchema: z.ZodType<TemplRawElement>;
|
|
481
|
+
export declare const TemplChildSchema: z.ZodType<TemplChild>;
|
|
482
|
+
export declare const TemplHTMLTemplateSchema: z.ZodObject<{
|
|
483
|
+
Range: z.ZodObject<{
|
|
484
|
+
From: z.ZodObject<{
|
|
485
|
+
Index: z.ZodNumber;
|
|
486
|
+
Line: z.ZodNumber;
|
|
487
|
+
Col: z.ZodNumber;
|
|
488
|
+
}, z.core.$strip>;
|
|
489
|
+
To: z.ZodObject<{
|
|
490
|
+
Index: z.ZodNumber;
|
|
491
|
+
Line: z.ZodNumber;
|
|
492
|
+
Col: z.ZodNumber;
|
|
493
|
+
}, z.core.$strip>;
|
|
494
|
+
}, z.core.$strip>;
|
|
495
|
+
Expression: z.ZodObject<{
|
|
496
|
+
Value: z.ZodString;
|
|
497
|
+
Range: z.ZodObject<{
|
|
498
|
+
From: z.ZodObject<{
|
|
499
|
+
Index: z.ZodNumber;
|
|
500
|
+
Line: z.ZodNumber;
|
|
501
|
+
Col: z.ZodNumber;
|
|
502
|
+
}, z.core.$strip>;
|
|
503
|
+
To: z.ZodObject<{
|
|
504
|
+
Index: z.ZodNumber;
|
|
505
|
+
Line: z.ZodNumber;
|
|
506
|
+
Col: z.ZodNumber;
|
|
507
|
+
}, z.core.$strip>;
|
|
508
|
+
}, z.core.$strip>;
|
|
509
|
+
}, z.core.$strip>;
|
|
510
|
+
Children: z.ZodArray<z.ZodType<TemplChild, unknown, z.core.$ZodTypeInternals<TemplChild, unknown>>>;
|
|
511
|
+
}, z.core.$strip>;
|
|
512
|
+
export declare const TemplFileNodeSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
513
|
+
Range: z.ZodObject<{
|
|
514
|
+
From: z.ZodObject<{
|
|
515
|
+
Index: z.ZodNumber;
|
|
516
|
+
Line: z.ZodNumber;
|
|
517
|
+
Col: z.ZodNumber;
|
|
518
|
+
}, z.core.$strip>;
|
|
519
|
+
To: z.ZodObject<{
|
|
520
|
+
Index: z.ZodNumber;
|
|
521
|
+
Line: z.ZodNumber;
|
|
522
|
+
Col: z.ZodNumber;
|
|
523
|
+
}, z.core.$strip>;
|
|
524
|
+
}, z.core.$strip>;
|
|
525
|
+
Expression: z.ZodObject<{
|
|
526
|
+
Value: z.ZodString;
|
|
527
|
+
Range: z.ZodObject<{
|
|
528
|
+
From: z.ZodObject<{
|
|
529
|
+
Index: z.ZodNumber;
|
|
530
|
+
Line: z.ZodNumber;
|
|
531
|
+
Col: z.ZodNumber;
|
|
532
|
+
}, z.core.$strip>;
|
|
533
|
+
To: z.ZodObject<{
|
|
534
|
+
Index: z.ZodNumber;
|
|
535
|
+
Line: z.ZodNumber;
|
|
536
|
+
Col: z.ZodNumber;
|
|
537
|
+
}, z.core.$strip>;
|
|
538
|
+
}, z.core.$strip>;
|
|
539
|
+
}, z.core.$strip>;
|
|
540
|
+
Children: z.ZodArray<z.ZodType<TemplChild, unknown, z.core.$ZodTypeInternals<TemplChild, unknown>>>;
|
|
541
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
542
|
+
Range: z.ZodObject<{
|
|
543
|
+
From: z.ZodObject<{
|
|
544
|
+
Index: z.ZodNumber;
|
|
545
|
+
Line: z.ZodNumber;
|
|
546
|
+
Col: z.ZodNumber;
|
|
547
|
+
}, z.core.$strip>;
|
|
548
|
+
To: z.ZodObject<{
|
|
549
|
+
Index: z.ZodNumber;
|
|
550
|
+
Line: z.ZodNumber;
|
|
551
|
+
Col: z.ZodNumber;
|
|
552
|
+
}, z.core.$strip>;
|
|
553
|
+
}, z.core.$strip>;
|
|
554
|
+
Name: z.ZodString;
|
|
555
|
+
Expression: z.ZodObject<{
|
|
556
|
+
Value: z.ZodString;
|
|
557
|
+
Range: z.ZodObject<{
|
|
558
|
+
From: z.ZodObject<{
|
|
559
|
+
Index: z.ZodNumber;
|
|
560
|
+
Line: z.ZodNumber;
|
|
561
|
+
Col: z.ZodNumber;
|
|
562
|
+
}, z.core.$strip>;
|
|
563
|
+
To: z.ZodObject<{
|
|
564
|
+
Index: z.ZodNumber;
|
|
565
|
+
Line: z.ZodNumber;
|
|
566
|
+
Col: z.ZodNumber;
|
|
567
|
+
}, z.core.$strip>;
|
|
568
|
+
}, z.core.$strip>;
|
|
569
|
+
}, z.core.$strip>;
|
|
570
|
+
Properties: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
571
|
+
Name: z.ZodString;
|
|
572
|
+
Value: z.ZodString;
|
|
573
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
574
|
+
Name: z.ZodString;
|
|
575
|
+
Value: z.ZodObject<{
|
|
576
|
+
Expression: z.ZodObject<{
|
|
577
|
+
Value: z.ZodString;
|
|
578
|
+
Range: z.ZodObject<{
|
|
579
|
+
From: z.ZodObject<{
|
|
580
|
+
Index: z.ZodNumber;
|
|
581
|
+
Line: z.ZodNumber;
|
|
582
|
+
Col: z.ZodNumber;
|
|
583
|
+
}, z.core.$strip>;
|
|
584
|
+
To: z.ZodObject<{
|
|
585
|
+
Index: z.ZodNumber;
|
|
586
|
+
Line: z.ZodNumber;
|
|
587
|
+
Col: z.ZodNumber;
|
|
588
|
+
}, z.core.$strip>;
|
|
589
|
+
}, z.core.$strip>;
|
|
590
|
+
}, z.core.$strip>;
|
|
591
|
+
TrailingSpace: z.ZodString;
|
|
592
|
+
}, z.core.$strip>;
|
|
593
|
+
}, z.core.$strip>]>>;
|
|
594
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
595
|
+
Range: z.ZodObject<{
|
|
596
|
+
From: z.ZodObject<{
|
|
597
|
+
Index: z.ZodNumber;
|
|
598
|
+
Line: z.ZodNumber;
|
|
599
|
+
Col: z.ZodNumber;
|
|
600
|
+
}, z.core.$strip>;
|
|
601
|
+
To: z.ZodObject<{
|
|
602
|
+
Index: z.ZodNumber;
|
|
603
|
+
Line: z.ZodNumber;
|
|
604
|
+
Col: z.ZodNumber;
|
|
605
|
+
}, z.core.$strip>;
|
|
606
|
+
}, z.core.$strip>;
|
|
607
|
+
Name: z.ZodObject<{
|
|
608
|
+
Value: z.ZodString;
|
|
609
|
+
Range: z.ZodObject<{
|
|
610
|
+
From: z.ZodObject<{
|
|
611
|
+
Index: z.ZodNumber;
|
|
612
|
+
Line: z.ZodNumber;
|
|
613
|
+
Col: z.ZodNumber;
|
|
614
|
+
}, z.core.$strip>;
|
|
615
|
+
To: z.ZodObject<{
|
|
616
|
+
Index: z.ZodNumber;
|
|
617
|
+
Line: z.ZodNumber;
|
|
618
|
+
Col: z.ZodNumber;
|
|
619
|
+
}, z.core.$strip>;
|
|
620
|
+
}, z.core.$strip>;
|
|
621
|
+
}, z.core.$strip>;
|
|
622
|
+
Parameters: z.ZodObject<{
|
|
623
|
+
Value: z.ZodString;
|
|
624
|
+
Range: z.ZodObject<{
|
|
625
|
+
From: z.ZodObject<{
|
|
626
|
+
Index: z.ZodNumber;
|
|
627
|
+
Line: z.ZodNumber;
|
|
628
|
+
Col: z.ZodNumber;
|
|
629
|
+
}, z.core.$strip>;
|
|
630
|
+
To: z.ZodObject<{
|
|
631
|
+
Index: z.ZodNumber;
|
|
632
|
+
Line: z.ZodNumber;
|
|
633
|
+
Col: z.ZodNumber;
|
|
634
|
+
}, z.core.$strip>;
|
|
635
|
+
}, z.core.$strip>;
|
|
636
|
+
}, z.core.$strip>;
|
|
637
|
+
Value: z.ZodString;
|
|
638
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
639
|
+
Expression: z.ZodObject<{
|
|
640
|
+
Value: z.ZodString;
|
|
641
|
+
Range: z.ZodObject<{
|
|
642
|
+
From: z.ZodObject<{
|
|
643
|
+
Index: z.ZodNumber;
|
|
644
|
+
Line: z.ZodNumber;
|
|
645
|
+
Col: z.ZodNumber;
|
|
646
|
+
}, z.core.$strip>;
|
|
647
|
+
To: z.ZodObject<{
|
|
648
|
+
Index: z.ZodNumber;
|
|
649
|
+
Line: z.ZodNumber;
|
|
650
|
+
Col: z.ZodNumber;
|
|
651
|
+
}, z.core.$strip>;
|
|
652
|
+
}, z.core.$strip>;
|
|
653
|
+
}, z.core.$strip>;
|
|
654
|
+
BeforePackage: z.ZodBoolean;
|
|
655
|
+
}, z.core.$strip>]>;
|
|
656
|
+
export declare const TemplASTSchema: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
657
|
+
Range: z.ZodObject<{
|
|
658
|
+
From: z.ZodObject<{
|
|
659
|
+
Index: z.ZodNumber;
|
|
660
|
+
Line: z.ZodNumber;
|
|
661
|
+
Col: z.ZodNumber;
|
|
662
|
+
}, z.core.$strip>;
|
|
663
|
+
To: z.ZodObject<{
|
|
664
|
+
Index: z.ZodNumber;
|
|
665
|
+
Line: z.ZodNumber;
|
|
666
|
+
Col: z.ZodNumber;
|
|
667
|
+
}, z.core.$strip>;
|
|
668
|
+
}, z.core.$strip>;
|
|
669
|
+
Expression: z.ZodObject<{
|
|
670
|
+
Value: z.ZodString;
|
|
671
|
+
Range: z.ZodObject<{
|
|
672
|
+
From: z.ZodObject<{
|
|
673
|
+
Index: z.ZodNumber;
|
|
674
|
+
Line: z.ZodNumber;
|
|
675
|
+
Col: z.ZodNumber;
|
|
676
|
+
}, z.core.$strip>;
|
|
677
|
+
To: z.ZodObject<{
|
|
678
|
+
Index: z.ZodNumber;
|
|
679
|
+
Line: z.ZodNumber;
|
|
680
|
+
Col: z.ZodNumber;
|
|
681
|
+
}, z.core.$strip>;
|
|
682
|
+
}, z.core.$strip>;
|
|
683
|
+
}, z.core.$strip>;
|
|
684
|
+
Children: z.ZodArray<z.ZodType<TemplChild, unknown, z.core.$ZodTypeInternals<TemplChild, unknown>>>;
|
|
685
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
686
|
+
Range: z.ZodObject<{
|
|
687
|
+
From: z.ZodObject<{
|
|
688
|
+
Index: z.ZodNumber;
|
|
689
|
+
Line: z.ZodNumber;
|
|
690
|
+
Col: z.ZodNumber;
|
|
691
|
+
}, z.core.$strip>;
|
|
692
|
+
To: z.ZodObject<{
|
|
693
|
+
Index: z.ZodNumber;
|
|
694
|
+
Line: z.ZodNumber;
|
|
695
|
+
Col: z.ZodNumber;
|
|
696
|
+
}, z.core.$strip>;
|
|
697
|
+
}, z.core.$strip>;
|
|
698
|
+
Name: z.ZodString;
|
|
699
|
+
Expression: z.ZodObject<{
|
|
700
|
+
Value: z.ZodString;
|
|
701
|
+
Range: z.ZodObject<{
|
|
702
|
+
From: z.ZodObject<{
|
|
703
|
+
Index: z.ZodNumber;
|
|
704
|
+
Line: z.ZodNumber;
|
|
705
|
+
Col: z.ZodNumber;
|
|
706
|
+
}, z.core.$strip>;
|
|
707
|
+
To: z.ZodObject<{
|
|
708
|
+
Index: z.ZodNumber;
|
|
709
|
+
Line: z.ZodNumber;
|
|
710
|
+
Col: z.ZodNumber;
|
|
711
|
+
}, z.core.$strip>;
|
|
712
|
+
}, z.core.$strip>;
|
|
713
|
+
}, z.core.$strip>;
|
|
714
|
+
Properties: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
715
|
+
Name: z.ZodString;
|
|
716
|
+
Value: z.ZodString;
|
|
717
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
718
|
+
Name: z.ZodString;
|
|
719
|
+
Value: z.ZodObject<{
|
|
720
|
+
Expression: z.ZodObject<{
|
|
721
|
+
Value: z.ZodString;
|
|
722
|
+
Range: z.ZodObject<{
|
|
723
|
+
From: z.ZodObject<{
|
|
724
|
+
Index: z.ZodNumber;
|
|
725
|
+
Line: z.ZodNumber;
|
|
726
|
+
Col: z.ZodNumber;
|
|
727
|
+
}, z.core.$strip>;
|
|
728
|
+
To: z.ZodObject<{
|
|
729
|
+
Index: z.ZodNumber;
|
|
730
|
+
Line: z.ZodNumber;
|
|
731
|
+
Col: z.ZodNumber;
|
|
732
|
+
}, z.core.$strip>;
|
|
733
|
+
}, z.core.$strip>;
|
|
734
|
+
}, z.core.$strip>;
|
|
735
|
+
TrailingSpace: z.ZodString;
|
|
736
|
+
}, z.core.$strip>;
|
|
737
|
+
}, z.core.$strip>]>>;
|
|
738
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
739
|
+
Range: z.ZodObject<{
|
|
740
|
+
From: z.ZodObject<{
|
|
741
|
+
Index: z.ZodNumber;
|
|
742
|
+
Line: z.ZodNumber;
|
|
743
|
+
Col: z.ZodNumber;
|
|
744
|
+
}, z.core.$strip>;
|
|
745
|
+
To: z.ZodObject<{
|
|
746
|
+
Index: z.ZodNumber;
|
|
747
|
+
Line: z.ZodNumber;
|
|
748
|
+
Col: z.ZodNumber;
|
|
749
|
+
}, z.core.$strip>;
|
|
750
|
+
}, z.core.$strip>;
|
|
751
|
+
Name: z.ZodObject<{
|
|
752
|
+
Value: z.ZodString;
|
|
753
|
+
Range: z.ZodObject<{
|
|
754
|
+
From: z.ZodObject<{
|
|
755
|
+
Index: z.ZodNumber;
|
|
756
|
+
Line: z.ZodNumber;
|
|
757
|
+
Col: z.ZodNumber;
|
|
758
|
+
}, z.core.$strip>;
|
|
759
|
+
To: z.ZodObject<{
|
|
760
|
+
Index: z.ZodNumber;
|
|
761
|
+
Line: z.ZodNumber;
|
|
762
|
+
Col: z.ZodNumber;
|
|
763
|
+
}, z.core.$strip>;
|
|
764
|
+
}, z.core.$strip>;
|
|
765
|
+
}, z.core.$strip>;
|
|
766
|
+
Parameters: z.ZodObject<{
|
|
767
|
+
Value: z.ZodString;
|
|
768
|
+
Range: z.ZodObject<{
|
|
769
|
+
From: z.ZodObject<{
|
|
770
|
+
Index: z.ZodNumber;
|
|
771
|
+
Line: z.ZodNumber;
|
|
772
|
+
Col: z.ZodNumber;
|
|
773
|
+
}, z.core.$strip>;
|
|
774
|
+
To: z.ZodObject<{
|
|
775
|
+
Index: z.ZodNumber;
|
|
776
|
+
Line: z.ZodNumber;
|
|
777
|
+
Col: z.ZodNumber;
|
|
778
|
+
}, z.core.$strip>;
|
|
779
|
+
}, z.core.$strip>;
|
|
780
|
+
}, z.core.$strip>;
|
|
781
|
+
Value: z.ZodString;
|
|
782
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
783
|
+
Expression: z.ZodObject<{
|
|
784
|
+
Value: z.ZodString;
|
|
785
|
+
Range: z.ZodObject<{
|
|
786
|
+
From: z.ZodObject<{
|
|
787
|
+
Index: z.ZodNumber;
|
|
788
|
+
Line: z.ZodNumber;
|
|
789
|
+
Col: z.ZodNumber;
|
|
790
|
+
}, z.core.$strip>;
|
|
791
|
+
To: z.ZodObject<{
|
|
792
|
+
Index: z.ZodNumber;
|
|
793
|
+
Line: z.ZodNumber;
|
|
794
|
+
Col: z.ZodNumber;
|
|
795
|
+
}, z.core.$strip>;
|
|
796
|
+
}, z.core.$strip>;
|
|
797
|
+
}, z.core.$strip>;
|
|
798
|
+
BeforePackage: z.ZodBoolean;
|
|
799
|
+
}, z.core.$strip>]>>;
|
|
800
|
+
export type TemplHTMLTemplate = z.infer<typeof TemplHTMLTemplateSchema>;
|
|
801
|
+
export type TemplFileNode = z.infer<typeof TemplFileNodeSchema>;
|
|
802
|
+
export type TemplAST = z.infer<typeof TemplASTSchema>;
|
|
803
|
+
export type TemplComponentNode = TemplHTMLTemplate;
|
|
804
|
+
//# sourceMappingURL=templ-ast.d.ts.map
|