@vue/compiler-core 3.2.46 → 3.3.0-alpha.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/dist/compiler-core.cjs.js +4819 -5222
- package/dist/compiler-core.cjs.prod.js +4674 -5075
- package/dist/compiler-core.d.ts +986 -1202
- package/dist/compiler-core.esm-bundler.js +4212 -4465
- package/package.json +3 -3
package/dist/compiler-core.d.ts
CHANGED
|
@@ -1,1202 +1,986 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
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
|
-
export
|
|
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
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
export
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
export
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
export
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
export
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
export
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
export
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
export
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
export
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
export
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
export
|
|
483
|
-
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
export
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
export
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
export
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
export
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
*
|
|
756
|
-
*/
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
*
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
*
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
*
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
export
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
export
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
declare
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
export declare function stringifyExpression(exp: ExpressionNode | string): string;
|
|
988
|
-
|
|
989
|
-
export declare type StructuralDirectiveTransform = (node: ElementNode, dir: DirectiveNode, context: TransformContext) => void | (() => void);
|
|
990
|
-
|
|
991
|
-
export declare const SUSPENSE: unique symbol;
|
|
992
|
-
|
|
993
|
-
export declare const TELEPORT: unique symbol;
|
|
994
|
-
|
|
995
|
-
export declare type TemplateChildNode = ElementNode | InterpolationNode | CompoundExpressionNode | TextNode | CommentNode | IfNode | IfBranchNode | ForNode | TextCallNode;
|
|
996
|
-
|
|
997
|
-
export declare interface TemplateLiteral extends Node_2 {
|
|
998
|
-
type: NodeTypes.JS_TEMPLATE_LITERAL;
|
|
999
|
-
elements: (string | JSChildNode)[];
|
|
1000
|
-
}
|
|
1001
|
-
|
|
1002
|
-
export declare interface TemplateNode extends BaseElementNode {
|
|
1003
|
-
tagType: ElementTypes.TEMPLATE;
|
|
1004
|
-
codegenNode: undefined;
|
|
1005
|
-
}
|
|
1006
|
-
|
|
1007
|
-
export declare type TemplateTextChildNode = TextNode | InterpolationNode | CompoundExpressionNode;
|
|
1008
|
-
|
|
1009
|
-
export declare interface TextCallNode extends Node_2 {
|
|
1010
|
-
type: NodeTypes.TEXT_CALL;
|
|
1011
|
-
content: TextNode | InterpolationNode | CompoundExpressionNode;
|
|
1012
|
-
codegenNode: CallExpression | SimpleExpressionNode;
|
|
1013
|
-
}
|
|
1014
|
-
|
|
1015
|
-
export declare const enum TextModes {
|
|
1016
|
-
DATA = 0,
|
|
1017
|
-
RCDATA = 1,
|
|
1018
|
-
RAWTEXT = 2,
|
|
1019
|
-
CDATA = 3,
|
|
1020
|
-
ATTRIBUTE_VALUE = 4
|
|
1021
|
-
}
|
|
1022
|
-
|
|
1023
|
-
export declare interface TextNode extends Node_2 {
|
|
1024
|
-
type: NodeTypes.TEXT;
|
|
1025
|
-
content: string;
|
|
1026
|
-
}
|
|
1027
|
-
|
|
1028
|
-
export declare const TO_DISPLAY_STRING: unique symbol;
|
|
1029
|
-
|
|
1030
|
-
export declare const TO_HANDLER_KEY: unique symbol;
|
|
1031
|
-
|
|
1032
|
-
export declare const TO_HANDLERS: unique symbol;
|
|
1033
|
-
|
|
1034
|
-
export declare function toValidAssetId(name: string, type: 'component' | 'directive' | 'filter'): string;
|
|
1035
|
-
|
|
1036
|
-
export declare const trackSlotScopes: NodeTransform;
|
|
1037
|
-
|
|
1038
|
-
export declare const trackVForSlotScopes: NodeTransform;
|
|
1039
|
-
|
|
1040
|
-
export declare function transform(root: RootNode, options: TransformOptions): void;
|
|
1041
|
-
|
|
1042
|
-
export declare const transformBind: DirectiveTransform;
|
|
1043
|
-
|
|
1044
|
-
export declare interface TransformContext extends Required<Omit<TransformOptions, 'filename' | keyof CompilerCompatOptions>>, CompilerCompatOptions {
|
|
1045
|
-
selfName: string | null;
|
|
1046
|
-
root: RootNode;
|
|
1047
|
-
helpers: Map<symbol, number>;
|
|
1048
|
-
components: Set<string>;
|
|
1049
|
-
directives: Set<string>;
|
|
1050
|
-
hoists: (JSChildNode | null)[];
|
|
1051
|
-
imports: ImportItem[];
|
|
1052
|
-
temps: number;
|
|
1053
|
-
cached: number;
|
|
1054
|
-
identifiers: {
|
|
1055
|
-
[name: string]: number | undefined;
|
|
1056
|
-
};
|
|
1057
|
-
scopes: {
|
|
1058
|
-
vFor: number;
|
|
1059
|
-
vSlot: number;
|
|
1060
|
-
vPre: number;
|
|
1061
|
-
vOnce: number;
|
|
1062
|
-
};
|
|
1063
|
-
parent: ParentNode_2 | null;
|
|
1064
|
-
childIndex: number;
|
|
1065
|
-
currentNode: RootNode | TemplateChildNode | null;
|
|
1066
|
-
inVOnce: boolean;
|
|
1067
|
-
helper<T extends symbol>(name: T): T;
|
|
1068
|
-
removeHelper<T extends symbol>(name: T): void;
|
|
1069
|
-
helperString(name: symbol): string;
|
|
1070
|
-
replaceNode(node: TemplateChildNode): void;
|
|
1071
|
-
removeNode(node?: TemplateChildNode): void;
|
|
1072
|
-
onNodeRemoved(): void;
|
|
1073
|
-
addIdentifiers(exp: ExpressionNode | string): void;
|
|
1074
|
-
removeIdentifiers(exp: ExpressionNode | string): void;
|
|
1075
|
-
hoist(exp: string | JSChildNode | ArrayExpression): SimpleExpressionNode;
|
|
1076
|
-
cache<T extends JSChildNode>(exp: T, isVNode?: boolean): CacheExpression | T;
|
|
1077
|
-
constantCache: Map<TemplateChildNode, ConstantTypes>;
|
|
1078
|
-
filters?: Set<string>;
|
|
1079
|
-
}
|
|
1080
|
-
|
|
1081
|
-
export declare const transformElement: NodeTransform;
|
|
1082
|
-
|
|
1083
|
-
export declare const transformExpression: NodeTransform;
|
|
1084
|
-
|
|
1085
|
-
export declare const transformModel: DirectiveTransform;
|
|
1086
|
-
|
|
1087
|
-
export declare const transformOn: DirectiveTransform;
|
|
1088
|
-
|
|
1089
|
-
export declare interface TransformOptions extends SharedTransformCodegenOptions, ErrorHandlingOptions, CompilerCompatOptions {
|
|
1090
|
-
/**
|
|
1091
|
-
* An array of node transforms to be applied to every AST node.
|
|
1092
|
-
*/
|
|
1093
|
-
nodeTransforms?: NodeTransform[];
|
|
1094
|
-
/**
|
|
1095
|
-
* An object of { name: transform } to be applied to every directive attribute
|
|
1096
|
-
* node found on element nodes.
|
|
1097
|
-
*/
|
|
1098
|
-
directiveTransforms?: Record<string, DirectiveTransform | undefined>;
|
|
1099
|
-
/**
|
|
1100
|
-
* An optional hook to transform a node being hoisted.
|
|
1101
|
-
* used by compiler-dom to turn hoisted nodes into stringified HTML vnodes.
|
|
1102
|
-
* @default null
|
|
1103
|
-
*/
|
|
1104
|
-
transformHoist?: HoistTransform | null;
|
|
1105
|
-
/**
|
|
1106
|
-
* If the pairing runtime provides additional built-in elements, use this to
|
|
1107
|
-
* mark them as built-in so the compiler will generate component vnodes
|
|
1108
|
-
* for them.
|
|
1109
|
-
*/
|
|
1110
|
-
isBuiltInComponent?: (tag: string) => symbol | void;
|
|
1111
|
-
/**
|
|
1112
|
-
* Used by some transforms that expects only native elements
|
|
1113
|
-
*/
|
|
1114
|
-
isCustomElement?: (tag: string) => boolean | void;
|
|
1115
|
-
/**
|
|
1116
|
-
* Transform expressions like {{ foo }} to `_ctx.foo`.
|
|
1117
|
-
* If this option is false, the generated code will be wrapped in a
|
|
1118
|
-
* `with (this) { ... }` block.
|
|
1119
|
-
* - This is force-enabled in module mode, since modules are by default strict
|
|
1120
|
-
* and cannot use `with`
|
|
1121
|
-
* @default mode === 'module'
|
|
1122
|
-
*/
|
|
1123
|
-
prefixIdentifiers?: boolean;
|
|
1124
|
-
/**
|
|
1125
|
-
* Hoist static VNodes and props objects to `_hoisted_x` constants
|
|
1126
|
-
* @default false
|
|
1127
|
-
*/
|
|
1128
|
-
hoistStatic?: boolean;
|
|
1129
|
-
/**
|
|
1130
|
-
* Cache v-on handlers to avoid creating new inline functions on each render,
|
|
1131
|
-
* also avoids the need for dynamically patching the handlers by wrapping it.
|
|
1132
|
-
* e.g `@click="foo"` by default is compiled to `{ onClick: foo }`. With this
|
|
1133
|
-
* option it's compiled to:
|
|
1134
|
-
* ```js
|
|
1135
|
-
* { onClick: _cache[0] || (_cache[0] = e => _ctx.foo(e)) }
|
|
1136
|
-
* ```
|
|
1137
|
-
* - Requires "prefixIdentifiers" to be enabled because it relies on scope
|
|
1138
|
-
* analysis to determine if a handler is safe to cache.
|
|
1139
|
-
* @default false
|
|
1140
|
-
*/
|
|
1141
|
-
cacheHandlers?: boolean;
|
|
1142
|
-
/**
|
|
1143
|
-
* A list of parser plugins to enable for `@babel/parser`, which is used to
|
|
1144
|
-
* parse expressions in bindings and interpolations.
|
|
1145
|
-
* https://babeljs.io/docs/en/next/babel-parser#plugins
|
|
1146
|
-
*/
|
|
1147
|
-
expressionPlugins?: ParserPlugin[];
|
|
1148
|
-
/**
|
|
1149
|
-
* SFC scoped styles ID
|
|
1150
|
-
*/
|
|
1151
|
-
scopeId?: string | null;
|
|
1152
|
-
/**
|
|
1153
|
-
* Indicates this SFC template has used :slotted in its styles
|
|
1154
|
-
* Defaults to `true` for backwards compatibility - SFC tooling should set it
|
|
1155
|
-
* to `false` if no `:slotted` usage is detected in `<style>`
|
|
1156
|
-
*/
|
|
1157
|
-
slotted?: boolean;
|
|
1158
|
-
/**
|
|
1159
|
-
* SFC `<style vars>` injection string
|
|
1160
|
-
* Should already be an object expression, e.g. `{ 'xxxx-color': color }`
|
|
1161
|
-
* needed to render inline CSS variables on component root
|
|
1162
|
-
*/
|
|
1163
|
-
ssrCssVars?: string;
|
|
1164
|
-
}
|
|
1165
|
-
|
|
1166
|
-
export declare type TransformPreset = [
|
|
1167
|
-
NodeTransform[],
|
|
1168
|
-
Record<string, DirectiveTransform>
|
|
1169
|
-
];
|
|
1170
|
-
|
|
1171
|
-
export declare function traverseNode(node: RootNode | TemplateChildNode, context: TransformContext): void;
|
|
1172
|
-
|
|
1173
|
-
export declare const UNREF: unique symbol;
|
|
1174
|
-
|
|
1175
|
-
export declare interface VNodeCall extends Node_2 {
|
|
1176
|
-
type: NodeTypes.VNODE_CALL;
|
|
1177
|
-
tag: string | symbol | CallExpression;
|
|
1178
|
-
props: PropsExpression | undefined;
|
|
1179
|
-
children: TemplateChildNode[] | TemplateTextChildNode | SlotsExpression | ForRenderListExpression | SimpleExpressionNode | undefined;
|
|
1180
|
-
patchFlag: string | undefined;
|
|
1181
|
-
dynamicProps: string | SimpleExpressionNode | undefined;
|
|
1182
|
-
directives: DirectiveArguments | undefined;
|
|
1183
|
-
isBlock: boolean;
|
|
1184
|
-
disableTracking: boolean;
|
|
1185
|
-
isComponent: boolean;
|
|
1186
|
-
}
|
|
1187
|
-
|
|
1188
|
-
export declare function walkBlockDeclarations(block: BlockStatement_2 | Program, onIdent: (node: Identifier) => void): void;
|
|
1189
|
-
|
|
1190
|
-
export declare function walkFunctionParams(node: Function_2, onIdent: (id: Identifier) => void): void;
|
|
1191
|
-
|
|
1192
|
-
export declare function walkIdentifiers(root: Node_3, onIdentifier: (node: Identifier, parent: Node_3, parentStack: Node_3[], isReference: boolean, isLocal: boolean) => void, includeAll?: boolean, parentStack?: Node_3[], knownIds?: Record<string, number>): void;
|
|
1193
|
-
|
|
1194
|
-
export declare function warnDeprecation(key: CompilerDeprecationTypes, context: ParserContext | TransformContext, loc: SourceLocation | null, ...args: any[]): void;
|
|
1195
|
-
|
|
1196
|
-
export declare const WITH_CTX: unique symbol;
|
|
1197
|
-
|
|
1198
|
-
export declare const WITH_DIRECTIVES: unique symbol;
|
|
1199
|
-
|
|
1200
|
-
export declare const WITH_MEMO: unique symbol;
|
|
1201
|
-
|
|
1202
|
-
export { }
|
|
1
|
+
import { ParserPlugin } from '@babel/parser';
|
|
2
|
+
import { RawSourceMap, SourceMapGenerator } from 'source-map';
|
|
3
|
+
import { Node as Node$1, Identifier, Function, BlockStatement as BlockStatement$1, Program, ObjectProperty } from '@babel/types';
|
|
4
|
+
export { generateCodeFrame } from '@vue/shared';
|
|
5
|
+
|
|
6
|
+
export type OptionalOptions = 'whitespace' | 'isNativeTag' | 'isBuiltInComponent' | keyof CompilerCompatOptions;
|
|
7
|
+
export type MergedParserOptions = Omit<Required<ParserOptions>, OptionalOptions> & Pick<ParserOptions, OptionalOptions>;
|
|
8
|
+
declare const enum TextModes {
|
|
9
|
+
DATA = 0,
|
|
10
|
+
RCDATA = 1,
|
|
11
|
+
RAWTEXT = 2,
|
|
12
|
+
CDATA = 3,
|
|
13
|
+
ATTRIBUTE_VALUE = 4
|
|
14
|
+
}
|
|
15
|
+
export interface ParserContext {
|
|
16
|
+
options: MergedParserOptions;
|
|
17
|
+
readonly originalSource: string;
|
|
18
|
+
source: string;
|
|
19
|
+
offset: number;
|
|
20
|
+
line: number;
|
|
21
|
+
column: number;
|
|
22
|
+
inPre: boolean;
|
|
23
|
+
inVPre: boolean;
|
|
24
|
+
onWarn: NonNullable<ErrorHandlingOptions['onWarn']>;
|
|
25
|
+
}
|
|
26
|
+
declare function baseParse(content: string, options?: ParserOptions): RootNode;
|
|
27
|
+
|
|
28
|
+
export type CompilerCompatConfig = Partial<Record<CompilerDeprecationTypes, boolean | 'suppress-warning'>> & {
|
|
29
|
+
MODE?: 2 | 3;
|
|
30
|
+
};
|
|
31
|
+
export interface CompilerCompatOptions {
|
|
32
|
+
compatConfig?: CompilerCompatConfig;
|
|
33
|
+
}
|
|
34
|
+
declare const enum CompilerDeprecationTypes {
|
|
35
|
+
COMPILER_IS_ON_ELEMENT = "COMPILER_IS_ON_ELEMENT",
|
|
36
|
+
COMPILER_V_BIND_SYNC = "COMPILER_V_BIND_SYNC",
|
|
37
|
+
COMPILER_V_BIND_PROP = "COMPILER_V_BIND_PROP",
|
|
38
|
+
COMPILER_V_BIND_OBJECT_ORDER = "COMPILER_V_BIND_OBJECT_ORDER",
|
|
39
|
+
COMPILER_V_ON_NATIVE = "COMPILER_V_ON_NATIVE",
|
|
40
|
+
COMPILER_V_IF_V_FOR_PRECEDENCE = "COMPILER_V_IF_V_FOR_PRECEDENCE",
|
|
41
|
+
COMPILER_NATIVE_TEMPLATE = "COMPILER_NATIVE_TEMPLATE",
|
|
42
|
+
COMPILER_INLINE_TEMPLATE = "COMPILER_INLINE_TEMPLATE",
|
|
43
|
+
COMPILER_FILTERS = "COMPILER_FILTER"
|
|
44
|
+
}
|
|
45
|
+
declare function checkCompatEnabled(key: CompilerDeprecationTypes, context: ParserContext | TransformContext, loc: SourceLocation | null, ...args: any[]): boolean;
|
|
46
|
+
declare function warnDeprecation(key: CompilerDeprecationTypes, context: ParserContext | TransformContext, loc: SourceLocation | null, ...args: any[]): void;
|
|
47
|
+
|
|
48
|
+
export type NodeTransform = (node: RootNode | TemplateChildNode, context: TransformContext) => void | (() => void) | (() => void)[];
|
|
49
|
+
export type DirectiveTransform = (dir: DirectiveNode, node: ElementNode, context: TransformContext, augmentor?: (ret: DirectiveTransformResult) => DirectiveTransformResult) => DirectiveTransformResult;
|
|
50
|
+
export interface DirectiveTransformResult {
|
|
51
|
+
props: Property[];
|
|
52
|
+
needRuntime?: boolean | symbol;
|
|
53
|
+
ssrTagParts?: TemplateLiteral['elements'];
|
|
54
|
+
}
|
|
55
|
+
export type StructuralDirectiveTransform = (node: ElementNode, dir: DirectiveNode, context: TransformContext) => void | (() => void);
|
|
56
|
+
export interface ImportItem {
|
|
57
|
+
exp: string | ExpressionNode;
|
|
58
|
+
path: string;
|
|
59
|
+
}
|
|
60
|
+
export interface TransformContext extends Required<Omit<TransformOptions, 'filename' | keyof CompilerCompatOptions>>, CompilerCompatOptions {
|
|
61
|
+
selfName: string | null;
|
|
62
|
+
root: RootNode;
|
|
63
|
+
helpers: Map<symbol, number>;
|
|
64
|
+
components: Set<string>;
|
|
65
|
+
directives: Set<string>;
|
|
66
|
+
hoists: (JSChildNode | null)[];
|
|
67
|
+
imports: ImportItem[];
|
|
68
|
+
temps: number;
|
|
69
|
+
cached: number;
|
|
70
|
+
identifiers: {
|
|
71
|
+
[name: string]: number | undefined;
|
|
72
|
+
};
|
|
73
|
+
scopes: {
|
|
74
|
+
vFor: number;
|
|
75
|
+
vSlot: number;
|
|
76
|
+
vPre: number;
|
|
77
|
+
vOnce: number;
|
|
78
|
+
};
|
|
79
|
+
parent: ParentNode | null;
|
|
80
|
+
childIndex: number;
|
|
81
|
+
currentNode: RootNode | TemplateChildNode | null;
|
|
82
|
+
inVOnce: boolean;
|
|
83
|
+
helper<T extends symbol>(name: T): T;
|
|
84
|
+
removeHelper<T extends symbol>(name: T): void;
|
|
85
|
+
helperString(name: symbol): string;
|
|
86
|
+
replaceNode(node: TemplateChildNode): void;
|
|
87
|
+
removeNode(node?: TemplateChildNode): void;
|
|
88
|
+
onNodeRemoved(): void;
|
|
89
|
+
addIdentifiers(exp: ExpressionNode | string): void;
|
|
90
|
+
removeIdentifiers(exp: ExpressionNode | string): void;
|
|
91
|
+
hoist(exp: string | JSChildNode | ArrayExpression): SimpleExpressionNode;
|
|
92
|
+
cache<T extends JSChildNode>(exp: T, isVNode?: boolean): CacheExpression | T;
|
|
93
|
+
constantCache: Map<TemplateChildNode, ConstantTypes>;
|
|
94
|
+
filters?: Set<string>;
|
|
95
|
+
}
|
|
96
|
+
declare function createTransformContext(root: RootNode, { filename, prefixIdentifiers, hoistStatic, cacheHandlers, nodeTransforms, directiveTransforms, transformHoist, isBuiltInComponent, isCustomElement, expressionPlugins, scopeId, slotted, ssr, inSSR, ssrCssVars, bindingMetadata, inline, isTS, onError, onWarn, compatConfig }: TransformOptions): TransformContext;
|
|
97
|
+
declare function transform(root: RootNode, options: TransformOptions): void;
|
|
98
|
+
declare function traverseNode(node: RootNode | TemplateChildNode, context: TransformContext): void;
|
|
99
|
+
declare function createStructuralDirectiveTransform(name: string | RegExp, fn: StructuralDirectiveTransform): NodeTransform;
|
|
100
|
+
|
|
101
|
+
declare function processFor(node: ElementNode, dir: DirectiveNode, context: TransformContext, processCodegen?: (forNode: ForNode) => (() => void) | undefined): (() => void) | undefined;
|
|
102
|
+
export interface ForParseResult {
|
|
103
|
+
source: ExpressionNode;
|
|
104
|
+
value: ExpressionNode | undefined;
|
|
105
|
+
key: ExpressionNode | undefined;
|
|
106
|
+
index: ExpressionNode | undefined;
|
|
107
|
+
}
|
|
108
|
+
declare function createForLoopParams({ value, key, index }: ForParseResult, memoArgs?: ExpressionNode[]): ExpressionNode[];
|
|
109
|
+
|
|
110
|
+
declare const FRAGMENT: unique symbol;
|
|
111
|
+
declare const TELEPORT: unique symbol;
|
|
112
|
+
declare const SUSPENSE: unique symbol;
|
|
113
|
+
declare const KEEP_ALIVE: unique symbol;
|
|
114
|
+
declare const BASE_TRANSITION: unique symbol;
|
|
115
|
+
declare const OPEN_BLOCK: unique symbol;
|
|
116
|
+
declare const CREATE_BLOCK: unique symbol;
|
|
117
|
+
declare const CREATE_ELEMENT_BLOCK: unique symbol;
|
|
118
|
+
declare const CREATE_VNODE: unique symbol;
|
|
119
|
+
declare const CREATE_ELEMENT_VNODE: unique symbol;
|
|
120
|
+
declare const CREATE_COMMENT: unique symbol;
|
|
121
|
+
declare const CREATE_TEXT: unique symbol;
|
|
122
|
+
declare const CREATE_STATIC: unique symbol;
|
|
123
|
+
declare const RESOLVE_COMPONENT: unique symbol;
|
|
124
|
+
declare const RESOLVE_DYNAMIC_COMPONENT: unique symbol;
|
|
125
|
+
declare const RESOLVE_DIRECTIVE: unique symbol;
|
|
126
|
+
declare const RESOLVE_FILTER: unique symbol;
|
|
127
|
+
declare const WITH_DIRECTIVES: unique symbol;
|
|
128
|
+
declare const RENDER_LIST: unique symbol;
|
|
129
|
+
declare const RENDER_SLOT: unique symbol;
|
|
130
|
+
declare const CREATE_SLOTS: unique symbol;
|
|
131
|
+
declare const TO_DISPLAY_STRING: unique symbol;
|
|
132
|
+
declare const MERGE_PROPS: unique symbol;
|
|
133
|
+
declare const NORMALIZE_CLASS: unique symbol;
|
|
134
|
+
declare const NORMALIZE_STYLE: unique symbol;
|
|
135
|
+
declare const NORMALIZE_PROPS: unique symbol;
|
|
136
|
+
declare const GUARD_REACTIVE_PROPS: unique symbol;
|
|
137
|
+
declare const TO_HANDLERS: unique symbol;
|
|
138
|
+
declare const CAMELIZE: unique symbol;
|
|
139
|
+
declare const CAPITALIZE: unique symbol;
|
|
140
|
+
declare const TO_HANDLER_KEY: unique symbol;
|
|
141
|
+
declare const SET_BLOCK_TRACKING: unique symbol;
|
|
142
|
+
declare const PUSH_SCOPE_ID: unique symbol;
|
|
143
|
+
declare const POP_SCOPE_ID: unique symbol;
|
|
144
|
+
declare const WITH_CTX: unique symbol;
|
|
145
|
+
declare const UNREF: unique symbol;
|
|
146
|
+
declare const IS_REF: unique symbol;
|
|
147
|
+
declare const WITH_MEMO: unique symbol;
|
|
148
|
+
declare const IS_MEMO_SAME: unique symbol;
|
|
149
|
+
declare const helperNameMap: Record<symbol, string>;
|
|
150
|
+
declare function registerRuntimeHelpers(helpers: Record<symbol, string>): void;
|
|
151
|
+
|
|
152
|
+
declare const transformElement: NodeTransform;
|
|
153
|
+
declare function resolveComponentType(node: ComponentNode, context: TransformContext, ssr?: boolean): string | symbol | CallExpression;
|
|
154
|
+
export type PropsExpression = ObjectExpression | CallExpression | ExpressionNode;
|
|
155
|
+
declare function buildProps(node: ElementNode, context: TransformContext, props: (DirectiveNode | AttributeNode)[] | undefined, isComponent: boolean, isDynamicComponent: boolean, ssr?: boolean): {
|
|
156
|
+
props: PropsExpression | undefined;
|
|
157
|
+
directives: DirectiveNode[];
|
|
158
|
+
patchFlag: number;
|
|
159
|
+
dynamicPropNames: string[];
|
|
160
|
+
shouldUseBlock: boolean;
|
|
161
|
+
};
|
|
162
|
+
declare function buildDirectiveArgs(dir: DirectiveNode, context: TransformContext): ArrayExpression;
|
|
163
|
+
|
|
164
|
+
export type Namespace = number;
|
|
165
|
+
declare const enum Namespaces {
|
|
166
|
+
HTML = 0
|
|
167
|
+
}
|
|
168
|
+
declare const enum NodeTypes {
|
|
169
|
+
ROOT = 0,
|
|
170
|
+
ELEMENT = 1,
|
|
171
|
+
TEXT = 2,
|
|
172
|
+
COMMENT = 3,
|
|
173
|
+
SIMPLE_EXPRESSION = 4,
|
|
174
|
+
INTERPOLATION = 5,
|
|
175
|
+
ATTRIBUTE = 6,
|
|
176
|
+
DIRECTIVE = 7,
|
|
177
|
+
COMPOUND_EXPRESSION = 8,
|
|
178
|
+
IF = 9,
|
|
179
|
+
IF_BRANCH = 10,
|
|
180
|
+
FOR = 11,
|
|
181
|
+
TEXT_CALL = 12,
|
|
182
|
+
VNODE_CALL = 13,
|
|
183
|
+
JS_CALL_EXPRESSION = 14,
|
|
184
|
+
JS_OBJECT_EXPRESSION = 15,
|
|
185
|
+
JS_PROPERTY = 16,
|
|
186
|
+
JS_ARRAY_EXPRESSION = 17,
|
|
187
|
+
JS_FUNCTION_EXPRESSION = 18,
|
|
188
|
+
JS_CONDITIONAL_EXPRESSION = 19,
|
|
189
|
+
JS_CACHE_EXPRESSION = 20,
|
|
190
|
+
JS_BLOCK_STATEMENT = 21,
|
|
191
|
+
JS_TEMPLATE_LITERAL = 22,
|
|
192
|
+
JS_IF_STATEMENT = 23,
|
|
193
|
+
JS_ASSIGNMENT_EXPRESSION = 24,
|
|
194
|
+
JS_SEQUENCE_EXPRESSION = 25,
|
|
195
|
+
JS_RETURN_STATEMENT = 26
|
|
196
|
+
}
|
|
197
|
+
declare const enum ElementTypes {
|
|
198
|
+
ELEMENT = 0,
|
|
199
|
+
COMPONENT = 1,
|
|
200
|
+
SLOT = 2,
|
|
201
|
+
TEMPLATE = 3
|
|
202
|
+
}
|
|
203
|
+
export interface Node {
|
|
204
|
+
type: NodeTypes;
|
|
205
|
+
loc: SourceLocation;
|
|
206
|
+
}
|
|
207
|
+
export interface SourceLocation {
|
|
208
|
+
start: Position;
|
|
209
|
+
end: Position;
|
|
210
|
+
source: string;
|
|
211
|
+
}
|
|
212
|
+
export interface Position {
|
|
213
|
+
offset: number;
|
|
214
|
+
line: number;
|
|
215
|
+
column: number;
|
|
216
|
+
}
|
|
217
|
+
export type ParentNode = RootNode | ElementNode | IfBranchNode | ForNode;
|
|
218
|
+
export type ExpressionNode = SimpleExpressionNode | CompoundExpressionNode;
|
|
219
|
+
export type TemplateChildNode = ElementNode | InterpolationNode | CompoundExpressionNode | TextNode | CommentNode | IfNode | IfBranchNode | ForNode | TextCallNode;
|
|
220
|
+
export interface RootNode extends Node {
|
|
221
|
+
type: NodeTypes.ROOT;
|
|
222
|
+
children: TemplateChildNode[];
|
|
223
|
+
helpers: Set<symbol>;
|
|
224
|
+
components: string[];
|
|
225
|
+
directives: string[];
|
|
226
|
+
hoists: (JSChildNode | null)[];
|
|
227
|
+
imports: ImportItem[];
|
|
228
|
+
cached: number;
|
|
229
|
+
temps: number;
|
|
230
|
+
ssrHelpers?: symbol[];
|
|
231
|
+
codegenNode?: TemplateChildNode | JSChildNode | BlockStatement;
|
|
232
|
+
filters?: string[];
|
|
233
|
+
}
|
|
234
|
+
export type ElementNode = PlainElementNode | ComponentNode | SlotOutletNode | TemplateNode;
|
|
235
|
+
export interface BaseElementNode extends Node {
|
|
236
|
+
type: NodeTypes.ELEMENT;
|
|
237
|
+
ns: Namespace;
|
|
238
|
+
tag: string;
|
|
239
|
+
tagType: ElementTypes;
|
|
240
|
+
isSelfClosing: boolean;
|
|
241
|
+
props: Array<AttributeNode | DirectiveNode>;
|
|
242
|
+
children: TemplateChildNode[];
|
|
243
|
+
}
|
|
244
|
+
export interface PlainElementNode extends BaseElementNode {
|
|
245
|
+
tagType: ElementTypes.ELEMENT;
|
|
246
|
+
codegenNode: VNodeCall | SimpleExpressionNode | CacheExpression | MemoExpression | undefined;
|
|
247
|
+
ssrCodegenNode?: TemplateLiteral;
|
|
248
|
+
}
|
|
249
|
+
export interface ComponentNode extends BaseElementNode {
|
|
250
|
+
tagType: ElementTypes.COMPONENT;
|
|
251
|
+
codegenNode: VNodeCall | CacheExpression | MemoExpression | undefined;
|
|
252
|
+
ssrCodegenNode?: CallExpression;
|
|
253
|
+
}
|
|
254
|
+
export interface SlotOutletNode extends BaseElementNode {
|
|
255
|
+
tagType: ElementTypes.SLOT;
|
|
256
|
+
codegenNode: RenderSlotCall | CacheExpression | undefined;
|
|
257
|
+
ssrCodegenNode?: CallExpression;
|
|
258
|
+
}
|
|
259
|
+
export interface TemplateNode extends BaseElementNode {
|
|
260
|
+
tagType: ElementTypes.TEMPLATE;
|
|
261
|
+
codegenNode: undefined;
|
|
262
|
+
}
|
|
263
|
+
export interface TextNode extends Node {
|
|
264
|
+
type: NodeTypes.TEXT;
|
|
265
|
+
content: string;
|
|
266
|
+
}
|
|
267
|
+
export interface CommentNode extends Node {
|
|
268
|
+
type: NodeTypes.COMMENT;
|
|
269
|
+
content: string;
|
|
270
|
+
}
|
|
271
|
+
export interface AttributeNode extends Node {
|
|
272
|
+
type: NodeTypes.ATTRIBUTE;
|
|
273
|
+
name: string;
|
|
274
|
+
value: TextNode | undefined;
|
|
275
|
+
}
|
|
276
|
+
export interface DirectiveNode extends Node {
|
|
277
|
+
type: NodeTypes.DIRECTIVE;
|
|
278
|
+
name: string;
|
|
279
|
+
exp: ExpressionNode | undefined;
|
|
280
|
+
arg: ExpressionNode | undefined;
|
|
281
|
+
modifiers: string[];
|
|
282
|
+
/**
|
|
283
|
+
* optional property to cache the expression parse result for v-for
|
|
284
|
+
*/
|
|
285
|
+
parseResult?: ForParseResult;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Static types have several levels.
|
|
289
|
+
* Higher levels implies lower levels. e.g. a node that can be stringified
|
|
290
|
+
* can always be hoisted and skipped for patch.
|
|
291
|
+
*/
|
|
292
|
+
declare const enum ConstantTypes {
|
|
293
|
+
NOT_CONSTANT = 0,
|
|
294
|
+
CAN_SKIP_PATCH = 1,
|
|
295
|
+
CAN_HOIST = 2,
|
|
296
|
+
CAN_STRINGIFY = 3
|
|
297
|
+
}
|
|
298
|
+
export interface SimpleExpressionNode extends Node {
|
|
299
|
+
type: NodeTypes.SIMPLE_EXPRESSION;
|
|
300
|
+
content: string;
|
|
301
|
+
isStatic: boolean;
|
|
302
|
+
constType: ConstantTypes;
|
|
303
|
+
/**
|
|
304
|
+
* Indicates this is an identifier for a hoist vnode call and points to the
|
|
305
|
+
* hoisted node.
|
|
306
|
+
*/
|
|
307
|
+
hoisted?: JSChildNode;
|
|
308
|
+
/**
|
|
309
|
+
* an expression parsed as the params of a function will track
|
|
310
|
+
* the identifiers declared inside the function body.
|
|
311
|
+
*/
|
|
312
|
+
identifiers?: string[];
|
|
313
|
+
isHandlerKey?: boolean;
|
|
314
|
+
}
|
|
315
|
+
export interface InterpolationNode extends Node {
|
|
316
|
+
type: NodeTypes.INTERPOLATION;
|
|
317
|
+
content: ExpressionNode;
|
|
318
|
+
}
|
|
319
|
+
export interface CompoundExpressionNode extends Node {
|
|
320
|
+
type: NodeTypes.COMPOUND_EXPRESSION;
|
|
321
|
+
children: (SimpleExpressionNode | CompoundExpressionNode | InterpolationNode | TextNode | string | symbol)[];
|
|
322
|
+
/**
|
|
323
|
+
* an expression parsed as the params of a function will track
|
|
324
|
+
* the identifiers declared inside the function body.
|
|
325
|
+
*/
|
|
326
|
+
identifiers?: string[];
|
|
327
|
+
isHandlerKey?: boolean;
|
|
328
|
+
}
|
|
329
|
+
export interface IfNode extends Node {
|
|
330
|
+
type: NodeTypes.IF;
|
|
331
|
+
branches: IfBranchNode[];
|
|
332
|
+
codegenNode?: IfConditionalExpression | CacheExpression;
|
|
333
|
+
}
|
|
334
|
+
export interface IfBranchNode extends Node {
|
|
335
|
+
type: NodeTypes.IF_BRANCH;
|
|
336
|
+
condition: ExpressionNode | undefined;
|
|
337
|
+
children: TemplateChildNode[];
|
|
338
|
+
userKey?: AttributeNode | DirectiveNode;
|
|
339
|
+
isTemplateIf?: boolean;
|
|
340
|
+
}
|
|
341
|
+
export interface ForNode extends Node {
|
|
342
|
+
type: NodeTypes.FOR;
|
|
343
|
+
source: ExpressionNode;
|
|
344
|
+
valueAlias: ExpressionNode | undefined;
|
|
345
|
+
keyAlias: ExpressionNode | undefined;
|
|
346
|
+
objectIndexAlias: ExpressionNode | undefined;
|
|
347
|
+
parseResult: ForParseResult;
|
|
348
|
+
children: TemplateChildNode[];
|
|
349
|
+
codegenNode?: ForCodegenNode;
|
|
350
|
+
}
|
|
351
|
+
export interface TextCallNode extends Node {
|
|
352
|
+
type: NodeTypes.TEXT_CALL;
|
|
353
|
+
content: TextNode | InterpolationNode | CompoundExpressionNode;
|
|
354
|
+
codegenNode: CallExpression | SimpleExpressionNode;
|
|
355
|
+
}
|
|
356
|
+
export type TemplateTextChildNode = TextNode | InterpolationNode | CompoundExpressionNode;
|
|
357
|
+
export interface VNodeCall extends Node {
|
|
358
|
+
type: NodeTypes.VNODE_CALL;
|
|
359
|
+
tag: string | symbol | CallExpression;
|
|
360
|
+
props: PropsExpression | undefined;
|
|
361
|
+
children: TemplateChildNode[] | TemplateTextChildNode | SlotsExpression | ForRenderListExpression | SimpleExpressionNode | undefined;
|
|
362
|
+
patchFlag: string | undefined;
|
|
363
|
+
dynamicProps: string | SimpleExpressionNode | undefined;
|
|
364
|
+
directives: DirectiveArguments | undefined;
|
|
365
|
+
isBlock: boolean;
|
|
366
|
+
disableTracking: boolean;
|
|
367
|
+
isComponent: boolean;
|
|
368
|
+
}
|
|
369
|
+
export type JSChildNode = VNodeCall | CallExpression | ObjectExpression | ArrayExpression | ExpressionNode | FunctionExpression | ConditionalExpression | CacheExpression | AssignmentExpression | SequenceExpression;
|
|
370
|
+
export interface CallExpression extends Node {
|
|
371
|
+
type: NodeTypes.JS_CALL_EXPRESSION;
|
|
372
|
+
callee: string | symbol;
|
|
373
|
+
arguments: (string | symbol | JSChildNode | SSRCodegenNode | TemplateChildNode | TemplateChildNode[])[];
|
|
374
|
+
}
|
|
375
|
+
export interface ObjectExpression extends Node {
|
|
376
|
+
type: NodeTypes.JS_OBJECT_EXPRESSION;
|
|
377
|
+
properties: Array<Property>;
|
|
378
|
+
}
|
|
379
|
+
export interface Property extends Node {
|
|
380
|
+
type: NodeTypes.JS_PROPERTY;
|
|
381
|
+
key: ExpressionNode;
|
|
382
|
+
value: JSChildNode;
|
|
383
|
+
}
|
|
384
|
+
export interface ArrayExpression extends Node {
|
|
385
|
+
type: NodeTypes.JS_ARRAY_EXPRESSION;
|
|
386
|
+
elements: Array<string | Node>;
|
|
387
|
+
}
|
|
388
|
+
export interface FunctionExpression extends Node {
|
|
389
|
+
type: NodeTypes.JS_FUNCTION_EXPRESSION;
|
|
390
|
+
params: ExpressionNode | string | (ExpressionNode | string)[] | undefined;
|
|
391
|
+
returns?: TemplateChildNode | TemplateChildNode[] | JSChildNode;
|
|
392
|
+
body?: BlockStatement | IfStatement;
|
|
393
|
+
newline: boolean;
|
|
394
|
+
/**
|
|
395
|
+
* This flag is for codegen to determine whether it needs to generate the
|
|
396
|
+
* withScopeId() wrapper
|
|
397
|
+
*/
|
|
398
|
+
isSlot: boolean;
|
|
399
|
+
/**
|
|
400
|
+
* __COMPAT__ only, indicates a slot function that should be excluded from
|
|
401
|
+
* the legacy $scopedSlots instance property.
|
|
402
|
+
*/
|
|
403
|
+
isNonScopedSlot?: boolean;
|
|
404
|
+
}
|
|
405
|
+
export interface ConditionalExpression extends Node {
|
|
406
|
+
type: NodeTypes.JS_CONDITIONAL_EXPRESSION;
|
|
407
|
+
test: JSChildNode;
|
|
408
|
+
consequent: JSChildNode;
|
|
409
|
+
alternate: JSChildNode;
|
|
410
|
+
newline: boolean;
|
|
411
|
+
}
|
|
412
|
+
export interface CacheExpression extends Node {
|
|
413
|
+
type: NodeTypes.JS_CACHE_EXPRESSION;
|
|
414
|
+
index: number;
|
|
415
|
+
value: JSChildNode;
|
|
416
|
+
isVNode: boolean;
|
|
417
|
+
}
|
|
418
|
+
export interface MemoExpression extends CallExpression {
|
|
419
|
+
callee: typeof WITH_MEMO;
|
|
420
|
+
arguments: [ExpressionNode, MemoFactory, string, string];
|
|
421
|
+
}
|
|
422
|
+
export interface MemoFactory extends FunctionExpression {
|
|
423
|
+
returns: BlockCodegenNode;
|
|
424
|
+
}
|
|
425
|
+
export type SSRCodegenNode = BlockStatement | TemplateLiteral | IfStatement | AssignmentExpression | ReturnStatement | SequenceExpression;
|
|
426
|
+
export interface BlockStatement extends Node {
|
|
427
|
+
type: NodeTypes.JS_BLOCK_STATEMENT;
|
|
428
|
+
body: (JSChildNode | IfStatement)[];
|
|
429
|
+
}
|
|
430
|
+
export interface TemplateLiteral extends Node {
|
|
431
|
+
type: NodeTypes.JS_TEMPLATE_LITERAL;
|
|
432
|
+
elements: (string | JSChildNode)[];
|
|
433
|
+
}
|
|
434
|
+
export interface IfStatement extends Node {
|
|
435
|
+
type: NodeTypes.JS_IF_STATEMENT;
|
|
436
|
+
test: ExpressionNode;
|
|
437
|
+
consequent: BlockStatement;
|
|
438
|
+
alternate: IfStatement | BlockStatement | ReturnStatement | undefined;
|
|
439
|
+
}
|
|
440
|
+
export interface AssignmentExpression extends Node {
|
|
441
|
+
type: NodeTypes.JS_ASSIGNMENT_EXPRESSION;
|
|
442
|
+
left: SimpleExpressionNode;
|
|
443
|
+
right: JSChildNode;
|
|
444
|
+
}
|
|
445
|
+
export interface SequenceExpression extends Node {
|
|
446
|
+
type: NodeTypes.JS_SEQUENCE_EXPRESSION;
|
|
447
|
+
expressions: JSChildNode[];
|
|
448
|
+
}
|
|
449
|
+
export interface ReturnStatement extends Node {
|
|
450
|
+
type: NodeTypes.JS_RETURN_STATEMENT;
|
|
451
|
+
returns: TemplateChildNode | TemplateChildNode[] | JSChildNode;
|
|
452
|
+
}
|
|
453
|
+
export interface DirectiveArguments extends ArrayExpression {
|
|
454
|
+
elements: DirectiveArgumentNode[];
|
|
455
|
+
}
|
|
456
|
+
export interface DirectiveArgumentNode extends ArrayExpression {
|
|
457
|
+
elements: [string] | [string, ExpressionNode] | [string, ExpressionNode, ExpressionNode] | [string, ExpressionNode, ExpressionNode, ObjectExpression];
|
|
458
|
+
}
|
|
459
|
+
export interface RenderSlotCall extends CallExpression {
|
|
460
|
+
callee: typeof RENDER_SLOT;
|
|
461
|
+
arguments: [string, string | ExpressionNode] | [string, string | ExpressionNode, PropsExpression] | [
|
|
462
|
+
string,
|
|
463
|
+
string | ExpressionNode,
|
|
464
|
+
PropsExpression | '{}',
|
|
465
|
+
TemplateChildNode[]
|
|
466
|
+
];
|
|
467
|
+
}
|
|
468
|
+
export type SlotsExpression = SlotsObjectExpression | DynamicSlotsExpression;
|
|
469
|
+
export interface SlotsObjectExpression extends ObjectExpression {
|
|
470
|
+
properties: SlotsObjectProperty[];
|
|
471
|
+
}
|
|
472
|
+
export interface SlotsObjectProperty extends Property {
|
|
473
|
+
value: SlotFunctionExpression;
|
|
474
|
+
}
|
|
475
|
+
export interface SlotFunctionExpression extends FunctionExpression {
|
|
476
|
+
returns: TemplateChildNode[];
|
|
477
|
+
}
|
|
478
|
+
export interface DynamicSlotsExpression extends CallExpression {
|
|
479
|
+
callee: typeof CREATE_SLOTS;
|
|
480
|
+
arguments: [SlotsObjectExpression, DynamicSlotEntries];
|
|
481
|
+
}
|
|
482
|
+
export interface DynamicSlotEntries extends ArrayExpression {
|
|
483
|
+
elements: (ConditionalDynamicSlotNode | ListDynamicSlotNode)[];
|
|
484
|
+
}
|
|
485
|
+
export interface ConditionalDynamicSlotNode extends ConditionalExpression {
|
|
486
|
+
consequent: DynamicSlotNode;
|
|
487
|
+
alternate: DynamicSlotNode | SimpleExpressionNode;
|
|
488
|
+
}
|
|
489
|
+
export interface ListDynamicSlotNode extends CallExpression {
|
|
490
|
+
callee: typeof RENDER_LIST;
|
|
491
|
+
arguments: [ExpressionNode, ListDynamicSlotIterator];
|
|
492
|
+
}
|
|
493
|
+
export interface ListDynamicSlotIterator extends FunctionExpression {
|
|
494
|
+
returns: DynamicSlotNode;
|
|
495
|
+
}
|
|
496
|
+
export interface DynamicSlotNode extends ObjectExpression {
|
|
497
|
+
properties: [Property, DynamicSlotFnProperty];
|
|
498
|
+
}
|
|
499
|
+
export interface DynamicSlotFnProperty extends Property {
|
|
500
|
+
value: SlotFunctionExpression;
|
|
501
|
+
}
|
|
502
|
+
export type BlockCodegenNode = VNodeCall | RenderSlotCall;
|
|
503
|
+
export interface IfConditionalExpression extends ConditionalExpression {
|
|
504
|
+
consequent: BlockCodegenNode | MemoExpression;
|
|
505
|
+
alternate: BlockCodegenNode | IfConditionalExpression | MemoExpression;
|
|
506
|
+
}
|
|
507
|
+
export interface ForCodegenNode extends VNodeCall {
|
|
508
|
+
isBlock: true;
|
|
509
|
+
tag: typeof FRAGMENT;
|
|
510
|
+
props: undefined;
|
|
511
|
+
children: ForRenderListExpression;
|
|
512
|
+
patchFlag: string;
|
|
513
|
+
disableTracking: boolean;
|
|
514
|
+
}
|
|
515
|
+
export interface ForRenderListExpression extends CallExpression {
|
|
516
|
+
callee: typeof RENDER_LIST;
|
|
517
|
+
arguments: [ExpressionNode, ForIteratorExpression];
|
|
518
|
+
}
|
|
519
|
+
export interface ForIteratorExpression extends FunctionExpression {
|
|
520
|
+
returns: BlockCodegenNode;
|
|
521
|
+
}
|
|
522
|
+
declare const locStub: SourceLocation;
|
|
523
|
+
declare function createRoot(children: TemplateChildNode[], loc?: SourceLocation): RootNode;
|
|
524
|
+
declare function createVNodeCall(context: TransformContext | null, tag: VNodeCall['tag'], props?: VNodeCall['props'], children?: VNodeCall['children'], patchFlag?: VNodeCall['patchFlag'], dynamicProps?: VNodeCall['dynamicProps'], directives?: VNodeCall['directives'], isBlock?: VNodeCall['isBlock'], disableTracking?: VNodeCall['disableTracking'], isComponent?: VNodeCall['isComponent'], loc?: SourceLocation): VNodeCall;
|
|
525
|
+
declare function createArrayExpression(elements: ArrayExpression['elements'], loc?: SourceLocation): ArrayExpression;
|
|
526
|
+
declare function createObjectExpression(properties: ObjectExpression['properties'], loc?: SourceLocation): ObjectExpression;
|
|
527
|
+
declare function createObjectProperty(key: Property['key'] | string, value: Property['value']): Property;
|
|
528
|
+
declare function createSimpleExpression(content: SimpleExpressionNode['content'], isStatic?: SimpleExpressionNode['isStatic'], loc?: SourceLocation, constType?: ConstantTypes): SimpleExpressionNode;
|
|
529
|
+
declare function createInterpolation(content: InterpolationNode['content'] | string, loc: SourceLocation): InterpolationNode;
|
|
530
|
+
declare function createCompoundExpression(children: CompoundExpressionNode['children'], loc?: SourceLocation): CompoundExpressionNode;
|
|
531
|
+
export type InferCodegenNodeType<T> = T extends typeof RENDER_SLOT ? RenderSlotCall : CallExpression;
|
|
532
|
+
declare function createCallExpression<T extends CallExpression['callee']>(callee: T, args?: CallExpression['arguments'], loc?: SourceLocation): InferCodegenNodeType<T>;
|
|
533
|
+
declare function createFunctionExpression(params: FunctionExpression['params'], returns?: FunctionExpression['returns'], newline?: boolean, isSlot?: boolean, loc?: SourceLocation): FunctionExpression;
|
|
534
|
+
declare function createConditionalExpression(test: ConditionalExpression['test'], consequent: ConditionalExpression['consequent'], alternate: ConditionalExpression['alternate'], newline?: boolean): ConditionalExpression;
|
|
535
|
+
declare function createCacheExpression(index: number, value: JSChildNode, isVNode?: boolean): CacheExpression;
|
|
536
|
+
declare function createBlockStatement(body: BlockStatement['body']): BlockStatement;
|
|
537
|
+
declare function createTemplateLiteral(elements: TemplateLiteral['elements']): TemplateLiteral;
|
|
538
|
+
declare function createIfStatement(test: IfStatement['test'], consequent: IfStatement['consequent'], alternate?: IfStatement['alternate']): IfStatement;
|
|
539
|
+
declare function createAssignmentExpression(left: AssignmentExpression['left'], right: AssignmentExpression['right']): AssignmentExpression;
|
|
540
|
+
declare function createSequenceExpression(expressions: SequenceExpression['expressions']): SequenceExpression;
|
|
541
|
+
declare function createReturnStatement(returns: ReturnStatement['returns']): ReturnStatement;
|
|
542
|
+
|
|
543
|
+
export interface CompilerError extends SyntaxError {
|
|
544
|
+
code: number | string;
|
|
545
|
+
loc?: SourceLocation;
|
|
546
|
+
}
|
|
547
|
+
export interface CoreCompilerError extends CompilerError {
|
|
548
|
+
code: ErrorCodes;
|
|
549
|
+
}
|
|
550
|
+
export type InferCompilerError<T> = T extends ErrorCodes ? CoreCompilerError : CompilerError;
|
|
551
|
+
declare function createCompilerError<T extends number>(code: T, loc?: SourceLocation, messages?: {
|
|
552
|
+
[code: number]: string;
|
|
553
|
+
}, additionalMessage?: string): InferCompilerError<T>;
|
|
554
|
+
declare const enum ErrorCodes {
|
|
555
|
+
ABRUPT_CLOSING_OF_EMPTY_COMMENT = 0,
|
|
556
|
+
CDATA_IN_HTML_CONTENT = 1,
|
|
557
|
+
DUPLICATE_ATTRIBUTE = 2,
|
|
558
|
+
END_TAG_WITH_ATTRIBUTES = 3,
|
|
559
|
+
END_TAG_WITH_TRAILING_SOLIDUS = 4,
|
|
560
|
+
EOF_BEFORE_TAG_NAME = 5,
|
|
561
|
+
EOF_IN_CDATA = 6,
|
|
562
|
+
EOF_IN_COMMENT = 7,
|
|
563
|
+
EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT = 8,
|
|
564
|
+
EOF_IN_TAG = 9,
|
|
565
|
+
INCORRECTLY_CLOSED_COMMENT = 10,
|
|
566
|
+
INCORRECTLY_OPENED_COMMENT = 11,
|
|
567
|
+
INVALID_FIRST_CHARACTER_OF_TAG_NAME = 12,
|
|
568
|
+
MISSING_ATTRIBUTE_VALUE = 13,
|
|
569
|
+
MISSING_END_TAG_NAME = 14,
|
|
570
|
+
MISSING_WHITESPACE_BETWEEN_ATTRIBUTES = 15,
|
|
571
|
+
NESTED_COMMENT = 16,
|
|
572
|
+
UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME = 17,
|
|
573
|
+
UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE = 18,
|
|
574
|
+
UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME = 19,
|
|
575
|
+
UNEXPECTED_NULL_CHARACTER = 20,
|
|
576
|
+
UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME = 21,
|
|
577
|
+
UNEXPECTED_SOLIDUS_IN_TAG = 22,
|
|
578
|
+
X_INVALID_END_TAG = 23,
|
|
579
|
+
X_MISSING_END_TAG = 24,
|
|
580
|
+
X_MISSING_INTERPOLATION_END = 25,
|
|
581
|
+
X_MISSING_DIRECTIVE_NAME = 26,
|
|
582
|
+
X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END = 27,
|
|
583
|
+
X_V_IF_NO_EXPRESSION = 28,
|
|
584
|
+
X_V_IF_SAME_KEY = 29,
|
|
585
|
+
X_V_ELSE_NO_ADJACENT_IF = 30,
|
|
586
|
+
X_V_FOR_NO_EXPRESSION = 31,
|
|
587
|
+
X_V_FOR_MALFORMED_EXPRESSION = 32,
|
|
588
|
+
X_V_FOR_TEMPLATE_KEY_PLACEMENT = 33,
|
|
589
|
+
X_V_BIND_NO_EXPRESSION = 34,
|
|
590
|
+
X_V_ON_NO_EXPRESSION = 35,
|
|
591
|
+
X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET = 36,
|
|
592
|
+
X_V_SLOT_MIXED_SLOT_USAGE = 37,
|
|
593
|
+
X_V_SLOT_DUPLICATE_SLOT_NAMES = 38,
|
|
594
|
+
X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN = 39,
|
|
595
|
+
X_V_SLOT_MISPLACED = 40,
|
|
596
|
+
X_V_MODEL_NO_EXPRESSION = 41,
|
|
597
|
+
X_V_MODEL_MALFORMED_EXPRESSION = 42,
|
|
598
|
+
X_V_MODEL_ON_SCOPE_VARIABLE = 43,
|
|
599
|
+
X_V_MODEL_ON_PROPS = 44,
|
|
600
|
+
X_INVALID_EXPRESSION = 45,
|
|
601
|
+
X_KEEP_ALIVE_INVALID_CHILDREN = 46,
|
|
602
|
+
X_PREFIX_ID_NOT_SUPPORTED = 47,
|
|
603
|
+
X_MODULE_MODE_NOT_SUPPORTED = 48,
|
|
604
|
+
X_CACHE_HANDLER_NOT_SUPPORTED = 49,
|
|
605
|
+
X_SCOPE_ID_NOT_SUPPORTED = 50,
|
|
606
|
+
__EXTEND_POINT__ = 51
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
export interface ErrorHandlingOptions {
|
|
610
|
+
onWarn?: (warning: CompilerError) => void;
|
|
611
|
+
onError?: (error: CompilerError) => void;
|
|
612
|
+
}
|
|
613
|
+
export interface ParserOptions extends ErrorHandlingOptions, CompilerCompatOptions {
|
|
614
|
+
/**
|
|
615
|
+
* e.g. platform native elements, e.g. `<div>` for browsers
|
|
616
|
+
*/
|
|
617
|
+
isNativeTag?: (tag: string) => boolean;
|
|
618
|
+
/**
|
|
619
|
+
* e.g. native elements that can self-close, e.g. `<img>`, `<br>`, `<hr>`
|
|
620
|
+
*/
|
|
621
|
+
isVoidTag?: (tag: string) => boolean;
|
|
622
|
+
/**
|
|
623
|
+
* e.g. elements that should preserve whitespace inside, e.g. `<pre>`
|
|
624
|
+
*/
|
|
625
|
+
isPreTag?: (tag: string) => boolean;
|
|
626
|
+
/**
|
|
627
|
+
* Platform-specific built-in components e.g. `<Transition>`
|
|
628
|
+
*/
|
|
629
|
+
isBuiltInComponent?: (tag: string) => symbol | void;
|
|
630
|
+
/**
|
|
631
|
+
* Separate option for end users to extend the native elements list
|
|
632
|
+
*/
|
|
633
|
+
isCustomElement?: (tag: string) => boolean | void;
|
|
634
|
+
/**
|
|
635
|
+
* Get tag namespace
|
|
636
|
+
*/
|
|
637
|
+
getNamespace?: (tag: string, parent: ElementNode | undefined) => Namespace;
|
|
638
|
+
/**
|
|
639
|
+
* Get text parsing mode for this element
|
|
640
|
+
*/
|
|
641
|
+
getTextMode?: (node: ElementNode, parent: ElementNode | undefined) => TextModes;
|
|
642
|
+
/**
|
|
643
|
+
* @default ['{{', '}}']
|
|
644
|
+
*/
|
|
645
|
+
delimiters?: [string, string];
|
|
646
|
+
/**
|
|
647
|
+
* Whitespace handling strategy
|
|
648
|
+
*/
|
|
649
|
+
whitespace?: 'preserve' | 'condense';
|
|
650
|
+
/**
|
|
651
|
+
* Only needed for DOM compilers
|
|
652
|
+
*/
|
|
653
|
+
decodeEntities?: (rawText: string, asAttr: boolean) => string;
|
|
654
|
+
/**
|
|
655
|
+
* Whether to keep comments in the templates AST.
|
|
656
|
+
* This defaults to `true` in development and `false` in production builds.
|
|
657
|
+
*/
|
|
658
|
+
comments?: boolean;
|
|
659
|
+
}
|
|
660
|
+
export type HoistTransform = (children: TemplateChildNode[], context: TransformContext, parent: ParentNode) => void;
|
|
661
|
+
declare const enum BindingTypes {
|
|
662
|
+
/**
|
|
663
|
+
* returned from data()
|
|
664
|
+
*/
|
|
665
|
+
DATA = "data",
|
|
666
|
+
/**
|
|
667
|
+
* declared as a prop
|
|
668
|
+
*/
|
|
669
|
+
PROPS = "props",
|
|
670
|
+
/**
|
|
671
|
+
* a local alias of a `<script setup>` destructured prop.
|
|
672
|
+
* the original is stored in __propsAliases of the bindingMetadata object.
|
|
673
|
+
*/
|
|
674
|
+
PROPS_ALIASED = "props-aliased",
|
|
675
|
+
/**
|
|
676
|
+
* a let binding (may or may not be a ref)
|
|
677
|
+
*/
|
|
678
|
+
SETUP_LET = "setup-let",
|
|
679
|
+
/**
|
|
680
|
+
* a const binding that can never be a ref.
|
|
681
|
+
* these bindings don't need `unref()` calls when processed in inlined
|
|
682
|
+
* template expressions.
|
|
683
|
+
*/
|
|
684
|
+
SETUP_CONST = "setup-const",
|
|
685
|
+
/**
|
|
686
|
+
* a const binding that does not need `unref()`, but may be mutated.
|
|
687
|
+
*/
|
|
688
|
+
SETUP_REACTIVE_CONST = "setup-reactive-const",
|
|
689
|
+
/**
|
|
690
|
+
* a const binding that may be a ref.
|
|
691
|
+
*/
|
|
692
|
+
SETUP_MAYBE_REF = "setup-maybe-ref",
|
|
693
|
+
/**
|
|
694
|
+
* bindings that are guaranteed to be refs
|
|
695
|
+
*/
|
|
696
|
+
SETUP_REF = "setup-ref",
|
|
697
|
+
/**
|
|
698
|
+
* declared by other options, e.g. computed, inject
|
|
699
|
+
*/
|
|
700
|
+
OPTIONS = "options"
|
|
701
|
+
}
|
|
702
|
+
export type BindingMetadata = {
|
|
703
|
+
[key: string]: BindingTypes | undefined;
|
|
704
|
+
} & {
|
|
705
|
+
__isScriptSetup?: boolean;
|
|
706
|
+
__propsAliases?: Record<string, string>;
|
|
707
|
+
};
|
|
708
|
+
export interface SharedTransformCodegenOptions {
|
|
709
|
+
/**
|
|
710
|
+
* Transform expressions like {{ foo }} to `_ctx.foo`.
|
|
711
|
+
* If this option is false, the generated code will be wrapped in a
|
|
712
|
+
* `with (this) { ... }` block.
|
|
713
|
+
* - This is force-enabled in module mode, since modules are by default strict
|
|
714
|
+
* and cannot use `with`
|
|
715
|
+
* @default mode === 'module'
|
|
716
|
+
*/
|
|
717
|
+
prefixIdentifiers?: boolean;
|
|
718
|
+
/**
|
|
719
|
+
* Control whether generate SSR-optimized render functions instead.
|
|
720
|
+
* The resulting function must be attached to the component via the
|
|
721
|
+
* `ssrRender` option instead of `render`.
|
|
722
|
+
*
|
|
723
|
+
* When compiler generates code for SSR's fallback branch, we need to set it to false:
|
|
724
|
+
* - context.ssr = false
|
|
725
|
+
*
|
|
726
|
+
* see `subTransform` in `ssrTransformComponent.ts`
|
|
727
|
+
*/
|
|
728
|
+
ssr?: boolean;
|
|
729
|
+
/**
|
|
730
|
+
* Indicates whether the compiler generates code for SSR,
|
|
731
|
+
* it is always true when generating code for SSR,
|
|
732
|
+
* regardless of whether we are generating code for SSR's fallback branch,
|
|
733
|
+
* this means that when the compiler generates code for SSR's fallback branch:
|
|
734
|
+
* - context.ssr = false
|
|
735
|
+
* - context.inSSR = true
|
|
736
|
+
*/
|
|
737
|
+
inSSR?: boolean;
|
|
738
|
+
/**
|
|
739
|
+
* Optional binding metadata analyzed from script - used to optimize
|
|
740
|
+
* binding access when `prefixIdentifiers` is enabled.
|
|
741
|
+
*/
|
|
742
|
+
bindingMetadata?: BindingMetadata;
|
|
743
|
+
/**
|
|
744
|
+
* Compile the function for inlining inside setup().
|
|
745
|
+
* This allows the function to directly access setup() local bindings.
|
|
746
|
+
*/
|
|
747
|
+
inline?: boolean;
|
|
748
|
+
/**
|
|
749
|
+
* Indicates that transforms and codegen should try to output valid TS code
|
|
750
|
+
*/
|
|
751
|
+
isTS?: boolean;
|
|
752
|
+
/**
|
|
753
|
+
* Filename for source map generation.
|
|
754
|
+
* Also used for self-recursive reference in templates
|
|
755
|
+
* @default 'template.vue.html'
|
|
756
|
+
*/
|
|
757
|
+
filename?: string;
|
|
758
|
+
}
|
|
759
|
+
export interface TransformOptions extends SharedTransformCodegenOptions, ErrorHandlingOptions, CompilerCompatOptions {
|
|
760
|
+
/**
|
|
761
|
+
* An array of node transforms to be applied to every AST node.
|
|
762
|
+
*/
|
|
763
|
+
nodeTransforms?: NodeTransform[];
|
|
764
|
+
/**
|
|
765
|
+
* An object of { name: transform } to be applied to every directive attribute
|
|
766
|
+
* node found on element nodes.
|
|
767
|
+
*/
|
|
768
|
+
directiveTransforms?: Record<string, DirectiveTransform | undefined>;
|
|
769
|
+
/**
|
|
770
|
+
* An optional hook to transform a node being hoisted.
|
|
771
|
+
* used by compiler-dom to turn hoisted nodes into stringified HTML vnodes.
|
|
772
|
+
* @default null
|
|
773
|
+
*/
|
|
774
|
+
transformHoist?: HoistTransform | null;
|
|
775
|
+
/**
|
|
776
|
+
* If the pairing runtime provides additional built-in elements, use this to
|
|
777
|
+
* mark them as built-in so the compiler will generate component vnodes
|
|
778
|
+
* for them.
|
|
779
|
+
*/
|
|
780
|
+
isBuiltInComponent?: (tag: string) => symbol | void;
|
|
781
|
+
/**
|
|
782
|
+
* Used by some transforms that expects only native elements
|
|
783
|
+
*/
|
|
784
|
+
isCustomElement?: (tag: string) => boolean | void;
|
|
785
|
+
/**
|
|
786
|
+
* Transform expressions like {{ foo }} to `_ctx.foo`.
|
|
787
|
+
* If this option is false, the generated code will be wrapped in a
|
|
788
|
+
* `with (this) { ... }` block.
|
|
789
|
+
* - This is force-enabled in module mode, since modules are by default strict
|
|
790
|
+
* and cannot use `with`
|
|
791
|
+
* @default mode === 'module'
|
|
792
|
+
*/
|
|
793
|
+
prefixIdentifiers?: boolean;
|
|
794
|
+
/**
|
|
795
|
+
* Hoist static VNodes and props objects to `_hoisted_x` constants
|
|
796
|
+
* @default false
|
|
797
|
+
*/
|
|
798
|
+
hoistStatic?: boolean;
|
|
799
|
+
/**
|
|
800
|
+
* Cache v-on handlers to avoid creating new inline functions on each render,
|
|
801
|
+
* also avoids the need for dynamically patching the handlers by wrapping it.
|
|
802
|
+
* e.g `@click="foo"` by default is compiled to `{ onClick: foo }`. With this
|
|
803
|
+
* option it's compiled to:
|
|
804
|
+
* ```js
|
|
805
|
+
* { onClick: _cache[0] || (_cache[0] = e => _ctx.foo(e)) }
|
|
806
|
+
* ```
|
|
807
|
+
* - Requires "prefixIdentifiers" to be enabled because it relies on scope
|
|
808
|
+
* analysis to determine if a handler is safe to cache.
|
|
809
|
+
* @default false
|
|
810
|
+
*/
|
|
811
|
+
cacheHandlers?: boolean;
|
|
812
|
+
/**
|
|
813
|
+
* A list of parser plugins to enable for `@babel/parser`, which is used to
|
|
814
|
+
* parse expressions in bindings and interpolations.
|
|
815
|
+
* https://babeljs.io/docs/en/next/babel-parser#plugins
|
|
816
|
+
*/
|
|
817
|
+
expressionPlugins?: ParserPlugin[];
|
|
818
|
+
/**
|
|
819
|
+
* SFC scoped styles ID
|
|
820
|
+
*/
|
|
821
|
+
scopeId?: string | null;
|
|
822
|
+
/**
|
|
823
|
+
* Indicates this SFC template has used :slotted in its styles
|
|
824
|
+
* Defaults to `true` for backwards compatibility - SFC tooling should set it
|
|
825
|
+
* to `false` if no `:slotted` usage is detected in `<style>`
|
|
826
|
+
*/
|
|
827
|
+
slotted?: boolean;
|
|
828
|
+
/**
|
|
829
|
+
* SFC `<style vars>` injection string
|
|
830
|
+
* Should already be an object expression, e.g. `{ 'xxxx-color': color }`
|
|
831
|
+
* needed to render inline CSS variables on component root
|
|
832
|
+
*/
|
|
833
|
+
ssrCssVars?: string;
|
|
834
|
+
}
|
|
835
|
+
export interface CodegenOptions extends SharedTransformCodegenOptions {
|
|
836
|
+
/**
|
|
837
|
+
* - `module` mode will generate ES module import statements for helpers
|
|
838
|
+
* and export the render function as the default export.
|
|
839
|
+
* - `function` mode will generate a single `const { helpers... } = Vue`
|
|
840
|
+
* statement and return the render function. It expects `Vue` to be globally
|
|
841
|
+
* available (or passed by wrapping the code with an IIFE). It is meant to be
|
|
842
|
+
* used with `new Function(code)()` to generate a render function at runtime.
|
|
843
|
+
* @default 'function'
|
|
844
|
+
*/
|
|
845
|
+
mode?: 'module' | 'function';
|
|
846
|
+
/**
|
|
847
|
+
* Generate source map?
|
|
848
|
+
* @default false
|
|
849
|
+
*/
|
|
850
|
+
sourceMap?: boolean;
|
|
851
|
+
/**
|
|
852
|
+
* SFC scoped styles ID
|
|
853
|
+
*/
|
|
854
|
+
scopeId?: string | null;
|
|
855
|
+
/**
|
|
856
|
+
* Option to optimize helper import bindings via variable assignment
|
|
857
|
+
* (only used for webpack code-split)
|
|
858
|
+
* @default false
|
|
859
|
+
*/
|
|
860
|
+
optimizeImports?: boolean;
|
|
861
|
+
/**
|
|
862
|
+
* Customize where to import runtime helpers from.
|
|
863
|
+
* @default 'vue'
|
|
864
|
+
*/
|
|
865
|
+
runtimeModuleName?: string;
|
|
866
|
+
/**
|
|
867
|
+
* Customize where to import ssr runtime helpers from/**
|
|
868
|
+
* @default 'vue/server-renderer'
|
|
869
|
+
*/
|
|
870
|
+
ssrRuntimeModuleName?: string;
|
|
871
|
+
/**
|
|
872
|
+
* Customize the global variable name of `Vue` to get helpers from
|
|
873
|
+
* in function mode
|
|
874
|
+
* @default 'Vue'
|
|
875
|
+
*/
|
|
876
|
+
runtimeGlobalName?: string;
|
|
877
|
+
}
|
|
878
|
+
export type CompilerOptions = ParserOptions & TransformOptions & CodegenOptions;
|
|
879
|
+
|
|
880
|
+
export type CodegenNode = TemplateChildNode | JSChildNode | SSRCodegenNode;
|
|
881
|
+
export interface CodegenResult {
|
|
882
|
+
code: string;
|
|
883
|
+
preamble: string;
|
|
884
|
+
ast: RootNode;
|
|
885
|
+
map?: RawSourceMap;
|
|
886
|
+
}
|
|
887
|
+
export interface CodegenContext extends Omit<Required<CodegenOptions>, 'bindingMetadata' | 'inline'> {
|
|
888
|
+
source: string;
|
|
889
|
+
code: string;
|
|
890
|
+
line: number;
|
|
891
|
+
column: number;
|
|
892
|
+
offset: number;
|
|
893
|
+
indentLevel: number;
|
|
894
|
+
pure: boolean;
|
|
895
|
+
map?: SourceMapGenerator;
|
|
896
|
+
helper(key: symbol): string;
|
|
897
|
+
push(code: string, node?: CodegenNode): void;
|
|
898
|
+
indent(): void;
|
|
899
|
+
deindent(withoutNewLine?: boolean): void;
|
|
900
|
+
newline(): void;
|
|
901
|
+
}
|
|
902
|
+
declare function generate(ast: RootNode, options?: CodegenOptions & {
|
|
903
|
+
onContextCreated?: (context: CodegenContext) => void;
|
|
904
|
+
}): CodegenResult;
|
|
905
|
+
|
|
906
|
+
export type TransformPreset = [
|
|
907
|
+
NodeTransform[],
|
|
908
|
+
Record<string, DirectiveTransform>
|
|
909
|
+
];
|
|
910
|
+
declare function getBaseTransformPreset(prefixIdentifiers?: boolean): TransformPreset;
|
|
911
|
+
declare function baseCompile(template: string | RootNode, options?: CompilerOptions): CodegenResult;
|
|
912
|
+
|
|
913
|
+
declare const isStaticExp: (p: JSChildNode) => p is SimpleExpressionNode;
|
|
914
|
+
declare const isBuiltInType: (tag: string, expected: string) => boolean;
|
|
915
|
+
declare function isCoreComponent(tag: string): symbol | void;
|
|
916
|
+
declare const isSimpleIdentifier: (name: string) => boolean;
|
|
917
|
+
/**
|
|
918
|
+
* Simple lexer to check if an expression is a member expression. This is
|
|
919
|
+
* lax and only checks validity at the root level (i.e. does not validate exps
|
|
920
|
+
* inside square brackets), but it's ok since these are only used on template
|
|
921
|
+
* expressions and false positives are invalid expressions in the first place.
|
|
922
|
+
*/
|
|
923
|
+
declare const isMemberExpressionBrowser: (path: string) => boolean;
|
|
924
|
+
declare const isMemberExpressionNode: (path: string, context: TransformContext) => boolean;
|
|
925
|
+
declare const isMemberExpression: (path: string, context: TransformContext) => boolean;
|
|
926
|
+
declare function getInnerRange(loc: SourceLocation, offset: number, length: number): SourceLocation;
|
|
927
|
+
declare function advancePositionWithClone(pos: Position, source: string, numberOfCharacters?: number): Position;
|
|
928
|
+
declare function advancePositionWithMutation(pos: Position, source: string, numberOfCharacters?: number): Position;
|
|
929
|
+
declare function assert(condition: boolean, msg?: string): void;
|
|
930
|
+
declare function findDir(node: ElementNode, name: string | RegExp, allowEmpty?: boolean): DirectiveNode | undefined;
|
|
931
|
+
declare function findProp(node: ElementNode, name: string, dynamicOnly?: boolean, allowEmpty?: boolean): ElementNode['props'][0] | undefined;
|
|
932
|
+
declare function isStaticArgOf(arg: DirectiveNode['arg'], name: string): boolean;
|
|
933
|
+
declare function hasDynamicKeyVBind(node: ElementNode): boolean;
|
|
934
|
+
declare function isText(node: TemplateChildNode): node is TextNode | InterpolationNode;
|
|
935
|
+
declare function isVSlot(p: ElementNode['props'][0]): p is DirectiveNode;
|
|
936
|
+
declare function isTemplateNode(node: RootNode | TemplateChildNode): node is TemplateNode;
|
|
937
|
+
declare function isSlotOutlet(node: RootNode | TemplateChildNode): node is SlotOutletNode;
|
|
938
|
+
declare function getVNodeHelper(ssr: boolean, isComponent: boolean): typeof CREATE_VNODE | typeof CREATE_ELEMENT_VNODE;
|
|
939
|
+
declare function getVNodeBlockHelper(ssr: boolean, isComponent: boolean): typeof CREATE_BLOCK | typeof CREATE_ELEMENT_BLOCK;
|
|
940
|
+
declare function injectProp(node: VNodeCall | RenderSlotCall, prop: Property, context: TransformContext): void;
|
|
941
|
+
declare function toValidAssetId(name: string, type: 'component' | 'directive' | 'filter'): string;
|
|
942
|
+
declare function hasScopeRef(node: TemplateChildNode | IfBranchNode | ExpressionNode | undefined, ids: TransformContext['identifiers']): boolean;
|
|
943
|
+
declare function getMemoedVNodeCall(node: BlockCodegenNode | MemoExpression): VNodeCall | RenderSlotCall;
|
|
944
|
+
declare function makeBlock(node: VNodeCall, { helper, removeHelper, inSSR }: TransformContext): void;
|
|
945
|
+
|
|
946
|
+
declare function walkIdentifiers(root: Node$1, onIdentifier: (node: Identifier, parent: Node$1, parentStack: Node$1[], isReference: boolean, isLocal: boolean) => void, includeAll?: boolean, parentStack?: Node$1[], knownIds?: Record<string, number>): void;
|
|
947
|
+
declare function isReferencedIdentifier(id: Identifier, parent: Node$1 | null, parentStack: Node$1[]): boolean;
|
|
948
|
+
declare function isInDestructureAssignment(parent: Node$1, parentStack: Node$1[]): boolean;
|
|
949
|
+
declare function walkFunctionParams(node: Function, onIdent: (id: Identifier) => void): void;
|
|
950
|
+
declare function walkBlockDeclarations(block: BlockStatement$1 | Program, onIdent: (node: Identifier) => void): void;
|
|
951
|
+
declare function extractIdentifiers(param: Node$1, nodes?: Identifier[]): Identifier[];
|
|
952
|
+
declare const isFunctionType: (node: Node$1) => node is Function;
|
|
953
|
+
declare const isStaticProperty: (node: Node$1) => node is ObjectProperty;
|
|
954
|
+
declare const isStaticPropertyKey: (node: Node$1, parent: Node$1) => boolean;
|
|
955
|
+
|
|
956
|
+
declare const transformModel: DirectiveTransform;
|
|
957
|
+
|
|
958
|
+
declare const transformOn: DirectiveTransform;
|
|
959
|
+
|
|
960
|
+
declare const transformBind: DirectiveTransform;
|
|
961
|
+
|
|
962
|
+
declare const noopDirectiveTransform: DirectiveTransform;
|
|
963
|
+
|
|
964
|
+
declare function processIf(node: ElementNode, dir: DirectiveNode, context: TransformContext, processCodegen?: (node: IfNode, branch: IfBranchNode, isRoot: boolean) => (() => void) | undefined): (() => void) | undefined;
|
|
965
|
+
|
|
966
|
+
declare const transformExpression: NodeTransform;
|
|
967
|
+
declare function processExpression(node: SimpleExpressionNode, context: TransformContext, asParams?: boolean, asRawStatements?: boolean, localVars?: Record<string, number>): ExpressionNode;
|
|
968
|
+
declare function stringifyExpression(exp: ExpressionNode | string): string;
|
|
969
|
+
|
|
970
|
+
declare const trackSlotScopes: NodeTransform;
|
|
971
|
+
declare const trackVForSlotScopes: NodeTransform;
|
|
972
|
+
export type SlotFnBuilder = (slotProps: ExpressionNode | undefined, slotChildren: TemplateChildNode[], loc: SourceLocation) => FunctionExpression;
|
|
973
|
+
declare function buildSlots(node: ElementNode, context: TransformContext, buildSlotFn?: SlotFnBuilder): {
|
|
974
|
+
slots: SlotsExpression;
|
|
975
|
+
hasDynamicSlots: boolean;
|
|
976
|
+
};
|
|
977
|
+
|
|
978
|
+
export interface SlotOutletProcessResult {
|
|
979
|
+
slotName: string | ExpressionNode;
|
|
980
|
+
slotProps: PropsExpression | undefined;
|
|
981
|
+
}
|
|
982
|
+
declare function processSlotOutlet(node: SlotOutletNode, context: TransformContext): SlotOutletProcessResult;
|
|
983
|
+
|
|
984
|
+
declare function getConstantType(node: TemplateChildNode | SimpleExpressionNode, context: TransformContext): ConstantTypes;
|
|
985
|
+
|
|
986
|
+
export { BASE_TRANSITION, BindingTypes, CAMELIZE, CAPITALIZE, CREATE_BLOCK, CREATE_COMMENT, CREATE_ELEMENT_BLOCK, CREATE_ELEMENT_VNODE, CREATE_SLOTS, CREATE_STATIC, CREATE_TEXT, CREATE_VNODE, CompilerDeprecationTypes, ConstantTypes, ElementTypes, ErrorCodes, FRAGMENT, GUARD_REACTIVE_PROPS, IS_MEMO_SAME, IS_REF, KEEP_ALIVE, MERGE_PROPS, NORMALIZE_CLASS, NORMALIZE_PROPS, NORMALIZE_STYLE, Namespaces, NodeTypes, OPEN_BLOCK, POP_SCOPE_ID, PUSH_SCOPE_ID, RENDER_LIST, RENDER_SLOT, RESOLVE_COMPONENT, RESOLVE_DIRECTIVE, RESOLVE_DYNAMIC_COMPONENT, RESOLVE_FILTER, SET_BLOCK_TRACKING, SUSPENSE, TELEPORT, TO_DISPLAY_STRING, TO_HANDLERS, TO_HANDLER_KEY, TextModes, UNREF, WITH_CTX, WITH_DIRECTIVES, WITH_MEMO, advancePositionWithClone, advancePositionWithMutation, assert, baseCompile, baseParse, buildDirectiveArgs, buildProps, buildSlots, checkCompatEnabled, createArrayExpression, createAssignmentExpression, createBlockStatement, createCacheExpression, createCallExpression, createCompilerError, createCompoundExpression, createConditionalExpression, createForLoopParams, createFunctionExpression, createIfStatement, createInterpolation, createObjectExpression, createObjectProperty, createReturnStatement, createRoot, createSequenceExpression, createSimpleExpression, createStructuralDirectiveTransform, createTemplateLiteral, createTransformContext, createVNodeCall, extractIdentifiers, findDir, findProp, generate, getBaseTransformPreset, getConstantType, getInnerRange, getMemoedVNodeCall, getVNodeBlockHelper, getVNodeHelper, hasDynamicKeyVBind, hasScopeRef, helperNameMap, injectProp, isBuiltInType, isCoreComponent, isFunctionType, isInDestructureAssignment, isMemberExpression, isMemberExpressionBrowser, isMemberExpressionNode, isReferencedIdentifier, isSimpleIdentifier, isSlotOutlet, isStaticArgOf, isStaticExp, isStaticProperty, isStaticPropertyKey, isTemplateNode, isText, isVSlot, locStub, makeBlock, noopDirectiveTransform, processExpression, processFor, processIf, processSlotOutlet, registerRuntimeHelpers, resolveComponentType, stringifyExpression, toValidAssetId, trackSlotScopes, trackVForSlotScopes, transform, transformBind, transformElement, transformExpression, transformModel, transformOn, traverseNode, walkBlockDeclarations, walkFunctionParams, walkIdentifiers, warnDeprecation };
|