deno.land / x / ts_morph@22.0.0 / ts_morph.d.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
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
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
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
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
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
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
470
471
472
473
474
475
476
477
478
479
480
481
482
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
544
545
546
547
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
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
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
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
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
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
import { errors, StandardizedFilePath, ts } from "./common/mod.ts";
/** Holds the compiler options. */export declare class CompilerOptionsContainer extends SettingsContainer<ts.CompilerOptions> { constructor(defaultSettings?: ts.CompilerOptions); /** * Sets one or all of the compiler options. * * WARNING: Setting the compiler options will cause a complete reparse of all the source files. * @param settings - Compiler options to set. */ set(settings: Partial<ts.CompilerOptions>): void; /** Gets the encoding from the compiler options or returns utf-8. */ getEncoding(): string;}
/** Represents a file system that can be interacted with. */export interface FileSystemHost { /** Gets if this file system is case sensitive. */ isCaseSensitive(): boolean; /** Asynchronously deletes the specified file or directory. */ delete(path: string): Promise<void>; /** Synchronously deletes the specified file or directory */ deleteSync(path: string): void; /** * Reads all the child directories and files. * @remarks Implementers should have this return the full file path. */ readDirSync(dirPath: string): RuntimeDirEntry[]; /** Asynchronously reads a file at the specified path. */ readFile(filePath: string, encoding?: string): Promise<string>; /** Synchronously reads a file at the specified path. */ readFileSync(filePath: string, encoding?: string): string; /** Asynchronously writes a file to the file system. */ writeFile(filePath: string, fileText: string): Promise<void>; /** Synchronously writes a file to the file system. */ writeFileSync(filePath: string, fileText: string): void; /** Asynchronously creates a directory at the specified path. */ mkdir(dirPath: string): Promise<void>; /** Synchronously creates a directory at the specified path. */ mkdirSync(dirPath: string): void; /** Asynchronously moves a file or directory. */ move(srcPath: string, destPath: string): Promise<void>; /** Synchronously moves a file or directory. */ moveSync(srcPath: string, destPath: string): void; /** Asynchronously copies a file or directory. */ copy(srcPath: string, destPath: string): Promise<void>; /** Synchronously copies a file or directory. */ copySync(srcPath: string, destPath: string): void; /** * Asynchronously checks if a file exists. * @remarks Implementers should throw an `errors.FileNotFoundError` when it does not exist. */ fileExists(filePath: string): Promise<boolean>; /** * Synchronously checks if a file exists. * @remarks Implementers should throw an `errors.FileNotFoundError` when it does not exist. */ fileExistsSync(filePath: string): boolean; /** Asynchronously checks if a directory exists. */ directoryExists(dirPath: string): Promise<boolean>; /** Synchronously checks if a directory exists. */ directoryExistsSync(dirPath: string): boolean; /** See https://nodejs.org/api/fs.html#fs_fs_realpathsync_path_options */ realpathSync(path: string): string; /** Gets the current directory of the environment. */ getCurrentDirectory(): string; /** Uses pattern matching to find files or directories. */ glob(patterns: ReadonlyArray<string>): Promise<string[]>; /** Synchronously uses pattern matching to find files or directories. */ globSync(patterns: ReadonlyArray<string>): string[];}
/** An implementation of a file system that exists in memory only. */export declare class InMemoryFileSystemHost implements FileSystemHost { #private; /** Constructor. */ constructor(); /** @inheritdoc */ isCaseSensitive(): boolean; /** @inheritdoc */ delete(path: string): Promise<void>; /** @inheritdoc */ deleteSync(path: string): void; /** @inheritdoc */ readDirSync(dirPath: string): RuntimeDirEntry[]; /** @inheritdoc */ readFile(filePath: string, encoding?: string): Promise<string>; /** @inheritdoc */ readFileSync(filePath: string, encoding?: string): string; /** @inheritdoc */ writeFile(filePath: string, fileText: string): Promise<void>; /** @inheritdoc */ writeFileSync(filePath: string, fileText: string): void; /** @inheritdoc */ mkdir(dirPath: string): Promise<void>; /** @inheritdoc */ mkdirSync(dirPath: string): void; /** @inheritdoc */ move(srcPath: string, destPath: string): Promise<void>; /** @inheritdoc */ moveSync(srcPath: string, destPath: string): void; /** @inheritdoc */ copy(srcPath: string, destPath: string): Promise<void>; /** @inheritdoc */ copySync(srcPath: string, destPath: string): void; /** @inheritdoc */ fileExists(filePath: string): Promise<boolean>; /** @inheritdoc */ fileExistsSync(filePath: string): boolean; /** @inheritdoc */ directoryExists(dirPath: string): Promise<boolean>; /** @inheritdoc */ directoryExistsSync(dirPath: string): boolean; /** @inheritdoc */ realpathSync(path: string): string; /** @inheritdoc */ getCurrentDirectory(): string; /** @inheritdoc */ glob(patterns: ReadonlyArray<string>): Promise<string[]>; /** @inheritdoc */ globSync(patterns: ReadonlyArray<string>): string[];}
/** Host for implementing custom module and/or type reference directive resolution. */export interface ResolutionHost { resolveModuleNames?: ts.LanguageServiceHost["resolveModuleNames"]; getResolvedModuleWithFailedLookupLocationsFromCache?: ts.LanguageServiceHost["getResolvedModuleWithFailedLookupLocationsFromCache"]; resolveTypeReferenceDirectives?: ts.LanguageServiceHost["resolveTypeReferenceDirectives"];}
/** * Factory used to create a resolution host. * @remarks The compiler options are retrieved via a function in order to get the project's current compiler options. */export type ResolutionHostFactory = (moduleResolutionHost: ts.ModuleResolutionHost, getCompilerOptions: () => ts.CompilerOptions) => ResolutionHost;/** Collection of reusable resolution hosts. */export declare const ResolutionHosts: { deno: ResolutionHostFactory; };export interface RuntimeDirEntry { name: string; isFile: boolean; isDirectory: boolean; isSymlink: boolean;}
export declare abstract class SettingsContainer<T extends object> { #private; protected _settings: T; /** * Constructor. * @param defaultSettings - The settings to use by default. */ constructor(defaultSettings: T); /** Resets the settings to the default. */ reset(): void; /** Gets a copy of the settings as an object. */ get(): T; /** * Sets one or all of the settings. * @param settings - Settings to set. */ set(settings: Partial<T>): void; /** * Subscribe to modifications in the settings container. * @param action - Action to execute when the settings change. */ onModified(action: () => void): void;}
declare const ArgumentError: typeof errors.ArgumentError;declare const ArgumentNullOrWhitespaceError: typeof errors.ArgumentNullOrWhitespaceError;declare const ArgumentOutOfRangeError: typeof errors.ArgumentOutOfRangeError;declare const ArgumentTypeError: typeof errors.ArgumentTypeError;declare const BaseError: typeof errors.BaseError;declare const DirectoryNotFoundError: typeof errors.DirectoryNotFoundError;declare const FileNotFoundError: typeof errors.FileNotFoundError;declare const InvalidOperationError: typeof errors.InvalidOperationError;declare const NotImplementedError: typeof errors.NotImplementedError;declare const NotSupportedError: typeof errors.NotSupportedError;declare const PathNotFoundError: typeof errors.PathNotFoundError;
export declare class Directory { #private; private constructor(); /** * Checks if this directory is an ancestor of the provided directory. * @param possibleDescendant - Directory or source file that's a possible descendant. */ isAncestorOf(possibleDescendant: Directory | SourceFile): boolean; /** * Checks if this directory is a descendant of the provided directory. * @param possibleAncestor - Directory or source file that's a possible ancestor. */ isDescendantOf(possibleAncestor: Directory): boolean; /** Gets the path to the directory. */ getPath(): StandardizedFilePath; /** Gets the directory path's base name. */ getBaseName(): string; /** Gets the parent directory or throws if it doesn't exist or was never added to the project. */ getParentOrThrow(message?: string | (() => string)): Directory; /** Gets the parent directory if it exists and was added to the project. */ getParent(): Directory | undefined; /** * Gets a child directory with the specified path or throws if not found. * @param path - Relative path from this directory or absolute path. */ getDirectoryOrThrow(path: string): Directory; /** * Gets a child directory by the specified condition or throws if not found. * @param condition - Condition to check the directory with. */ getDirectoryOrThrow(condition: (directory: Directory) => boolean): Directory; /** * Gets a directory with the specified path or undefined if not found. * @param path - Relative path from this directory or absolute path. */ getDirectory(path: string): Directory | undefined; /** * Gets a child directory by the specified condition or undefined if not found. * @param condition - Condition to check the directory with. */ getDirectory(condition: (directory: Directory) => boolean): Directory | undefined; /** * Gets a child source file with the specified path or throws if not found. * @param path - Relative or absolute path to the file. */ getSourceFileOrThrow(path: string): SourceFile; /** * Gets a child source file by the specified condition or throws if not found. * @param condition - Condition to check the source file with. */ getSourceFileOrThrow(condition: (sourceFile: SourceFile) => boolean): SourceFile; /** * Gets a child source file with the specified path or undefined if not found. * @param path - Relative or absolute path to the file. */ getSourceFile(path: string): SourceFile | undefined; /** * Gets a child source file by the specified condition or undefined if not found. * @param condition - Condition to check the source file with. */ getSourceFile(condition: (sourceFile: SourceFile) => boolean): SourceFile | undefined; /** Gets the child directories. */ getDirectories(): Directory[]; /** Gets the source files within this directory. */ getSourceFiles(): SourceFile[]; /** * Gets all the source files added to the project relative to the directory that match a pattern. * @param globPattern - Glob pattern for filtering out the source files. */ getSourceFiles(globPattern: string): SourceFile[]; /** * Gets all the source files added to the project relative to the directory that match the provided patterns. * @param globPatterns - Glob patterns for filtering out the source files. */ getSourceFiles(globPatterns: ReadonlyArray<string>): SourceFile[]; /** Gets the source files in the current directory and all the descendant directories. */ getDescendantSourceFiles(): SourceFile[]; /** Gets the descendant directories. */ getDescendantDirectories(): Directory[]; /** * Add source files based on file globs. * @param fileGlobs - File glob or globs to add files based on. * @returns The matched source files. */ addSourceFilesAtPaths(fileGlobs: string | ReadonlyArray<string>): SourceFile[]; /** * Adds an existing directory from the relative path or directory name, or returns undefined if it doesn't exist. * * Will return the directory if it was already added. * @param relativeOrAbsoluteDirPath - Directory name or path to the directory that should be added. * @param options - Options. */ addDirectoryAtPathIfExists(relativeOrAbsoluteDirPath: string, options?: DirectoryAddOptions): Directory | undefined; /** * Adds an existing directory from the relative path or directory name, or throws if it doesn't exist. * * Will return the directory if it was already added. * @param relativeOrAbsoluteDirPath - Directory name or path to the directory that should be added. * @throws DirectoryNotFoundError if the directory does not exist. */ addDirectoryAtPath(relativeOrAbsoluteDirPath: string, options?: DirectoryAddOptions): Directory; /** * Creates a directory if it doesn't exist. * @param relativeOrAbsoluteDirPath - Relative or absolute path to the directory that should be created. */ createDirectory(relativeOrAbsoluteDirPath: string): Directory; /** * Creates a source file, relative to this directory. * * Note: The file will not be created and saved to the file system until .save() is called on the source file. * @param relativeFilePath - Relative file path of the source file to create. * @param sourceFileText - Text, structure, or writer function to create the source file text with. * @param options - Options. * @throws - InvalidOperationError if a source file already exists at the provided file name. */ createSourceFile(relativeFilePath: string, sourceFileText?: string | OptionalKind<SourceFileStructure> | WriterFunction, options?: SourceFileCreateOptions): SourceFile; /** * Adds an existing source file, relative to this directory, or returns undefined. * * Will return the source file if it was already added. * @param relativeFilePath - Relative file path to add. */ addSourceFileAtPathIfExists(relativeFilePath: string): SourceFile | undefined; /** * Adds an existing source file, relative to this directory, or throws if it doesn't exist. * * Will return the source file if it was already added. * @param relativeFilePath - Relative file path to add. * @throws FileNotFoundError when the file doesn't exist. */ addSourceFileAtPath(relativeFilePath: string): SourceFile; /** * Emits the files in the directory. * @param options - Options for emitting. */ emit(options?: { emitOnlyDtsFiles?: boolean; outDir?: string; declarationDir?: string; }): Promise<DirectoryEmitResult>; /** * Emits the files in the directory synchronously. * * Remarks: This might be very slow compared to the asynchronous version if there are a lot of files. * @param options - Options for emitting. */ emitSync(options?: { emitOnlyDtsFiles?: boolean; outDir?: string; declarationDir?: string; }): DirectoryEmitResult; /** * Copies the directory to a subdirectory of the specified directory. * @param dirPathOrDirectory Directory path or directory object to copy the directory to. * @param options Options for copying. * @returns The new copied directory. */ copyToDirectory(dirPathOrDirectory: string | Directory, options?: DirectoryCopyOptions): Directory; /** * Copies the directory to a new directory. * @param relativeOrAbsolutePath - The relative or absolute path to the new directory. * @param options - Options. * @returns The directory the copy was made to. */ copy(relativeOrAbsolutePath: string, options?: DirectoryCopyOptions): Directory; /** * Immediately copies the directory to the specified path asynchronously. * @param relativeOrAbsolutePath - Directory path as an absolute or relative path. * @param options - Options for moving the directory. * @remarks If includeTrackedFiles is true, then it will execute the pending operations in the current directory. */ copyImmediately(relativeOrAbsolutePath: string, options?: DirectoryCopyOptions): Promise<Directory>; /** * Immediately copies the directory to the specified path synchronously. * @param relativeOrAbsolutePath - Directory path as an absolute or relative path. * @param options - Options for moving the directory. * @remarks If includeTrackedFiles is true, then it will execute the pending operations in the current directory. */ copyImmediatelySync(relativeOrAbsolutePath: string, options?: DirectoryCopyOptions): Directory; /** * Moves the directory to a subdirectory of the specified directory. * @param dirPathOrDirectory Directory path or directory object to move the directory to. * @param options Options for moving. */ moveToDirectory(dirPathOrDirectory: string | Directory, options?: DirectoryMoveOptions): this; /** * Moves the directory to a new path. * @param relativeOrAbsolutePath - Directory path as an absolute or relative path. * @param options - Options for moving the directory. */ move(relativeOrAbsolutePath: string, options?: DirectoryMoveOptions): this; /** * Immediately moves the directory to a new path asynchronously. * @param relativeOrAbsolutePath - Directory path as an absolute or relative path. * @param options - Options for moving the directory. */ moveImmediately(relativeOrAbsolutePath: string, options?: DirectoryMoveOptions): Promise<this>; /** * Immediately moves the directory to a new path synchronously. * @param relativeOrAbsolutePath - Directory path as an absolute or relative path. * @param options - Options for moving the directory. */ moveImmediatelySync(relativeOrAbsolutePath: string, options?: DirectoryMoveOptions): this; /** * Recreates the directory. * @remarks This will delete all the descendant source files and directories in memory and queue a delete & mkdir to the file system. */ clear(): void; /** * Asynchronously recreates the directory. * @remarks This will delete all the descendant source files and directories in memory and push a delete & mkdir to the file system. */ clearImmediately(): Promise<void>; /** * Synchronously recreates the directory. * @remarks This will delete all the descendant source files and directories in memory and push a delete & mkdir to the file system. */ clearImmediatelySync(): void; /** * Queues a deletion of the directory to the file system. * * The directory will be deleted when calling ast.save(). If you wish to delete the file immediately, then use deleteImmediately(). */ delete(): void; /** Asyncronously deletes the directory and all its descendants from the file system. */ deleteImmediately(): Promise<void>; /** Synchronously deletes the directory and all its descendants from the file system. */ deleteImmediatelySync(): void; /** * Forgets the directory and all its descendants from the Project. * * Note: Does not delete the directory from the file system. */ forget(): void; /** Asynchronously saves the directory and all the unsaved source files to the disk. */ save(): Promise<void>; /** Synchronously saves the directory and all the unsaved source files to the disk. */ saveSync(): void; /** * Gets the relative path to the specified path. * @param fileOrDirPath - The file or directory path. */ getRelativePathTo(fileOrDirPath: string): string; /** * Gets the relative path to another source file. * @param sourceFile - Source file. */ getRelativePathTo(sourceFile: SourceFile): string; /** * Gets the relative path to another directory. * @param directory - Directory. */ getRelativePathTo(directory: Directory): string; /** * Gets the relative path to the specified file path as a module specifier. * @param filePath - File path. * @remarks To get to a directory, provide `path/to/directory/index.ts`. */ getRelativePathAsModuleSpecifierTo(filePath: string): string; /** * Gets the relative path to the specified source file as a module specifier. * @param sourceFile - Source file. */ getRelativePathAsModuleSpecifierTo(sourceFile: SourceFile): string; /** * Gets the relative path to the specified directory as a module specifier. * @param directory - Directory. */ getRelativePathAsModuleSpecifierTo(directory: Directory): string; /** Gets the project. */ getProject(): Project; /** Gets if the directory was forgotten. */ wasForgotten(): boolean;}
export interface DirectoryAddOptions { /** * Whether to also recursively add all the directory's descendant directories. * @remarks Defaults to false. */ recursive?: boolean;}
export interface DirectoryCopyOptions extends SourceFileCopyOptions { /** * Includes all the files in the directory and sub-directory when copying. * @remarks - Defaults to true. */ includeUntrackedFiles?: boolean;}
export declare class DirectoryEmitResult { #private; private constructor(); /** Gets a collections of skipped file paths. */ getSkippedFilePaths(): StandardizedFilePath[]; /** Gets the output file paths. */ getOutputFilePaths(): StandardizedFilePath[];}
export interface DirectoryMoveOptions extends SourceFileMoveOptions {}
/** Occurs when there is a problem doing a manipulation. */export declare class ManipulationError extends errors.InvalidOperationError { readonly filePath: string; readonly oldText: string; readonly newText: string; constructor(filePath: string, oldText: string, newText: string, errorMessage: string);}
/** Project that holds source files. */export declare class Project { #private; /** * Initializes a new instance. * @param options - Optional options. */ constructor(options?: ProjectOptions); /** Gets the manipulation settings. */ get manipulationSettings(): ManipulationSettingsContainer; /** Gets the compiler options for modification. */ get compilerOptions(): CompilerOptionsContainer; /** * Adds the source files the project's source files depend on to the project. * @returns The added source files. * @remarks * This should be done after source files are added to the project, preferably once to * avoid doing more work than necessary. * * This is done by default when creating a Project and providing a tsconfig.json and * not specifying to not add the source files. */ resolveSourceFileDependencies(): SourceFile[]; /** * Adds an existing directory from the path or returns undefined if it doesn't exist. * * Will return the directory if it was already added. * @param dirPath - Path to add the directory at. * @param options - Options. */ addDirectoryAtPathIfExists(dirPath: string, options?: DirectoryAddOptions): Directory | undefined; /** * Adds an existing directory from the path or throws if it doesn't exist. * * Will return the directory if it was already added. * @param dirPath - Path to add the directory at. * @param options - Options. * @throws DirectoryNotFoundError when the directory does not exist. */ addDirectoryAtPath(dirPath: string, options?: DirectoryAddOptions): Directory; /** * Creates a directory at the specified path. * @param dirPath - Path to create the directory at. */ createDirectory(dirPath: string): Directory; /** * Gets a directory by the specified path or throws if it doesn't exist. * @param dirPath - Path to create the directory at. */ getDirectoryOrThrow(dirPath: string, message?: string | (() => string)): Directory; /** * Gets a directory by the specified path or returns undefined if it doesn't exist. * @param dirPath - Directory path. */ getDirectory(dirPath: string): Directory | undefined; /** Gets all the directories. */ getDirectories(): Directory[]; /** Gets the directories without a parent. */ getRootDirectories(): Directory[]; /** * Adds source files based on file globs. * @param fileGlobs - File glob or globs to add files based on. * @returns The matched source files. */ addSourceFilesAtPaths(fileGlobs: string | ReadonlyArray<string>): SourceFile[]; /** * Adds a source file from a file path if it exists or returns undefined. * * Will return the source file if it was already added. * @param filePath - File path to get the file from. */ addSourceFileAtPathIfExists(filePath: string): SourceFile | undefined; /** * Adds an existing source file from a file path or throws if it doesn't exist. * * Will return the source file if it was already added. * @param filePath - File path to get the file from. * @throws FileNotFoundError when the file is not found. */ addSourceFileAtPath(filePath: string): SourceFile; /** * Adds all the source files from the specified tsconfig.json. * * Note that this is done by default when specifying a tsconfig file in the constructor and not explicitly setting the * `skipAddingFilesFromTsConfig` option to `true`. * @param tsConfigFilePath - File path to the tsconfig.json file. */ addSourceFilesFromTsConfig(tsConfigFilePath: string): SourceFile[]; /** * Creates a source file at the specified file path with the specified text. * * Note: The file will not be created and saved to the file system until .save() is called on the source file. * @param filePath - File path of the source file. * @param sourceFileText - Text, structure, or writer function for the source file text. * @param options - Options. * @throws - InvalidOperationError if a source file already exists at the provided file path. */ createSourceFile(filePath: string, sourceFileText?: string | OptionalKind<SourceFileStructure> | WriterFunction, options?: SourceFileCreateOptions): SourceFile; /** * Removes a source file from the project. * @param sourceFile - Source file to remove. * @returns True if removed. */ removeSourceFile(sourceFile: SourceFile): boolean; /** * Gets a source file by a file name or file path. Throws an error if it doesn't exist. * @param fileNameOrPath - File name or path that the path could end with or equal. */ getSourceFileOrThrow(fileNameOrPath: string): SourceFile; /** * Gets a source file by a search function. Throws an error if it doesn't exist. * @param searchFunction - Search function. */ getSourceFileOrThrow(searchFunction: (file: SourceFile) => boolean): SourceFile; /** * Gets a source file by a file name or file path. Returns undefined if none exists. * @param fileNameOrPath - File name or path that the path could end with or equal. */ getSourceFile(fileNameOrPath: string): SourceFile | undefined; /** * Gets a source file by a search function. Returns undefined if none exists. * @param searchFunction - Search function. */ getSourceFile(searchFunction: (file: SourceFile) => boolean): SourceFile | undefined; /** Gets all the source files added to the project. */ getSourceFiles(): SourceFile[]; /** * Gets all the source files added to the project that match a pattern. * @param globPattern - Glob pattern for filtering out the source files. */ getSourceFiles(globPattern: string): SourceFile[]; /** * Gets all the source files added to the project that match the passed in patterns. * @param globPatterns - Glob patterns for filtering out the source files. */ getSourceFiles(globPatterns: ReadonlyArray<string>): SourceFile[]; /** * Gets the specified ambient module symbol or returns undefined if not found. * @param moduleName - The ambient module name with or without quotes. */ getAmbientModule(moduleName: string): Symbol | undefined; /** * Gets the specified ambient module symbol or throws if not found. * @param moduleName - The ambient module name with or without quotes. */ getAmbientModuleOrThrow(moduleName: string, message?: string | (() => string)): Symbol; /** * Gets the ambient module symbols (ex. modules in the * @types folder or node_modules). */ getAmbientModules(): Symbol[]; /** Saves all the unsaved source files to the file system and deletes all deleted files. */ save(): Promise<void>; /** * Synchronously saves all the unsaved source files to the file system and deletes all deleted files. * * Remarks: This might be very slow compared to the asynchronous version if there are a lot of files. */ saveSync(): void; /** * Enables logging to the console. * @param enabled - Enabled. */ enableLogging(enabled?: boolean): void; /** Gets the pre-emit diagnostics. */ getPreEmitDiagnostics(): Diagnostic[]; /** Gets the language service. */ getLanguageService(): LanguageService; /** Gets the program. */ getProgram(): Program; /** Gets the type checker. */ getTypeChecker(): TypeChecker; /** Gets the file system. */ getFileSystem(): FileSystemHost; /** * Asynchronously emits all the source files to the file system as JavaScript files. * @param emitOptions - Optional emit options. */ emit(emitOptions?: EmitOptions): Promise<EmitResult>; /** * Synchronously emits all the source files to the file system as JavaScript files. * @param emitOptions - Optional emit options. */ emitSync(emitOptions?: EmitOptions): EmitResult; /** * Emits all the source files to memory. * @param emitOptions - Optional emit options. */ emitToMemory(emitOptions?: EmitOptions): MemoryEmitResult; /** Gets the compiler options. */ getCompilerOptions(): CompilerOptions; /** Gets the diagnostics found when parsing the tsconfig.json file provided in the project's constructor. */ getConfigFileParsingDiagnostics(): Diagnostic[]; /** * Creates a writer with the current manipulation settings. * @remarks Generally it's best to use a provided writer, but this may be useful in some scenarios. */ createWriter(): CodeBlockWriter; /** * Forgets the nodes created in the scope of the passed in block. * * This is an advanced method that can be used to easily "forget" all the nodes created within the scope of the block. * @param block - Block of code to run. Use the `remember` callback or return a node to remember it. */ forgetNodesCreatedInBlock<T = void>(block: (remember: (...node: Node[]) => void) => T): T; /** * Forgets the nodes created in the scope of the passed in block asynchronously. * * This is an advanced method that can be used to easily "forget" all the nodes created within the scope of the block. * @param block - Block of code to run. Use the `remember` callback or return a node to remember it. */ forgetNodesCreatedInBlock<T = void>(block: (remember: (...node: Node[]) => void) => Promise<T>): Promise<T>; /** * Formats an array of diagnostics with their color and context into a string. * @param diagnostics - Diagnostics to get a string of. * @param options - Collection of options. For example, the new line character to use (defaults to the OS' new line character). */ formatDiagnosticsWithColorAndContext(diagnostics: ReadonlyArray<Diagnostic>, opts?: { newLineChar?: "\n" | "\r\n"; }): string; /** Gets a ts.ModuleResolutionHost for the project. */ getModuleResolutionHost(): ts.ModuleResolutionHost;}
/** Options for creating a project. */export interface ProjectOptions { /** Compiler options */ compilerOptions?: CompilerOptions; /** File path to the tsconfig.json file. */ tsConfigFilePath?: string; /** Can be overriden by `tsConfigFilePath` or `compilerOptions`. */ defaultCompilerOptions?: CompilerOptions; /** * Whether to skip adding the source files from the specified tsconfig.json. * @default false */ skipAddingFilesFromTsConfig?: boolean; /** * Skip resolving file dependencies when providing a ts config file path and adding the files from tsconfig. * @default false */ skipFileDependencyResolution?: boolean; /** * Skip loading the lib files. Unlike the compiler API, ts-morph does not load these * from the node_modules folder, but instead loads them from some other JS code * and uses a fake path for their existence. If you want to use a custom lib files * folder path, then provide one using the libFolderPath options. * @default false */ skipLoadingLibFiles?: boolean; /** The folder to use for loading lib files. */ libFolderPath?: string; /** Manipulation settings */ manipulationSettings?: Partial<ManipulationSettings>; /** * Whether to use an in-memory file system. * @default false */ useInMemoryFileSystem?: boolean; /** * Optional file system host. Useful for mocking access to the file system. * @remarks Consider using `useInMemoryFileSystem` instead. */ fileSystem?: FileSystemHost; /** Creates a resolution host for specifying custom module and/or type reference directive resolution. */ resolutionHost?: ResolutionHostFactory;}
/** Options for creating a source file. */export interface SourceFileCreateOptions { /** * Whether a source file should be overwritten if it exists. Defaults to false. * @remarks When false, the method will throw when a file exists. */ overwrite?: boolean; /** Specifies the script kind of the source file. */ scriptKind?: ScriptKind;}
export type Constructor<T> = new (...args: any[]) => T;export type InstanceOf<T> = T extends new (...args: any[]) => infer U ? U : never;export type WriterFunction = (writer: CodeBlockWriter) => void;/** * Creates a wrapped node from a compiler node. * @param node - Node to create a wrapped node from. * @param info - Info for creating the wrapped node. */export declare function createWrappedNode<T extends ts.Node = ts.Node>(node: T, opts?: CreateWrappedNodeOptions): CompilerNodeToWrappedType<T>;
export interface CreateWrappedNodeOptions { /** Compiler options. */ compilerOptions?: CompilerOptions; /** Optional source file of the node. Will make it not bother going up the tree to find the source file. */ sourceFile?: ts.SourceFile; /** Type checker. */ typeChecker?: ts.TypeChecker;}
/** * Prints the provided node using the compiler's printer. * @param node - Compiler node. * @param options - Options. * @remarks If the node was not constructed with the compiler API factory methods and the node * does not have parents set, then use the other overload that accepts a source file. */export declare function printNode(node: ts.Node, options?: PrintNodeOptions): string;/** * Prints the provided node using the compiler's printer. * @param node - Compiler node. * @param sourceFile - Compiler source file. * @param options - Options. */export declare function printNode(node: ts.Node, sourceFile: ts.SourceFile, options?: PrintNodeOptions): string;
/** Options for printing a node. */export interface PrintNodeOptions { /** Whether to remove comments or not. */ removeComments?: boolean; /** * New line kind. * * Defaults to line feed. */ newLineKind?: NewLineKind; /** * From the compiler api: "A value indicating the purpose of a node. This is primarily used to * distinguish between an `Identifier` used in an expression position, versus an * `Identifier` used as an `IdentifierName` as part of a declaration. For most nodes you * should just pass `Unspecified`." * * Defaults to `Unspecified`. */ emitHint?: EmitHint; /** * The script kind. * * @remarks This is only useful when passing in a compiler node that was constructed * with the compiler API factory methods. * * Defaults to TSX. */ scriptKind?: ScriptKind;}
export type SourceFileReferencingNodes = ImportDeclaration | ExportDeclaration | ImportEqualsDeclaration | CallExpression;
export interface CompilerOptionsFromTsConfigOptions { encoding?: string; fileSystem?: FileSystemHost;}
export interface CompilerOptionsFromTsConfigResult { options: CompilerOptions; errors: Diagnostic[];}
/** * Gets the compiler options from a specified tsconfig.json * @param filePath - File path to the tsconfig.json. * @param options - Options. */export declare function getCompilerOptionsFromTsConfig(filePath: string, options?: CompilerOptionsFromTsConfigOptions): CompilerOptionsFromTsConfigResult;
/** Functions for writing code. */export declare class Writers { private constructor(); /** * Gets a writer function for writing the provided object as an object literal expression. * @param obj - Object to write. */ static object(obj: { [key: string]: WriterFunctionOrValue | undefined; }): WriterFunction; /** Gets a writer function for writing an object type. */ static objectType(structure: TypeElementMemberedNodeStructure): WriterFunction; /** Gets a writer function for writing a union type (ex. `FirstType | SecondType`). */ static unionType(firstType: WriterFunctionOrValue, secondType: WriterFunctionOrValue, ...additionalTypes: WriterFunctionOrValue[]): (writer: CodeBlockWriter) => void; /** Gets a writer function for writing an intersection type (ex. `FirstType & SecondType`). */ static intersectionType(firstType: WriterFunctionOrValue, secondType: WriterFunctionOrValue, ...additionalTypes: WriterFunctionOrValue[]): (writer: CodeBlockWriter) => void; /** Gets a writer function for writing a type assertion (ex. `type as assertionType`). */ static assertion(type: WriterFunctionOrValue, assertionType: WriterFunctionOrValue): (writer: CodeBlockWriter) => void; /** * Gets a writer function for writing a return statement returning the provided value (ex. `return value;`). * @param value - Value to be returned. */ static returnStatement(value: WriterFunctionOrValue): WriterFunction;}
export type WriterFunctionOrValue = string | number | WriterFunction;export type AssertionKey = Identifier | StringLiteral;export type PropertyName = Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier | NoSubstitutionTemplateLiteral;export type ModuleName = Identifier | StringLiteral;export type AccessorDeclaration = GetAccessorDeclaration | SetAccessorDeclaration;export type ArrayBindingElement = BindingElement | OmittedExpression;export type BindingName = Identifier | BindingPattern;export type BindingPattern = ObjectBindingPattern | ArrayBindingPattern;export type BooleanLiteral = TrueLiteral | FalseLiteral;export type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression | Decorator | JsxOpeningLikeElement | InstanceofExpression;export type EntityNameExpression = Identifier | PropertyAccessExpression;export type DeclarationName = PropertyName | JsxAttributeName | StringLiteralLike | ElementAccessExpression | BindingPattern | EntityNameExpression;export type EntityName = Identifier | QualifiedName;export type JsxChild = JsxText | JsxExpression | JsxElement | JsxSelfClosingElement | JsxFragment;export type JsxAttributeName = Identifier | JsxNamespacedName;export type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute;export type JsxOpeningLikeElement = JsxSelfClosingElement | JsxOpeningElement;export type JsxTagNameExpression = Identifier | ThisExpression | JsxTagNamePropertyAccess | JsxNamespacedName;
export interface JsxTagNamePropertyAccess extends PropertyAccessExpression { getExpression(): Identifier | ThisExpression | JsxTagNamePropertyAccess;}
export type ObjectLiteralElementLike = PropertyAssignment | ShorthandPropertyAssignment | SpreadAssignment | MethodDeclaration | AccessorDeclaration;export type CaseOrDefaultClause = CaseClause | DefaultClause;export type ModuleReference = EntityName | ExternalModuleReference;export type StringLiteralLike = StringLiteral | NoSubstitutionTemplateLiteral;export type TypeElementTypes = PropertySignature | MethodSignature | ConstructSignatureDeclaration | CallSignatureDeclaration | IndexSignatureDeclaration | GetAccessorDeclaration | SetAccessorDeclaration;export type TemplateLiteral = TemplateExpression | NoSubstitutionTemplateLiteral;/** * Local target declarations. * @remarks This may be missing some types. Please open an issue if this returns a type not listed here. */export type LocalTargetDeclarations = SourceFile | ClassDeclaration | InterfaceDeclaration | EnumDeclaration | FunctionDeclaration | VariableDeclaration | TypeAliasDeclaration | ModuleDeclaration | ExportAssignment;/** * Declarations that can be exported from a module. * @remarks This may be missing some types. Please open an issue if this returns a type not listed here. */export type ExportedDeclarations = ClassDeclaration | InterfaceDeclaration | EnumDeclaration | FunctionDeclaration | VariableDeclaration | TypeAliasDeclaration | ModuleDeclaration | Expression | SourceFile;export declare function AmbientableNode<T extends Constructor<AmbientableNodeExtensionType>>(Base: T): Constructor<AmbientableNode> & T;
export interface AmbientableNode { /** If the node has the declare keyword. */ hasDeclareKeyword(): boolean; /** Gets the declare keyword or undefined if none exists. */ getDeclareKeyword(): Node | undefined; /** Gets the declare keyword or throws if it doesn't exist. */ getDeclareKeywordOrThrow(message?: string | (() => string)): Node; /** Gets if the node is ambient. */ isAmbient(): boolean; /** * Sets if this node has a declare keyword. * @param value - To add the declare keyword or not. */ setHasDeclareKeyword(value?: boolean): this;}
type AmbientableNodeExtensionType = Node & ModifierableNode;export declare function ArgumentedNode<T extends Constructor<ArgumentedNodeExtensionType>>(Base: T): Constructor<ArgumentedNode> & T;
export interface ArgumentedNode { /** Gets all the arguments of the node. */ getArguments(): Node[]; /** * Adds an argument. * @param argumentText - Argument text to add. */ addArgument(argumentText: string | WriterFunction): Node; /** * Adds arguments. * @param argumentTexts - Argument texts to add. */ addArguments(argumentTexts: ReadonlyArray<string | WriterFunction> | WriterFunction): Node[]; /** * Inserts an argument. * @param index - Child index to insert at. * @param argumentText - Argument text to insert. */ insertArgument(index: number, argumentText: string | WriterFunction): Node; /** * Inserts arguments. * @param index - Child index to insert at. * @param argumentTexts - Argument texts to insert. */ insertArguments(index: number, argumentTexts: ReadonlyArray<string | WriterFunction> | WriterFunction): Node[]; /** * Removes an argument. * @param arg - Argument to remove. */ removeArgument(arg: Node): this; /** * Removes an argument. * @param index - Index to remove. */ removeArgument(index: number): this;}
type ArgumentedNodeExtensionType = Node<ts.Node & { arguments?: ts.NodeArray<ts.Node>; }>;export declare function AsyncableNode<T extends Constructor<AsyncableNodeExtensionType>>(Base: T): Constructor<AsyncableNode> & T;
export interface AsyncableNode { /** If it's async. */ isAsync(): boolean; /** Gets the async keyword or undefined if none exists. */ getAsyncKeyword(): Node<ts.AsyncKeyword> | undefined; /** Gets the async keyword or throws if none exists. */ getAsyncKeywordOrThrow(message?: string | (() => string)): Node<ts.AsyncKeyword>; /** * Sets if the node is async. * @param value - If it should be async or not. */ setIsAsync(value: boolean): this;}
type AsyncableNodeExtensionType = Node & ModifierableNode;export declare function AwaitableNode<T extends Constructor<AwaitableNodeExtensionType>>(Base: T): Constructor<AwaitableNode> & T;
export interface AwaitableNode { /** If it's an awaited node. */ isAwaited(): boolean; /** Gets the await token or undefined if none exists. */ getAwaitKeyword(): Node<ts.AwaitKeyword> | undefined; /** Gets the await token or throws if none exists. */ getAwaitKeywordOrThrow(message?: string | (() => string)): Node<ts.AwaitKeyword>; /** * Sets if the node is awaited. * @param value - If it should be awaited or not. */ setIsAwaited(value: boolean): this;}
type AwaitableNodeExtensionType = Node<ts.Node & { awaitModifier?: ts.AwaitKeyword; }>;export declare function BodiedNode<T extends Constructor<BodiedNodeExtensionType>>(Base: T): Constructor<BodiedNode> & T;
export interface BodiedNode { /** Gets the body. */ getBody(): Node; /** * Sets the body text. * @param textOrWriterFunction - Text or writer function to set as the body. */ setBodyText(textOrWriterFunction: string | WriterFunction): this; /** Gets the body text without leading whitespace, leading indentation, or trailing whitespace. */ getBodyText(): string;}
type BodiedNodeExtensionType = Node<ts.Node & { body: ts.Node; }>;export declare function BodyableNode<T extends Constructor<BodyableNodeExtensionType>>(Base: T): Constructor<BodyableNode> & T;
export interface BodyableNode { /** Gets the body or throws an error if it doesn't exist. */ getBodyOrThrow(message?: string | (() => string)): Node; /** Gets the body if it exists. */ getBody(): Node | undefined; /** Gets the body text without leading whitespace, leading indentation, or trailing whitespace. Returns undefined if there is no body. */ getBodyText(): string | undefined; /** Gets if the node has a body. */ hasBody(): boolean; /** * Sets the body text. A body is required to do this operation. * @param textOrWriterFunction - Text or writer function to set as the body. */ setBodyText(textOrWriterFunction: string | WriterFunction): this; /** Adds a body if it doesn't exists. */ addBody(): this; /** Removes the body if it exists. */ removeBody(): this;}
type BodyableNodeExtensionType = Node<ts.Node & { body?: ts.Node; }>;export declare function ChildOrderableNode<T extends Constructor<ChildOrderableNodeExtensionType>>(Base: T): Constructor<ChildOrderableNode> & T;
export interface ChildOrderableNode { /** Sets the child order of the node within the parent. */ setOrder(order: number): this;}
type ChildOrderableNodeExtensionType = Node;export declare function DecoratableNode<T extends Constructor<DecoratableNodeExtensionType>>(Base: T): Constructor<DecoratableNode> & T;
export interface DecoratableNode { /** * Gets a decorator or undefined if it doesn't exist. * @param name - Name of the parameter. */ getDecorator(name: string): Decorator | undefined; /** * Gets a decorator or undefined if it doesn't exist. * @param findFunction - Function to use to find the parameter. */ getDecorator(findFunction: (declaration: Decorator) => boolean): Decorator | undefined; /** * Gets a decorator or throws if it doesn't exist. * @param name - Name of the parameter. */ getDecoratorOrThrow(name: string): Decorator; /** * Gets a decorator or throws if it doesn't exist. * @param findFunction - Function to use to find the parameter. */ getDecoratorOrThrow(findFunction: (declaration: Decorator) => boolean): Decorator; /** Gets all the decorators of the node. */ getDecorators(): Decorator[]; /** * Adds a decorator. * @param structure - Structure of the decorator. */ addDecorator(structure: OptionalKind<DecoratorStructure>): Decorator; /** * Adds decorators. * @param structures - Structures of the decorators. */ addDecorators(structures: ReadonlyArray<OptionalKind<DecoratorStructure>>): Decorator[]; /** * Inserts a decorator. * @param index - Child index to insert at. Specify a negative index to insert from the reverse. * @param structure - Structure of the decorator. */ insertDecorator(index: number, structure: OptionalKind<DecoratorStructure>): Decorator; /** * Insert decorators. * @param index - Child index to insert at. * @param structures - Structures to insert. */ insertDecorators(index: number, structures: ReadonlyArray<OptionalKind<DecoratorStructure>>): Decorator[];}
type DecoratableNodeExtensionType = Node<ts.Node> & ModifierableNode;export declare function DotDotDotTokenableNode<T extends Constructor<DotDotDotTokenableNodeExtensionType>>(Base: T): Constructor<DotDotDotTokenableNode> & T;
export interface DotDotDotTokenableNode { /** Gets the dot dot dot token (...) if it exists or returns undefined */ getDotDotDotToken(): Node<ts.DotDotDotToken> | undefined; /** Gets the dot dot dot token (...) if it exists or throws if not. */ getDotDotDotTokenOrThrow(message?: string | (() => string)): Node<ts.DotDotDotToken>;}
type DotDotDotTokenableNodeExtensionType = Node<ts.Node & { dotDotDotToken?: ts.DotDotDotToken; }>;export declare function ExclamationTokenableNode<T extends Constructor<ExclamationTokenableNodeExtensionType>>(Base: T): Constructor<ExclamationTokenableNode> & T;
export interface ExclamationTokenableNode { /** If it has a exclamation token. */ hasExclamationToken(): boolean; /** Gets the exclamation token node or returns undefined if it doesn't exist. */ getExclamationTokenNode(): Node<ts.ExclamationToken> | undefined; /** Gets the exclamation token node or throws. */ getExclamationTokenNodeOrThrow(message?: string | (() => string)): Node<ts.ExclamationToken>; /** * Sets if this node has a exclamation token. * @param value - If it should have a exclamation token or not. */ setHasExclamationToken(value: boolean): this;}
type ExclamationTokenableNodeExtensionType = Node<ts.Node & { exclamationToken?: ts.ExclamationToken; }>;export declare function ExportableNode<T extends Constructor<ExportableNodeExtensionType>>(Base: T): Constructor<ExportableNode> & T;
export interface ExportableNode extends ExportGetableNode { /** * Sets if this node is a default export of a file. * @param value - If it should be a default export or not. */ setIsDefaultExport(value: boolean): this; /** * Sets if the node is exported. * * Note: Will remove the default keyword if set. * @param value - If it should be exported or not. */ setIsExported(value: boolean): this;}
type ExportableNodeExtensionType = Node & ModifierableNode;export declare function ExportGetableNode<T extends Constructor<ExportGetableNodeExtensionType>>(Base: T): Constructor<ExportGetableNode> & T;
export interface ExportGetableNode { /** If the node has the export keyword. */ hasExportKeyword(): boolean; /** Gets the export keyword or undefined if none exists. */ getExportKeyword(): Node | undefined; /** Gets the export keyword or throws if none exists. */ getExportKeywordOrThrow(message?: string | (() => string)): Node; /** If the node has the default keyword. */ hasDefaultKeyword(): boolean; /** Gets the default keyword or undefined if none exists. */ getDefaultKeyword(): Node | undefined; /** Gets the default keyword or throws if none exists. */ getDefaultKeywordOrThrow(message?: string | (() => string)): Node; /** Gets if the node is exported from a namespace, is a default export, or is a named export. */ isExported(): boolean; /** Gets if this node is a default export of a file. */ isDefaultExport(): boolean; /** Gets if this node is a named export of a file. */ isNamedExport(): boolean;}
type ExportGetableNodeExtensionType = Node;export declare function ExtendsClauseableNode<T extends Constructor<ExtendsClauseableNodeExtensionType>>(Base: T): Constructor<ExtendsClauseableNode> & T;
export interface ExtendsClauseableNode { /** Gets the extends clauses. */ getExtends(): ExpressionWithTypeArguments[]; /** * Adds multiple extends clauses. * @param texts - Texts to add for the extends clause. */ addExtends(texts: ReadonlyArray<string | WriterFunction> | WriterFunction): ExpressionWithTypeArguments[]; /** * Adds an extends clause. * @param text - Text to add for the extends clause. */ addExtends(text: string): ExpressionWithTypeArguments; /** * Inserts multiple extends clauses. * @param texts - Texts to insert for the extends clause. */ insertExtends(index: number, texts: ReadonlyArray<string | WriterFunction> | WriterFunction): ExpressionWithTypeArguments[]; /** * Inserts an extends clause. * @param text - Text to insert for the extends clause. */ insertExtends(index: number, text: string): ExpressionWithTypeArguments; /** * Removes the extends at the specified index. * @param index - Index to remove. */ removeExtends(index: number): this; /** * Removes the specified extends. * @param extendsNode - Node of the extend to remove. */ removeExtends(extendsNode: ExpressionWithTypeArguments): this;}
type ExtendsClauseableNodeExtensionType = Node & HeritageClauseableNode;export declare function GeneratorableNode<T extends Constructor<GeneratorableNodeExtensionType>>(Base: T): Constructor<GeneratorableNode> & T;
export interface GeneratorableNode { /** If it's a generator function. */ isGenerator(): boolean; /** Gets the asterisk token or undefined if none exists. */ getAsteriskToken(): Node<ts.AsteriskToken> | undefined; /** Gets the asterisk token or throws if none exists. */ getAsteriskTokenOrThrow(message?: string | (() => string)): Node<ts.AsteriskToken>; /** * Sets if the node is a generator. * @param value - If it should be a generator or not. */ setIsGenerator(value: boolean): this;}
type GeneratorableNodeExtensionType = Node<ts.Node & { asteriskToken?: ts.AsteriskToken; }>;export declare function HeritageClauseableNode<T extends Constructor<HeritageClauseableNodeExtensionType>>(Base: T): Constructor<HeritageClauseableNode> & T;
export interface HeritageClauseableNode { /** Gets the heritage clauses of the node. */ getHeritageClauses(): HeritageClause[]; /** * Gets the heritage clause by kind. * @kind - Kind of heritage clause. */ getHeritageClauseByKind(kind: SyntaxKind.ExtendsKeyword | SyntaxKind.ImplementsKeyword): HeritageClause | undefined; /** * Gets the heritage clause by kind or throws if it doesn't exist. * @kind - Kind of heritage clause. */ getHeritageClauseByKindOrThrow(kind: SyntaxKind.ExtendsKeyword | SyntaxKind.ImplementsKeyword): HeritageClause;}
type HeritageClauseableNodeExtensionType = Node<ts.Node & { heritageClauses?: ts.NodeArray<ts.HeritageClause>; }>;export declare function ImplementsClauseableNode<T extends Constructor<ImplementsClauseableNodeExtensionType>>(Base: T): Constructor<ImplementsClauseableNode> & T;
export interface ImplementsClauseableNode { /** Gets the implements clauses. */ getImplements(): ExpressionWithTypeArguments[]; /** * Adds an implements clause. * @param text - Text to add for the implements clause. */ addImplements(text: string): ExpressionWithTypeArguments; /** * Adds multiple implements clauses. * @param text - Texts to add for the implements clause. */ addImplements(text: ReadonlyArray<string | WriterFunction> | WriterFunction): ExpressionWithTypeArguments[]; /** * Inserts an implements clause. * @param text - Text to insert for the implements clause. */ insertImplements(index: number, texts: ReadonlyArray<string | WriterFunction> | WriterFunction): ExpressionWithTypeArguments[]; /** * Inserts multiple implements clauses. * @param text - Texts to insert for the implements clause. */ insertImplements(index: number, text: string): ExpressionWithTypeArguments; /** * Removes the implements at the specified index. * @param index - Index to remove. */ removeImplements(index: number): this; /** * Removes the specified implements. * @param implementsNode - Node of the implements to remove. */ removeImplements(implementsNode: ExpressionWithTypeArguments): this;}
type ImplementsClauseableNodeExtensionType = Node & HeritageClauseableNode;export declare function InitializerExpressionableNode<T extends Constructor<InitializerExpressionableNodeExtensionType>>(Base: T): Constructor<InitializerExpressionableNode> & T;
export interface InitializerExpressionableNode extends InitializerExpressionGetableNode { /** Removes the initializer. */ removeInitializer(): this; /** * Sets the initializer. * @param text - Text or writer function to set for the initializer. */ setInitializer(textOrWriterFunction: string | WriterFunction): this;}
type InitializerExpressionableNodeExtensionType = Node<ts.Node & { initializer?: ts.Expression; }>;export declare function InitializerExpressionGetableNode<T extends Constructor<InitializerExpressionGetableNodeExtensionType>>(Base: T): Constructor<InitializerExpressionGetableNode> & T;
export interface InitializerExpressionGetableNode { /** Gets if node has an initializer. */ hasInitializer(): boolean; /** Gets the initializer. */ getInitializer(): Expression | undefined; /** Gets the initializer if it's a certain kind or throws. */ getInitializerIfKindOrThrow<TKind extends SyntaxKind>(kind: TKind): KindToExpressionMappings[TKind]; /** Gets the initializer if it's a certain kind. */ getInitializerIfKind<TKind extends SyntaxKind>(kind: TKind): KindToExpressionMappings[TKind] | undefined; /** Gets the initializer or throw. */ getInitializerOrThrow(message?: string | (() => string)): Expression;}
type InitializerExpressionGetableNodeExtensionType = Node<ts.Node & { initializer?: ts.Expression; }>;export declare function JSDocableNode<T extends Constructor<JSDocableNodeExtensionType>>(Base: T): Constructor<JSDocableNode> & T;
export interface JSDocableNode { /** Gets the JS doc nodes. */ getJsDocs(): JSDoc[]; /** * Adds a JS doc. * @param structure - Structure to add. */ addJsDoc(structure: OptionalKind<JSDocStructure> | string | WriterFunction): JSDoc; /** * Adds JS docs. * @param structures - Structures to add. */ addJsDocs(structures: ReadonlyArray<OptionalKind<JSDocStructure> | string | WriterFunction>): JSDoc[]; /** * Inserts a JS doc. * @param index - Child index to insert at. * @param structure - Structure to insert. */ insertJsDoc(index: number, structure: OptionalKind<JSDocStructure> | string | WriterFunction): JSDoc; /** * Inserts JS docs. * @param index - Child index to insert at. * @param structures - Structures to insert. */ insertJsDocs(index: number, structures: ReadonlyArray<OptionalKind<JSDocStructure> | string | WriterFunction>): JSDoc[];}
type JSDocableNodeExtensionType = Node<ts.Node & { jsDoc?: ts.NodeArray<ts.JSDoc>; }>;export declare function LiteralLikeNode<T extends Constructor<LiteralLikeNodeExtensionType>>(Base: T): Constructor<LiteralLikeNode> & T;
export interface LiteralLikeNode { /** Get text of the literal. */ getLiteralText(): string; /** Gets if the literal is terminated. */ isTerminated(): boolean; /** Gets if the literal has an extended unicode escape. */ hasExtendedUnicodeEscape(): boolean;}
type LiteralLikeNodeExtensionType = Node<ts.LiteralLikeNode>;export declare function ModifierableNode<T extends Constructor<ModifierableNodeExtensionType>>(Base: T): Constructor<ModifierableNode> & T;
export interface ModifierableNode { /** Gets the node's modifiers. */ getModifiers(): Node<ts.Modifier>[]; /** * Gets the first modifier of the specified syntax kind or throws if none found. * @param kind - Syntax kind. */ getFirstModifierByKindOrThrow<TKind extends SyntaxKind>(kind: TKind): KindToNodeMappings[TKind]; /** * Gets the first modifier of the specified syntax kind or undefined if none found. * @param kind - Syntax kind. */ getFirstModifierByKind<TKind extends SyntaxKind>(kind: TKind): KindToNodeMappings[TKind] | undefined; /** * Gets if it has the specified modifier. * @param kind - Syntax kind to check for. */ hasModifier(kind: SyntaxKind): boolean; /** * Gets if it has the specified modifier. * @param text - Text to check for. */ hasModifier(text: ModifierTexts): boolean; /** * Toggles a modifier. * @param text - Text to toggle the modifier for. * @param value - Optional toggling value. */ toggleModifier(text: ModifierTexts, value?: boolean): this;}
type ModifierableNodeExtensionType = Node;export type ModifierTexts = "export" | "default" | "declare" | "abstract" | "public" | "protected" | "private" | "readonly" | "static" | "async" | "const" | "override" | "in" | "out" | "accessor";export declare function ModuledNode<T extends Constructor<ModuledNodeExtensionType>>(Base: T): Constructor<ModuledNode> & T;
export interface ModuledNode { /** * Adds an import. * @param structure - Structure that represents the import. */ addImportDeclaration(structure: OptionalKind<ImportDeclarationStructure>): ImportDeclaration; /** * Adds imports. * @param structures - Structures that represent the imports. */ addImportDeclarations(structures: ReadonlyArray<OptionalKind<ImportDeclarationStructure>>): ImportDeclaration[]; /** * Insert an import. * @param index - Child index to insert at. * @param structure - Structure that represents the import. */ insertImportDeclaration(index: number, structure: OptionalKind<ImportDeclarationStructure>): ImportDeclaration; /** * Inserts imports. * @param index - Child index to insert at. * @param structures - Structures that represent the imports to insert. */ insertImportDeclarations(index: number, structures: ReadonlyArray<OptionalKind<ImportDeclarationStructure>>): ImportDeclaration[]; /** * Gets the first import declaration that matches a condition, or undefined if it doesn't exist. * @param condition - Condition to get the import declaration by. */ getImportDeclaration(condition: (importDeclaration: ImportDeclaration) => boolean): ImportDeclaration | undefined; /** * Gets the first import declaration that matches a module specifier, or undefined if it doesn't exist. * @param module - Module specifier to get the import declaration by. */ getImportDeclaration(moduleSpecifier: string): ImportDeclaration | undefined; /** * Gets the first import declaration that matches a condition, or throws if it doesn't exist. * @param condition - Condition to get the import declaration by. */ getImportDeclarationOrThrow(condition: (importDeclaration: ImportDeclaration) => boolean): ImportDeclaration; /** * Gets the first import declaration that matches a module specifier, or throws if it doesn't exist. * @param module - Module specifier to get the import declaration by. */ getImportDeclarationOrThrow(moduleSpecifier: string): ImportDeclaration; /** Get the module's import declarations. */ getImportDeclarations(): ImportDeclaration[]; /** * Add export declarations. * @param structure - Structure that represents the export. */ addExportDeclaration(structure: OptionalKind<ExportDeclarationStructure>): ExportDeclaration; /** * Add export declarations. * @param structures - Structures that represent the exports. */ addExportDeclarations(structures: ReadonlyArray<OptionalKind<ExportDeclarationStructure>>): ExportDeclaration[]; /** * Insert an export declaration. * @param index - Child index to insert at. * @param structure - Structure that represents the export. */ insertExportDeclaration(index: number, structure: OptionalKind<ExportDeclarationStructure>): ExportDeclaration; /** * Insert export declarations. * @param index - Child index to insert at. * @param structures - Structures that represent the exports to insert. */ insertExportDeclarations(index: number, structures: ReadonlyArray<OptionalKind<ExportDeclarationStructure>>): ExportDeclaration[]; getExportDeclaration(condition: (exportDeclaration: ExportDeclaration) => boolean, message?: string | (() => string)): ExportDeclaration | undefined; /** * Gets the first export declaration that matches a module specifier, or undefined if it doesn't exist. * @param module - Module specifier to get the export declaration by. */ getExportDeclaration(moduleSpecifier: string): ExportDeclaration | undefined; /** * Gets the first export declaration that matches a condition, or throws if it doesn't exist. * @param condition - Condition to get the export declaration by. */ getExportDeclarationOrThrow(condition: (exportDeclaration: ExportDeclaration) => boolean, message?: string | (() => string)): ExportDeclaration; /** * Gets the first export declaration that matches a module specifier, or throws if it doesn't exist. * @param module - Module specifier to get the export declaration by. */ getExportDeclarationOrThrow(moduleSpecifier: string, message?: string | (() => string)): ExportDeclaration; /** Get the export declarations. */ getExportDeclarations(): ExportDeclaration[]; /** * Add export assignments. * @param structure - Structure that represents the export. */ addExportAssignment(structure: OptionalKind<ExportAssignmentStructure>): ExportAssignment; /** * Add export assignments. * @param structures - Structures that represent the exports. */ addExportAssignments(structures: ReadonlyArray<OptionalKind<ExportAssignmentStructure>>): ExportAssignment[]; /** * Insert an export assignment. * @param index - Child index to insert at. * @param structure - Structure that represents the export. */ insertExportAssignment(index: number, structure: OptionalKind<ExportAssignmentStructure>): ExportAssignment; /** * Insert export assignments into a file. * @param index - Child index to insert at. * @param structures - Structures that represent the exports to insert. */ insertExportAssignments(index: number, structures: ReadonlyArray<OptionalKind<ExportAssignmentStructure>>): ExportAssignment[]; /** * Gets the first export assignment that matches a condition, or undefined if it doesn't exist. * @param condition - Condition to get the export assignment by. */ getExportAssignment(condition: (exportAssignment: ExportAssignment) => boolean): ExportAssignment | undefined; /** * Gets the first export assignment that matches a condition, or throws if it doesn't exist. * @param condition - Condition to get the export assignment by. */ getExportAssignmentOrThrow(condition: (exportAssignment: ExportAssignment) => boolean, message?: string | (() => string)): ExportAssignment; /** Get the file's export assignments. */ getExportAssignments(): ExportAssignment[]; /** Gets the default export symbol. */ getDefaultExportSymbol(): Symbol | undefined; /** Gets the default export symbol or throws if it doesn't exist. */ getDefaultExportSymbolOrThrow(message?: string | (() => string)): Symbol; /** Gets the export symbols. */ getExportSymbols(): Symbol[]; /** * Gets all the declarations that are exported from the module. * * The key is the name it's exported on and the value is the array of declarations for that name. * * This will include declarations that are transitively exported from other modules. If you mean to get the export * declarations then use `.getExportDeclarations()`. */ getExportedDeclarations(): ReadonlyMap<string, ExportedDeclarations[]>; /** Removes any "export default". */ removeDefaultExport(defaultExportSymbol?: Symbol | undefined): this;}
type ModuledNodeExtensionType = Node<ts.SourceFile | ts.ModuleDeclaration> & StatementedNode;export declare function BindingNamedNode<T extends Constructor<BindingNamedNodeExtensionType>>(Base: T): Constructor<BindingNamedNode> & T;
export interface BindingNamedNode extends BindingNamedNodeSpecific, ReferenceFindableNode, RenameableNode {}
type BindingNamedNodeExtensionType = NamedNodeBaseExtensionType<ts.BindingName>;export type BindingNamedNodeSpecific = NamedNodeSpecificBase<BindingName>;export declare function ImportAttributeNamedNode<T extends Constructor<ImportAttributeNamedNodeExtensionType>>(Base: T): Constructor<ImportAttributeNamedNode> & T;
export interface ImportAttributeNamedNode extends ImportAttributeNamedNodeSpecific, ReferenceFindableNode, RenameableNode {}
type ImportAttributeNamedNodeExtensionType = NamedNodeBaseExtensionType<ts.ImportAttributeName>;export type ImportAttributeNamedNodeSpecific = NamedNodeSpecificBase<AssertionKey>;export declare function ModuleNamedNode<T extends Constructor<ModuleNamedNodeExtensionType>>(Base: T): Constructor<ModuleNamedNode> & T;
export interface ModuleNamedNode extends ModuleNamedNodeSpecific, ReferenceFindableNode, RenameableNode {}
type ModuleNamedNodeExtensionType = NamedNodeBaseExtensionType<ts.ModuleName>;export type ModuleNamedNodeSpecific = NamedNodeSpecificBase<ModuleName>;export declare function NameableNode<T extends Constructor<NameableNodeExtensionType>>(Base: T): Constructor<NameableNode> & T;
export interface NameableNode extends NameableNodeSpecific, ReferenceFindableNode, RenameableNode {}
type NameableNodeExtensionType = Node<ts.Node & { name?: ts.Identifier; }>;export interface NameableNodeSpecific { /** Gets the name node if it exists. */ getNameNode(): Identifier | undefined; /** Gets the name node if it exists, or throws. */ getNameNodeOrThrow(message?: string | (() => string)): Identifier; /** Gets the name if it exists. */ getName(): string | undefined; /** Gets the name if it exists, or throws. */ getNameOrThrow(message?: string | (() => string)): string; /** Removes the name from the node. */ removeName(): this;}
export declare function NamedNode<T extends Constructor<NamedNodeExtensionType>>(Base: T): Constructor<NamedNode> & T;
export interface NamedNode extends NamedNodeSpecific, ReferenceFindableNode, RenameableNode {}
type NamedNodeExtensionType = NamedNodeBaseExtensionType<ts.Identifier>;export type NamedNodeSpecific = NamedNodeSpecificBase<Identifier>;export declare function NamedNodeBase<TCompilerNode extends ts.Node, U extends Constructor<NamedNodeBaseExtensionType<TCompilerNode>>>(Base: U): Constructor<NamedNodeSpecificBase<CompilerNodeToWrappedType<TCompilerNode>>> & U;
export interface NamedNodeSpecificBase<TNode extends Node> { /** Gets the name node. */ getNameNode(): TNode; /** Gets the name as a string. */ getName(): string;}
type NamedNodeBaseExtensionType<TCompilerNode extends ts.Node> = Node<ts.Node & { name: TCompilerNode; }>;export declare function PropertyNamedNode<T extends Constructor<PropertyNamedNodeExtensionType>>(Base: T): Constructor<PropertyNamedNode> & T;
export interface PropertyNamedNode extends PropertyNamedNodeSpecific, ReferenceFindableNode, RenameableNode {}
type PropertyNamedNodeExtensionType = NamedNodeBaseExtensionType<ts.PropertyName>;export type PropertyNamedNodeSpecific = NamedNodeSpecificBase<PropertyName>;export declare function ReferenceFindableNode<T extends Constructor<ReferenceFindableNodeExtensionType>>(Base: T): Constructor<ReferenceFindableNode> & T;
export interface ReferenceFindableNode { /** Finds the references of the definition of the node. */ findReferences(): ReferencedSymbol[]; /** Finds the nodes that reference the definition of the node. */ findReferencesAsNodes(): Node[];}
type ReferenceFindableNodeExtensionType = Node<ts.Node & { name?: ts.PropertyName | ts.BindingName | ts.DeclarationName | ts.StringLiteral; }>;export declare function RenameableNode<T extends Constructor<RenameableNodeExtensionType>>(Base: T): Constructor<RenameableNode> & T;
export interface RenameableNode { /** * Renames the name of the node. * @param newName - New name. * @param options - Options for renaming. */ rename(newName: string, options?: RenameOptions): this;}
type RenameableNodeExtensionType = Node<ts.Node>;export declare function OverrideableNode<T extends Constructor<OverrideableNodeExtensionType>>(Base: T): Constructor<OverrideableNode> & T;
export interface OverrideableNode { /** If it has an override keyword. */ hasOverrideKeyword(): boolean; /** Gets the override keyword or undefined if none exists. */ getOverrideKeyword(): Node<ts.OverrideKeyword> | undefined; /** Gets the override keyword or throws if none exists. */ getOverrideKeywordOrThrow(message?: string | (() => string)): Node<ts.Modifier>; /** * Sets if the node has an override keyword. * @param value - If it should have an override keyword or not. */ setHasOverrideKeyword(value: boolean): this;}
type OverrideableNodeExtensionType = Node & ModifierableNode;export declare function ParameteredNode<T extends Constructor<ParameteredNodeExtensionType>>(Base: T): Constructor<ParameteredNode> & T;
export interface ParameteredNode { /** * Gets a parameter or undefined if it doesn't exist. * @param name - Name of the parameter. */ getParameter(name: string): ParameterDeclaration | undefined; /** * Gets a parameter or undefined if it doesn't exist. * @param findFunction - Function to use to find the parameter. */ getParameter(findFunction: (declaration: ParameterDeclaration) => boolean): ParameterDeclaration | undefined; /** * Gets a parameter or throws if it doesn't exist. * @param name - Name of the parameter. */ getParameterOrThrow(name: string): ParameterDeclaration; /** * Gets a parameter or throws if it doesn't exist. * @param findFunction - Function to use to find the parameter. */ getParameterOrThrow(findFunction: (declaration: ParameterDeclaration) => boolean): ParameterDeclaration; /** Gets all the parameters of the node. */ getParameters(): ParameterDeclaration[]; /** * Adds a parameter. * @param structure - Structure of the parameter. */ addParameter(structure: OptionalKind<ParameterDeclarationStructure>): ParameterDeclaration; /** * Adds parameters. * @param structures - Structures of the parameters. */ addParameters(structures: ReadonlyArray<OptionalKind<ParameterDeclarationStructure>>): ParameterDeclaration[]; /** * Inserts parameters. * @param index - Child index to insert at. * @param structures - Parameters to insert. */ insertParameters(index: number, structures: ReadonlyArray<OptionalKind<ParameterDeclarationStructure>>): ParameterDeclaration[]; /** * Inserts a parameter. * @param index - Child index to insert at. * @param structures - Parameter to insert. */ insertParameter(index: number, structure: OptionalKind<ParameterDeclarationStructure>): ParameterDeclaration;}
type ParameteredNodeExtensionType = Node<ts.Node & { parameters: ts.NodeArray<ts.ParameterDeclaration>; }>;export declare function QuestionDotTokenableNode<T extends Constructor<QuestionDotTokenableNodeExtensionType>>(Base: T): Constructor<QuestionDotTokenableNode> & T;
export interface QuestionDotTokenableNode { /** If it has a question dot token. */ hasQuestionDotToken(): boolean; /** Gets the question dot token node or returns undefined if it doesn't exist. */ getQuestionDotTokenNode(): Node<ts.QuestionDotToken> | undefined; /** Gets the question dot token node or throws. */ getQuestionDotTokenNodeOrThrow(message?: string | (() => string)): Node<ts.QuestionDotToken>; /** * Sets if this node has a question dot token. * @param value - If it should have a question dot token or not. */ setHasQuestionDotToken(value: boolean): this;}
type QuestionDotTokenableNodeExtensionType = Node<ts.Node & { questionDotToken?: ts.QuestionDotToken; }>;export declare function QuestionTokenableNode<T extends Constructor<QuestionTokenableNodeExtensionType>>(Base: T): Constructor<QuestionTokenableNode> & T;
export interface QuestionTokenableNode { /** If it has a question token. */ hasQuestionToken(): boolean; /** Gets the question token node or returns undefined if it doesn't exist. */ getQuestionTokenNode(): Node<ts.QuestionToken> | undefined; /** Gets the question token node or throws. */ getQuestionTokenNodeOrThrow(message?: string | (() => string)): Node<ts.QuestionToken>; /** * Sets if this node has a question token. * @param value - If it should have a question token or not. */ setHasQuestionToken(value: boolean): this;}
type QuestionTokenableNodeExtensionType = Node<ts.Node & { questionToken?: ts.QuestionToken; }>;export declare function ReadonlyableNode<T extends Constructor<ReadonlyableNodeExtensionType>>(Base: T): Constructor<ReadonlyableNode> & T;
export interface ReadonlyableNode { /** Gets if it's readonly. */ isReadonly(): boolean; /** Gets the readonly keyword, or undefined if none exists. */ getReadonlyKeyword(): Node | undefined; /** Gets the readonly keyword, or throws if none exists. */ getReadonlyKeywordOrThrow(message?: string | (() => string)): Node; /** * Sets if this node is readonly. * @param value - If readonly or not. */ setIsReadonly(value: boolean): this;}
type ReadonlyableNodeExtensionType = Node & ModifierableNode;export declare function ReturnTypedNode<T extends Constructor<ReturnTypedNodeExtensionType>>(Base: T): Constructor<ReturnTypedNode> & T;
export interface ReturnTypedNode { /** Gets the return type. */ getReturnType(): Type; /** Gets the return type node or undefined if none exists. */ getReturnTypeNode(): TypeNode | undefined; /** Gets the return type node or throws if none exists. */ getReturnTypeNodeOrThrow(message?: string | (() => string)): TypeNode; /** * Sets the return type of the node. * @param textOrWriterFunction - Text or writer function to set the return type with. */ setReturnType(textOrWriterFunction: string | WriterFunction): this; /** Removes the return type. */ removeReturnType(): this; /** Gets the signature of the node from the type checker. */ getSignature(): Signature;}
type ReturnTypedNodeExtensionType = Node<ts.SignatureDeclaration>;export declare function ScopeableNode<T extends Constructor<ScopeableNodeExtensionType>>(Base: T): Constructor<ScopeableNode> & T;
export interface ScopeableNode { /** * Gets the scope. */ getScope(): Scope | undefined; /** * Sets the scope. * @param scope - Scope to set to. */ setScope(scope: Scope | undefined): this; /** Gets if the node has a scope keyword. */ hasScopeKeyword(): boolean;}
type ScopeableNodeExtensionType = Node & ModifierableNode;export declare function ScopedNode<T extends Constructor<ScopedNodeExtensionType>>(Base: T): Constructor<ScopedNode> & T;
export interface ScopedNode { /** Gets the scope. */ getScope(): Scope; /** * Sets the scope. * @param scope - Scope to set to. */ setScope(scope: Scope | undefined): this; /** Gets if the node has a scope keyword. */ hasScopeKeyword(): boolean;}
type ScopedNodeExtensionType = Node & ModifierableNode;export declare function SignaturedDeclaration<T extends Constructor<SignaturedDeclarationExtensionType>>(Base: T): Constructor<SignaturedDeclaration> & T;
export interface SignaturedDeclaration extends ParameteredNode, ReturnTypedNode {}
type SignaturedDeclarationExtensionType = Node<ts.SignatureDeclaration>;export declare function StaticableNode<T extends Constructor<StaticableNodeExtensionType>>(Base: T): Constructor<StaticableNode> & T;
export interface StaticableNode { /** Gets if it's static. */ isStatic(): boolean; /** Gets the static keyword, or undefined if none exists. */ getStaticKeyword(): Node | undefined; /** Gets the static keyword, or throws if none exists. */ getStaticKeywordOrThrow(message?: string | (() => string)): Node; /** * Sets if the node is static. * @param value - If it should be static or not. */ setIsStatic(value: boolean): this;}
type StaticableNodeExtensionType = Node & ModifierableNode;export declare function TextInsertableNode<T extends Constructor<TextInsertableNodeExtensionType>>(Base: T): Constructor<TextInsertableNode> & T;
export interface TextInsertableNode { /** * Inserts text within the body of the node. * * WARNING: This will forget any previously navigated descendant nodes. * @param pos - Position to insert at. * @param textOrWriterFunction - Text to insert. */ insertText(pos: number, textOrWriterFunction: string | WriterFunction): this; /** * Replaces text within the body of the node. * * WARNING: This will forget any previously navigated descendant nodes. * @param range - Start and end position of the text to replace. * @param textOrWriterFunction - Text to replace the range with. */ replaceText(range: [number, number], textOrWriterFunction: string | WriterFunction): this; /** Removes all the text within the node */ removeText(): this; /** * Removes text within the body of the node. * * WARNING: This will forget any previously navigated descendant nodes. * @param pos - Start position to remove. * @param end - End position to remove. */ removeText(pos: number, end: number): this;}
type TextInsertableNodeExtensionType = Node;export declare function TypeArgumentedNode<T extends Constructor<TypeArgumentedNodeExtensionType>>(Base: T): Constructor<TypeArgumentedNode> & T;
export interface TypeArgumentedNode { /** Gets all the type arguments of the node. */ getTypeArguments(): TypeNode[]; /** * Adds a type argument. * @param argumentText - Argument text to add. */ addTypeArgument(argumentText: string): TypeNode; /** * Adds type arguments. * @param argumentTexts - Argument texts to add. */ addTypeArguments(argumentTexts: ReadonlyArray<string>): TypeNode[]; /** * Inserts a type argument. * @param index - Child index to insert at. * @param argumentText - Argument text to insert. */ insertTypeArgument(index: number, argumentText: string): TypeNode; /** * Inserts type arguments. * @param index - Child index to insert at. * @param argumentTexts - Argument texts to insert. */ insertTypeArguments(index: number, argumentTexts: ReadonlyArray<string>): TypeNode[]; /** * Removes a type argument. * @param typeArg - Type argument to remove. */ removeTypeArgument(typeArg: Node): this; /** * Removes a type argument. * @param index - Index to remove. */ removeTypeArgument(index: number): this;}
type TypeArgumentedNodeExtensionType = Node<ts.Node & { typeArguments?: ts.NodeArray<ts.TypeNode>; }>;export declare function TypedNode<T extends Constructor<TypedNodeExtensionType>>(Base: T): Constructor<TypedNode> & T;
export interface TypedNode { /** Gets the type node or undefined if none exists. */ getTypeNode(): TypeNode | undefined; /** Gets the type node or throws if none exists. */ getTypeNodeOrThrow(message?: string | (() => string)): TypeNode; /** * Sets the type. * @param textOrWriterFunction - Text or writer function to set the type with. */ setType(textOrWriterFunction: string | WriterFunction): this; /** Removes the type. */ removeType(): this;}
type TypedNodeExtensionType = Node<ts.Node & { type?: ts.TypeNode; }>;export declare function TypeElementMemberedNode<T extends Constructor<TypeElementMemberedNodeExtensionType>>(Base: T): Constructor<TypeElementMemberedNode> & T;
export interface TypeElementMemberedNode { /** * Adds a member. * @param member - Member to add. */ addMember(member: string | WriterFunction | TypeElementMemberStructures): TypeElementTypes | CommentTypeElement; /** * Adds members. * @param members - Collection of members to add. */ addMembers(members: string | WriterFunction | ReadonlyArray<string | WriterFunction | TypeElementMemberStructures>): (TypeElementTypes | CommentTypeElement)[]; /** * Inserts a member. * @param index - Child index to insert at. * @param member - Member to insert. */ insertMember(index: number, member: string | WriterFunction | TypeElementMemberStructures): TypeElementTypes | CommentTypeElement; /** * Inserts members. * @param index - Child index to insert at. * @param members - Collection of members to insert. */ insertMembers(index: number, members: string | WriterFunction | ReadonlyArray<string | WriterFunction | TypeElementMemberStructures>): (TypeElementTypes | CommentTypeElement)[]; /** * Add construct signature. * @param structure - Structure representing the construct signature. */ addConstructSignature(structure: OptionalKind<ConstructSignatureDeclarationStructure>): ConstructSignatureDeclaration; /** * Add construct signatures. * @param structures - Structures representing the construct signatures. */ addConstructSignatures(structures: ReadonlyArray<OptionalKind<ConstructSignatureDeclarationStructure>>): ConstructSignatureDeclaration[]; /** * Insert construct signature. * @param index - Child index to insert at. * @param structure - Structure representing the construct signature. */ insertConstructSignature(index: number, structure: OptionalKind<ConstructSignatureDeclarationStructure>): ConstructSignatureDeclaration; /** * Insert construct signatures. * @param index - Child index to insert at. * @param structures - Structures representing the construct signatures. */ insertConstructSignatures(index: number, structures: ReadonlyArray<OptionalKind<ConstructSignatureDeclarationStructure>>): ConstructSignatureDeclaration[]; /** * Gets the first construct signature by a find function. * @param findFunction - Function to find the construct signature by. */ getConstructSignature(findFunction: (member: ConstructSignatureDeclaration) => boolean): ConstructSignatureDeclaration | undefined; /** * Gets the first construct signature by a find function or throws if not found. * @param findFunction - Function to find the construct signature by. */ getConstructSignatureOrThrow(findFunction: (member: ConstructSignatureDeclaration) => boolean): ConstructSignatureDeclaration; /** Gets the interface construct signatures. */ getConstructSignatures(): ConstructSignatureDeclaration[]; /** * Add call signature. * @param structure - Structure representing the call signature. */ addCallSignature(structure: OptionalKind<CallSignatureDeclarationStructure>): CallSignatureDeclaration; /** * Add call signatures. * @param structures - Structures representing the call signatures. */ addCallSignatures(structures: ReadonlyArray<OptionalKind<CallSignatureDeclarationStructure>>): CallSignatureDeclaration[]; /** * Insert call signature. * @param index - Child index to insert at. * @param structure - Structure representing the call signature. */ insertCallSignature(index: number, structure: OptionalKind<CallSignatureDeclarationStructure>): CallSignatureDeclaration; /** * Insert call signatures. * @param index - Child index to insert at. * @param structures - Structures representing the call signatures. */ insertCallSignatures(index: number, structures: ReadonlyArray<OptionalKind<CallSignatureDeclarationStructure>>): CallSignatureDeclaration[]; /** * Gets the first call signature by a find function. * @param findFunction - Function to find the call signature by. */ getCallSignature(findFunction: (member: CallSignatureDeclaration) => boolean): CallSignatureDeclaration | undefined; /** * Gets the first call signature by a find function or throws if not found. * @param findFunction - Function to find the call signature by. */ getCallSignatureOrThrow(findFunction: (member: CallSignatureDeclaration) => boolean): CallSignatureDeclaration; /** Gets the interface call signatures. */ getCallSignatures(): CallSignatureDeclaration[]; /** * Add index signature. * @param structure - Structure representing the index signature. */ addIndexSignature(structure: OptionalKind<IndexSignatureDeclarationStructure>): IndexSignatureDeclaration; /** * Add index signatures. * @param structures - Structures representing the index signatures. */ addIndexSignatures(structures: ReadonlyArray<OptionalKind<IndexSignatureDeclarationStructure>>): IndexSignatureDeclaration[]; /** * Insert index signature. * @param index - Child index to insert at. * @param structure - Structure representing the index signature. */ insertIndexSignature(index: number, structure: OptionalKind<IndexSignatureDeclarationStructure>): IndexSignatureDeclaration; /** * Insert index signatures. * @param index - Child index to insert at. * @param structures - Structures representing the index signatures. */ insertIndexSignatures(index: number, structures: ReadonlyArray<OptionalKind<IndexSignatureDeclarationStructure>>): IndexSignatureDeclaration[]; /** * Gets the first index signature by a find function. * @param findFunction - Function to find the index signature by. */ getIndexSignature(findFunction: (member: IndexSignatureDeclaration) => boolean): IndexSignatureDeclaration | undefined; /** * Gets the first index signature by a find function or throws if not found. * @param findFunction - Function to find the index signature by. */ getIndexSignatureOrThrow(findFunction: (member: IndexSignatureDeclaration) => boolean): IndexSignatureDeclaration; /** Gets the interface index signatures. */ getIndexSignatures(): IndexSignatureDeclaration[]; /** * Add method. * @param structure - Structure representing the method. */ addMethod(structure: OptionalKind<MethodSignatureStructure>): MethodSignature; /** * Add methods. * @param structures - Structures representing the methods. */ addMethods(structures: ReadonlyArray<OptionalKind<MethodSignatureStructure>>): MethodSignature[]; /** * Insert method. * @param index - Child index to insert at. * @param structure - Structure representing the method. */ insertMethod(index: number, structure: OptionalKind<MethodSignatureStructure>): MethodSignature; /** * Insert methods. * @param index - Child index to insert at. * @param structures - Structures representing the methods. */ insertMethods(index: number, structures: ReadonlyArray<OptionalKind<MethodSignatureStructure>>): MethodSignature[]; /** * Gets the first method by name. * @param name - Name. */ getMethod(name: string): MethodSignature | undefined; /** * Gets the first method by a find function. * @param findFunction - Function to find the method by. */ getMethod(findFunction: (member: MethodSignature) => boolean): MethodSignature | undefined; /** * Gets the first method by name or throws if not found. * @param name - Name. */ getMethodOrThrow(name: string): MethodSignature; /** * Gets the first method by a find function or throws if not found. * @param findFunction - Function to find the method by. */ getMethodOrThrow(findFunction: (member: MethodSignature) => boolean): MethodSignature; /** Gets the interface method signatures. */ getMethods(): MethodSignature[]; /** * Add property. * @param structure - Structure representing the property. */ addProperty(structure: OptionalKind<PropertySignatureStructure>): PropertySignature; /** * Add properties. * @param structures - Structures representing the properties. */ addProperties(structures: ReadonlyArray<OptionalKind<PropertySignatureStructure>>): PropertySignature[]; /** * Insert property. * @param index - Child index to insert at. * @param structure - Structure representing the property. */ insertProperty(index: number, structure: OptionalKind<PropertySignatureStructure>): PropertySignature; /** * Insert properties. * @param index - Child index to insert at. * @param structures - Structures representing the properties. */ insertProperties(index: number, structures: ReadonlyArray<OptionalKind<PropertySignatureStructure>>): PropertySignature[]; /** * Gets the first property by name. * @param name - Name. */ getProperty(name: string): PropertySignature | undefined; /** * Gets the first property by a find function. * @param findFunction - Function to find the property by. */ getProperty(findFunction: (member: PropertySignature) => boolean): PropertySignature | undefined; /** * Gets the first property by name or throws if not found. * @param name - Name. */ getPropertyOrThrow(name: string): PropertySignature; /** * Gets the first property by a find function or throws if not found. * @param findFunction - Function to find the property by. */ getPropertyOrThrow(findFunction: (member: PropertySignature) => boolean): PropertySignature; /** Gets the interface property signatures. */ getProperties(): PropertySignature[]; /** * Add get accessor. * @param structure - Structure representing the get accessor. */ addGetAccessor(structure: OptionalKind<GetAccessorDeclarationStructure>): GetAccessorDeclaration; /** * Add get accessors. * @param structures - Structures representing the get accessors. */ addGetAccessors(structures: ReadonlyArray<OptionalKind<GetAccessorDeclarationStructure>>): GetAccessorDeclaration[]; /** * Insert get accessor. * @param index - Child index to insert at. * @param structure - Structure representing the get accessor. */ insertGetAccessor(index: number, structure: OptionalKind<GetAccessorDeclarationStructure>): GetAccessorDeclaration; /** * Insert get accessors. * @param index - Child index to insert at. * @param structures - Structures representing the get accessors. */ insertGetAccessors(index: number, structures: ReadonlyArray<OptionalKind<GetAccessorDeclarationStructure>>): GetAccessorDeclaration[]; /** * Gets the first get accessor by name. * @param name - Name. */ getGetAccessor(name: string): GetAccessorDeclaration | undefined; /** * Gets the first get accessor by a find function. * @param findFunction - Function to find the get accessor by. */ getGetAccessor(findFunction: (member: GetAccessorDeclaration) => boolean): GetAccessorDeclaration | undefined; /** * Gets the first get accessor by name or throws if not found. * @param name - Name. */ getGetAccessorOrThrow(name: string): GetAccessorDeclaration; /** * Gets the first get accessor by a find function or throws if not found. * @param findFunction - Function to find the get accessor by. */ getGetAccessorOrThrow(findFunction: (member: GetAccessorDeclaration) => boolean): GetAccessorDeclaration; /** Gets the interface get accessor declarations. */ getGetAccessors(): GetAccessorDeclaration[]; /** * Add set accessor. * @param structure - Structure representing the set accessor. */ addSetAccessor(structure: OptionalKind<SetAccessorDeclarationStructure>): SetAccessorDeclaration; /** * Add set accessors. * @param structures - Structures representing the set accessors. */ addSetAccessors(structures: ReadonlyArray<OptionalKind<SetAccessorDeclarationStructure>>): SetAccessorDeclaration[]; /** * Insert set accessor. * @param index - Child index to insert at. * @param structure - Structure representing the set accessor. */ insertSetAccessor(index: number, structure: OptionalKind<SetAccessorDeclarationStructure>): SetAccessorDeclaration; /** * Insert set accessors. * @param index - Child index to insert at. * @param structures - Structures representing the set accessors. */ insertSetAccessors(index: number, structures: ReadonlyArray<OptionalKind<SetAccessorDeclarationStructure>>): SetAccessorDeclaration[]; /** * Gets the first set accessor by name. * @param name - Name. */ getSetAccessor(name: string): SetAccessorDeclaration | undefined; /** * Gets the first set accessor by a find function. * @param findFunction - Function to find the set accessor by. */ getSetAccessor(findFunction: (member: SetAccessorDeclaration) => boolean): SetAccessorDeclaration | undefined; /** * Gets the first set accessor by name or throws if not found. * @param name - Name. */ getSetAccessorOrThrow(name: string): SetAccessorDeclaration; /** * Gets the first set accessor by a find function or throws if not found. * @param findFunction - Function to find the set accessor by. */ getSetAccessorOrThrow(findFunction: (member: SetAccessorDeclaration) => boolean): SetAccessorDeclaration; /** Gets the interface set accessor declarations. */ getSetAccessors(): SetAccessorDeclaration[]; /** Gets all the members. */ getMembers(): TypeElementTypes[]; /** Gets all the members with comment type elements. */ getMembersWithComments(): (TypeElementTypes | CommentTypeElement)[];}
type TypeElementMemberedNodeExtensionType = Node<ts.Node & { members: ts.NodeArray<ts.TypeElement>; }>;export declare function TypeParameteredNode<T extends Constructor<TypeParameteredNodeExtensionType>>(Base: T): Constructor<TypeParameteredNode> & T;
export interface TypeParameteredNode { /** * Gets a type parameter or undefined if it doesn't exist. * @param name - Name of the parameter. */ getTypeParameter(name: string): TypeParameterDeclaration | undefined; /** * Gets a type parameter or undefined if it doesn't exist. * @param findFunction - Function to use to find the type parameter. */ getTypeParameter(findFunction: (declaration: TypeParameterDeclaration) => boolean): TypeParameterDeclaration | undefined; /** * Gets a type parameter or throws if it doesn't exist. * @param name - Name of the parameter. */ getTypeParameterOrThrow(name: string): TypeParameterDeclaration; /** * Gets a type parameter or throws if it doesn't exist. * @param findFunction - Function to use to find the type parameter. */ getTypeParameterOrThrow(findFunction: (declaration: TypeParameterDeclaration) => boolean): TypeParameterDeclaration; /** Gets the type parameters. */ getTypeParameters(): TypeParameterDeclaration[]; /** * Adds a type parameter. * @param structure - Structure of the type parameter. */ addTypeParameter(structure: OptionalKind<TypeParameterDeclarationStructure> | string): TypeParameterDeclaration; /** * Adds type parameters. * @param structures - Structures of the type parameters. */ addTypeParameters(structures: ReadonlyArray<OptionalKind<TypeParameterDeclarationStructure> | string>): TypeParameterDeclaration[]; /** * Inserts a type parameter. * @param index - Child index to insert at. Specify a negative index to insert from the reverse. * @param structure - Structure of the type parameter. */ insertTypeParameter(index: number, structure: OptionalKind<TypeParameterDeclarationStructure> | string): TypeParameterDeclaration; /** * Inserts type parameters. * @param index - Child index to insert at. Specify a negative index to insert from the reverse. * @param structures - Structures of the type parameters. */ insertTypeParameters(index: number, structures: ReadonlyArray<OptionalKind<TypeParameterDeclarationStructure> | string>): TypeParameterDeclaration[];}
type TypeParameteredNodeExtensionType = Node<ts.Node & { typeParameters?: ts.NodeArray<ts.TypeParameterDeclaration>; }>;export declare function UnwrappableNode<T extends Constructor<UnwrappableNodeExtensionType>>(Base: T): Constructor<UnwrappableNode> & T;
export interface UnwrappableNode { /** Replaces the node's text with its body's statements. */ unwrap(): void;}
type UnwrappableNodeExtensionType = Node;
export declare class ArrayBindingPattern extends Node<ts.ArrayBindingPattern> { /** Gets the array binding pattern's elements. */ getElements(): (BindingElement | OmittedExpression)[]; /** @inheritdoc **/ getParent(): NodeParentType<ts.ArrayBindingPattern>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ArrayBindingPattern>>;}
declare const BindingElementBase: Constructor<DotDotDotTokenableNode> & Constructor<InitializerExpressionableNode> & Constructor<BindingNamedNode> & typeof Node;
export declare class BindingElement extends BindingElementBase<ts.BindingElement> { /** * Gets binding element's property name node or throws if not found. * * For example in `const { a: b } = { a: 5 }`, `a` would be the property name. */ getPropertyNameNodeOrThrow(message?: string | (() => string)): PropertyName; /** * Gets binding element's property name node or returns undefined if not found. * * For example in `const { a: b } = { a: 5 }`, `a` would be the property name. */ getPropertyNameNode(): PropertyName | undefined; /** @inheritdoc **/ getParent(): NodeParentType<ts.BindingElement>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.BindingElement>>;}
export declare class ObjectBindingPattern extends Node<ts.ObjectBindingPattern> { /** Gets the object binding pattern's elements. */ getElements(): BindingElement[]; /** @inheritdoc **/ getParent(): NodeParentType<ts.ObjectBindingPattern>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ObjectBindingPattern>>;}
export declare function AbstractableNode<T extends Constructor<AbstractableNodeExtensionType>>(Base: T): Constructor<AbstractableNode> & T;
export interface AbstractableNode { /** Gets if the node is abstract. */ isAbstract(): boolean; /** Gets the abstract keyword or undefined if it doesn't exist. */ getAbstractKeyword(): Node | undefined; /** Gets the abstract keyword or throws if it doesn't exist. */ getAbstractKeywordOrThrow(message?: string | (() => string)): Node; /** * Sets if the node is abstract. * @param isAbstract - If it should be abstract or not. */ setIsAbstract(isAbstract: boolean): this;}
type AbstractableNodeExtensionType = Node & ModifierableNode;export declare function ClassLikeDeclarationBase<T extends Constructor<ClassLikeDeclarationBaseExtensionType>>(Base: T): Constructor<ClassLikeDeclarationBase> & T;
export interface ClassLikeDeclarationBase extends NameableNode, TextInsertableNode, ImplementsClauseableNode, HeritageClauseableNode, AbstractableNode, JSDocableNode, TypeParameteredNode, DecoratableNode, ModifierableNode, ClassLikeDeclarationBaseSpecific {}
declare function ClassLikeDeclarationBaseSpecific<T extends Constructor<ClassLikeDeclarationBaseSpecificExtensionType>>(Base: T): Constructor<ClassLikeDeclarationBaseSpecific> & T;
interface ClassLikeDeclarationBaseSpecific { /** * Sets the extends expression. * @param text - Text to set as the extends expression. */ setExtends(text: string | WriterFunction): this; /** Removes the extends expression, if it exists. */ removeExtends(): this; /** Gets the extends expression or throws if it doesn't exist. */ getExtendsOrThrow(message?: string | (() => string)): ExpressionWithTypeArguments; /** Gets the extends expression or returns undefined if it doesn't exist. */ getExtends(): ExpressionWithTypeArguments | undefined; /** * Inserts a class member. * @param member - Class member to insert. */ addMember(member: string | WriterFunction | ClassMemberStructures): ClassMemberTypes | CommentClassElement; /** * Inserts class members. * @param members - Collection of class members to insert. */ addMembers(members: string | WriterFunction | ReadonlyArray<string | WriterFunction | ClassMemberStructures>): (ClassMemberTypes | CommentClassElement)[]; /** * Inserts a class member. * @param index - Child index to insert at. * @param member - Class member to insert. */ insertMember(index: number, member: string | WriterFunction | ClassMemberStructures): ClassMemberTypes | CommentClassElement; /** * Inserts class members. * @param index - Child index to insert at. * @param members - Collection of class members to insert. */ insertMembers(index: number, members: string | WriterFunction | ReadonlyArray<string | WriterFunction | ClassMemberStructures>): (ClassMemberTypes | CommentClassElement)[]; /** * Adds a constructor. * @param structure - Structure of the constructor. */ addConstructor(structure?: OptionalKind<ConstructorDeclarationStructure>): ConstructorDeclaration; /** * Adds constructors. * @param structures - Structures of the constructor. */ addConstructors(structures: ReadonlyArray<OptionalKind<ConstructorDeclarationStructure>>): ConstructorDeclaration[]; /** * Inserts a constructor. * @param index - Child index to insert at. * @param structure - Structure of the constructor. */ insertConstructor(index: number, structure?: OptionalKind<ConstructorDeclarationStructure>): ConstructorDeclaration; /** * Inserts constructors. * @param index - Child index to insert at. * @param structures - Structures of the constructor. */ insertConstructors(index: number, structures: ReadonlyArray<OptionalKind<ConstructorDeclarationStructure>>): ConstructorDeclaration[]; /** Gets the constructor declarations. */ getConstructors(): ConstructorDeclaration[]; /** * Adds a static block. * @param structure - Structure of the static block. */ addStaticBlock(structure?: OptionalKind<ClassStaticBlockDeclarationStructure>): ClassStaticBlockDeclaration; /** * Adds static block. * @param structures - Structures of the static block. */ addStaticBlocks(structures: ReadonlyArray<OptionalKind<ClassStaticBlockDeclarationStructure>>): ClassStaticBlockDeclaration[]; /** * Inserts a static block. * @param index - Child index to insert at. * @param structure - Structure of the static block. */ insertStaticBlock(index: number, structure?: OptionalKind<ClassStaticBlockDeclarationStructure>): ClassStaticBlockDeclaration; /** * Inserts static blocks. * @param index - Child index to insert at. * @param structures - Structures of the static blocks. */ insertStaticBlocks(index: number, structures: ReadonlyArray<OptionalKind<ClassStaticBlockDeclarationStructure>>): ClassStaticBlockDeclaration[]; /** Gets the static blocks. */ getStaticBlocks(): ClassStaticBlockDeclaration[]; /** * Add get accessor. * @param structure - Structure representing the get accessor. */ addGetAccessor(structure: OptionalKind<GetAccessorDeclarationStructure>): GetAccessorDeclaration; /** * Add properties. * @param structures - Structures representing the properties. */ addGetAccessors(structures: ReadonlyArray<OptionalKind<GetAccessorDeclarationStructure>>): GetAccessorDeclaration[]; /** * Insert get accessor. * @param index - Child index to insert at. * @param structure - Structure representing the get accessor. */ insertGetAccessor(index: number, structure: OptionalKind<GetAccessorDeclarationStructure>): GetAccessorDeclaration; /** * Insert properties. * @param index - Child index to insert at. * @param structures - Structures representing the properties. */ insertGetAccessors(index: number, structures: ReadonlyArray<OptionalKind<GetAccessorDeclarationStructure>>): GetAccessorDeclaration[]; /** * Add set accessor. * @param structure - Structure representing the set accessor. */ addSetAccessor(structure: OptionalKind<SetAccessorDeclarationStructure>): SetAccessorDeclaration; /** * Add properties. * @param structures - Structures representing the properties. */ addSetAccessors(structures: ReadonlyArray<OptionalKind<SetAccessorDeclarationStructure>>): SetAccessorDeclaration[]; /** * Insert set accessor. * @param index - Child index to insert at. * @param structure - Structure representing the set accessor. */ insertSetAccessor(index: number, structure: OptionalKind<SetAccessorDeclarationStructure>): SetAccessorDeclaration; /** * Insert properties. * @param index - Child index to insert at. * @param structures - Structures representing the properties. */ insertSetAccessors(index: number, structures: ReadonlyArray<OptionalKind<SetAccessorDeclarationStructure>>): SetAccessorDeclaration[]; /** * Add property. * @param structure - Structure representing the property. */ addProperty(structure: OptionalKind<PropertyDeclarationStructure>): PropertyDeclaration; /** * Add properties. * @param structures - Structures representing the properties. */ addProperties(structures: ReadonlyArray<OptionalKind<PropertyDeclarationStructure>>): PropertyDeclaration[]; /** * Insert property. * @param index - Child index to insert at. * @param structure - Structure representing the property. */ insertProperty(index: number, structure: OptionalKind<PropertyDeclarationStructure>): PropertyDeclaration; /** * Insert properties. * @param index - Child index to insert at. * @param structures - Structures representing the properties. */ insertProperties(index: number, structures: ReadonlyArray<OptionalKind<PropertyDeclarationStructure>>): PropertyDeclaration[]; /** * Add method. * @param structure - Structure representing the method. */ addMethod(structure: OptionalKind<MethodDeclarationStructure>): MethodDeclaration; /** * Add methods. * @param structures - Structures representing the methods. */ addMethods(structures: ReadonlyArray<OptionalKind<MethodDeclarationStructure>>): MethodDeclaration[]; /** * Insert method. * @param index - Child index to insert at. * @param structure - Structure representing the method. */ insertMethod(index: number, structure: OptionalKind<MethodDeclarationStructure>): MethodDeclaration; /** * Insert methods. * @param index - Child index to insert at. * @param structures - Structures representing the methods. */ insertMethods(index: number, structures: ReadonlyArray<OptionalKind<MethodDeclarationStructure>>): MethodDeclaration[]; /** * Gets the first instance property by name. * @param name - Name. */ getInstanceProperty(name: string): ClassInstancePropertyTypes | undefined; /** * Gets the first instance property by a find function. * @param findFunction - Function to find an instance property by. */ getInstanceProperty(findFunction: (prop: ClassInstancePropertyTypes) => boolean): ClassInstancePropertyTypes | undefined; /** * Gets the first instance property by name or throws if not found. * @param name - Name. */ getInstancePropertyOrThrow(name: string): ClassInstancePropertyTypes; /** * Gets the first instance property by a find function or throws if not found. * @param findFunction - Function to find an instance property by. */ getInstancePropertyOrThrow(findFunction: (prop: ClassInstancePropertyTypes) => boolean): ClassInstancePropertyTypes; /** Gets the class instance property declarations. */ getInstanceProperties(): ClassInstancePropertyTypes[]; /** * Gets the first static property by name. * @param name - Name. */ getStaticProperty(name: string): ClassStaticPropertyTypes | undefined; /** * Gets the first static property by a find function. * @param findFunction - Function to find a static property by. */ getStaticProperty(findFunction: (prop: ClassStaticPropertyTypes) => boolean): ClassStaticPropertyTypes | undefined; /** * Gets the first static property by name or throws if not found. * @param name - Name. */ getStaticPropertyOrThrow(name: string): ClassStaticPropertyTypes; /** * Gets the first static property by a find function. or throws if not found. * @param findFunction - Function to find a static property by. */ getStaticPropertyOrThrow(findFunction: (prop: ClassStaticPropertyTypes) => boolean): ClassStaticPropertyTypes; /** Gets the class instance property declarations. */ getStaticProperties(): ClassStaticPropertyTypes[]; /** * Gets the first property declaration by name. * @param name - Name. */ getProperty(name: string): PropertyDeclaration | undefined; /** * Gets the first property declaration by a find function. * @param findFunction - Function to find a property declaration by. */ getProperty(findFunction: (property: PropertyDeclaration) => boolean): PropertyDeclaration | undefined; /** * Gets the first property declaration by name or throws if it doesn't exist. * @param name - Name. */ getPropertyOrThrow(name: string): PropertyDeclaration; /** * Gets the first property declaration by a find function or throws if it doesn't exist. * @param findFunction - Function to find a property declaration by. */ getPropertyOrThrow(findFunction: (property: PropertyDeclaration) => boolean): PropertyDeclaration; /** Gets the class property declarations regardless of whether it's an instance of static property. */ getProperties(): PropertyDeclaration[]; /** * Gets the first get accessor declaration by name. * @param name - Name. */ getGetAccessor(name: string): GetAccessorDeclaration | undefined; /** * Gets the first get accessor declaration by a find function. * @param findFunction - Function to find a get accessor declaration by. */ getGetAccessor(findFunction: (getAccessor: GetAccessorDeclaration) => boolean): GetAccessorDeclaration | undefined; /** * Gets the first get accessor declaration by name or throws if it doesn't exist. * @param name - Name. */ getGetAccessorOrThrow(name: string): GetAccessorDeclaration; /** * Gets the first get accessor declaration by a find function or throws if it doesn't exist. * @param findFunction - Function to find a get accessor declaration by. */ getGetAccessorOrThrow(findFunction: (getAccessor: GetAccessorDeclaration) => boolean): GetAccessorDeclaration; /** Gets the class get accessor declarations regardless of whether it's an instance of static getAccessor. */ getGetAccessors(): GetAccessorDeclaration[]; /** * Sets the first set accessor declaration by name. * @param name - Name. */ getSetAccessor(name: string): SetAccessorDeclaration | undefined; /** * Sets the first set accessor declaration by a find function. * @param findFunction - Function to find a set accessor declaration by. */ getSetAccessor(findFunction: (setAccessor: SetAccessorDeclaration) => boolean): SetAccessorDeclaration | undefined; /** * Sets the first set accessor declaration by name or throws if it doesn't exist. * @param name - Name. */ getSetAccessorOrThrow(name: string): SetAccessorDeclaration; /** * Sets the first set accessor declaration by a find function or throws if it doesn't exist. * @param findFunction - Function to find a set accessor declaration by. */ getSetAccessorOrThrow(findFunction: (setAccessor: SetAccessorDeclaration) => boolean): SetAccessorDeclaration; /** Sets the class set accessor declarations regardless of whether it's an instance of static setAccessor. */ getSetAccessors(): SetAccessorDeclaration[]; /** * Gets the first method declaration by name. * @param name - Name. */ getMethod(name: string): MethodDeclaration | undefined; /** * Gets the first method declaration by a find function. * @param findFunction - Function to find a method declaration by. */ getMethod(findFunction: (method: MethodDeclaration) => boolean): MethodDeclaration | undefined; /** * Gets the first method declaration by name or throws if it doesn't exist. * @param name - Name. */ getMethodOrThrow(name: string): MethodDeclaration; /** * Gets the first method declaration by a find function or throws if it doesn't exist. * @param findFunction - Function to find a method declaration by. */ getMethodOrThrow(findFunction: (method: MethodDeclaration) => boolean): MethodDeclaration; /** Gets the class method declarations regardless of whether it's an instance of static method. */ getMethods(): MethodDeclaration[]; /** * Gets the first instance method by name. * @param name - Name. */ getInstanceMethod(name: string): MethodDeclaration | undefined; /** * Gets the first instance method by a find function. * @param findFunction - Function to find an instance method by. */ getInstanceMethod(findFunction: (method: MethodDeclaration) => boolean): MethodDeclaration | undefined; /** * Gets the first instance method by name or throws if not found. * @param name - Name. */ getInstanceMethodOrThrow(name: string): MethodDeclaration; /** * Gets the first instance method by a find function. or throws if not found. * @param findFunction - Function to find an instance method by. */ getInstanceMethodOrThrow(findFunction: (method: MethodDeclaration) => boolean): MethodDeclaration; /** Gets the class instance method declarations. */ getInstanceMethods(): MethodDeclaration[]; /** * Gets the first static method by name. * @param name - Name. */ getStaticMethod(name: string): MethodDeclaration | undefined; /** * Gets the first static method by a find function. * @param findFunction - Function to find a static method by. */ getStaticMethod(findFunction: (method: MethodDeclaration) => boolean): MethodDeclaration | undefined; /** * Gets the first static method by name or throws if not found. * @param name - Name. */ getStaticMethodOrThrow(name: string): MethodDeclaration; /** * Gets the first static method by a find function. or throws if not found. * @param findFunction - Function to find a static method by. */ getStaticMethodOrThrow(findFunction: (method: MethodDeclaration) => boolean): MethodDeclaration; /** Gets the class instance method declarations. */ getStaticMethods(): MethodDeclaration[]; /** * Gets the first instance member by name. * @param name - Name. */ getInstanceMember(name: string): ClassInstanceMemberTypes | undefined; /** * Gets the first instance member by a find function. * @param findFunction - Function to find the instance member by. */ getInstanceMember(findFunction: (member: ClassInstanceMemberTypes) => boolean): ClassInstanceMemberTypes | undefined; /** * Gets the first instance member by name or throws if not found. * @param name - Name. */ getInstanceMemberOrThrow(name: string): ClassInstanceMemberTypes; /** * Gets the first instance member by a find function. or throws if not found. * @param findFunction - Function to find the instance member by. */ getInstanceMemberOrThrow(findFunction: (member: ClassInstanceMemberTypes) => boolean): ClassInstanceMemberTypes; /** Gets the instance members. */ getInstanceMembers(): ClassInstanceMemberTypes[]; /** * Gets the first static member by name. * @param name - Name. */ getStaticMember(name: string): ClassStaticMemberTypes | undefined; /** * Gets the first static member by a find function. * @param findFunction - Function to find an static method by. */ getStaticMember(findFunction: (member: ClassStaticMemberTypes) => boolean): ClassStaticMemberTypes | undefined; /** * Gets the first static member by name or throws if not found. * @param name - Name. */ getStaticMemberOrThrow(name: string): ClassStaticMemberTypes; /** * Gets the first static member by a find function. or throws if not found. * @param findFunction - Function to find an static method by. */ getStaticMemberOrThrow(findFunction: (member: ClassStaticMemberTypes) => boolean): ClassStaticMemberTypes; /** Gets the static members. */ getStaticMembers(): ClassStaticMemberTypes[]; /** Gets the class' members regardless of whether it's an instance of static member. */ getMembers(): ClassMemberTypes[]; /** Gets the class' members with comment class elements. */ getMembersWithComments(): (ClassMemberTypes | CommentClassElement)[]; /** * Gets the first member by name. * @param name - Name. */ getMember(name: string): ClassMemberTypes | undefined; /** * Gets the first member by a find function. * @param findFunction - Function to find an method by. */ getMember(findFunction: (member: ClassMemberTypes) => boolean): ClassMemberTypes | undefined; /** * Gets the first member by name or throws if not found. * @param name - Name. */ getMemberOrThrow(name: string): ClassMemberTypes; /** * Gets the first member by a find function. or throws if not found. * @param findFunction - Function to find an method by. */ getMemberOrThrow(findFunction: (member: ClassMemberTypes) => boolean): ClassMemberTypes; /** * Gets the base types. * * This is useful to use if the base could possibly be a mixin. */ getBaseTypes(): Type[]; /** * Gets the base class or throws. * * Note: Use getBaseTypes if you need to get the mixins. */ getBaseClassOrThrow(message?: string | (() => string)): ClassDeclaration; /** * Gets the base class. * * Note: Use getBaseTypes if you need to get the mixins. */ getBaseClass(): ClassDeclaration | undefined; /** Gets all the derived classes. */ getDerivedClasses(): ClassDeclaration[];}
export type ClassPropertyTypes = PropertyDeclaration | GetAccessorDeclaration | SetAccessorDeclaration;export type ClassInstancePropertyTypes = ClassPropertyTypes | ParameterDeclaration;export type ClassInstanceMemberTypes = MethodDeclaration | ClassInstancePropertyTypes;export type ClassStaticPropertyTypes = PropertyDeclaration | GetAccessorDeclaration | SetAccessorDeclaration;export type ClassStaticMemberTypes = MethodDeclaration | ClassStaticBlockDeclaration | ClassStaticPropertyTypes;export type ClassMemberTypes = MethodDeclaration | PropertyDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | ConstructorDeclaration | ClassStaticBlockDeclaration;type ClassLikeDeclarationBaseExtensionType = Node<ts.ClassLikeDeclarationBase>;type ClassLikeDeclarationBaseSpecificExtensionType = Node<ts.ClassLikeDeclarationBase> & HeritageClauseableNode & ModifierableNode & NameableNode;declare const ClassDeclarationBase: Constructor<ModuleChildableNode> & Constructor<AmbientableNode> & Constructor<ExportableNode> & Constructor<ClassLikeDeclarationBase> & typeof Statement;
export declare class ClassDeclaration extends ClassDeclarationBase<ts.ClassDeclaration> { /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<ClassDeclarationStructure>): this; /** Gets the structure equivalent to this node. */ getStructure(): ClassDeclarationStructure; /** * Extracts an interface declaration structure from the class. * @param name - Name of the interface. Falls back to the same name as the class and then the filepath's base name. */ extractInterface(name?: string): InterfaceDeclarationStructure; /** * Extracts an interface declaration structure from the static part of the class. * @param name - Name of the interface. */ extractStaticInterface(name: string): InterfaceDeclarationStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.ClassDeclaration>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ClassDeclaration>>;}
export declare class ClassElement<T extends ts.ClassElement = ts.ClassElement> extends Node<T> { /** Removes the class member. */ remove(): void;}
declare const ClassExpressionBase: Constructor<ClassLikeDeclarationBase> & typeof PrimaryExpression;
export declare class ClassExpression extends ClassExpressionBase<ts.ClassExpression> { /** @inheritdoc **/ getParent(): NodeParentType<ts.ClassExpression>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ClassExpression>>;}
declare const ClassStaticBlockDeclarationBase: Constructor<ChildOrderableNode> & Constructor<TextInsertableNode> & Constructor<StatementedNode> & Constructor<JSDocableNode> & Constructor<BodiedNode> & typeof ClassElement;
export declare class ClassStaticBlockDeclaration extends ClassStaticBlockDeclarationBase<ts.ClassStaticBlockDeclaration> { /** * Method that exists for the sake of making code compile that looks for the name of static members. * This always returns "static". */ getName(): "static"; /** * Method that exists for the sake of making code compile that looks for this method on class members. * This always returns true. */ isStatic(): true; /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<ClassStaticBlockDeclarationStructure>): this; /** Gets the structure equivalent to this node. */ getStructure(): ClassStaticBlockDeclarationStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.ClassStaticBlockDeclaration>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ClassStaticBlockDeclaration>>;}
export declare class CommentClassElement extends ClassElement<CompilerCommentClassElement> {}
declare const ConstructorDeclarationBase: Constructor<ReferenceFindableNode> & Constructor<ChildOrderableNode> & Constructor<TextInsertableNode> & Constructor<OverloadableNode> & Constructor<ScopedNode> & Constructor<FunctionLikeDeclaration> & Constructor<BodyableNode> & typeof ClassElement;declare const ConstructorDeclarationOverloadBase: Constructor<TypeParameteredNode> & Constructor<JSDocableNode> & Constructor<ChildOrderableNode> & Constructor<TextInsertableNode> & Constructor<ScopedNode> & Constructor<ModifierableNode> & Constructor<SignaturedDeclaration> & typeof ClassElement;
export declare class ConstructorDeclaration extends ConstructorDeclarationBase<ts.ConstructorDeclaration> { /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<ConstructorDeclarationStructure>): this; /** * Add a constructor overload. * @param structure - Structure to add. */ addOverload(structure: OptionalKind<ConstructorDeclarationOverloadStructure>): ConstructorDeclaration; /** * Add constructor overloads. * @param structures - Structures to add. */ addOverloads(structures: ReadonlyArray<OptionalKind<ConstructorDeclarationOverloadStructure>>): ConstructorDeclaration[]; /** * Inserts a constructor overload. * @param index - Child index to insert at. * @param structure - Structures to insert. */ insertOverload(index: number, structure: OptionalKind<ConstructorDeclarationOverloadStructure>): ConstructorDeclaration; /** * Inserts constructor overloads. * @param index - Child index to insert at. * @param structures - Structures to insert. */ insertOverloads(index: number, structures: ReadonlyArray<OptionalKind<ConstructorDeclarationOverloadStructure>>): ConstructorDeclaration[]; /** Gets the structure equivalent to this node. */ getStructure(): ConstructorDeclarationStructure | ConstructorDeclarationOverloadStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.ConstructorDeclaration>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ConstructorDeclaration>>;}
declare const GetAccessorDeclarationBase: Constructor<ChildOrderableNode> & Constructor<TextInsertableNode> & Constructor<DecoratableNode> & Constructor<AbstractableNode> & Constructor<ScopedNode> & Constructor<StaticableNode> & Constructor<FunctionLikeDeclaration> & Constructor<BodyableNode> & Constructor<PropertyNamedNode> & typeof ClassElement;
export declare class GetAccessorDeclaration extends GetAccessorDeclarationBase<ts.GetAccessorDeclaration> { /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<GetAccessorDeclarationStructure>): this; /** Gets the corresponding set accessor if one exists. */ getSetAccessor(): SetAccessorDeclaration | undefined; /** Gets the corresponding set accessor or throws if not exists. */ getSetAccessorOrThrow(message?: string | (() => string)): SetAccessorDeclaration; /** Gets the structure equivalent to this node. */ getStructure(): GetAccessorDeclarationStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.GetAccessorDeclaration>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.GetAccessorDeclaration>>;}
declare const MethodDeclarationBase: Constructor<ChildOrderableNode> & Constructor<TextInsertableNode> & Constructor<OverrideableNode> & Constructor<OverloadableNode> & Constructor<BodyableNode> & Constructor<DecoratableNode> & Constructor<AbstractableNode> & Constructor<ScopedNode> & Constructor<QuestionTokenableNode> & Constructor<StaticableNode> & Constructor<AsyncableNode> & Constructor<GeneratorableNode> & Constructor<FunctionLikeDeclaration> & Constructor<PropertyNamedNode> & typeof ClassElement;declare const MethodDeclarationOverloadBase: Constructor<JSDocableNode> & Constructor<ChildOrderableNode> & Constructor<TextInsertableNode> & Constructor<OverrideableNode> & Constructor<ScopedNode> & Constructor<TypeParameteredNode> & Constructor<AbstractableNode> & Constructor<QuestionTokenableNode> & Constructor<StaticableNode> & Constructor<AsyncableNode> & Constructor<ModifierableNode> & Constructor<GeneratorableNode> & Constructor<SignaturedDeclaration> & typeof ClassElement;
export declare class MethodDeclaration extends MethodDeclarationBase<ts.MethodDeclaration> { /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<MethodDeclarationStructure>): this; /** * Add a method overload. * @param structure - Structure to add. */ addOverload(structure: OptionalKind<MethodDeclarationOverloadStructure>): MethodDeclaration; /** * Add method overloads. * @param structures - Structures to add. */ addOverloads(structures: ReadonlyArray<OptionalKind<MethodDeclarationOverloadStructure>>): MethodDeclaration[]; /** * Inserts a method overload. * @param index - Child index to insert at. * @param structure - Structures to insert. */ insertOverload(index: number, structure: OptionalKind<MethodDeclarationOverloadStructure>): MethodDeclaration; /** * Inserts method overloads. * @param index - Child index to insert at. * @param structures - Structures to insert. */ insertOverloads(index: number, structures: ReadonlyArray<OptionalKind<MethodDeclarationOverloadStructure>>): MethodDeclaration[]; /** Gets the structure equivalent to this node. */ getStructure(): MethodDeclarationStructure | MethodDeclarationOverloadStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.MethodDeclaration>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.MethodDeclaration>>;}
declare const PropertyDeclarationBase: Constructor<ChildOrderableNode> & Constructor<OverrideableNode> & Constructor<AmbientableNode> & Constructor<DecoratableNode> & Constructor<AbstractableNode> & Constructor<ScopedNode> & Constructor<StaticableNode> & Constructor<JSDocableNode> & Constructor<ReadonlyableNode> & Constructor<ExclamationTokenableNode> & Constructor<QuestionTokenableNode> & Constructor<InitializerExpressionableNode> & Constructor<TypedNode> & Constructor<PropertyNamedNode> & Constructor<ModifierableNode> & typeof ClassElement;
export declare class PropertyDeclaration extends PropertyDeclarationBase<ts.PropertyDeclaration> { /** Gets if this property declaration has an accessor keyword. */ hasAccessorKeyword(): boolean; /** Sets if this property declaration should have an accessor keyword. */ setHasAccessorKeyword(value: boolean): this; /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<PropertyDeclarationStructure>): this; /** Removes the property. */ remove(): void; /** Gets the structure equivalent to this node. */ getStructure(): PropertyDeclarationStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.PropertyDeclaration>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.PropertyDeclaration>>;}
declare const SetAccessorDeclarationBase: Constructor<ChildOrderableNode> & Constructor<TextInsertableNode> & Constructor<DecoratableNode> & Constructor<AbstractableNode> & Constructor<ScopedNode> & Constructor<StaticableNode> & Constructor<FunctionLikeDeclaration> & Constructor<BodyableNode> & Constructor<PropertyNamedNode> & typeof ClassElement;
export declare class SetAccessorDeclaration extends SetAccessorDeclarationBase<ts.SetAccessorDeclaration> { /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<SetAccessorDeclarationStructure>): this; /** Gets the corresponding get accessor if one exists. */ getGetAccessor(): GetAccessorDeclaration | undefined; /** Gets the corresponding get accessor or throws if not exists. */ getGetAccessorOrThrow(message?: string | (() => string)): GetAccessorDeclaration; /** Gets the structure equivalent to this node. */ getStructure(): SetAccessorDeclarationStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.SetAccessorDeclaration>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.SetAccessorDeclaration>>;}
export declare class CommentRange extends TextRange<ts.CommentRange> { private constructor(); /** Gets the comment syntax kind. */ getKind(): ts.CommentKind;}
export declare abstract class CompilerCommentNode implements ts.Node { #private; pos: number; end: number; kind: SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia; flags: ts.NodeFlags; modifiers?: ts.NodeArray<ts.Modifier> | undefined; parent: ts.Node; protected constructor(); getSourceFile(): ts.SourceFile; getChildCount(sourceFile?: ts.SourceFile | undefined): number; getChildAt(index: number, sourceFile?: ts.SourceFile | undefined): ts.Node; getChildren(sourceFile?: ts.SourceFile | undefined): ts.Node[]; getStart(sourceFile?: ts.SourceFile | undefined, includeJsDocComment?: boolean | undefined): number; getFullStart(): number; getEnd(): number; getWidth(sourceFile?: ts.SourceFileLike | undefined): number; getFullWidth(): number; getLeadingTriviaWidth(sourceFile?: ts.SourceFile | undefined): number; getFullText(sourceFile?: ts.SourceFile | undefined): string; getText(sourceFile?: ts.SourceFile | undefined): string; getFirstToken(sourceFile?: ts.SourceFile | undefined): ts.Node | undefined; getLastToken(sourceFile?: ts.SourceFile | undefined): ts.Node | undefined; forEachChild<T>(cbNode: (node: ts.Node) => T | undefined, cbNodeArray?: ((nodes: ts.NodeArray<ts.Node>) => T | undefined) | undefined): T | undefined;}
export declare class CompilerCommentStatement extends CompilerCommentNode implements ts.Statement { _jsdocContainerBrand: any; _statementBrand: any;}
export declare class CompilerCommentClassElement extends CompilerCommentNode implements ts.ClassElement { _classElementBrand: any; _declarationBrand: any;}
export declare class CompilerCommentTypeElement extends CompilerCommentNode implements ts.TypeElement { _typeElementBrand: any; _declarationBrand: any;}
export declare class CompilerCommentObjectLiteralElement extends CompilerCommentNode implements ts.ObjectLiteralElement { _declarationBrand: any; _objectLiteralBrand: any; declarationBrand: any;}
export declare class CompilerCommentEnumMember extends CompilerCommentNode implements ts.Node {}
export type NodePropertyToWrappedType<NodeType extends ts.Node, KeyName extends keyof NodeType, NonNullableNodeType = NonNullable<NodeType[KeyName]>> = NodeType[KeyName] extends ts.NodeArray<infer ArrayNodeTypeForNullable> | undefined ? CompilerNodeToWrappedType<ArrayNodeTypeForNullable>[] | undefined : NodeType[KeyName] extends ts.NodeArray<infer ArrayNodeType> ? CompilerNodeToWrappedType<ArrayNodeType>[] : NodeType[KeyName] extends ts.Node ? CompilerNodeToWrappedType<NodeType[KeyName]> : NonNullableNodeType extends ts.Node ? CompilerNodeToWrappedType<NonNullableNodeType> | undefined : NodeType[KeyName];export type NodeParentType<NodeType extends ts.Node> = NodeType extends ts.SourceFile ? undefined : ts.Node extends NodeType ? CompilerNodeToWrappedType<NodeType["parent"]> | undefined : CompilerNodeToWrappedType<NodeType["parent"]>;
export declare class Node<NodeType extends ts.Node = ts.Node> { #private; /** Gets if the node is an AnyKeyword. */ static readonly isAnyKeyword: (node: Node | undefined) => node is Expression; /** Gets if the node is an ArrayBindingPattern. */ static readonly isArrayBindingPattern: (node: Node | undefined) => node is ArrayBindingPattern; /** Gets if the node is an ArrayLiteralExpression. */ static readonly isArrayLiteralExpression: (node: Node | undefined) => node is ArrayLiteralExpression; /** Gets if the node is an ArrowFunction. */ static readonly isArrowFunction: (node: Node | undefined) => node is ArrowFunction; /** Gets if the node is an AsExpression. */ static readonly isAsExpression: (node: Node | undefined) => node is AsExpression; /** Gets if the node is an AwaitExpression. */ static readonly isAwaitExpression: (node: Node | undefined) => node is AwaitExpression; /** Gets if the node is a BigIntLiteral. */ static readonly isBigIntLiteral: (node: Node | undefined) => node is BigIntLiteral; /** Gets if the node is a BinaryExpression. */ static readonly isBinaryExpression: (node: Node | undefined) => node is BinaryExpression; /** Gets if the node is a BindingElement. */ static readonly isBindingElement: (node: Node | undefined) => node is BindingElement; /** Gets if the node is a Block. */ static readonly isBlock: (node: Node | undefined) => node is Block; /** Gets if the node is a BooleanKeyword. */ static readonly isBooleanKeyword: (node: Node | undefined) => node is Expression; /** Gets if the node is a BreakStatement. */ static readonly isBreakStatement: (node: Node | undefined) => node is BreakStatement; /** Gets if the node is a CallExpression. */ static readonly isCallExpression: (node: Node | undefined) => node is CallExpression; /** Gets if the node is a CaseBlock. */ static readonly isCaseBlock: (node: Node | undefined) => node is CaseBlock; /** Gets if the node is a CaseClause. */ static readonly isCaseClause: (node: Node | undefined) => node is CaseClause; /** Gets if the node is a CatchClause. */ static readonly isCatchClause: (node: Node | undefined) => node is CatchClause; /** Gets if the node is a ClassDeclaration. */ static readonly isClassDeclaration: (node: Node | undefined) => node is ClassDeclaration; /** Gets if the node is a ClassExpression. */ static readonly isClassExpression: (node: Node | undefined) => node is ClassExpression; /** Gets if the node is a ClassStaticBlockDeclaration. */ static readonly isClassStaticBlockDeclaration: (node: Node | undefined) => node is ClassStaticBlockDeclaration; /** Gets if the node is a CommaListExpression. */ static readonly isCommaListExpression: (node: Node | undefined) => node is CommaListExpression; /** Gets if the node is a ComputedPropertyName. */ static readonly isComputedPropertyName: (node: Node | undefined) => node is ComputedPropertyName; /** Gets if the node is a ConditionalExpression. */ static readonly isConditionalExpression: (node: Node | undefined) => node is ConditionalExpression; /** Gets if the node is a ContinueStatement. */ static readonly isContinueStatement: (node: Node | undefined) => node is ContinueStatement; /** Gets if the node is a DebuggerStatement. */ static readonly isDebuggerStatement: (node: Node | undefined) => node is DebuggerStatement; /** Gets if the node is a Decorator. */ static readonly isDecorator: (node: Node | undefined) => node is Decorator; /** Gets if the node is a DefaultClause. */ static readonly isDefaultClause: (node: Node | undefined) => node is DefaultClause; /** Gets if the node is a DeleteExpression. */ static readonly isDeleteExpression: (node: Node | undefined) => node is DeleteExpression; /** Gets if the node is a DoStatement. */ static readonly isDoStatement: (node: Node | undefined) => node is DoStatement; /** Gets if the node is an ElementAccessExpression. */ static readonly isElementAccessExpression: (node: Node | undefined) => node is ElementAccessExpression; /** Gets if the node is an EmptyStatement. */ static readonly isEmptyStatement: (node: Node | undefined) => node is EmptyStatement; /** Gets if the node is an EnumDeclaration. */ static readonly isEnumDeclaration: (node: Node | undefined) => node is EnumDeclaration; /** Gets if the node is an EnumMember. */ static readonly isEnumMember: (node: Node | undefined) => node is EnumMember; /** Gets if the node is an ExportAssignment. */ static readonly isExportAssignment: (node: Node | undefined) => node is ExportAssignment; /** Gets if the node is an ExportDeclaration. */ static readonly isExportDeclaration: (node: Node | undefined) => node is ExportDeclaration; /** Gets if the node is an ExportSpecifier. */ static readonly isExportSpecifier: (node: Node | undefined) => node is ExportSpecifier; /** Gets if the node is an ExpressionStatement. */ static readonly isExpressionStatement: (node: Node | undefined) => node is ExpressionStatement; /** Gets if the node is an ExpressionWithTypeArguments. */ static readonly isExpressionWithTypeArguments: (node: Node | undefined) => node is ExpressionWithTypeArguments; /** Gets if the node is an ExternalModuleReference. */ static readonly isExternalModuleReference: (node: Node | undefined) => node is ExternalModuleReference; /** Gets if the node is a ForInStatement. */ static readonly isForInStatement: (node: Node | undefined) => node is ForInStatement; /** Gets if the node is a ForOfStatement. */ static readonly isForOfStatement: (node: Node | undefined) => node is ForOfStatement; /** Gets if the node is a ForStatement. */ static readonly isForStatement: (node: Node | undefined) => node is ForStatement; /** Gets if the node is a FunctionDeclaration. */ static readonly isFunctionDeclaration: (node: Node | undefined) => node is FunctionDeclaration; /** Gets if the node is a FunctionExpression. */ static readonly isFunctionExpression: (node: Node | undefined) => node is FunctionExpression; /** Gets if the node is a HeritageClause. */ static readonly isHeritageClause: (node: Node | undefined) => node is HeritageClause; /** Gets if the node is a Identifier. */ static readonly isIdentifier: (node: Node | undefined) => node is Identifier; /** Gets if the node is a IfStatement. */ static readonly isIfStatement: (node: Node | undefined) => node is IfStatement; /** Gets if the node is a ImportAttribute. */ static readonly isImportAttribute: (node: Node | undefined) => node is ImportAttribute; /** Gets if the node is a ImportAttributes. */ static readonly isImportAttributes: (node: Node | undefined) => node is ImportAttributes; /** Gets if the node is a ImportClause. */ static readonly isImportClause: (node: Node | undefined) => node is ImportClause; /** Gets if the node is a ImportDeclaration. */ static readonly isImportDeclaration: (node: Node | undefined) => node is ImportDeclaration; /** Gets if the node is a ImportEqualsDeclaration. */ static readonly isImportEqualsDeclaration: (node: Node | undefined) => node is ImportEqualsDeclaration; /** Gets if the node is a ImportSpecifier. */ static readonly isImportSpecifier: (node: Node | undefined) => node is ImportSpecifier; /** Gets if the node is a InferKeyword. */ static readonly isInferKeyword: (node: Node | undefined) => node is Node<ts.Token<SyntaxKind.InferKeyword>>; /** Gets if the node is a InterfaceDeclaration. */ static readonly isInterfaceDeclaration: (node: Node | undefined) => node is InterfaceDeclaration; /** Gets if the node is a JSDoc. */ static readonly isJSDoc: (node: Node | undefined) => node is JSDoc; /** Gets if the node is a JSDocAllType. */ static readonly isJSDocAllType: (node: Node | undefined) => node is JSDocAllType; /** Gets if the node is a JSDocAugmentsTag. */ static readonly isJSDocAugmentsTag: (node: Node | undefined) => node is JSDocAugmentsTag; /** Gets if the node is a JSDocAuthorTag. */ static readonly isJSDocAuthorTag: (node: Node | undefined) => node is JSDocAuthorTag; /** Gets if the node is a JSDocCallbackTag. */ static readonly isJSDocCallbackTag: (node: Node | undefined) => node is JSDocCallbackTag; /** Gets if the node is a JSDocClassTag. */ static readonly isJSDocClassTag: (node: Node | undefined) => node is JSDocClassTag; /** Gets if the node is a JSDocDeprecatedTag. */ static readonly isJSDocDeprecatedTag: (node: Node | undefined) => node is JSDocDeprecatedTag; /** Gets if the node is a JSDocEnumTag. */ static readonly isJSDocEnumTag: (node: Node | undefined) => node is JSDocEnumTag; /** Gets if the node is a JSDocFunctionType. */ static readonly isJSDocFunctionType: (node: Node | undefined) => node is JSDocFunctionType; /** Gets if the node is a JSDocImplementsTag. */ static readonly isJSDocImplementsTag: (node: Node | undefined) => node is JSDocImplementsTag; /** Gets if the node is a JSDocLink. */ static readonly isJSDocLink: (node: Node | undefined) => node is JSDocLink; /** Gets if the node is a JSDocLinkCode. */ static readonly isJSDocLinkCode: (node: Node | undefined) => node is JSDocLinkCode; /** Gets if the node is a JSDocLinkPlain. */ static readonly isJSDocLinkPlain: (node: Node | undefined) => node is JSDocLinkPlain; /** Gets if the node is a JSDocMemberName. */ static readonly isJSDocMemberName: (node: Node | undefined) => node is JSDocMemberName; /** Gets if the node is a JSDocNamepathType. */ static readonly isJSDocNamepathType: (node: Node | undefined) => node is JSDocNamepathType; /** Gets if the node is a JSDocNameReference. */ static readonly isJSDocNameReference: (node: Node | undefined) => node is JSDocNameReference; /** Gets if the node is a JSDocNonNullableType. */ static readonly isJSDocNonNullableType: (node: Node | undefined) => node is JSDocNonNullableType; /** Gets if the node is a JSDocNullableType. */ static readonly isJSDocNullableType: (node: Node | undefined) => node is JSDocNullableType; /** Gets if the node is a JSDocOptionalType. */ static readonly isJSDocOptionalType: (node: Node | undefined) => node is JSDocOptionalType; /** Gets if the node is a JSDocOverloadTag. */ static readonly isJSDocOverloadTag: (node: Node | undefined) => node is JSDocOverloadTag; /** Gets if the node is a JSDocOverrideTag. */ static readonly isJSDocOverrideTag: (node: Node | undefined) => node is JSDocOverrideTag; /** Gets if the node is a JSDocParameterTag. */ static readonly isJSDocParameterTag: (node: Node | undefined) => node is JSDocParameterTag; /** Gets if the node is a JSDocPrivateTag. */ static readonly isJSDocPrivateTag: (node: Node | undefined) => node is JSDocPrivateTag; /** Gets if the node is a JSDocPropertyTag. */ static readonly isJSDocPropertyTag: (node: Node | undefined) => node is JSDocPropertyTag; /** Gets if the node is a JSDocProtectedTag. */ static readonly isJSDocProtectedTag: (node: Node | undefined) => node is JSDocProtectedTag; /** Gets if the node is a JSDocPublicTag. */ static readonly isJSDocPublicTag: (node: Node | undefined) => node is JSDocPublicTag; /** Gets if the node is a JSDocReadonlyTag. */ static readonly isJSDocReadonlyTag: (node: Node | undefined) => node is JSDocReadonlyTag; /** Gets if the node is a JSDocReturnTag. */ static readonly isJSDocReturnTag: (node: Node | undefined) => node is JSDocReturnTag; /** Gets if the node is a JSDocSatisfiesTag. */ static readonly isJSDocSatisfiesTag: (node: Node | undefined) => node is JSDocSatisfiesTag; /** Gets if the node is a JSDocSeeTag. */ static readonly isJSDocSeeTag: (node: Node | undefined) => node is JSDocSeeTag; /** Gets if the node is a JSDocSignature. */ static readonly isJSDocSignature: (node: Node | undefined) => node is JSDocSignature; /** Gets if the node is a JSDocTemplateTag. */ static readonly isJSDocTemplateTag: (node: Node | undefined) => node is JSDocTemplateTag; /** Gets if the node is a JSDocText. */ static readonly isJSDocText: (node: Node | undefined) => node is JSDocText; /** Gets if the node is a JSDocThisTag. */ static readonly isJSDocThisTag: (node: Node | undefined) => node is JSDocThisTag; /** Gets if the node is a JSDocThrowsTag. */ static readonly isJSDocThrowsTag: (node: Node | undefined) => node is JSDocThrowsTag; /** Gets if the node is a JSDocTypedefTag. */ static readonly isJSDocTypedefTag: (node: Node | undefined) => node is JSDocTypedefTag; /** Gets if the node is a JSDocTypeExpression. */ static readonly isJSDocTypeExpression: (node: Node | undefined) => node is JSDocTypeExpression; /** Gets if the node is a JSDocTypeLiteral. */ static readonly isJSDocTypeLiteral: (node: Node | undefined) => node is JSDocTypeLiteral; /** Gets if the node is a JSDocTypeTag. */ static readonly isJSDocTypeTag: (node: Node | undefined) => node is JSDocTypeTag; /** Gets if the node is a JSDocUnknownType. */ static readonly isJSDocUnknownType: (node: Node | undefined) => node is JSDocUnknownType; /** Gets if the node is a JSDocVariadicType. */ static readonly isJSDocVariadicType: (node: Node | undefined) => node is JSDocVariadicType; /** Gets if the node is a JsxAttribute. */ static readonly isJsxAttribute: (node: Node | undefined) => node is JsxAttribute; /** Gets if the node is a JsxClosingElement. */ static readonly isJsxClosingElement: (node: Node | undefined) => node is JsxClosingElement; /** Gets if the node is a JsxClosingFragment. */ static readonly isJsxClosingFragment: (node: Node | undefined) => node is JsxClosingFragment; /** Gets if the node is a JsxElement. */ static readonly isJsxElement: (node: Node | undefined) => node is JsxElement; /** Gets if the node is a JsxExpression. */ static readonly isJsxExpression: (node: Node | undefined) => node is JsxExpression; /** Gets if the node is a JsxFragment. */ static readonly isJsxFragment: (node: Node | undefined) => node is JsxFragment; /** Gets if the node is a JsxNamespacedName. */ static readonly isJsxNamespacedName: (node: Node | undefined) => node is JsxNamespacedName; /** Gets if the node is a JsxOpeningElement. */ static readonly isJsxOpeningElement: (node: Node | undefined) => node is JsxOpeningElement; /** Gets if the node is a JsxOpeningFragment. */ static readonly isJsxOpeningFragment: (node: Node | undefined) => node is JsxOpeningFragment; /** Gets if the node is a JsxSelfClosingElement. */ static readonly isJsxSelfClosingElement: (node: Node | undefined) => node is JsxSelfClosingElement; /** Gets if the node is a JsxSpreadAttribute. */ static readonly isJsxSpreadAttribute: (node: Node | undefined) => node is JsxSpreadAttribute; /** Gets if the node is a JsxText. */ static readonly isJsxText: (node: Node | undefined) => node is JsxText; /** Gets if the node is a LabeledStatement. */ static readonly isLabeledStatement: (node: Node | undefined) => node is LabeledStatement; /** Gets if the node is a MetaProperty. */ static readonly isMetaProperty: (node: Node | undefined) => node is MetaProperty; /** Gets if the node is a MethodDeclaration. */ static readonly isMethodDeclaration: (node: Node | undefined) => node is MethodDeclaration; /** Gets if the node is a MethodSignature. */ static readonly isMethodSignature: (node: Node | undefined) => node is MethodSignature; /** Gets if the node is a ModuleBlock. */ static readonly isModuleBlock: (node: Node | undefined) => node is ModuleBlock; /** Gets if the node is a ModuleDeclaration. */ static readonly isModuleDeclaration: (node: Node | undefined) => node is ModuleDeclaration; /** Gets if the node is a NamedExports. */ static readonly isNamedExports: (node: Node | undefined) => node is NamedExports; /** Gets if the node is a NamedImports. */ static readonly isNamedImports: (node: Node | undefined) => node is NamedImports; /** Gets if the node is a NamedTupleMember. */ static readonly isNamedTupleMember: (node: Node | undefined) => node is NamedTupleMember; /** Gets if the node is a NamespaceExport. */ static readonly isNamespaceExport: (node: Node | undefined) => node is NamespaceExport; /** Gets if the node is a NamespaceImport. */ static readonly isNamespaceImport: (node: Node | undefined) => node is NamespaceImport; /** Gets if the node is a NeverKeyword. */ static readonly isNeverKeyword: (node: Node | undefined) => node is Node<ts.Token<SyntaxKind.NeverKeyword>>; /** Gets if the node is a NewExpression. */ static readonly isNewExpression: (node: Node | undefined) => node is NewExpression; /** Gets if the node is a NonNullExpression. */ static readonly isNonNullExpression: (node: Node | undefined) => node is NonNullExpression; /** Gets if the node is a NoSubstitutionTemplateLiteral. */ static readonly isNoSubstitutionTemplateLiteral: (node: Node | undefined) => node is NoSubstitutionTemplateLiteral; /** Gets if the node is a NotEmittedStatement. */ static readonly isNotEmittedStatement: (node: Node | undefined) => node is NotEmittedStatement; /** Gets if the node is a NumberKeyword. */ static readonly isNumberKeyword: (node: Node | undefined) => node is Expression; /** Gets if the node is a NumericLiteral. */ static readonly isNumericLiteral: (node: Node | undefined) => node is NumericLiteral; /** Gets if the node is a ObjectBindingPattern. */ static readonly isObjectBindingPattern: (node: Node | undefined) => node is ObjectBindingPattern; /** Gets if the node is a ObjectKeyword. */ static readonly isObjectKeyword: (node: Node | undefined) => node is Expression; /** Gets if the node is a ObjectLiteralExpression. */ static readonly isObjectLiteralExpression: (node: Node | undefined) => node is ObjectLiteralExpression; /** Gets if the node is a OmittedExpression. */ static readonly isOmittedExpression: (node: Node | undefined) => node is OmittedExpression; /** Gets if the node is a ParenthesizedExpression. */ static readonly isParenthesizedExpression: (node: Node | undefined) => node is ParenthesizedExpression; /** Gets if the node is a PartiallyEmittedExpression. */ static readonly isPartiallyEmittedExpression: (node: Node | undefined) => node is PartiallyEmittedExpression; /** Gets if the node is a PostfixUnaryExpression. */ static readonly isPostfixUnaryExpression: (node: Node | undefined) => node is PostfixUnaryExpression; /** Gets if the node is a PrefixUnaryExpression. */ static readonly isPrefixUnaryExpression: (node: Node | undefined) => node is PrefixUnaryExpression; /** Gets if the node is a PrivateIdentifier. */ static readonly isPrivateIdentifier: (node: Node | undefined) => node is PrivateIdentifier; /** Gets if the node is a PropertyAccessExpression. */ static readonly isPropertyAccessExpression: (node: Node | undefined) => node is PropertyAccessExpression; /** Gets if the node is a PropertyAssignment. */ static readonly isPropertyAssignment: (node: Node | undefined) => node is PropertyAssignment; /** Gets if the node is a PropertyDeclaration. */ static readonly isPropertyDeclaration: (node: Node | undefined) => node is PropertyDeclaration; /** Gets if the node is a PropertySignature. */ static readonly isPropertySignature: (node: Node | undefined) => node is PropertySignature; /** Gets if the node is a QualifiedName. */ static readonly isQualifiedName: (node: Node | undefined) => node is QualifiedName; /** Gets if the node is a RegularExpressionLiteral. */ static readonly isRegularExpressionLiteral: (node: Node | undefined) => node is RegularExpressionLiteral; /** Gets if the node is a ReturnStatement. */ static readonly isReturnStatement: (node: Node | undefined) => node is ReturnStatement; /** Gets if the node is a SatisfiesExpression. */ static readonly isSatisfiesExpression: (node: Node | undefined) => node is SatisfiesExpression; /** Gets if the node is a SemicolonToken. */ static readonly isSemicolonToken: (node: Node | undefined) => node is Node<ts.Token<SyntaxKind.SemicolonToken>>; /** Gets if the node is a ShorthandPropertyAssignment. */ static readonly isShorthandPropertyAssignment: (node: Node | undefined) => node is ShorthandPropertyAssignment; /** Gets if the node is a SourceFile. */ static readonly isSourceFile: (node: Node | undefined) => node is SourceFile; /** Gets if the node is a SpreadAssignment. */ static readonly isSpreadAssignment: (node: Node | undefined) => node is SpreadAssignment; /** Gets if the node is a SpreadElement. */ static readonly isSpreadElement: (node: Node | undefined) => node is SpreadElement; /** Gets if the node is a StringKeyword. */ static readonly isStringKeyword: (node: Node | undefined) => node is Expression; /** Gets if the node is a StringLiteral. */ static readonly isStringLiteral: (node: Node | undefined) => node is StringLiteral; /** Gets if the node is a SwitchStatement. */ static readonly isSwitchStatement: (node: Node | undefined) => node is SwitchStatement; /** Gets if the node is a SymbolKeyword. */ static readonly isSymbolKeyword: (node: Node | undefined) => node is Expression; /** Gets if the node is a SyntaxList. */ static readonly isSyntaxList: (node: Node | undefined) => node is SyntaxList; /** Gets if the node is a TaggedTemplateExpression. */ static readonly isTaggedTemplateExpression: (node: Node | undefined) => node is TaggedTemplateExpression; /** Gets if the node is a TemplateExpression. */ static readonly isTemplateExpression: (node: Node | undefined) => node is TemplateExpression; /** Gets if the node is a TemplateHead. */ static readonly isTemplateHead: (node: Node | undefined) => node is TemplateHead; /** Gets if the node is a TemplateMiddle. */ static readonly isTemplateMiddle: (node: Node | undefined) => node is TemplateMiddle; /** Gets if the node is a TemplateSpan. */ static readonly isTemplateSpan: (node: Node | undefined) => node is TemplateSpan; /** Gets if the node is a TemplateTail. */ static readonly isTemplateTail: (node: Node | undefined) => node is TemplateTail; /** Gets if the node is a ThrowStatement. */ static readonly isThrowStatement: (node: Node | undefined) => node is ThrowStatement; /** Gets if the node is a TryStatement. */ static readonly isTryStatement: (node: Node | undefined) => node is TryStatement; /** Gets if the node is a TypeAliasDeclaration. */ static readonly isTypeAliasDeclaration: (node: Node | undefined) => node is TypeAliasDeclaration; /** Gets if the node is a TypeOfExpression. */ static readonly isTypeOfExpression: (node: Node | undefined) => node is TypeOfExpression; /** Gets if the node is a UndefinedKeyword. */ static readonly isUndefinedKeyword: (node: Node | undefined) => node is Expression; /** Gets if the node is a VariableDeclaration. */ static readonly isVariableDeclaration: (node: Node | undefined) => node is VariableDeclaration; /** Gets if the node is a VariableDeclarationList. */ static readonly isVariableDeclarationList: (node: Node | undefined) => node is VariableDeclarationList; /** Gets if the node is a VariableStatement. */ static readonly isVariableStatement: (node: Node | undefined) => node is VariableStatement; /** Gets if the node is a VoidExpression. */ static readonly isVoidExpression: (node: Node | undefined) => node is VoidExpression; /** Gets if the node is a WhileStatement. */ static readonly isWhileStatement: (node: Node | undefined) => node is WhileStatement; /** Gets if the node is a WithStatement. */ static readonly isWithStatement: (node: Node | undefined) => node is WithStatement; /** Gets if the node is a YieldExpression. */ static readonly isYieldExpression: (node: Node | undefined) => node is YieldExpression; protected constructor(); /** Gets the underlying compiler node. */ get compilerNode(): NodeType; /** * Releases the node and all its descendants from the underlying node cache and ast. * * This is useful if you want to improve the performance of manipulation by not tracking this node anymore. */ forget(): void; /** Forgets the descendants of this node. */ forgetDescendants(): void; /** * Gets if the compiler node was forgotten. * * This will be true when the compiler node was forgotten or removed. */ wasForgotten(): boolean; /** Gets the syntax kind. */ getKind(): SyntaxKind; /** Gets the syntax kind name. */ getKindName(): string; /** Gets the node's flags. */ getFlags(): ts.NodeFlags; /** * Prints the node using the compiler's printer. * @param options - Options. */ print(options?: PrintNodeOptions): string; /** Gets the symbol or throws an error if it doesn't exist. */ getSymbolOrThrow(message?: string | (() => string)): Symbol; /** Gets the compiler symbol or undefined if it doesn't exist. */ getSymbol(): Symbol | undefined; /** * Gets the symbols in the scope of the node. * * Note: This will always return the local symbols. If you want the export symbol from a local symbol, then * use the `#getExportSymbol()` method on the symbol. * @param meaning - Meaning of symbol to filter by. */ getSymbolsInScope(meaning: SymbolFlags): Symbol[]; /** * Gets the specified local symbol by name or throws if it doesn't exist. * * WARNING: The symbol table of locals is not exposed publicly by the compiler. Use this at your own risk knowing it may break. * @param name - Name of the local symbol. */ getLocalOrThrow(name: string, message?: string | (() => string)): Symbol; /** * Gets the specified local symbol by name or returns undefined if it doesn't exist. * * WARNING: The symbol table of locals is not exposed publicly by the compiler. Use this at your own risk knowing it may break. * @param name - Name of the local symbol. */ getLocal(name: string): Symbol | undefined; /** * Gets the symbols within the current scope. * * WARNING: The symbol table of locals is not exposed publicly by the compiler. Use this at your own risk knowing it may break. */ getLocals(): Symbol[]; /** Gets the type of the node. */ getType(): Type; /** * If the node contains the provided range (inclusive). * @param pos - Start position. * @param end - End position. */ containsRange(pos: number, end: number): boolean; /** * Gets if the specified position is within a string. * @param pos - Position. */ isInStringAtPos(pos: number): boolean; /** * Gets the node as the specified kind if it is equal to that kind, otherwise throws. * @param kind - Syntax kind. */ asKindOrThrow<TKind extends SyntaxKind>(kind: TKind, message?: string | (() => string)): KindToNodeMappings[TKind]; /** * Returns if the node is the specified kind. * * This is a type guard. * @param kind - Syntax kind. */ isKind<TKind extends SyntaxKind>(kind: TKind): this is KindToNodeMappings[TKind]; /** * Gets the node as the specified kind if it is equal to that kind, otherwise returns undefined. * @param kind - Syntax kind. */ asKind<TKind extends SyntaxKind>(kind: TKind): KindToNodeMappings[TKind] | undefined; /** * Gets the first child by a condition or throws. * @param condition - Condition. */ getFirstChildOrThrow<T extends Node>(condition?: (node: Node) => node is T, message?: string | (() => string)): T; /** * Gets the first child by a condition or throws. * @param condition - Condition. */ getFirstChildOrThrow(condition?: (node: Node) => boolean, message?: string | (() => string)): Node; /** * Gets the first child by a condition. * @param condition - Condition. */ getFirstChild<T extends Node>(condition?: (node: Node) => node is T): T | undefined; /** * Gets the first child by a condition. * @param condition - Condition. */ getFirstChild(condition?: (node: Node) => boolean): Node | undefined; /** * Gets the last child by a condition or throws. * @param condition - Condition. */ getLastChildOrThrow<T extends Node>(condition?: (node: Node) => node is T, message?: string | (() => string)): T; /** * Gets the last child by a condition or throws. * @param condition - Condition. */ getLastChildOrThrow(condition?: (node: Node) => boolean, message?: string | (() => string)): Node; /** * Gets the last child by a condition. * @param condition - Condition. */ getLastChild<T extends Node>(condition?: (node: Node) => node is T): T | undefined; /** * Gets the last child by a condition. * @param condition - Condition. */ getLastChild(condition?: (node: Node) => boolean): Node | undefined; /** * Gets the first descendant by a condition or throws. * @param condition - Condition. */ getFirstDescendantOrThrow<T extends Node>(condition?: (node: Node) => node is T, message?: string | (() => string)): T; /** * Gets the first descendant by a condition or throws. * @param condition - Condition. */ getFirstDescendantOrThrow(condition?: (node: Node) => boolean, message?: string | (() => string)): Node; /** * Gets the first descendant by a condition. * @param condition - Condition. */ getFirstDescendant<T extends Node>(condition?: (node: Node) => node is T): T | undefined; /** * Gets the first descendant by a condition. * @param condition - Condition. */ getFirstDescendant(condition?: (node: Node) => boolean): Node | undefined; /** * Gets the previous sibling or throws. * @param condition - Optional condition for getting the previous sibling. */ getPreviousSiblingOrThrow<T extends Node>(condition?: (node: Node) => node is T, message?: string | (() => string)): T; /** * Gets the previous sibling or throws. * @param condition - Optional condition for getting the previous sibling. */ getPreviousSiblingOrThrow(condition?: (node: Node) => boolean, message?: string | (() => string)): Node; /** * Gets the previous sibling. * @param condition - Optional condition for getting the previous sibling. */ getPreviousSibling<T extends Node>(condition?: (node: Node) => node is T): T | undefined; /** * Gets the previous sibling. * @param condition - Optional condition for getting the previous sibling. */ getPreviousSibling(condition?: (node: Node) => boolean): Node | undefined; /** * Gets the next sibling or throws. * @param condition - Optional condition for getting the next sibling. */ getNextSiblingOrThrow<T extends Node>(condition?: (node: Node) => node is T, message?: string | (() => string)): T; /** * Gets the next sibling or throws. * @param condition - Optional condition for getting the next sibling. */ getNextSiblingOrThrow(condition?: (node: Node) => boolean, message?: string | (() => string)): Node; /** * Gets the next sibling. * @param condition - Optional condition for getting the next sibling. */ getNextSibling<T extends Node>(condition?: (node: Node) => node is T): T | undefined; /** * Gets the next sibling. * @param condition - Optional condition for getting the next sibling. */ getNextSibling(condition?: (node: Node) => boolean): Node | undefined; /** * Gets the previous siblings. * * Note: Closest sibling is the zero index. */ getPreviousSiblings(): Node[]; /** * Gets the next siblings. * * Note: Closest sibling is the zero index. */ getNextSiblings(): Node[]; /** Gets all the children of the node. */ getChildren(): Node[]; /** * Gets the child at the specified index. * @param index - Index of the child. */ getChildAtIndex(index: number): Node; /** Gets the child syntax list or throws if it doesn't exist. */ getChildSyntaxListOrThrow(message?: string | (() => string)): SyntaxList; /** Gets the child syntax list if it exists. */ getChildSyntaxList(): SyntaxList | undefined; /** * Invokes the `cbNode` callback for each child and the `cbNodeArray` for every array of nodes stored in properties of the node. * If `cbNodeArray` is not defined, then it will pass every element of the array to `cbNode`. * @returns The first truthy value returned by a callback. * @param cbNode - Callback invoked for each child. * @param cbNodeArray - Callback invoked for each array of nodes. */ forEachChild<T>(cbNode: (node: Node) => T | undefined, cbNodeArray?: (nodes: Node[]) => T | undefined): T | undefined; /** * Invokes the `cbNode` callback for each descendant and the `cbNodeArray` for every array of nodes stored in properties of the node and descendant nodes. * If `cbNodeArray` is not defined, then it will pass every element of the array to `cbNode`. * * @returns The first truthy value returned by a callback. * @remarks There exists a `traversal` object on the second parameter that allows various control of iteration. * @param cbNode - Callback invoked for each descendant. * @param cbNodeArray - Callback invoked for each array of nodes. */ forEachDescendant<T>(cbNode: (node: Node, traversal: ForEachDescendantTraversalControl) => T | undefined, cbNodeArray?: (nodes: Node[], traversal: ForEachDescendantTraversalControl) => T | undefined): T | undefined; /** Gets the child nodes passed to the delegate of `node.forEachChild(child => {})` as an array. */ forEachChildAsArray(): Node<ts.Node>[]; /** Gets the descendant nodes passed to the delegate of `node.forEachDescendant(descendant => {})` as an array. */ forEachDescendantAsArray(): Node<ts.Node>[]; /** Gets the node's descendants. */ getDescendants(): Node[]; /** Gets the node's descendant statements and any arrow function statement-like expressions (ex. returns the expression `5` in `() => 5`). */ getDescendantStatements(): (Statement | Expression)[]; /** Gets the number of children the node has. */ getChildCount(): number; /** * Gets the child at the provided text position, or undefined if not found. * @param pos - Text position to search for. */ getChildAtPos(pos: number): Node | undefined; /** * Gets the most specific descendant at the provided text position, or undefined if not found. * @param pos - Text position to search for. */ getDescendantAtPos(pos: number): Node | undefined; /** * Gets the most specific descendant at the provided start text position with the specified width, or undefined if not found. * @param start - Start text position to search for. * @param width - Text length of the node to search for. */ getDescendantAtStartWithWidth(start: number, width: number): Node | undefined; /** Gets the source file text position where the node starts that includes the leading trivia (comments and whitespace). */ getPos(): number; /** * Gets the source file text position where the node ends. * * @remarks This does not include the following trivia (comments and whitespace). */ getEnd(): number; /** * Gets the source file text position where the node starts that does not include the leading trivia (comments and whitespace). * @param includeJsDocComments - Whether to include the JS doc comments. */ getStart(includeJsDocComments?: boolean): number; /** Gets the source file text position of the end of the last significant token or the start of the source file. */ getFullStart(): number; /** Gets the first source file text position that is not whitespace taking into account comment nodes and a previous node's trailing trivia. */ getNonWhitespaceStart(): number; /** * Gets the text length of the node without trivia. * @param includeJsDocComments - Whether to include the JS doc comments in the width or not. */ getWidth(includeJsDocComments?: boolean): number; /** Gets the text length of the node with trivia. */ getFullWidth(): number; /** Gets the node's leading trivia's text length. */ getLeadingTriviaWidth(): number; /** Gets the text length from the end of the current node to the next significant token or new line. */ getTrailingTriviaWidth(): number; /** Gets the text position of the next significant token or new line. */ getTrailingTriviaEnd(): number; /** * Gets the text without leading trivia (comments and whitespace). * @param includeJsDocComments - Whether to include the js doc comments when getting the text. */ getText(includeJsDocComments?: boolean): string; /** * Gets the text without leading trivia (comments and whitespace). * @param options - Options for getting the text. */ getText(options: { trimLeadingIndentation?: boolean; includeJsDocComments?: boolean; }): string; /** Gets the full text with leading trivia (comments and whitespace). */ getFullText(): string; /** Gets the combined modifier flags. */ getCombinedModifierFlags(): ts.ModifierFlags; /** Gets the source file. */ getSourceFile(): SourceFile; /** Gets the project. */ getProject(): Project; /** * Gets a compiler node property wrapped in a Node. * @param propertyName - Property name. */ getNodeProperty<KeyType extends keyof LocalNodeType, LocalNodeType extends ts.Node = NodeType>(propertyName: KeyType): NodePropertyToWrappedType<LocalNodeType, KeyType>; /** Goes up the tree getting all the parents in ascending order. */ getAncestors(): Node[]; /** Get the node's parent. */ getParent(): Node<ts.Node> | undefined; /** Gets the parent or throws an error if it doesn't exist. */ getParentOrThrow(message?: string | (() => string)): Node<ts.Node>; /** * Goes up the parents (ancestors) of the node while a condition is true. * Throws if the initial parent doesn't match the condition. * @param condition - Condition that tests the parent to see if the expression is true. */ getParentWhileOrThrow<T extends Node>(condition: (parent: Node, node: Node) => parent is T, message?: string | (() => string)): T; /** * Goes up the parents (ancestors) of the node while a condition is true. * Throws if the initial parent doesn't match the condition. * @param condition - Condition that tests the parent to see if the expression is true. */ getParentWhileOrThrow(condition: (parent: Node, node: Node) => boolean, message?: string | (() => string)): Node; /** * Goes up the parents (ancestors) of the node while a condition is true. * Returns undefined if the initial parent doesn't match the condition. * @param condition - Condition that tests the parent to see if the expression is true. */ getParentWhile<T extends Node>(condition: (parent: Node, child: Node) => parent is T): T | undefined; /** * Goes up the parents (ancestors) of the node while a condition is true. * Returns undefined if the initial parent doesn't match the condition. * @param condition - Condition that tests the parent to see if the expression is true. */ getParentWhile(condition: (parent: Node, child: Node) => boolean): Node | undefined; /** * Goes up the parents (ancestors) of the node while the parent is the specified syntax kind. * Throws if the initial parent is not the specified syntax kind. * @param kind - Syntax kind to check for. */ getParentWhileKindOrThrow<TKind extends SyntaxKind>(kind: TKind, message?: string | (() => string)): KindToNodeMappings[TKind]; /** * Goes up the parents (ancestors) of the node while the parent is the specified syntax kind. * Returns undefined if the initial parent is not the specified syntax kind. * @param kind - Syntax kind to check for. */ getParentWhileKind<TKind extends SyntaxKind>(kind: TKind): KindToNodeMappings[TKind] | undefined; /** Gets the last token of this node. Usually this is a close brace. */ getLastToken(): Node; /** Gets if this node is in a syntax list. */ isInSyntaxList(): boolean; /** Gets the parent if it's a syntax list or throws an error otherwise. */ getParentSyntaxListOrThrow(message?: string | (() => string)): SyntaxList; /** Gets the parent if it's a syntax list. */ getParentSyntaxList(): SyntaxList | undefined; /** Gets the child index of this node relative to the parent. */ getChildIndex(): number; /** Gets the indentation level of the current node. */ getIndentationLevel(): number; /** Gets the child indentation level of the current node. */ getChildIndentationLevel(): number; /** * Gets the indentation text. * @param offset - Optional number of levels of indentation to add or remove. */ getIndentationText(offset?: number): string; /** * Gets the next indentation level text. * @param offset - Optional number of levels of indentation to add or remove. */ getChildIndentationText(offset?: number): string; /** * Gets the position of the start of the line that this node starts on. * @param includeJsDocComments - Whether to include the JS doc comments or not. */ getStartLinePos(includeJsDocComments?: boolean): number; /** * Gets the line number at the start of the node. * @param includeJsDocComments - Whether to include the JS doc comments or not. */ getStartLineNumber(includeJsDocComments?: boolean): number; /** Gets the line number of the end of the node. */ getEndLineNumber(): number; /** Gets if this is the first node on the current line. */ isFirstNodeOnLine(): boolean; /** * Replaces the text of the current node with new text. * * This will forget the current node and return a new node that can be asserted or type guarded to the correct type. * @param textOrWriterFunction - Text or writer function to replace with. * @returns The new node. * @remarks This will replace the text from the `Node#getStart(true)` position (start position with js docs) to `Node#getEnd()`. * Use `Node#getText(true)` to get all the text that will be replaced. */ replaceWithText(textOrWriterFunction: string | WriterFunction): Node; /** * Prepends the specified whitespace to current node. * @param textOrWriterFunction - Text or writer function. */ prependWhitespace(textOrWriterFunction: string | WriterFunction): void; /** * Appends the specified whitespace to current node. * @param textOrWriterFunction - Text or writer function. */ appendWhitespace(textOrWriterFunction: string | WriterFunction): void; /** * Formats the node's text using the internal TypeScript formatting API. * @param settings - Format code settings. */ formatText(settings?: FormatCodeSettings): void; /** * Transforms the node using the compiler api nodes and functions and returns * the node that was transformed (experimental). * * WARNING: This will forget descendants of transformed nodes and potentially this node. * @example Increments all the numeric literals in a source file. * ```ts * sourceFile.transform(traversal => { * const node = traversal.visitChildren(); // recommend always visiting the children first (post order) * if (ts.isNumericLiteral(node)) * return ts.createNumericLiteral((parseInt(node.text, 10) + 1).toString()); * return node; * }); * ``` * @example Updates the class declaration node without visiting the children. * ```ts * const classDec = sourceFile.getClassOrThrow("MyClass"); * classDec.transform(traversal => { * const node = traversal.currentNode; * return ts.updateClassDeclaration(node, undefined, undefined, ts.createIdentifier("MyUpdatedClass"), undefined, undefined, []); * }); * ``` */ transform(visitNode: (traversal: TransformTraversalControl) => ts.Node): Node; /** Gets the leading comment ranges of the current node. */ getLeadingCommentRanges(): CommentRange[]; /** Gets the trailing comment ranges of the current node. */ getTrailingCommentRanges(): CommentRange[]; /** * Gets the children based on a kind. * @param kind - Syntax kind. */ getChildrenOfKind<TKind extends SyntaxKind>(kind: TKind): KindToNodeMappings[TKind][]; /** * Gets the first child by syntax kind or throws an error if not found. * @param kind - Syntax kind. */ getFirstChildByKindOrThrow<TKind extends SyntaxKind>(kind: TKind, message?: string | (() => string)): KindToNodeMappings[TKind]; /** * Gets the first child by syntax kind. * @param kind - Syntax kind. */ getFirstChildByKind<TKind extends SyntaxKind>(kind: TKind): KindToNodeMappings[TKind] | undefined; /** * Gets the first child if it matches the specified syntax kind or throws an error if not found. * @param kind - Syntax kind. */ getFirstChildIfKindOrThrow<TKind extends SyntaxKind>(kind: TKind, message?: string | (() => string)): KindToNodeMappings[TKind]; /** * Gets the first child if it matches the specified syntax kind. * @param kind - Syntax kind. */ getFirstChildIfKind<TKind extends SyntaxKind>(kind: TKind): KindToNodeMappings[TKind] | undefined; /** * Gets the last child by syntax kind or throws an error if not found. * @param kind - Syntax kind. */ getLastChildByKindOrThrow<TKind extends SyntaxKind>(kind: TKind, message?: string | (() => string)): KindToNodeMappings[TKind]; /** * Gets the last child by syntax kind. * @param kind - Syntax kind. */ getLastChildByKind<TKind extends SyntaxKind>(kind: TKind): KindToNodeMappings[TKind] | undefined; /** * Gets the last child if it matches the specified syntax kind or throws an error if not found. * @param kind - Syntax kind. */ getLastChildIfKindOrThrow<TKind extends SyntaxKind>(kind: TKind, message?: string | (() => string)): KindToNodeMappings[TKind]; /** * Gets the last child if it matches the specified syntax kind. * @param kind - Syntax kind. */ getLastChildIfKind<TKind extends SyntaxKind>(kind: TKind): KindToNodeMappings[TKind] | undefined; /** * Gets the child at the specified index if it's the specified kind or throws an exception. * @param index - Child index to get. * @param kind - Expected kind. */ getChildAtIndexIfKindOrThrow<TKind extends SyntaxKind>(index: number, kind: TKind, message?: string | (() => string)): KindToNodeMappings[TKind]; /** * Gets the child at the specified index if it's the specified kind or returns undefined. * @param index - Child index to get. * @param kind - Expected kind. */ getChildAtIndexIfKind<TKind extends SyntaxKind>(index: number, kind: TKind): KindToNodeMappings[TKind] | undefined; /** * Gets the previous sibiling if it matches the specified kind, or throws. * @param kind - Kind to check. */ getPreviousSiblingIfKindOrThrow<TKind extends SyntaxKind>(kind: TKind, message?: string | (() => string)): KindToNodeMappings[TKind]; /** * Gets the next sibiling if it matches the specified kind, or throws. * @param kind - Kind to check. */ getNextSiblingIfKindOrThrow<TKind extends SyntaxKind>(kind: TKind, message?: string | (() => string)): KindToNodeMappings[TKind]; /** * Gets the previous sibling if it matches the specified kind. * @param kind - Kind to check. */ getPreviousSiblingIfKind<TKind extends SyntaxKind>(kind: TKind): KindToNodeMappings[TKind] | undefined; /** * Gets the next sibling if it matches the specified kind. * @param kind - Kind to check. */ getNextSiblingIfKind<TKind extends SyntaxKind>(kind: TKind): KindToNodeMappings[TKind] | undefined; /** Gets the parent if it matches a certain condition or throws. */ getParentIfOrThrow<T extends Node>(condition: (parent: Node | undefined, node: Node) => parent is T, message?: string | (() => string)): T; /** Gets the parent if it matches a certain condition or throws. */ getParentIfOrThrow(condition: (parent: Node | undefined, node: Node) => boolean, message?: string | (() => string)): Node; /** Gets the parent if it matches a certain condition. */ getParentIf<T extends Node>(condition: (parent: Node | undefined, node: Node) => parent is T): T | undefined; /** Gets the parent if it matches a certain condition. */ getParentIf(condition: (parent: Node | undefined, node: Node) => boolean): Node | undefined; /** Gets the parent if it's a certain syntax kind or throws. */ getParentIfKindOrThrow<TKind extends SyntaxKind>(kind: TKind, message?: string | (() => string)): KindToNodeMappings[TKind]; /** Gets the parent if it's a certain syntax kind. */ getParentIfKind<TKind extends SyntaxKind>(kind: TKind): KindToNodeMappings[TKind] | undefined; /** * Gets the first ancestor by syntax kind or throws if not found. * @param kind - Syntax kind. */ getFirstAncestorByKindOrThrow<TKind extends SyntaxKind>(kind: TKind, message?: string | (() => string)): KindToNodeMappings[TKind]; /** * Get the first ancestor by syntax kind. * @param kind - Syntax kind. */ getFirstAncestorByKind<TKind extends SyntaxKind>(kind: TKind): KindToNodeMappings[TKind] | undefined; /** * Gets the first ancestor that matches the provided condition or throws if not found. * @param condition - Condition to match. */ getFirstAncestorOrThrow<T extends Node>(condition?: (node: Node) => node is T): T; /** * Gets the first ancestor that matches the provided condition or throws if not found. * @param condition - Condition to match. */ getFirstAncestorOrThrow(condition?: (node: Node) => boolean): Node; /** * Gets the first ancestor that matches the provided condition or returns undefined if not found. * @param condition - Condition to match. */ getFirstAncestor<T extends Node>(condition?: (node: Node) => node is T): T | undefined; /** * Gets the first ancestor that matches the provided condition or returns undefined if not found. * @param condition - Condition to match. */ getFirstAncestor(condition?: (node: Node) => boolean): Node | undefined; /** * Gets the descendants that match a specified syntax kind. * @param kind - Kind to check. */ getDescendantsOfKind<TKind extends SyntaxKind>(kind: TKind): KindToNodeMappings[TKind][]; /** * Gets the first descendant by syntax kind or throws. * @param kind - Syntax kind. */ getFirstDescendantByKindOrThrow<TKind extends SyntaxKind>(kind: TKind, message?: string | (() => string)): KindToNodeMappings[TKind]; /** * Gets the first descendant by syntax kind. * @param kind - Syntax kind. */ getFirstDescendantByKind<TKind extends SyntaxKind>(kind: TKind): KindToNodeMappings[TKind] | undefined; /** * Gets if the node has an expression. * @param node - Node to check. */ static hasExpression<T extends Node>(node: T): node is T & { getExpression(): Expression; }; /** * Gets if the node has a name. * @param node - Node to check. */ static hasName<T extends Node>(node: T): node is T & { getName(): string; getNameNode(): Node; }; /** * Gets if the node has a body. * @param node - Node to check. */ static hasBody<T extends Node>(node: T): node is T & { getBody(): Node; }; /** * Gets if the node has a structure. * @param node - Node to check. */ static hasStructure<T extends Node>(node: T): node is T & { getStructure(): Structures; }; /** Creates a type guard for syntax kinds. */ static is<TKind extends keyof KindToNodeMappings>(kind: TKind): (node: Node | undefined) => node is KindToNodeMappings[TKind]; /** Gets if the provided value is a Node. */ static isNode(value: unknown): value is Node; /** Gets if the provided node is a comment node. */ static isCommentNode(node: Node | undefined): node is CommentStatement | CommentClassElement | CommentTypeElement | CommentObjectLiteralElement | CommentEnumMember; /** Gets if the provided node is a CommentStatement. */ static isCommentStatement(node: Node | undefined): node is CommentStatement; /** Gets if the provided node is a CommentClassElement. */ static isCommentClassElement(node: Node | undefined): node is CommentClassElement; /** Gets if the provided value is a CommentTypeElement. */ static isCommentTypeElement(node: Node | undefined): node is CommentTypeElement; /** Gets if the provided node is a CommentObjectLiteralElement. */ static isCommentObjectLiteralElement(node: Node | undefined): node is CommentObjectLiteralElement; /** Gets if the provided node is a CommentEnumMember. */ static isCommentEnumMember(node: Node | undefined): node is CommentEnumMember; /** Gets if the node is an AbstractableNode. */ static isAbstractable<T extends Node>(node: T | undefined): node is AbstractableNode & AbstractableNodeExtensionType & T; /** Gets if the node is an AmbientableNode. */ static isAmbientable<T extends Node>(node: T | undefined): node is AmbientableNode & AmbientableNodeExtensionType & T; /** Gets if the node is an ArgumentedNode. */ static isArgumented<T extends Node>(node: T | undefined): node is ArgumentedNode & ArgumentedNodeExtensionType & T; /** Gets if the node is an ArrayTypeNode. */ static isArrayTypeNode(node: Node | undefined): node is ArrayTypeNode; /** Gets if the node is an AsyncableNode. */ static isAsyncable<T extends Node>(node: T | undefined): node is AsyncableNode & AsyncableNodeExtensionType & T; /** Gets if the node is an AwaitableNode. */ static isAwaitable<T extends Node>(node: T | undefined): node is AwaitableNode & AwaitableNodeExtensionType & T; /** Gets if the node is a BindingNamedNode. */ static isBindingNamed<T extends Node>(node: T | undefined): node is BindingNamedNode & BindingNamedNodeExtensionType & T; /** Gets if the node is a BodiedNode. */ static isBodied<T extends Node>(node: T | undefined): node is BodiedNode & BodiedNodeExtensionType & T; /** Gets if the node is a BodyableNode. */ static isBodyable<T extends Node>(node: T | undefined): node is BodyableNode & BodyableNodeExtensionType & T; /** Gets if the node is a CallSignatureDeclaration. */ static isCallSignatureDeclaration(node: Node | undefined): node is CallSignatureDeclaration; /** Gets if the node is a ChildOrderableNode. */ static isChildOrderable<T extends Node>(node: T | undefined): node is ChildOrderableNode & ChildOrderableNodeExtensionType & T; /** Gets if the node is a ClassLikeDeclarationBase. */ static isClassLikeDeclarationBase<T extends Node>(node: T | undefined): node is ClassLikeDeclarationBase & ClassLikeDeclarationBaseExtensionType & T; /** Gets if the node is a ConditionalTypeNode. */ static isConditionalTypeNode(node: Node | undefined): node is ConditionalTypeNode; /** Gets if the node is a ConstructorDeclaration. */ static isConstructorDeclaration(node: Node | undefined): node is ConstructorDeclaration; /** Gets if the node is a ConstructorTypeNode. */ static isConstructorTypeNode(node: Node | undefined): node is ConstructorTypeNode; /** Gets if the node is a ConstructSignatureDeclaration. */ static isConstructSignatureDeclaration(node: Node | undefined): node is ConstructSignatureDeclaration; /** Gets if the node is a DecoratableNode. */ static isDecoratable<T extends Node>(node: T | undefined): node is DecoratableNode & DecoratableNodeExtensionType & T; /** Gets if the node is a DotDotDotTokenableNode. */ static isDotDotDotTokenable<T extends Node>(node: T | undefined): node is DotDotDotTokenableNode & DotDotDotTokenableNodeExtensionType & T; /** Gets if the node is an ExclamationTokenableNode. */ static isExclamationTokenable<T extends Node>(node: T | undefined): node is ExclamationTokenableNode & ExclamationTokenableNodeExtensionType & T; /** Gets if the node is an ExportableNode. */ static isExportable<T extends Node>(node: T | undefined): node is ExportableNode & ExportableNodeExtensionType & T; /** Gets if the node is an ExportGetableNode. */ static isExportGetable<T extends Node>(node: T | undefined): node is ExportGetableNode & ExportGetableNodeExtensionType & T; /** Gets if the node is an Expression. */ static isExpression(node: Node | undefined): node is Expression; /** Gets if the node is an ExpressionableNode. */ static isExpressionable<T extends Node>(node: T | undefined): node is ExpressionableNode & ExpressionableNodeExtensionType & T; /** Gets if the node is an ExpressionedNode. */ static isExpressioned<T extends Node>(node: T | undefined): node is ExpressionedNode & ExpressionedNodeExtensionType & T; /** Gets if the node is an ExtendsClauseableNode. */ static isExtendsClauseable<T extends Node>(node: T | undefined): node is ExtendsClauseableNode & ExtendsClauseableNodeExtensionType & T; /** Gets if the node is a FalseLiteral. */ static isFalseLiteral(node: Node | undefined): node is FalseLiteral; /** Gets if the node is a FunctionLikeDeclaration. */ static isFunctionLikeDeclaration<T extends Node>(node: T | undefined): node is FunctionLikeDeclaration & FunctionLikeDeclarationExtensionType & T; /** Gets if the node is a FunctionTypeNode. */ static isFunctionTypeNode(node: Node | undefined): node is FunctionTypeNode; /** Gets if the node is a GeneratorableNode. */ static isGeneratorable<T extends Node>(node: T | undefined): node is GeneratorableNode & GeneratorableNodeExtensionType & T; /** Gets if the node is a GetAccessorDeclaration. */ static isGetAccessorDeclaration(node: Node | undefined): node is GetAccessorDeclaration; /** Gets if the node is a HeritageClauseableNode. */ static isHeritageClauseable<T extends Node>(node: T | undefined): node is HeritageClauseableNode & HeritageClauseableNodeExtensionType & T; /** Gets if the node is a ImplementsClauseableNode. */ static isImplementsClauseable<T extends Node>(node: T | undefined): node is ImplementsClauseableNode & ImplementsClauseableNodeExtensionType & T; /** Gets if the node is a ImportAttributeNamedNode. */ static isImportAttributeNamed<T extends Node>(node: T | undefined): node is ImportAttributeNamedNode & ImportAttributeNamedNodeExtensionType & T; /** Gets if the node is a ImportExpression. */ static isImportExpression(node: Node | undefined): node is ImportExpression; /** Gets if the node is a ImportTypeNode. */ static isImportTypeNode(node: Node | undefined): node is ImportTypeNode; /** Gets if the node is a IndexedAccessTypeNode. */ static isIndexedAccessTypeNode(node: Node | undefined): node is IndexedAccessTypeNode; /** Gets if the node is a IndexSignatureDeclaration. */ static isIndexSignatureDeclaration(node: Node | undefined): node is IndexSignatureDeclaration; /** Gets if the node is a InferTypeNode. */ static isInferTypeNode(node: Node | undefined): node is InferTypeNode; /** Gets if the node is a InitializerExpressionableNode. */ static isInitializerExpressionable<T extends Node>(node: T | undefined): node is InitializerExpressionableNode & InitializerExpressionableNodeExtensionType & T; /** Gets if the node is a InitializerExpressionGetableNode. */ static isInitializerExpressionGetable<T extends Node>(node: T | undefined): node is InitializerExpressionGetableNode & InitializerExpressionGetableNodeExtensionType & T; /** Gets if the node is a IntersectionTypeNode. */ static isIntersectionTypeNode(node: Node | undefined): node is IntersectionTypeNode; /** Gets if the node is a IterationStatement. */ static isIterationStatement(node: Node | undefined): node is IterationStatement; /** Gets if the node is a JSDocableNode. */ static isJSDocable<T extends Node>(node: T | undefined): node is JSDocableNode & JSDocableNodeExtensionType & T; /** Gets if the node is a JSDocPropertyLikeTag. */ static isJSDocPropertyLikeTag<T extends Node>(node: T | undefined): node is JSDocPropertyLikeTag & JSDocPropertyLikeTagExtensionType & T; /** Gets if the node is a JSDocTag. */ static isJSDocTag(node: Node | undefined): node is JSDocTag; /** Gets if the node is a JSDocType. */ static isJSDocType(node: Node | undefined): node is JSDocType; /** Gets if the node is a JSDocTypeExpressionableTag. */ static isJSDocTypeExpressionableTag<T extends Node>(node: T | undefined): node is JSDocTypeExpressionableTag & JSDocTypeExpressionableTagExtensionType & T; /** Gets if the node is a JSDocTypeParameteredTag. */ static isJSDocTypeParameteredTag<T extends Node>(node: T | undefined): node is JSDocTypeParameteredTag & JSDocTypeParameteredTagExtensionType & T; /** Gets if the node is a JSDocUnknownTag. */ static isJSDocUnknownTag(node: Node | undefined): node is JSDocUnknownTag; /** Gets if the node is a JsxAttributedNode. */ static isJsxAttributed<T extends Node>(node: T | undefined): node is JsxAttributedNode & JsxAttributedNodeExtensionType & T; /** Gets if the node is a JsxTagNamedNode. */ static isJsxTagNamed<T extends Node>(node: T | undefined): node is JsxTagNamedNode & JsxTagNamedNodeExtensionType & T; /** Gets if the node is a LeftHandSideExpression. */ static isLeftHandSideExpression(node: Node | undefined): node is LeftHandSideExpression; /** Gets if the node is a LeftHandSideExpressionedNode. */ static isLeftHandSideExpressioned<T extends Node>(node: T | undefined): node is LeftHandSideExpressionedNode & LeftHandSideExpressionedNodeExtensionType & T; /** Gets if the node is a LiteralExpression. */ static isLiteralExpression(node: Node | undefined): node is LiteralExpression; /** Gets if the node is a LiteralLikeNode. */ static isLiteralLike<T extends Node>(node: T | undefined): node is LiteralLikeNode & LiteralLikeNodeExtensionType & T; /** Gets if the node is a LiteralTypeNode. */ static isLiteralTypeNode(node: Node | undefined): node is LiteralTypeNode; /** Gets if the node is a MappedTypeNode. */ static isMappedTypeNode(node: Node | undefined): node is MappedTypeNode; /** Gets if the node is a MemberExpression. */ static isMemberExpression(node: Node | undefined): node is MemberExpression; /** Gets if the node is a ModifierableNode. */ static isModifierable<T extends Node>(node: T | undefined): node is ModifierableNode & ModifierableNodeExtensionType & T; /** Gets if the node is a ModuleChildableNode. */ static isModuleChildable<T extends Node>(node: T | undefined): node is ModuleChildableNode & ModuleChildableNodeExtensionType & T; /** Gets if the node is a ModuledNode. */ static isModuled<T extends Node>(node: T | undefined): node is ModuledNode & ModuledNodeExtensionType & T; /** Gets if the node is a ModuleNamedNode. */ static isModuleNamed<T extends Node>(node: T | undefined): node is ModuleNamedNode & ModuleNamedNodeExtensionType & T; /** Gets if the node is a NameableNode. */ static isNameable<T extends Node>(node: T | undefined): node is NameableNode & NameableNodeExtensionType & T; /** Gets if the node is a NamedNode. */ static isNamed<T extends Node>(node: T | undefined): node is NamedNode & NamedNodeExtensionType & T; /** Gets if the node is a NodeWithTypeArguments. */ static isNodeWithTypeArguments(node: Node | undefined): node is NodeWithTypeArguments; /** Gets if the node is a NullLiteral. */ static isNullLiteral(node: Node | undefined): node is NullLiteral; /** Gets if the node is a OverloadableNode. */ static isOverloadable<T extends Node>(node: T | undefined): node is OverloadableNode & OverloadableNodeExtensionType & T; /** Gets if the node is a OverrideableNode. */ static isOverrideable<T extends Node>(node: T | undefined): node is OverrideableNode & OverrideableNodeExtensionType & T; /** Gets if the node is a ParameterDeclaration. */ static isParameterDeclaration(node: Node | undefined): node is ParameterDeclaration; /** Gets if the node is a ParameteredNode. */ static isParametered<T extends Node>(node: T | undefined): node is ParameteredNode & ParameteredNodeExtensionType & T; /** Gets if the node is a ParenthesizedTypeNode. */ static isParenthesizedTypeNode(node: Node | undefined): node is ParenthesizedTypeNode; /** Gets if the node is a PrimaryExpression. */ static isPrimaryExpression(node: Node | undefined): node is PrimaryExpression; /** Gets if the node is a PropertyNamedNode. */ static isPropertyNamed<T extends Node>(node: T | undefined): node is PropertyNamedNode & PropertyNamedNodeExtensionType & T; /** Gets if the node is a QuestionDotTokenableNode. */ static isQuestionDotTokenable<T extends Node>(node: T | undefined): node is QuestionDotTokenableNode & QuestionDotTokenableNodeExtensionType & T; /** Gets if the node is a QuestionTokenableNode. */ static isQuestionTokenable<T extends Node>(node: T | undefined): node is QuestionTokenableNode & QuestionTokenableNodeExtensionType & T; /** Gets if the node is a ReadonlyableNode. */ static isReadonlyable<T extends Node>(node: T | undefined): node is ReadonlyableNode & ReadonlyableNodeExtensionType & T; /** Gets if the node is a ReferenceFindableNode. */ static isReferenceFindable<T extends Node>(node: T | undefined): node is ReferenceFindableNode & ReferenceFindableNodeExtensionType & T; /** Gets if the node is a RenameableNode. */ static isRenameable<T extends Node>(node: T | undefined): node is RenameableNode & RenameableNodeExtensionType & T; /** Gets if the node is a RestTypeNode. */ static isRestTypeNode(node: Node | undefined): node is RestTypeNode; /** Gets if the node is a ReturnTypedNode. */ static isReturnTyped<T extends Node>(node: T | undefined): node is ReturnTypedNode & ReturnTypedNodeExtensionType & T; /** Gets if the node is a ScopeableNode. */ static isScopeable<T extends Node>(node: T | undefined): node is ScopeableNode & ScopeableNodeExtensionType & T; /** Gets if the node is a ScopedNode. */ static isScoped<T extends Node>(node: T | undefined): node is ScopedNode & ScopedNodeExtensionType & T; /** Gets if the node is a SetAccessorDeclaration. */ static isSetAccessorDeclaration(node: Node | undefined): node is SetAccessorDeclaration; /** Gets if the node is a SignaturedDeclaration. */ static isSignaturedDeclaration<T extends Node>(node: T | undefined): node is SignaturedDeclaration & SignaturedDeclarationExtensionType & T; /** Gets if the node is a Statement. */ static isStatement(node: Node | undefined): node is Statement; /** Gets if the node is a StatementedNode. */ static isStatemented<T extends Node>(node: T | undefined): node is StatementedNode & StatementedNodeExtensionType & T; /** Gets if the node is a StaticableNode. */ static isStaticable<T extends Node>(node: T | undefined): node is StaticableNode & StaticableNodeExtensionType & T; /** Gets if the node is a SuperExpression. */ static isSuperExpression(node: Node | undefined): node is SuperExpression; /** Gets if the node is a TemplateLiteralTypeNode. */ static isTemplateLiteralTypeNode(node: Node | undefined): node is TemplateLiteralTypeNode; /** Gets if the node is a TextInsertableNode. */ static isTextInsertable<T extends Node>(node: T | undefined): node is TextInsertableNode & TextInsertableNodeExtensionType & T; /** Gets if the node is a ThisExpression. */ static isThisExpression(node: Node | undefined): node is ThisExpression; /** Gets if the node is a ThisTypeNode. */ static isThisTypeNode(node: Node | undefined): node is ThisTypeNode; /** Gets if the node is a TrueLiteral. */ static isTrueLiteral(node: Node | undefined): node is TrueLiteral; /** Gets if the node is a TupleTypeNode. */ static isTupleTypeNode(node: Node | undefined): node is TupleTypeNode; /** Gets if the node is a TypeArgumentedNode. */ static isTypeArgumented<T extends Node>(node: T | undefined): node is TypeArgumentedNode & TypeArgumentedNodeExtensionType & T; /** Gets if the node is a TypeAssertion. */ static isTypeAssertion(node: Node | undefined): node is TypeAssertion; /** Gets if the node is a TypedNode. */ static isTyped<T extends Node>(node: T | undefined): node is TypedNode & TypedNodeExtensionType & T; /** Gets if the node is a TypeElement. */ static isTypeElement(node: Node | undefined): node is TypeElement; /** Gets if the node is a TypeElementMemberedNode. */ static isTypeElementMembered<T extends Node>(node: T | undefined): node is TypeElementMemberedNode & TypeElementMemberedNodeExtensionType & T; /** Gets if the node is a TypeLiteralNode. */ static isTypeLiteral(node: Node | undefined): node is TypeLiteralNode; /** Gets if the node is a TypeNode. */ static isTypeNode(node: Node | undefined): node is TypeNode; /** Gets if the node is a TypeOperatorTypeNode. */ static isTypeOperatorTypeNode(node: Node | undefined): node is TypeOperatorTypeNode; /** Gets if the node is a TypeParameterDeclaration. */ static isTypeParameterDeclaration(node: Node | undefined): node is TypeParameterDeclaration; /** Gets if the node is a TypeParameteredNode. */ static isTypeParametered<T extends Node>(node: T | undefined): node is TypeParameteredNode & TypeParameteredNodeExtensionType & T; /** Gets if the node is a TypePredicateNode. */ static isTypePredicate(node: Node | undefined): node is TypePredicateNode; /** Gets if the node is a TypeQueryNode. */ static isTypeQuery(node: Node | undefined): node is TypeQueryNode; /** Gets if the node is a TypeReferenceNode. */ static isTypeReference(node: Node | undefined): node is TypeReferenceNode; /** Gets if the node is a UnaryExpression. */ static isUnaryExpression(node: Node | undefined): node is UnaryExpression; /** Gets if the node is a UnaryExpressionedNode. */ static isUnaryExpressioned<T extends Node>(node: T | undefined): node is UnaryExpressionedNode & UnaryExpressionedNodeExtensionType & T; /** Gets if the node is a UnionTypeNode. */ static isUnionTypeNode(node: Node | undefined): node is UnionTypeNode; /** Gets if the node is a UnwrappableNode. */ static isUnwrappable<T extends Node>(node: T | undefined): node is UnwrappableNode & UnwrappableNodeExtensionType & T; /** Gets if the node is a UpdateExpression. */ static isUpdateExpression(node: Node | undefined): node is UpdateExpression;}
export declare enum Scope { Public = "public", Protected = "protected", Private = "private"}
export declare class SyntaxList extends Node<ts.SyntaxList> { /** * Adds text at the end of the current children. * @param textOrWriterFunction - Text to add or function that provides a writer to write with. * @returns The children that were added. */ addChildText(textOrWriterFunction: string | WriterFunction | ReadonlyArray<string | WriterFunction>): Node<ts.Node>[]; /** * Inserts text at the specified child index. * @param index - Child index to insert at. * @param textOrWriterFunction - Text to insert or function that provides a writer to write with. * @returns The children that were inserted. */ insertChildText(index: number, textOrWriterFunction: string | WriterFunction | ReadonlyArray<string | WriterFunction>): Node<ts.Node>[]; /** @inheritdoc **/ getParent(): NodeParentType<ts.SyntaxList>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.SyntaxList>>;}
export declare class TextRange<TRange extends ts.TextRange = ts.TextRange> { #private; protected constructor(); /** Gets the underlying compiler object. */ get compilerObject(): TRange; /** Gets the source file of the text range. */ getSourceFile(): SourceFile; /** Gets the position. */ getPos(): number; /** Gets the end. */ getEnd(): number; /** Gets the width of the text range. */ getWidth(): number; /** Gets the text of the text range. */ getText(): string; /** * Gets if the text range was forgotten. * * This will be true after any manipulations have occured to the source file this text range was generated from. */ wasForgotten(): boolean;}
export interface ForEachDescendantTraversalControl { /** Stops traversal. */ stop(): void; /** Skips traversal of the current node's descendants. */ skip(): void; /** Skips traversal of the current node, siblings, and all their descendants. */ up(): void;}
export interface TransformTraversalControl { /** Factory to create nodes with. */ factory: ts.NodeFactory; /** * The node currently being transformed. * @remarks Use the result of `.visitChildren()` instead before transforming if visiting the children. */ currentNode: ts.Node; /** Visits the children of the current node and returns a new node for the current node. */ visitChildren(): ts.Node;}
export type CompilerNodeToWrappedType<T extends ts.Node> = T extends ts.ObjectDestructuringAssignment ? ObjectDestructuringAssignment : T extends ts.ArrayDestructuringAssignment ? ArrayDestructuringAssignment : T extends ts.SuperElementAccessExpression ? SuperElementAccessExpression : T extends ts.SuperPropertyAccessExpression ? SuperPropertyAccessExpression : T extends ts.AssignmentExpression<infer U> ? AssignmentExpression<ts.AssignmentExpression<U>> : T["kind"] extends keyof ImplementedKindToNodeMappings ? ImplementedKindToNodeMappings[T["kind"]] : T extends ts.SyntaxList ? SyntaxList : T extends ts.JSDocTypeExpression ? JSDocTypeExpression : T extends ts.JSDocType ? JSDocType : T extends ts.NodeWithTypeArguments ? NodeWithTypeArguments : T extends ts.TypeNode ? TypeNode : T extends ts.JSDocTag ? JSDocTag : T extends ts.LiteralExpression ? LiteralExpression : T extends ts.PrimaryExpression ? PrimaryExpression : T extends ts.MemberExpression ? MemberExpression : T extends ts.LeftHandSideExpression ? LeftHandSideExpression : T extends ts.UpdateExpression ? UpdateExpression : T extends ts.UnaryExpression ? UnaryExpression : T extends ts.Expression ? Expression : T extends ts.IterationStatement ? IterationStatement : T extends CompilerCommentStatement ? CommentStatement : T extends CompilerCommentClassElement ? CommentClassElement : T extends CompilerCommentTypeElement ? CommentTypeElement : T extends CompilerCommentObjectLiteralElement ? CommentObjectLiteralElement : T extends CompilerCommentEnumMember ? CommentEnumMember : T extends ts.TypeElement ? TypeElement : T extends ts.Statement ? Statement : T extends ts.ClassElement ? ClassElement : T extends ts.ObjectLiteralElement ? ObjectLiteralElement : Node<T>;declare const DecoratorBase: Constructor<LeftHandSideExpressionedNode> & typeof Node;
export declare class Decorator extends DecoratorBase<ts.Decorator> { private _getInnerExpression; /** Gets the decorator name. */ getName(): string; /** Gets the name node of the decorator. */ getNameNode(): Identifier; /** Gets the full decorator name. */ getFullName(): string; /** Gets if the decorator is a decorator factory. */ isDecoratorFactory(): boolean; /** * Set if this decorator is a decorator factory. * @param isDecoratorFactory - If it should be a decorator factory or not. */ setIsDecoratorFactory(isDecoratorFactory: boolean): this; /** Gets the call expression if a decorator factory, or throws. */ getCallExpressionOrThrow(message?: string | (() => string)): CallExpression; /** Gets the call expression if a decorator factory. */ getCallExpression(): CallExpression | undefined; /** Gets the decorator's arguments from its call expression. */ getArguments(): Node[]; /** Gets the decorator's type arguments from its call expression. */ getTypeArguments(): TypeNode[]; /** * Adds a type argument. * @param argumentTexts - Argument text. */ addTypeArgument(argumentText: string): TypeNode<ts.TypeNode>; /** * Adds type arguments. * @param argumentTexts - Argument texts. */ addTypeArguments(argumentTexts: ReadonlyArray<string>): TypeNode<ts.TypeNode>[]; /** * Inserts a type argument. * @param index - Child index to insert at. * @param argumentTexts - Argument text. */ insertTypeArgument(index: number, argumentText: string): TypeNode<ts.TypeNode>; /** * Inserts type arguments. * @param index - Child index to insert at. * @param argumentTexts - Argument texts. */ insertTypeArguments(index: number, argumentTexts: ReadonlyArray<string>): TypeNode<ts.TypeNode>[]; /** * Removes a type argument. * @param typeArg - Type argument to remove. */ removeTypeArgument(typeArg: Node): this; /** * Removes a type argument. * @param index - Index to remove. */ removeTypeArgument(index: number): this; /** * Adds an argument. * @param argumentTexts - Argument text. */ addArgument(argumentText: string | WriterFunction): Node<ts.Node>; /** * Adds arguments. * @param argumentTexts - Argument texts. */ addArguments(argumentTexts: ReadonlyArray<string | WriterFunction> | WriterFunction): Node<ts.Node>[]; /** * Inserts an argument. * @param index - Child index to insert at. * @param argumentTexts - Argument text. */ insertArgument(index: number, argumentText: string | WriterFunction): Node<ts.Node>; /** * Inserts arguments. * @param index - Child index to insert at. * @param argumentTexts - Argument texts. */ insertArguments(index: number, argumentTexts: ReadonlyArray<string | WriterFunction> | WriterFunction): Node<ts.Node>[]; /** * Removes an argument based on the node. * @param node - Argument's node to remove. */ removeArgument(node: Node): this; /** * Removes an argument based on the specified index. * @param index - Index to remove. */ removeArgument(index: number): this; /** Removes this decorator. */ remove(): void; /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<DecoratorStructure>): this; /** Gets the structure equivalent to this node. */ getStructure(): DecoratorStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.Decorator>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.Decorator>>;}
export declare function JSDocPropertyLikeTag<T extends Constructor<JSDocPropertyLikeTagExtensionType>>(Base: T): Constructor<JSDocPropertyLikeTag> & T;
export interface JSDocPropertyLikeTag { /** Gets the type expression node of the JS doc tag if it exists. */ getTypeExpression(): JSDocTypeExpression | undefined; /** Gets the type expression node of the JS doc tag or throws if it doesn't exist. */ getTypeExpressionOrThrow(message?: string | (() => string)): JSDocTypeExpression; /** Gets the name of the JS doc property like tag. */ getName(): string; /** Gets the name node of the JS doc property like tag. */ getNameNode(): EntityName; /** Checks if the JS doc property like tag is bracketed. */ isBracketed(): boolean;}
type JSDocPropertyLikeTagExtensionType = Node<ts.JSDocPropertyLikeTag> & JSDocTag;export declare function JSDocTypeExpressionableTag<T extends Constructor<JSDocTypeExpressionableTagExtensionType>>(Base: T): Constructor<JSDocTypeExpressionableTag> & T;
export interface JSDocTypeExpressionableTag { /** Gets the type expression node of the JS doc tag if it exists. */ getTypeExpression(): JSDocTypeExpression | undefined; /** Gets the type expression node of the JS doc tag or throws if it doesn't exist. */ getTypeExpressionOrThrow(message?: string | (() => string)): JSDocTypeExpression;}
type JSDocTypeExpressionableTagExtensionType = Node<ts.Node & { typeExpression: ts.JSDocTypeExpression | undefined; }> & JSDocTag;export declare function JSDocTypeParameteredTag<T extends Constructor<JSDocTypeParameteredTagExtensionType>>(Base: T): Constructor<JSDocTypeParameteredTag> & T;
export interface JSDocTypeParameteredTag { /** Gets the type parameters. */ getTypeParameters(): TypeParameterDeclaration[];}
type JSDocTypeParameteredTagExtensionType = Node<ts.Node & { typeParameters: ts.NodeArray<ts.TypeParameterDeclaration>; }> & JSDocTag;declare const JSDocBase: typeof Node;
/** JS doc node. */export declare class JSDoc extends JSDocBase<ts.JSDoc> { /** Gets if this JS doc spans multiple lines. */ isMultiLine(): boolean; /** Gets the tags of the JSDoc. */ getTags(): JSDocTag[]; /** Gets the JSDoc's text without the surrounding slashes and stars. */ getInnerText(): string; /** Gets the comment property. Use `#getCommentText()` to get the text of the JS doc comment if necessary. */ getComment(): string | (JSDocText | JSDocLink | JSDocLinkCode | JSDocLinkPlain | undefined)[] | undefined; /** Gets the text of the JS doc comment. */ getCommentText(): string | undefined; /** * Gets the description from the JS doc comment. * @remarks This will contain a leading newline if the jsdoc is multi-line. */ getDescription(): string; /** * Sets the description. * @param textOrWriterFunction - Text or writer function to set. */ setDescription(textOrWriterFunction: string | WriterFunction): this; /** * Adds a JS doc tag. * @param structure - Tag structure to add. */ addTag(structure: OptionalKind<JSDocTagStructure>): JSDocTag<ts.JSDocTag>; /** * Adds JS doc tags. * @param structures - Tag structures to add. */ addTags(structures: ReadonlyArray<OptionalKind<JSDocTagStructure>>): JSDocTag<ts.JSDocTag>[]; /** * Inserts a JS doc tag at the specified index. * @param index - Index to insert at. * @param structure - Tag structure to insert. */ insertTag(index: number, structure: OptionalKind<JSDocTagStructure>): JSDocTag<ts.JSDocTag>; /** * Inserts JS doc tags at the specified index. * @param index - Index to insert at. * @param structures - Tag structures to insert. */ insertTags(index: number, structures: ReadonlyArray<OptionalKind<JSDocTagStructure>>): JSDocTag<ts.JSDocTag>[]; /** Removes this JSDoc. */ remove(): void; /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<JSDocStructure>): Node<ts.Node>; /** Gets the structure equivalent to this node. */ getStructure(): JSDocStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDoc>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDoc>>;}
/** JS doc all type. */export declare class JSDocAllType extends JSDocType<ts.JSDocAllType> { /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocAllType>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocAllType>>;}
/** JS doc augments tag node. */export declare class JSDocAugmentsTag extends JSDocTag<ts.JSDocAugmentsTag> { /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocAugmentsTag>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocAugmentsTag>>;}
/** JS doc author tag node. */export declare class JSDocAuthorTag extends JSDocTag<ts.JSDocAuthorTag> { /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocAuthorTag>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocAuthorTag>>;}
/** JS doc callback tag node. */export declare class JSDocCallbackTag extends JSDocTag<ts.JSDocCallbackTag> { /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocCallbackTag>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocCallbackTag>>;}
/** JS doc class tag node. */export declare class JSDocClassTag extends JSDocTag<ts.JSDocClassTag> { /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocClassTag>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocClassTag>>;}
/** JS doc deprecated tag node. */export declare class JSDocDeprecatedTag extends JSDocTag<ts.JSDocDeprecatedTag> { /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocDeprecatedTag>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocDeprecatedTag>>;}
/** JS doc enum tag node. */export declare class JSDocEnumTag extends JSDocTag<ts.JSDocEnumTag> { /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocEnumTag>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocEnumTag>>;}
declare const JSDocFunctionTypeBase: Constructor<SignaturedDeclaration> & typeof JSDocType;
/** JS doc function type. */export declare class JSDocFunctionType extends JSDocFunctionTypeBase<ts.JSDocFunctionType> { /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocFunctionType>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocFunctionType>>;}
/** JS doc implements tag node. */export declare class JSDocImplementsTag extends JSDocTag<ts.JSDocImplementsTag> { /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocImplementsTag>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocImplementsTag>>;}
/** JS doc link node. */export declare class JSDocLink extends Node<ts.JSDocLink> { /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocLink>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocLink>>;}
/** JS doc link code node. */export declare class JSDocLinkCode extends Node<ts.JSDocLinkCode> { /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocLinkCode>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocLinkCode>>;}
/** JS doc link plain node. */export declare class JSDocLinkPlain extends Node<ts.JSDocLinkPlain> { /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocLinkPlain>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocLinkPlain>>;}
/** JS doc member name node. */export declare class JSDocMemberName extends Node<ts.JSDocMemberName> { /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocMemberName>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocMemberName>>;}
/** JS doc namepath type. */export declare class JSDocNamepathType extends JSDocType<ts.JSDocNamepathType> { /** Gets the type node of the JS doc namepath node. */ getTypeNode(): TypeNode<ts.TypeNode>; /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocNamepathType>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocNamepathType>>;}
/** JS doc name reference. */export declare class JSDocNameReference extends Node<ts.JSDocNameReference> { /** Gets the name of the JS doc name reference. */ getName(): Identifier | QualifiedName | JSDocMemberName; /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocNameReference>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocNameReference>>;}
/** JS doc non-nullable type. */export declare class JSDocNonNullableType extends JSDocType<ts.JSDocNonNullableType> { /** Gets the type node of the JS doc non-nullable type node. */ getTypeNode(): TypeNode<ts.TypeNode>; isPostfix(): boolean; /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocNonNullableType>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocNonNullableType>>;}
/** JS doc nullable type. */export declare class JSDocNullableType extends JSDocType<ts.JSDocNullableType> { /** Gets the type node of the JS doc nullable type node. */ getTypeNode(): TypeNode<ts.TypeNode>; isPostfix(): boolean; /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocNullableType>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocNullableType>>;}
/** JS doc optional type. */export declare class JSDocOptionalType extends JSDocType<ts.JSDocOptionalType> { /** Gets the type node of the JS doc optional type node. */ getTypeNode(): TypeNode<ts.TypeNode>; /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocOptionalType>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocOptionalType>>;}
declare const JSDocOverloadTagBase: Constructor<JSDocTypeExpressionableTag> & typeof JSDocTag;
/** JS doc overload tag. */export declare class JSDocOverloadTag extends JSDocOverloadTagBase<ts.JSDocOverloadTag> { /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocOverloadTag>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocOverloadTag>>;}
/** JS doc override tag node. */export declare class JSDocOverrideTag extends JSDocTag<ts.JSDocOverrideTag> { /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocOverrideTag>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocOverrideTag>>;}
declare const JSDocParameterTagBase: Constructor<JSDocPropertyLikeTag> & typeof JSDocTag;
/** JS doc parameter tag node. */export declare class JSDocParameterTag extends JSDocParameterTagBase<ts.JSDocParameterTag> { /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocParameterTag>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocParameterTag>>;}
/** JS doc private tag node. */export declare class JSDocPrivateTag extends JSDocTag<ts.JSDocPrivateTag> { /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocPrivateTag>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocPrivateTag>>;}
declare const JSDocPropertyTagBase: Constructor<JSDocPropertyLikeTag> & typeof JSDocTag;
/** JS doc property tag node. */export declare class JSDocPropertyTag extends JSDocPropertyTagBase<ts.JSDocPropertyTag> { /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocPropertyTag>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocPropertyTag>>;}
/** JS doc protected tag node. */export declare class JSDocProtectedTag extends JSDocTag<ts.JSDocProtectedTag> { /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocProtectedTag>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocProtectedTag>>;}
/** JS doc public tag node. */export declare class JSDocPublicTag extends JSDocTag<ts.JSDocPublicTag> { /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocPublicTag>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocPublicTag>>;}
/** JS doc readonly tag node. */export declare class JSDocReadonlyTag extends JSDocTag<ts.JSDocReadonlyTag> { /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocReadonlyTag>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocReadonlyTag>>;}
declare const JSDocReturnTagBase: Constructor<JSDocTypeExpressionableTag> & typeof JSDocTag;
/** JS doc return tag node. */export declare class JSDocReturnTag extends JSDocReturnTagBase<ts.JSDocReturnTag> { /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocReturnTag>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocReturnTag>>;}
declare const JSDocSatisfiesTagBase: Constructor<JSDocTypeExpressionableTag> & typeof JSDocTag;
/** JS doc satifiest tag. */export declare class JSDocSatisfiesTag extends JSDocSatisfiesTagBase<ts.JSDocSatisfiesTag> { /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocSatisfiesTag>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocSatisfiesTag>>;}
declare const JSDocSeeTagBase: Constructor<JSDocTypeExpressionableTag> & typeof JSDocTag;
/** JS doc "see" tag node. */export declare class JSDocSeeTag extends JSDocSeeTagBase<ts.JSDocSeeTag> { /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocSeeTag>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocSeeTag>>;}
/** JS doc signature node. */export declare class JSDocSignature extends JSDocType<ts.JSDocSignature> { /** Gets the type node of the JS doc signature. */ getTypeNode(): JSDocReturnTag | undefined; /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocSignature>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocSignature>>;}
declare const JSDocTagBase: typeof Node;
/** JS doc tag node. */export declare class JSDocTag<NodeType extends ts.JSDocTag = ts.JSDocTag> extends JSDocTagBase<NodeType> { /** Gets the tag's name as a string (ex. returns `"param"` for `&#64;param`). */ getTagName(): string; /** Gets the tag name node (ex. Returns the `param` identifier for `&#64;param`). */ getTagNameNode(): Identifier; /** * Sets the tag name. * @param tagName - The new name to use. * @returns The current node or new node if the node kind changed. * @remarks This will forget the current node if the JSDocTag kind changes. Use the return value if you're changing the kind. */ setTagName(tagName: string): Node<ts.Node>; /** Gets the tag's comment property. Use `#getCommentText()` to get the text of the JS doc tag comment if necessary. */ getComment(): string | (JSDocText | JSDocLink | JSDocLinkCode | JSDocLinkPlain | undefined)[] | undefined; /** Gets the text of the JS doc tag comment (ex. `"Some description."` for `&#64;param value Some description.`). */ getCommentText(): string | undefined; /** Removes the JS doc comment. */ remove(): void; /** * Sets the node from a structure. * @param structure - Structure to set the node with. * @returns The node or the node that replaced the existing node (ex. when changing from a JSDocParameterTag to something else). */ set(structure: Partial<JSDocTagStructure>): Node<ts.Node>; /** @inheritdoc */ replaceWithText(textOrWriterFunction: string | WriterFunction): Node; /** Gets a structure that represents this JS doc tag node. */ getStructure(): JSDocTagStructure;}
/** JS doc tag info. */export declare class JSDocTagInfo { #private; private constructor(); /** Gets the compiler JS doc tag info. */ get compilerObject(): ts.JSDocTagInfo; /** Gets the name. */ getName(): string; /** Gets the text. */ getText(): ts.SymbolDisplayPart[];}
declare const JSDocTemplateTagBase: Constructor<JSDocTypeParameteredTag> & typeof JSDocTag;
/** JS doc template tag node. */export declare class JSDocTemplateTag extends JSDocTemplateTagBase<ts.JSDocTemplateTag> { /** Gets the template tag's constraint if it exists or returns undefined. */ getConstraint(): JSDocTypeExpression | undefined; /** Gets the template tag's constraint if it exists or throws otherwise. */ getConstraintOrThrow(message?: string | (() => string)): JSDocTypeExpression; /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocTemplateTag>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocTemplateTag>>;}
/** JS doc text node. */export declare class JSDocText extends Node<ts.JSDocText> { /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocText>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocText>>;}
declare const JSDocThisTagBase: Constructor<JSDocTypeExpressionableTag> & typeof JSDocTag;
/** JS doc "this" tag node. */export declare class JSDocThisTag extends JSDocThisTagBase<ts.JSDocThisTag> { /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocThisTag>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocThisTag>>;}
declare const JSDocThrowsTagBase: Constructor<JSDocTypeExpressionableTag> & typeof JSDocTag;
/** JS doc return tag node. */export declare class JSDocThrowsTag extends JSDocThrowsTagBase<ts.JSDocThrowsTag> { /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocThrowsTag>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocThrowsTag>>;}
/** JS doc type node. */export declare class JSDocType<T extends ts.JSDocType = ts.JSDocType> extends TypeNode<T> {}
/** JS doc type def tag node. */export declare class JSDocTypedefTag extends JSDocTag<ts.JSDocTypedefTag> { /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocTypedefTag>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocTypedefTag>>;}
/** JS doc type expression node. */export declare class JSDocTypeExpression extends TypeNode<ts.JSDocTypeExpression> { /** Gets the type node of the JS doc type expression. */ getTypeNode(): TypeNode<ts.TypeNode>; /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocTypeExpression>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocTypeExpression>>;}
/** JS doc type literal. */export declare class JSDocTypeLiteral extends JSDocType<ts.JSDocTypeLiteral> { /** Gets if it's an array type. */ isArrayType(): boolean; /** Gets the JS doc property tags if they exist. */ getPropertyTags(): JSDocTag<ts.JSDocTag>[] | undefined; /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocTypeLiteral>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocTypeLiteral>>;}
/** JS doc type tag node. */export declare class JSDocTypeTag extends JSDocTag<ts.JSDocTypeTag> { /** Gets the type expression node of the JS doc property type tag. */ getTypeExpression(): JSDocTypeExpression | undefined; /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocTypeTag>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocTypeTag>>;}
/** JS doc unknown tag node. */export declare class JSDocUnknownTag extends JSDocTag<ts.JSDocUnknownTag> { /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocUnknownTag>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocUnknownTag>>;}
/** JS doc unknown type. */export declare class JSDocUnknownType extends JSDocType<ts.JSDocUnknownType> { /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocUnknownType>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocUnknownType>>;}
/** JS doc variadic type. */export declare class JSDocVariadicType extends JSDocType<ts.JSDocVariadicType> { /** Gets the type node of the JS doc variadic type node. */ getTypeNode(): TypeNode<ts.TypeNode>; /** @inheritdoc **/ getParent(): NodeParentType<ts.JSDocVariadicType>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JSDocVariadicType>>;}
export declare class CommentEnumMember extends Node<CompilerCommentEnumMember> { /** Removes this enum member comment. */ remove(): void;}
declare const EnumDeclarationBase: Constructor<TextInsertableNode> & Constructor<ModuleChildableNode> & Constructor<JSDocableNode> & Constructor<AmbientableNode> & Constructor<ExportableNode> & Constructor<ModifierableNode> & Constructor<NamedNode> & typeof Statement;
export declare class EnumDeclaration extends EnumDeclarationBase<ts.EnumDeclaration> { /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<EnumDeclarationStructure>): this; /** * Adds a member to the enum. * @param structure - Structure of the enum. */ addMember(structure: OptionalKind<EnumMemberStructure>): EnumMember; /** * Adds a member to the enum. * @param structure - Structure of the enum. */ addMember(structure: OptionalKind<EnumMemberStructure> | WriterFunction | string): EnumMember | CommentEnumMember; /** * Adds members to the enum. * @param structures - Structures of the enums. */ addMembers(structures: ReadonlyArray<OptionalKind<EnumMemberStructure>>): EnumMember[]; /** * Adds members to the enum. * @param structures - Structures of the enums. */ addMembers(structures: ReadonlyArray<OptionalKind<EnumMemberStructure> | WriterFunction | string> | string | WriterFunction): (EnumMember | CommentEnumMember)[]; /** * Inserts a member to the enum. * @param index - Child index to insert at. * @param structure - Structure of the enum. */ insertMember(index: number, structure: OptionalKind<EnumMemberStructure>): EnumMember; /** * Inserts a member to the enum. * @param index - Child index to insert at. * @param structure - Structure of the enum. */ insertMember(index: number, structure: OptionalKind<EnumMemberStructure> | WriterFunction | string): EnumMember | CommentEnumMember; /** * Inserts members to an enum. * @param index - Child index to insert at. * @param structures - Structures of the enums. */ insertMembers(index: number, structures: ReadonlyArray<OptionalKind<EnumMemberStructure>>): EnumMember[]; /** * Inserts members to an enum. * @param index - Child index to insert at. * @param structures - Structures of the enums. */ insertMembers(index: number, structures: ReadonlyArray<OptionalKind<EnumMemberStructure> | WriterFunction | string> | WriterFunction | string): (EnumMember | CommentEnumMember)[]; /** * Gets an enum member. * @param name - Name of the member. */ getMember(name: string): EnumMember | undefined; /** * Gets an enum member. * @param findFunction - Function to use to find the member. */ getMember(findFunction: (declaration: EnumMember) => boolean): EnumMember | undefined; /** * Gets an enum member or throws if not found. * @param name - Name of the member. */ getMemberOrThrow(name: string): EnumMember; /** * Gets an enum member or throws if not found. * @param findFunction - Function to use to find the member. */ getMemberOrThrow(findFunction: (declaration: EnumMember) => boolean): EnumMember; /** Gets the enum's members. */ getMembers(): EnumMember[]; /** Gets the enum's members with comment enum members. */ getMembersWithComments(): (EnumMember | CommentEnumMember)[]; /** Toggle if it's a const enum. */ setIsConstEnum(value: boolean): this; /** Gets if it's a const enum. */ isConstEnum(): boolean; /** Gets the const enum keyword or undefined if not exists. */ getConstKeyword(): Node<ts.Node> | undefined; /** Gets the structure equivalent to this node. */ getStructure(): EnumDeclarationStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.EnumDeclaration>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.EnumDeclaration>>;}
declare const EnumMemberBase: Constructor<JSDocableNode> & Constructor<InitializerExpressionableNode> & Constructor<PropertyNamedNode> & typeof Node;
export declare class EnumMember extends EnumMemberBase<ts.EnumMember> { /** Gets the constant value of the enum. */ getValue(): string | number | undefined; /** * Sets the enum value. * * This is a helper method. Use `#setInitializer` if you want to set the initializer * to something other than a string or number. * @param value - Enum value. */ setValue(value: string | number): this; /** Removes this enum member. */ remove(): void; /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<EnumMemberStructure>): this; /** Gets the structure equivalent to this node. */ getStructure(): EnumMemberStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.EnumMember>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.EnumMember>>;}
declare const ArrayDestructuringAssignmentBase: typeof AssignmentExpression;
export declare class ArrayDestructuringAssignment extends ArrayDestructuringAssignmentBase<ts.ArrayDestructuringAssignment> { /** Gets the left array literal expression of the array destructuring assignment. */ getLeft(): ArrayLiteralExpression; /** @inheritdoc **/ getParent(): NodeParentType<ts.ArrayDestructuringAssignment>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ArrayDestructuringAssignment>>;}
export declare class ArrayLiteralExpression extends PrimaryExpression<ts.ArrayLiteralExpression> { /** Gets the array's elements. */ getElements(): Expression[]; /** * Adds an element to the array. * @param textOrWriterFunction - Text to add as an element. * @param options - Options. */ addElement(textOrWriterFunction: string | WriterFunction, options?: { useNewLines?: boolean; }): Expression<ts.Expression>; /** * Adds elements to the array. * @param textsOrWriterFunction - Texts to add as elements. * @param options - Options. */ addElements(textsOrWriterFunction: ReadonlyArray<string | WriterFunction> | WriterFunction, options?: { useNewLines?: boolean; }): Expression<ts.Expression>[]; /** * Insert an element into the array. * @param index - Child index to insert at. * @param text - Text to insert as an element. * @param options - Options. */ insertElement(index: number, textOrWriterFunction: string | WriterFunction, options?: { useNewLines?: boolean; }): Expression<ts.Expression>; /** * Insert elements into the array. * @param index - Child index to insert at. * @param textsOrWriterFunction - Texts to insert as elements. * @param options - Options. */ insertElements(index: number, textsOrWriterFunction: ReadonlyArray<string | WriterFunction> | WriterFunction, options?: { useNewLines?: boolean; }): Expression<ts.Expression>[]; /** * Removes an element from the array. * @param index - Index to remove from. */ removeElement(index: number): void; /** * Removes an element from the array. * @param element - Element to remove. */ removeElement(element: Expression): void; /** @inheritdoc **/ getParent(): NodeParentType<ts.ArrayLiteralExpression>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ArrayLiteralExpression>>;}
declare const AsExpressionBase: Constructor<TypedNode> & Constructor<ExpressionedNode> & typeof Expression;
export declare class AsExpression extends AsExpressionBase<ts.AsExpression> { /** @inheritdoc **/ getParent(): NodeParentType<ts.AsExpression>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.AsExpression>>;}
declare const AssignmentExpressionBase: typeof BinaryExpression;
export declare class AssignmentExpression<T extends ts.AssignmentExpression<ts.AssignmentOperatorToken> = ts.AssignmentExpression<ts.AssignmentOperatorToken>> extends AssignmentExpressionBase<T> { /** Gets the operator token of the assignment expression. */ getOperatorToken(): Node<ts.AssignmentOperatorToken>;}
declare const AwaitExpressionBase: Constructor<UnaryExpressionedNode> & typeof UnaryExpression;
export declare class AwaitExpression extends AwaitExpressionBase<ts.AwaitExpression> { /** @inheritdoc **/ getParent(): NodeParentType<ts.AwaitExpression>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.AwaitExpression>>;}
export interface InstanceofExpression extends BinaryExpression { compilerNode: ts.InstanceofExpression; getOperatorToken(): Node<ts.Token<SyntaxKind.InstanceOfKeyword>>;}
declare const BinaryExpressionBase: typeof Expression;
export declare class BinaryExpression<T extends ts.BinaryExpression = ts.BinaryExpression> extends BinaryExpressionBase<T> { /** Gets the left side of the binary expression. */ getLeft(): Expression; /** Gets the operator token of the binary expression. */ getOperatorToken(): Node<ts.BinaryOperatorToken>; /** Gets the right side of the binary expression. */ getRight(): Expression;}
declare const CallExpressionBase: Constructor<TypeArgumentedNode> & Constructor<ArgumentedNode> & Constructor<QuestionDotTokenableNode> & Constructor<LeftHandSideExpressionedNode> & typeof LeftHandSideExpression;
export declare class CallExpression<T extends ts.CallExpression = ts.CallExpression> extends CallExpressionBase<T> { /** Gets the return type of the call expression. */ getReturnType(): Type;}
declare const CommaListExpressionBase: typeof Expression;
export declare class CommaListExpression extends CommaListExpressionBase<ts.CommaListExpression> { /** Gets the elements. */ getElements(): Expression[]; /** @inheritdoc **/ getParent(): NodeParentType<ts.CommaListExpression>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.CommaListExpression>>;}
declare const ConditionalExpressionBase: typeof Expression;
export declare class ConditionalExpression extends ConditionalExpressionBase<ts.ConditionalExpression> { /** Gets the condition of the conditional expression. */ getCondition(): Expression; /** Gets the question token of the conditional expression. */ getQuestionToken(): Node<ts.QuestionToken>; /** Gets the when true expression of the conditional expression. */ getWhenTrue(): Expression; /** Gets the colon token of the conditional expression. */ getColonToken(): Node<ts.ColonToken>; /** Gets the when false expression of the conditional expression. */ getWhenFalse(): Expression; /** @inheritdoc **/ getParent(): NodeParentType<ts.ConditionalExpression>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ConditionalExpression>>;}
declare const DeleteExpressionBase: Constructor<UnaryExpressionedNode> & typeof UnaryExpression;
export declare class DeleteExpression extends DeleteExpressionBase<ts.DeleteExpression> { /** @inheritdoc **/ getParent(): NodeParentType<ts.DeleteExpression>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.DeleteExpression>>;}
declare const ElementAccessExpressionBase: Constructor<QuestionDotTokenableNode> & Constructor<LeftHandSideExpressionedNode> & typeof MemberExpression;
export declare class ElementAccessExpression<T extends ts.ElementAccessExpression = ts.ElementAccessExpression> extends ElementAccessExpressionBase<T> { /** Gets this element access expression's argument expression or undefined if none exists. */ getArgumentExpression(): Expression | undefined; /** Gets this element access expression's argument expression or throws if none exists. */ getArgumentExpressionOrThrow(message?: string | (() => string)): Expression<ts.Expression>;}
export declare class Expression<T extends ts.Expression = ts.Expression> extends Node<T> { /** Gets the contextual type of the expression. */ getContextualType(): Type | undefined;}
export declare function ExpressionableNode<T extends Constructor<ExpressionableNodeExtensionType>>(Base: T): Constructor<ExpressionableNode> & T;
export interface ExpressionableNode { /** Gets the expression if it exists or returns undefined. */ getExpression(): Expression | undefined; /** Gets the expression if it exists or throws. */ getExpressionOrThrow(message?: string | (() => string)): Expression; /** Gets the expression if it is of the specified syntax kind or returns undefined. */ getExpressionIfKind<TKind extends SyntaxKind>(kind: TKind): KindToExpressionMappings[TKind] | undefined; /** Gets the expression if it is of the specified syntax kind or throws. */ getExpressionIfKindOrThrow<TKind extends SyntaxKind>(kind: TKind): KindToExpressionMappings[TKind];}
type ExpressionableNodeExtensionType = Node<ts.Node & { expression?: ts.Expression; }>;export declare function BaseExpressionedNode<T extends Constructor<ExpressionedNodeExtensionType>, TExpression extends Node = CompilerNodeToWrappedType<InstanceOf<T>["compilerNode"]>>(Base: T): Constructor<BaseExpressionedNode<TExpression>> & T;
export interface BaseExpressionedNode<TExpression extends Node> { /** Gets the expression. */ getExpression(): TExpression; /** * Gets the expression if its of a certain kind or returns undefined. * @param kind - Syntax kind of the expression. */ getExpressionIfKind<TKind extends SyntaxKind>(kind: TKind): KindToExpressionMappings[TKind] | undefined; /** * Gets the expression if its of a certain kind or throws. * @param kind - Syntax kind of the expression. */ getExpressionIfKindOrThrow<TKind extends SyntaxKind>(kind: TKind): KindToExpressionMappings[TKind]; /** * Sets the expression. * @param textOrWriterFunction - Text to set the expression with. */ setExpression(textOrWriterFunction: string | WriterFunction): this;}
export declare function ExpressionedNode<T extends Constructor<ExpressionedNodeExtensionType>>(Base: T): Constructor<ExpressionedNode> & T;
export interface ExpressionedNode extends BaseExpressionedNode<Expression> {}
type ExpressionedNodeExtensionType = Node<ts.Node & { expression: ts.Expression; }>;export declare function ImportExpressionedNode<T extends Constructor<ImportExpressionedNodeExtensionType>>(Base: T): Constructor<ImportExpressionedNode> & T;
export interface ImportExpressionedNode extends BaseExpressionedNode<ImportExpression> {}
type ImportExpressionedNodeExtensionType = Node<ts.Node & { expression: ts.ImportExpression; }>;export declare function LeftHandSideExpressionedNode<T extends Constructor<LeftHandSideExpressionedNodeExtensionType>>(Base: T): Constructor<LeftHandSideExpressionedNode> & T;
export interface LeftHandSideExpressionedNode extends BaseExpressionedNode<LeftHandSideExpression> {}
type LeftHandSideExpressionedNodeExtensionType = Node<ts.Node & { expression: ts.LeftHandSideExpression; }>;export declare function SuperExpressionedNode<T extends Constructor<SuperExpressionedNodeExtensionType>>(Base: T): Constructor<SuperExpressionedNode> & T;
export interface SuperExpressionedNode extends BaseExpressionedNode<SuperExpression> {}
type SuperExpressionedNodeExtensionType = Node<ts.Node & { expression: ts.SuperExpression; }>;export declare function UnaryExpressionedNode<T extends Constructor<UnaryExpressionedNodeExtensionType>>(Base: T): Constructor<UnaryExpressionedNode> & T;
export interface UnaryExpressionedNode extends BaseExpressionedNode<UnaryExpression> {}
type UnaryExpressionedNodeExtensionType = Node<ts.Node & { expression: ts.UnaryExpression; }>;declare const ImportExpressionBase: typeof PrimaryExpression;
export declare class ImportExpression extends ImportExpressionBase<ts.ImportExpression> { /** @inheritdoc **/ getParent(): NodeParentType<ts.ImportExpression>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ImportExpression>>;}
export declare class LeftHandSideExpression<T extends ts.LeftHandSideExpression = ts.LeftHandSideExpression> extends UpdateExpression<T> {}
declare const LiteralExpressionBase: Constructor<LiteralLikeNode> & typeof PrimaryExpression;
export declare class LiteralExpression<T extends ts.LiteralExpression = ts.LiteralExpression> extends LiteralExpressionBase<T> {}
export declare class MemberExpression<T extends ts.MemberExpression = ts.MemberExpression> extends LeftHandSideExpression<T> {}
declare const MetaPropertyBase: Constructor<NamedNode> & typeof PrimaryExpression;
export declare class MetaProperty extends MetaPropertyBase<ts.MetaProperty> { /** Gets the keyword token. */ getKeywordToken(): SyntaxKind.ImportKeyword | SyntaxKind.NewKeyword; /** @inheritdoc **/ getParent(): NodeParentType<ts.MetaProperty>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.MetaProperty>>;}
declare const NewExpressionBase: Constructor<TypeArgumentedNode> & Constructor<ArgumentedNode> & Constructor<LeftHandSideExpressionedNode> & typeof PrimaryExpression;
export declare class NewExpression extends NewExpressionBase<ts.NewExpression> { /** @inheritdoc **/ getParent(): NodeParentType<ts.NewExpression>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.NewExpression>>;}
declare const NonNullExpressionBase: Constructor<ExpressionedNode> & typeof LeftHandSideExpression;
export declare class NonNullExpression extends NonNullExpressionBase<ts.NonNullExpression> { /** @inheritdoc **/ getParent(): NodeParentType<ts.NonNullExpression>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.NonNullExpression>>;}
export declare class CommentObjectLiteralElement extends ObjectLiteralElement<CompilerCommentObjectLiteralElement> {}
declare const ObjectDestructuringAssignmentBase: typeof AssignmentExpression;
export declare class ObjectDestructuringAssignment extends ObjectDestructuringAssignmentBase<ts.ObjectDestructuringAssignment> { /** Gets the left object literal expression of the object destructuring assignment. */ getLeft(): ObjectLiteralExpression; /** @inheritdoc **/ getParent(): NodeParentType<ts.ObjectDestructuringAssignment>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ObjectDestructuringAssignment>>;}
export declare class ObjectLiteralElement<T extends ts.ObjectLiteralElement = ts.ObjectLiteralElement> extends Node<T> { /** Removes the object literal element from the object literal expression. */ remove(): void;}
declare const ObjectLiteralExpressionBase: typeof PrimaryExpression;
export declare class ObjectLiteralExpression extends ObjectLiteralExpressionBase<ts.ObjectLiteralExpression> { #private; /** * Gets the first property by the provided name or throws. * @param name - Name of the property. */ getPropertyOrThrow(name: string): ObjectLiteralElementLike; /** * Gets the first property that matches the provided find function or throws. * @param findFunction - Find function. */ getPropertyOrThrow(findFunction: (property: ObjectLiteralElementLike) => boolean): ObjectLiteralElementLike; /** * Gets the first property by the provided name or returns undefined. * @param name - Name of the property. */ getProperty(name: string): ObjectLiteralElementLike | undefined; /** * Gets the first property that matches the provided find function or returns undefined. * @param findFunction - Find function. */ getProperty(findFunction: (property: ObjectLiteralElementLike) => boolean): ObjectLiteralElementLike | undefined; /** Gets the properties. */ getProperties(): ObjectLiteralElementLike[]; /** Gets the properties with comment object literal elements. */ getPropertiesWithComments(): (ObjectLiteralElementLike | CommentObjectLiteralElement)[]; /** * Adds the specified property to the object literal expression. * * Note: If you only want to add a property assignment, then it might be more convenient to use #addPropertyAssignment. * @structure - The structure to add. */ addProperty(structure: string | WriterFunction | ObjectLiteralExpressionPropertyStructures): CommentObjectLiteralElement | ObjectLiteralElementLike; /** * Adds the specified properties to the object literal expression. * * Note: If you only want to add property assignments, then it might be more convenient to use #addPropertyAssignments. * @structures - The structures to add. */ addProperties(structures: string | WriterFunction | ReadonlyArray<string | WriterFunction | ObjectLiteralExpressionPropertyStructures>): (CommentObjectLiteralElement | ObjectLiteralElementLike)[]; /** * Inserts the specified property to the object literal expression. * * Note: If you only want to insert a property assignment, then it might be more convenient to use #insertPropertyAssignment. * @index - The index to insert at. * @structure - The structure to insert. */ insertProperty(index: number, structure: string | WriterFunction | ObjectLiteralExpressionPropertyStructures): CommentObjectLiteralElement | ObjectLiteralElementLike; /** * Inserts the specified properties to the object literal expression. * * Note: If you only want to insert property assignments, then it might be more convenient to use #insertPropertyAssignments. * @index - The index to insert at. * @structures - The structures to insert. */ insertProperties(index: number, structures: string | WriterFunction | ReadonlyArray<string | WriterFunction | ObjectLiteralExpressionPropertyStructures>): (CommentObjectLiteralElement | ObjectLiteralElementLike)[]; /** * Adds a property assignment. * @param structure - Structure that represents the property assignment to add. */ addPropertyAssignment(structure: OptionalKind<PropertyAssignmentStructure>): PropertyAssignment; /** * Adds property assignments. * @param structures - Structure that represents the property assignments to add. */ addPropertyAssignments(structures: ReadonlyArray<OptionalKind<PropertyAssignmentStructure>>): PropertyAssignment[]; /** * Inserts a property assignment at the specified index. * @param index - Child index to insert at. * @param structure - Structure that represents the property assignment to insert. */ insertPropertyAssignment(index: number, structure: OptionalKind<PropertyAssignmentStructure>): PropertyAssignment; /** * Inserts property assignments at the specified index. * @param index - Child index to insert at. * @param structures - Structures that represent the property assignments to insert. */ insertPropertyAssignments(index: number, structures: ReadonlyArray<OptionalKind<PropertyAssignmentStructure>>): PropertyAssignment[]; /** * Adds a shorthand property assignment. * @param structure - Structure that represents the shorthand property assignment to add. */ addShorthandPropertyAssignment(structure: OptionalKind<ShorthandPropertyAssignmentStructure>): ShorthandPropertyAssignment; /** * Adds shorthand property assignments. * @param structures - Structure that represents the shorthand property assignments to add. */ addShorthandPropertyAssignments(structures: ReadonlyArray<OptionalKind<ShorthandPropertyAssignmentStructure>>): ShorthandPropertyAssignment[]; /** * Inserts a shorthand property assignment at the specified index. * @param index - Child index to insert at. * @param structure - Structure that represents the shorthand property assignment to insert. */ insertShorthandPropertyAssignment(index: number, structure: OptionalKind<ShorthandPropertyAssignmentStructure>): ShorthandPropertyAssignment; /** * Inserts shorthand property assignments at the specified index. * @param index - Child index to insert at. * @param structures - Structures that represent the shorthand property assignments to insert. */ insertShorthandPropertyAssignments(index: number, structures: ReadonlyArray<OptionalKind<ShorthandPropertyAssignmentStructure>>): ShorthandPropertyAssignment[]; /** * Adds a spread assignment. * @param structure - Structure that represents the spread assignment to add. */ addSpreadAssignment(structure: OptionalKind<SpreadAssignmentStructure>): SpreadAssignment; /** * Adds spread assignments. * @param structures - Structure that represents the spread assignments to add. */ addSpreadAssignments(structures: ReadonlyArray<OptionalKind<SpreadAssignmentStructure>>): SpreadAssignment[]; /** * Inserts a spread assignment at the specified index. * @param index - Child index to insert at. * @param structure - Structure that represents the spread assignment to insert. */ insertSpreadAssignment(index: number, structure: OptionalKind<SpreadAssignmentStructure>): SpreadAssignment; /** * Inserts spread assignments at the specified index. * @param index - Child index to insert at. * @param structures - Structures that represent the spread assignments to insert. */ insertSpreadAssignments(index: number, structures: ReadonlyArray<OptionalKind<SpreadAssignmentStructure>>): SpreadAssignment[]; /** * Adds a method. * @param structure - Structure that represents the method to add. */ addMethod(structure: OptionalKind<MethodDeclarationStructure>): MethodDeclaration; /** * Adds methods. * @param structures - Structure that represents the methods to add. */ addMethods(structures: ReadonlyArray<OptionalKind<MethodDeclarationStructure>>): MethodDeclaration[]; /** * Inserts a method at the specified index. * @param index - Child index to insert at. * @param structure - Structure that represents the method to insert. */ insertMethod(index: number, structure: OptionalKind<MethodDeclarationStructure>): MethodDeclaration; /** * Inserts methods at the specified index. * @param index - Child index to insert at. * @param structures - Structures that represent the methods to insert. */ insertMethods(index: number, structures: ReadonlyArray<OptionalKind<MethodDeclarationStructure>>): MethodDeclaration[]; /** * Adds a get accessor. * @param structure - Structure that represents the property assignment to add. */ addGetAccessor(structure: OptionalKind<GetAccessorDeclarationStructure>): GetAccessorDeclaration; /** * Adds get accessors. * @param structures - Structure that represents the get accessors to add. */ addGetAccessors(structures: ReadonlyArray<OptionalKind<GetAccessorDeclarationStructure>>): GetAccessorDeclaration[]; /** * Inserts a get accessor at the specified index. * @param index - Child index to insert at. * @param structure - Structure that represents the get accessor to insert. */ insertGetAccessor(index: number, structure: OptionalKind<GetAccessorDeclarationStructure>): GetAccessorDeclaration; /** * Inserts get accessors at the specified index. * @param index - Child index to insert at. * @param structures - Structures that represent the get accessors to insert. */ insertGetAccessors(index: number, structures: ReadonlyArray<OptionalKind<GetAccessorDeclarationStructure>>): GetAccessorDeclaration[]; /** * Adds a set accessor. * @param structure - Structure that represents the property assignment to add. */ addSetAccessor(structure: OptionalKind<SetAccessorDeclarationStructure>): SetAccessorDeclaration; /** * Adds set accessors. * @param structures - Structure that represents the set accessors to add. */ addSetAccessors(structures: ReadonlyArray<OptionalKind<SetAccessorDeclarationStructure>>): SetAccessorDeclaration[]; /** * Inserts a set accessor at the specified index. * @param index - Child index to insert at. * @param structure - Structure that represents the set accessor to insert. */ insertSetAccessor(index: number, structure: OptionalKind<SetAccessorDeclarationStructure>): SetAccessorDeclaration; /** * Inserts set accessors at the specified index. * @param index - Child index to insert at. * @param structures - Structures that represent the set accessors to insert. */ insertSetAccessors(index: number, structures: ReadonlyArray<OptionalKind<SetAccessorDeclarationStructure>>): SetAccessorDeclaration[]; /** @inheritdoc **/ getParent(): NodeParentType<ts.ObjectLiteralExpression>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ObjectLiteralExpression>>;}
declare const PropertyAssignmentBase: Constructor<InitializerExpressionGetableNode> & Constructor<QuestionTokenableNode> & Constructor<PropertyNamedNode> & typeof ObjectLiteralElement;
export declare class PropertyAssignment extends PropertyAssignmentBase<ts.PropertyAssignment> { /** * Removes the initializer and returns the new shorthand property assignment. * * Note: The current node will no longer be valid because it's no longer a property assignment. */ removeInitializer(): ShorthandPropertyAssignment; /** * Sets the initializer. * @param textOrWriterFunction - New text ot set for the initializer. */ setInitializer(textOrWriterFunction: string | WriterFunction): this; /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<PropertyAssignmentStructure>): this | ShorthandPropertyAssignment; /** Gets the structure equivalent to this node. */ getStructure(): PropertyAssignmentStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.PropertyAssignment>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.PropertyAssignment>>;}
declare const ShorthandPropertyAssignmentBase: Constructor<InitializerExpressionGetableNode> & Constructor<QuestionTokenableNode> & Constructor<NamedNode> & typeof ObjectLiteralElement;
export declare class ShorthandPropertyAssignment extends ShorthandPropertyAssignmentBase<ts.ShorthandPropertyAssignment> { /** Gets if the shorthand property assignment has an object assignment initializer. */ hasObjectAssignmentInitializer(): boolean; /** Gets the object assignment initializer or throws if it doesn't exist. */ getObjectAssignmentInitializerOrThrow(message?: string | (() => string)): Expression<ts.Expression>; /** Gets the object assignment initializer if it exists. */ getObjectAssignmentInitializer(): Expression | undefined; /** Gets the equals token or throws if it doesn't exist. */ getEqualsTokenOrThrow(message?: string | (() => string)): Node<ts.EqualsToken>; /** Gets the equals token if it exists. */ getEqualsToken(): Node<ts.EqualsToken> | undefined; /** * Remove the object assignment initializer. * * This is only useful to remove bad code. */ removeObjectAssignmentInitializer(): this; /** * Sets the initializer. * * Note: The current node will no longer be valid because it's no longer a shorthand property assignment. * @param text - New text to set for the initializer. */ setInitializer(text: string): PropertyAssignment; /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<ShorthandPropertyAssignmentStructure>): this; /** Gets the structure equivalent to this node. */ getStructure(): ShorthandPropertyAssignmentStructure; /** * Gets the shorthand assignment value symbol of this node if it exists. Convenience API * for TypeChecker#getShorthandAssignmentValueSymbol(node) */ getValueSymbol(): Symbol | undefined; /** Gets the value symbol or throws if it doesn't exist. */ getValueSymbolOrThrow(message?: string | (() => string)): Symbol; /** @inheritdoc **/ getParent(): NodeParentType<ts.ShorthandPropertyAssignment>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ShorthandPropertyAssignment>>;}
declare const SpreadAssignmentBase: Constructor<ExpressionedNode> & typeof ObjectLiteralElement;
export declare class SpreadAssignment extends SpreadAssignmentBase<ts.SpreadAssignment> { /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<SpreadAssignmentStructure>): this; /** Gets the structure equivalent to this node. */ getStructure(): SpreadAssignmentStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.SpreadAssignment>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.SpreadAssignment>>;}
declare const OmittedExpressionBase: typeof Expression;
export declare class OmittedExpression extends OmittedExpressionBase<ts.OmittedExpression> { /** @inheritdoc **/ getParent(): NodeParentType<ts.OmittedExpression>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.OmittedExpression>>;}
declare const ParenthesizedExpressionBase: Constructor<ExpressionedNode> & typeof Expression;
export declare class ParenthesizedExpression extends ParenthesizedExpressionBase<ts.ParenthesizedExpression> { /** @inheritdoc **/ getParent(): NodeParentType<ts.ParenthesizedExpression>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ParenthesizedExpression>>;}
declare const PartiallyEmittedExpressionBase: Constructor<ExpressionedNode> & typeof Expression;
export declare class PartiallyEmittedExpression extends PartiallyEmittedExpressionBase<ts.PartiallyEmittedExpression> { /** @inheritdoc **/ getParent(): NodeParentType<ts.PartiallyEmittedExpression>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.PartiallyEmittedExpression>>;}
declare const PostfixUnaryExpressionBase: typeof UnaryExpression;
export declare class PostfixUnaryExpression extends PostfixUnaryExpressionBase<ts.PostfixUnaryExpression> { /** Gets the operator token of the postfix unary expression. */ getOperatorToken(): ts.PostfixUnaryOperator; /** Gets the operand of the postfix unary expression. */ getOperand(): LeftHandSideExpression; /** @inheritdoc **/ getParent(): NodeParentType<ts.PostfixUnaryExpression>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.PostfixUnaryExpression>>;}
declare const PrefixUnaryExpressionBase: typeof UnaryExpression;
export declare class PrefixUnaryExpression extends PrefixUnaryExpressionBase<ts.PrefixUnaryExpression> { /** Gets the operator token of the prefix unary expression. */ getOperatorToken(): ts.PrefixUnaryOperator; /** Gets the operand of the prefix unary expression. */ getOperand(): UnaryExpression; /** @inheritdoc **/ getParent(): NodeParentType<ts.PrefixUnaryExpression>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.PrefixUnaryExpression>>;}
export declare class PrimaryExpression<T extends ts.PrimaryExpression = ts.PrimaryExpression> extends MemberExpression<T> {}
declare const PropertyAccessExpressionBase: Constructor<NamedNode> & Constructor<QuestionDotTokenableNode> & Constructor<LeftHandSideExpressionedNode> & typeof MemberExpression;
export declare class PropertyAccessExpression<T extends ts.PropertyAccessExpression = ts.PropertyAccessExpression> extends PropertyAccessExpressionBase<T> {}
declare const SatisfiesExpressionBase: Constructor<TypedNode> & Constructor<ExpressionedNode> & typeof Expression;
export declare class SatisfiesExpression extends SatisfiesExpressionBase<ts.SatisfiesExpression> { /** @inheritdoc **/ getParent(): NodeParentType<ts.SatisfiesExpression>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.SatisfiesExpression>>;}
declare const SpreadElementBase: Constructor<ExpressionedNode> & typeof Expression;
export declare class SpreadElement extends SpreadElementBase<ts.SpreadElement> { /** @inheritdoc **/ getParent(): NodeParentType<ts.SpreadElement>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.SpreadElement>>;}
declare const SuperElementAccessExpressionBase: Constructor<SuperExpressionedNode> & typeof ElementAccessExpression;
export declare class SuperElementAccessExpression extends SuperElementAccessExpressionBase<ts.SuperElementAccessExpression> { /** @inheritdoc **/ getParent(): NodeParentType<ts.SuperElementAccessExpression>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.SuperElementAccessExpression>>;}
declare const SuperExpressionBase: typeof PrimaryExpression;
export declare class SuperExpression extends SuperExpressionBase<ts.SuperExpression> { /** @inheritdoc **/ getParent(): NodeParentType<ts.SuperExpression>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.SuperExpression>>;}
declare const SuperPropertyAccessExpressionBase: Constructor<SuperExpressionedNode> & typeof PropertyAccessExpression;
export declare class SuperPropertyAccessExpression extends SuperPropertyAccessExpressionBase<ts.SuperPropertyAccessExpression> { /** @inheritdoc **/ getParent(): NodeParentType<ts.SuperPropertyAccessExpression>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.SuperPropertyAccessExpression>>;}
declare const ThisExpressionBase: typeof PrimaryExpression;
export declare class ThisExpression extends ThisExpressionBase<ts.ThisExpression> { /** @inheritdoc **/ getParent(): NodeParentType<ts.ThisExpression>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ThisExpression>>;}
declare const TypeAssertionBase: Constructor<TypedNode> & Constructor<UnaryExpressionedNode> & typeof UnaryExpression;
export declare class TypeAssertion extends TypeAssertionBase<ts.TypeAssertion> { /** @inheritdoc **/ getParent(): NodeParentType<ts.TypeAssertion>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.TypeAssertion>>;}
declare const TypeOfExpressionBase: Constructor<UnaryExpressionedNode> & typeof UnaryExpression;
export declare class TypeOfExpression extends TypeOfExpressionBase<ts.TypeOfExpression> { /** @inheritdoc **/ getParent(): NodeParentType<ts.TypeOfExpression>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.TypeOfExpression>>;}
export declare class UnaryExpression<T extends ts.UnaryExpression = ts.UnaryExpression> extends Expression<T> {}
export declare class UpdateExpression<T extends ts.UpdateExpression = ts.UpdateExpression> extends UnaryExpression<T> {}
declare const VoidExpressionBase: Constructor<UnaryExpressionedNode> & typeof UnaryExpression;
export declare class VoidExpression extends VoidExpressionBase<ts.VoidExpression> { /** @inheritdoc **/ getParent(): NodeParentType<ts.VoidExpression>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.VoidExpression>>;}
declare const YieldExpressionBase: Constructor<ExpressionableNode> & Constructor<GeneratorableNode> & typeof Expression;
export declare class YieldExpression extends YieldExpressionBase<ts.YieldExpression> { /** @inheritdoc **/ getParent(): NodeParentType<ts.YieldExpression>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.YieldExpression>>;}
declare const ArrowFunctionBase: Constructor<TextInsertableNode> & Constructor<BodiedNode> & Constructor<AsyncableNode> & Constructor<FunctionLikeDeclaration> & typeof Expression;
export declare class ArrowFunction extends ArrowFunctionBase<ts.ArrowFunction> { /** Gets the equals greater than token of the arrow function. */ getEqualsGreaterThan(): Node<ts.Token<SyntaxKind.EqualsGreaterThanToken>>; /** @inheritdoc **/ getParent(): NodeParentType<ts.ArrowFunction>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ArrowFunction>>;}
declare const FunctionDeclarationBase: Constructor<UnwrappableNode> & Constructor<TextInsertableNode> & Constructor<OverloadableNode> & Constructor<BodyableNode> & Constructor<AsyncableNode> & Constructor<GeneratorableNode> & Constructor<AmbientableNode> & Constructor<ExportableNode> & Constructor<FunctionLikeDeclaration> & Constructor<ModuleChildableNode> & Constructor<NameableNode> & typeof Statement;declare const FunctionDeclarationOverloadBase: Constructor<UnwrappableNode> & Constructor<TextInsertableNode> & Constructor<AsyncableNode> & Constructor<GeneratorableNode> & Constructor<SignaturedDeclaration> & Constructor<AmbientableNode> & Constructor<ModuleChildableNode> & Constructor<JSDocableNode> & Constructor<TypeParameteredNode> & Constructor<ExportableNode> & Constructor<ModifierableNode> & typeof Statement;
export declare class FunctionDeclaration extends FunctionDeclarationBase<ts.FunctionDeclaration> { /** * Adds a function overload. * @param structure - Structure of the overload. */ addOverload(structure: OptionalKind<FunctionDeclarationOverloadStructure>): FunctionDeclaration; /** * Adds function overloads. * @param structures - Structures of the overloads. */ addOverloads(structures: ReadonlyArray<OptionalKind<FunctionDeclarationOverloadStructure>>): FunctionDeclaration[]; /** * Inserts a function overload. * @param index - Child index to insert at. * @param structure - Structure of the overload. */ insertOverload(index: number, structure: OptionalKind<FunctionDeclarationOverloadStructure>): FunctionDeclaration; /** * Inserts function overloads. * @param index - Child index to insert at. * @param structure - Structures of the overloads. */ insertOverloads(index: number, structures: ReadonlyArray<OptionalKind<FunctionDeclarationOverloadStructure>>): FunctionDeclaration[]; /** Removes this function declaration. */ remove(): void; /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<FunctionDeclarationStructure>): this; /** Gets the structure equivalent to this node. */ getStructure(): FunctionDeclarationStructure | FunctionDeclarationOverloadStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.FunctionDeclaration>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.FunctionDeclaration>>;}
declare const FunctionExpressionBase: Constructor<JSDocableNode> & Constructor<TextInsertableNode> & Constructor<BodiedNode> & Constructor<AsyncableNode> & Constructor<GeneratorableNode> & Constructor<StatementedNode> & Constructor<TypeParameteredNode> & Constructor<SignaturedDeclaration> & Constructor<ModifierableNode> & Constructor<NameableNode> & typeof PrimaryExpression;
export declare class FunctionExpression extends FunctionExpressionBase<ts.FunctionExpression> { /** @inheritdoc **/ getParent(): NodeParentType<ts.FunctionExpression>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.FunctionExpression>>;}
export declare function FunctionLikeDeclaration<T extends Constructor<FunctionLikeDeclarationExtensionType>>(Base: T): Constructor<FunctionLikeDeclaration> & T;
export interface FunctionLikeDeclaration extends JSDocableNode, TypeParameteredNode, SignaturedDeclaration, StatementedNode, ModifierableNode {}
type FunctionLikeDeclarationExtensionType = Node<ts.FunctionLikeDeclaration>;export declare function OverloadableNode<T extends Constructor<OverloadableNodeExtensionType>>(Base: T): Constructor<OverloadableNode> & T;
/** Node that supports overloads. */export interface OverloadableNode { /** Gets all the overloads associated with this node. */ getOverloads(): this[]; /** Gets the implementation or undefined if it doesn't exist. */ getImplementation(): this | undefined; /** Gets the implementation or throws if it doesn't exist. */ getImplementationOrThrow(message?: string | (() => string)): this; /** Gets if this is not the implementation. */ isOverload(): boolean; /** Gets if this is the implementation. */ isImplementation(): boolean;}
type OverloadableNodeExtensionType = Node & BodyableNode;declare const ParameterDeclarationBase: Constructor<OverrideableNode> & Constructor<QuestionTokenableNode> & Constructor<DecoratableNode> & Constructor<ScopeableNode> & Constructor<ReadonlyableNode> & Constructor<ModifierableNode> & Constructor<DotDotDotTokenableNode> & Constructor<TypedNode> & Constructor<InitializerExpressionableNode> & Constructor<BindingNamedNode> & typeof Node;
export declare class ParameterDeclaration extends ParameterDeclarationBase<ts.ParameterDeclaration> { /** Gets if it's a rest parameter. */ isRestParameter(): boolean; /** Gets if this is a property with a scope, readonly, or override keyword (found in class constructors). */ isParameterProperty(): boolean; /** * Sets if it's a rest parameter. * @param value - Sets if it's a rest parameter or not. */ setIsRestParameter(value: boolean): this; /** Gets if it's optional. */ isOptional(): boolean; /** Remove this parameter. */ remove(): void; /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<ParameterDeclarationStructure>): this; /** Gets the structure equivalent to this node. */ getStructure(): ParameterDeclarationStructure; /** * Sets if this node has a question token. * @param value - If it should have a question token or not. */ setHasQuestionToken(value: boolean): this; /** * Sets the initializer. * @param text - Text or writer function to set for the initializer. */ setInitializer(textOrWriterFunction: string | WriterFunction): this; /** * Sets the type. * @param textOrWriterFunction - Text or writer function to set the type with. */ setType(textOrWriterFunction: string | WriterFunction): this; /** @inheritdoc **/ getParent(): NodeParentType<ts.ParameterDeclaration>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ParameterDeclaration>>;}
export declare class HeritageClause extends Node<ts.HeritageClause> { /** Gets all the type nodes for the heritage clause. */ getTypeNodes(): ExpressionWithTypeArguments[]; /** Gets the heritage clause token. */ getToken(): SyntaxKind.ExtendsKeyword | SyntaxKind.ImplementsKeyword; /** * Remove the expression from the heritage clause. * @param index - Index of the expression to remove. */ removeExpression(index: number): this; /** * Removes the expression from the heritage clause. * @param expressionNode - Expression to remove. */ removeExpression(expressionNode: ExpressionWithTypeArguments): this; /** @inheritdoc **/ getParent(): NodeParentType<ts.HeritageClause>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.HeritageClause>>;}
declare const CallSignatureDeclarationBase: Constructor<TypeParameteredNode> & Constructor<ChildOrderableNode> & Constructor<JSDocableNode> & Constructor<SignaturedDeclaration> & typeof TypeElement;
export declare class CallSignatureDeclaration extends CallSignatureDeclarationBase<ts.CallSignatureDeclaration> { /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<CallSignatureDeclarationStructure>): this; /** Gets the structure equivalent to this node. */ getStructure(): CallSignatureDeclarationStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.CallSignatureDeclaration>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.CallSignatureDeclaration>>;}
export declare class CommentTypeElement extends TypeElement<CompilerCommentTypeElement> {}
declare const ConstructSignatureDeclarationBase: Constructor<TypeParameteredNode> & Constructor<ChildOrderableNode> & Constructor<JSDocableNode> & Constructor<SignaturedDeclaration> & typeof TypeElement;
export declare class ConstructSignatureDeclaration extends ConstructSignatureDeclarationBase<ts.ConstructSignatureDeclaration> { /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<ConstructSignatureDeclarationStructure>): this; /** Gets the structure equivalent to this node. */ getStructure(): ConstructSignatureDeclarationStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.ConstructSignatureDeclaration>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ConstructSignatureDeclaration>>;}
declare const IndexSignatureDeclarationBase: Constructor<ReturnTypedNode> & Constructor<ChildOrderableNode> & Constructor<JSDocableNode> & Constructor<ReadonlyableNode> & Constructor<ModifierableNode> & typeof TypeElement;
export declare class IndexSignatureDeclaration extends IndexSignatureDeclarationBase<ts.IndexSignatureDeclaration> { /** Gets the key name. */ getKeyName(): string; /** * Sets the key name. * @param name - New name. */ setKeyName(name: string): void; /** Gets the key name node. */ getKeyNameNode(): BindingName; /** Gets the key type. */ getKeyType(): Type; /** * Sets the key type. * @param type - Type. */ setKeyType(type: string): this; /** Gets the key type node. */ getKeyTypeNode(): TypeNode; /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<IndexSignatureDeclarationStructure>): this; /** Gets the structure equivalent to this node. */ getStructure(): IndexSignatureDeclarationStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.IndexSignatureDeclaration>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.IndexSignatureDeclaration>>;}
declare const InterfaceDeclarationBase: Constructor<TypeElementMemberedNode> & Constructor<TextInsertableNode> & Constructor<ExtendsClauseableNode> & Constructor<HeritageClauseableNode> & Constructor<TypeParameteredNode> & Constructor<JSDocableNode> & Constructor<AmbientableNode> & Constructor<ModuleChildableNode> & Constructor<ExportableNode> & Constructor<ModifierableNode> & Constructor<NamedNode> & typeof Statement;
export declare class InterfaceDeclaration extends InterfaceDeclarationBase<ts.InterfaceDeclaration> { /** Gets the base types. */ getBaseTypes(): Type[]; /** Gets the base declarations. */ getBaseDeclarations(): (TypeAliasDeclaration | InterfaceDeclaration | ClassDeclaration)[]; /** * Gets all the implementations of the interface. * * This is similar to "go to implementation." */ getImplementations(): ImplementationLocation[]; /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<InterfaceDeclarationStructure>): this; /** Gets the structure equivalent to this node. */ getStructure(): InterfaceDeclarationStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.InterfaceDeclaration>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.InterfaceDeclaration>>;}
declare const MethodSignatureBase: Constructor<ChildOrderableNode> & Constructor<JSDocableNode> & Constructor<QuestionTokenableNode> & Constructor<TypeParameteredNode> & Constructor<SignaturedDeclaration> & Constructor<PropertyNamedNode> & typeof TypeElement;
export declare class MethodSignature extends MethodSignatureBase<ts.MethodSignature> { /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<MethodSignatureStructure>): this; /** Gets the structure equivalent to this node. */ getStructure(): MethodSignatureStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.MethodSignature>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.MethodSignature>>;}
declare const PropertySignatureBase: Constructor<ChildOrderableNode> & Constructor<JSDocableNode> & Constructor<ReadonlyableNode> & Constructor<QuestionTokenableNode> & Constructor<InitializerExpressionableNode> & Constructor<TypedNode> & Constructor<PropertyNamedNode> & Constructor<ModifierableNode> & typeof TypeElement;
export declare class PropertySignature extends PropertySignatureBase<ts.PropertySignature> { /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<PropertySignatureStructure>): this; /** Gets the structure equivalent to this node. */ getStructure(): PropertySignatureStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.PropertySignature>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.PropertySignature>>;}
export declare class TypeElement<TNode extends ts.TypeElement = ts.TypeElement> extends Node<TNode> { /** Removes the member. */ remove(): void;}
export declare function JsxAttributedNode<T extends Constructor<JsxAttributedNodeExtensionType>>(Base: T): Constructor<JsxAttributedNode> & T;
export interface JsxAttributedNode { /** Gets the JSX element's attributes. */ getAttributes(): JsxAttributeLike[]; /** * Gets an attribute by name or returns undefined when it can't be found. * @param name - Name to search for. */ getAttribute(name: string): JsxAttributeLike | undefined; /** * Gets an attribute by a find function or returns undefined when it can't be found. * @param findFunction - Find function. */ getAttribute(findFunction: (attribute: JsxAttributeLike) => boolean): JsxAttributeLike | undefined; /** * Gets an attribute by name or throws when it can't be found. * @param name - Name to search for. */ getAttributeOrThrow(name: string): JsxAttributeLike; /** * Gets an attribute by a find function or throws when it can't be found. * @param findFunction - Find function. */ getAttributeOrThrow(findFunction: (attribute: JsxAttributeLike) => boolean): JsxAttributeLike; /** Adds an attribute into the element. */ addAttribute(attribute: OptionalKind<JsxAttributeStructure> | OptionalKind<JsxSpreadAttributeStructure>): JsxAttributeLike; /** Adds attributes into the element. */ addAttributes(attributes: ReadonlyArray<OptionalKind<JsxAttributeStructure> | OptionalKind<JsxSpreadAttributeStructure>>): JsxAttributeLike[]; /** Inserts an attribute into the element. */ insertAttribute(index: number, attribute: OptionalKind<JsxAttributeStructure> | OptionalKind<JsxSpreadAttributeStructure>): JsxAttributeLike; /** Inserts attributes into the element. */ insertAttributes(index: number, attributes: ReadonlyArray<OptionalKind<JsxAttributeStructure> | OptionalKind<JsxSpreadAttributeStructure>>): JsxAttributeLike[];}
type JsxAttributedNodeExtensionType = Node<ts.Node & { attributes: ts.JsxAttributes; }> & JsxTagNamedNode;export declare function JsxTagNamedNode<T extends Constructor<JsxTagNamedNodeExtensionType>>(Base: T): Constructor<JsxTagNamedNode> & T;
export interface JsxTagNamedNode { /** Gets the tag name of the JSX closing element. */ getTagNameNode(): JsxTagNameExpression;}
type JsxTagNamedNodeExtensionType = Node<ts.Node & { tagName: ts.JsxTagNameExpression; }>;declare const JsxAttributeBase: typeof Node;
export declare class JsxAttribute extends JsxAttributeBase<ts.JsxAttribute> { /** Gets the name node of the JSX attribute. */ getNameNode(): JsxAttributeName; /** Sets the name of the JSX attribute. */ setName(name: string | JsxNamespacedNameStructure): this; /** Gets the JSX attribute's initializer or throws if it doesn't exist. */ getInitializerOrThrow(message?: string | (() => string)): StringLiteral | JsxElement | JsxSelfClosingElement | JsxFragment | JsxExpression; /** Gets the JSX attribute's initializer or returns undefined if it doesn't exist. */ getInitializer(): JsxElement | JsxExpression | JsxFragment | JsxSelfClosingElement | StringLiteral | undefined; /** * Sets the initializer. * @param textOrWriterFunction - Text or writer function to set the initializer with. * @remarks You need to provide the quotes or braces. */ setInitializer(textOrWriterFunction: string | WriterFunction): this; /** Removes the initializer. */ removeInitializer(): this; /** Removes the JSX attribute. */ remove(): void; /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<JsxAttributeStructure>): this; /** Gets the structure equivalent to this node. */ getStructure(): JsxAttributeStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.JsxAttribute>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JsxAttribute>>;}
declare const JsxClosingElementBase: Constructor<JsxTagNamedNode> & typeof Node;
export declare class JsxClosingElement extends JsxClosingElementBase<ts.JsxClosingElement> { /** @inheritdoc **/ getParent(): NodeParentType<ts.JsxClosingElement>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JsxClosingElement>>;}
export declare class JsxClosingFragment extends Expression<ts.JsxClosingFragment> { /** @inheritdoc **/ getParent(): NodeParentType<ts.JsxClosingFragment>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JsxClosingFragment>>;}
declare const JsxElementBase: typeof PrimaryExpression;
export declare class JsxElement extends JsxElementBase<ts.JsxElement> { /** Gets the children of the JSX element. */ getJsxChildren(): JsxChild[]; /** Gets the opening element. */ getOpeningElement(): JsxOpeningElement; /** Gets the closing element. */ getClosingElement(): JsxClosingElement; /** * Sets the body text. * @param textOrWriterFunction - Text or writer function to set as the body. */ setBodyText(textOrWriterFunction: string | WriterFunction): this; /** * Sets the body text without surrounding new lines. * @param textOrWriterFunction - Text to set as the body. */ setBodyTextInline(textOrWriterFunction: string | WriterFunction): this; /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<JsxElementStructure>): this; /** Gets the structure equivalent to this node. */ getStructure(): JsxElementStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.JsxElement>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JsxElement>>;}
declare const JsxExpressionBase: Constructor<ExpressionableNode> & Constructor<DotDotDotTokenableNode> & typeof Expression;
export declare class JsxExpression extends JsxExpressionBase<ts.JsxExpression> { /** @inheritdoc **/ getParent(): NodeParentType<ts.JsxExpression>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JsxExpression>>;}
export declare class JsxFragment extends PrimaryExpression<ts.JsxFragment> { /** Gets the children of the JSX fragment. */ getJsxChildren(): JsxChild[]; /** Gets the opening fragment. */ getOpeningFragment(): JsxOpeningFragment; /** Gets the closing fragment. */ getClosingFragment(): JsxClosingFragment; /** @inheritdoc **/ getParent(): NodeParentType<ts.JsxFragment>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JsxFragment>>;}
declare const JsxNamespacedNameBase: typeof Node;
export declare class JsxNamespacedName extends JsxNamespacedNameBase<ts.JsxNamespacedName> { /** Gets the namespace name node. */ getNamespaceNode(): Identifier; /** Gets the name node. */ getNameNode(): Identifier; set(structure: JsxNamespacedNameStructure): this; getStructure(): JsxNamespacedNameStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.JsxNamespacedName>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JsxNamespacedName>>;}
declare const JsxOpeningElementBase: Constructor<JsxAttributedNode> & Constructor<JsxTagNamedNode> & typeof Expression;
export declare class JsxOpeningElement extends JsxOpeningElementBase<ts.JsxOpeningElement> { /** @inheritdoc **/ getParent(): NodeParentType<ts.JsxOpeningElement>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JsxOpeningElement>>;}
export declare class JsxOpeningFragment extends Expression<ts.JsxOpeningFragment> { /** @inheritdoc **/ getParent(): NodeParentType<ts.JsxOpeningFragment>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JsxOpeningFragment>>;}
declare const JsxSelfClosingElementBase: Constructor<JsxAttributedNode> & Constructor<JsxTagNamedNode> & typeof PrimaryExpression;
export declare class JsxSelfClosingElement extends JsxSelfClosingElementBase<ts.JsxSelfClosingElement> { /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<JsxSelfClosingElementStructure>): this; /** Gets the structure equivalent to this node. */ getStructure(): JsxSelfClosingElementStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.JsxSelfClosingElement>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JsxSelfClosingElement>>;}
declare const JsxSpreadAttributeBase: Constructor<ExpressionedNode> & typeof Node;
export declare class JsxSpreadAttribute extends JsxSpreadAttributeBase<ts.JsxSpreadAttribute> { /** Removes the JSX spread attribute. */ remove(): void; /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<JsxSpreadAttributeStructure>): this; /** Gets the structure equivalent to this node. */ getStructure(): JsxSpreadAttributeStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.JsxSpreadAttribute>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JsxSpreadAttribute>>;}
declare const JsxTextBase: Constructor<LiteralLikeNode> & typeof Node;
export declare class JsxText extends JsxTextBase<ts.JsxText> { /** Gets if the JSX text contains only white spaces. */ containsOnlyTriviaWhiteSpaces(): boolean; /** @inheritdoc **/ getParent(): NodeParentType<ts.JsxText>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.JsxText>>;}
export interface ImplementedKindToNodeMappings { [SyntaxKind.SourceFile]: SourceFile; [SyntaxKind.ArrayBindingPattern]: ArrayBindingPattern; [SyntaxKind.ArrayLiteralExpression]: ArrayLiteralExpression; [SyntaxKind.ArrayType]: ArrayTypeNode; [SyntaxKind.ArrowFunction]: ArrowFunction; [SyntaxKind.AsExpression]: AsExpression; [SyntaxKind.AwaitExpression]: AwaitExpression; [SyntaxKind.BigIntLiteral]: BigIntLiteral; [SyntaxKind.BindingElement]: BindingElement; [SyntaxKind.BinaryExpression]: BinaryExpression; [SyntaxKind.Block]: Block; [SyntaxKind.BreakStatement]: BreakStatement; [SyntaxKind.CallExpression]: CallExpression; [SyntaxKind.CallSignature]: CallSignatureDeclaration; [SyntaxKind.CaseBlock]: CaseBlock; [SyntaxKind.CaseClause]: CaseClause; [SyntaxKind.CatchClause]: CatchClause; [SyntaxKind.ClassDeclaration]: ClassDeclaration; [SyntaxKind.ClassExpression]: ClassExpression; [SyntaxKind.ClassStaticBlockDeclaration]: ClassStaticBlockDeclaration; [SyntaxKind.ConditionalType]: ConditionalTypeNode; [SyntaxKind.Constructor]: ConstructorDeclaration; [SyntaxKind.ConstructorType]: ConstructorTypeNode; [SyntaxKind.ConstructSignature]: ConstructSignatureDeclaration; [SyntaxKind.ContinueStatement]: ContinueStatement; [SyntaxKind.CommaListExpression]: CommaListExpression; [SyntaxKind.ComputedPropertyName]: ComputedPropertyName; [SyntaxKind.ConditionalExpression]: ConditionalExpression; [SyntaxKind.DebuggerStatement]: DebuggerStatement; [SyntaxKind.Decorator]: Decorator; [SyntaxKind.DefaultClause]: DefaultClause; [SyntaxKind.DeleteExpression]: DeleteExpression; [SyntaxKind.DoStatement]: DoStatement; [SyntaxKind.ElementAccessExpression]: ElementAccessExpression; [SyntaxKind.EmptyStatement]: EmptyStatement; [SyntaxKind.EnumDeclaration]: EnumDeclaration; [SyntaxKind.EnumMember]: EnumMember; [SyntaxKind.ExportAssignment]: ExportAssignment; [SyntaxKind.ExportDeclaration]: ExportDeclaration; [SyntaxKind.ExportSpecifier]: ExportSpecifier; [SyntaxKind.ExpressionWithTypeArguments]: ExpressionWithTypeArguments; [SyntaxKind.ExpressionStatement]: ExpressionStatement; [SyntaxKind.ExternalModuleReference]: ExternalModuleReference; [SyntaxKind.QualifiedName]: QualifiedName; [SyntaxKind.ForInStatement]: ForInStatement; [SyntaxKind.ForOfStatement]: ForOfStatement; [SyntaxKind.ForStatement]: ForStatement; [SyntaxKind.FunctionDeclaration]: FunctionDeclaration; [SyntaxKind.FunctionExpression]: FunctionExpression; [SyntaxKind.FunctionType]: FunctionTypeNode; [SyntaxKind.GetAccessor]: GetAccessorDeclaration; [SyntaxKind.HeritageClause]: HeritageClause; [SyntaxKind.Identifier]: Identifier; [SyntaxKind.IfStatement]: IfStatement; [SyntaxKind.ImportClause]: ImportClause; [SyntaxKind.ImportDeclaration]: ImportDeclaration; [SyntaxKind.ImportEqualsDeclaration]: ImportEqualsDeclaration; [SyntaxKind.ImportSpecifier]: ImportSpecifier; [SyntaxKind.ImportType]: ImportTypeNode; [SyntaxKind.ImportAttribute]: ImportAttribute; [SyntaxKind.ImportAttributes]: ImportAttributes; [SyntaxKind.IndexedAccessType]: IndexedAccessTypeNode; [SyntaxKind.IndexSignature]: IndexSignatureDeclaration; [SyntaxKind.InferType]: InferTypeNode; [SyntaxKind.InterfaceDeclaration]: InterfaceDeclaration; [SyntaxKind.IntersectionType]: IntersectionTypeNode; [SyntaxKind.JSDocAllType]: JSDocAllType; [SyntaxKind.JSDocAugmentsTag]: JSDocAugmentsTag; [SyntaxKind.JSDocAuthorTag]: JSDocAuthorTag; [SyntaxKind.JSDocCallbackTag]: JSDocCallbackTag; [SyntaxKind.JSDocClassTag]: JSDocClassTag; [SyntaxKind.JSDocDeprecatedTag]: JSDocDeprecatedTag; [SyntaxKind.JSDocEnumTag]: JSDocEnumTag; [SyntaxKind.JSDocFunctionType]: JSDocFunctionType; [SyntaxKind.JSDocImplementsTag]: JSDocImplementsTag; [SyntaxKind.JSDocLink]: JSDocLink; [SyntaxKind.JSDocLinkCode]: JSDocLinkCode; [SyntaxKind.JSDocLinkPlain]: JSDocLinkPlain; [SyntaxKind.JSDocMemberName]: JSDocMemberName; [SyntaxKind.JSDocNamepathType]: JSDocNamepathType; [SyntaxKind.JSDocNameReference]: JSDocNameReference; [SyntaxKind.JSDocNonNullableType]: JSDocNonNullableType; [SyntaxKind.JSDocNullableType]: JSDocNullableType; [SyntaxKind.JSDocOptionalType]: JSDocOptionalType; [SyntaxKind.JSDocOverrideTag]: JSDocOverrideTag; [SyntaxKind.JSDocParameterTag]: JSDocParameterTag; [SyntaxKind.JSDocPrivateTag]: JSDocPrivateTag; [SyntaxKind.JSDocPropertyTag]: JSDocPropertyTag; [SyntaxKind.JSDocProtectedTag]: JSDocProtectedTag; [SyntaxKind.JSDocPublicTag]: JSDocPublicTag; [SyntaxKind.JSDocReturnTag]: JSDocReturnTag; [SyntaxKind.JSDocReadonlyTag]: JSDocReadonlyTag; [SyntaxKind.JSDocThrowsTag]: JSDocThrowsTag; [SyntaxKind.JSDocOverloadTag]: JSDocOverloadTag; [SyntaxKind.JSDocSatisfiesTag]: JSDocSatisfiesTag; [SyntaxKind.JSDocSeeTag]: JSDocSeeTag; [SyntaxKind.JSDocSignature]: JSDocSignature; [SyntaxKind.JSDocTag]: JSDocUnknownTag; [SyntaxKind.JSDocTemplateTag]: JSDocTemplateTag; [SyntaxKind.JSDocText]: JSDocText; [SyntaxKind.JSDocThisTag]: JSDocThisTag; [SyntaxKind.JSDocTypeExpression]: JSDocTypeExpression; [SyntaxKind.JSDocTypeLiteral]: JSDocTypeLiteral; [SyntaxKind.JSDocTypeTag]: JSDocTypeTag; [SyntaxKind.JSDocTypedefTag]: JSDocTypedefTag; [SyntaxKind.JSDocUnknownType]: JSDocUnknownType; [SyntaxKind.JSDocVariadicType]: JSDocVariadicType; [SyntaxKind.JsxAttribute]: JsxAttribute; [SyntaxKind.JsxClosingElement]: JsxClosingElement; [SyntaxKind.JsxClosingFragment]: JsxClosingFragment; [SyntaxKind.JsxElement]: JsxElement; [SyntaxKind.JsxExpression]: JsxExpression; [SyntaxKind.JsxFragment]: JsxFragment; [SyntaxKind.JsxNamespacedName]: JsxNamespacedName; [SyntaxKind.JsxOpeningElement]: JsxOpeningElement; [SyntaxKind.JsxOpeningFragment]: JsxOpeningFragment; [SyntaxKind.JsxSelfClosingElement]: JsxSelfClosingElement; [SyntaxKind.JsxSpreadAttribute]: JsxSpreadAttribute; [SyntaxKind.JsxText]: JsxText; [SyntaxKind.LabeledStatement]: LabeledStatement; [SyntaxKind.LiteralType]: LiteralTypeNode; [SyntaxKind.MappedType]: MappedTypeNode; [SyntaxKind.MetaProperty]: MetaProperty; [SyntaxKind.MethodDeclaration]: MethodDeclaration; [SyntaxKind.MethodSignature]: MethodSignature; [SyntaxKind.ModuleBlock]: ModuleBlock; [SyntaxKind.ModuleDeclaration]: ModuleDeclaration; [SyntaxKind.NamedExports]: NamedExports; [SyntaxKind.NamedImports]: NamedImports; [SyntaxKind.NamedTupleMember]: NamedTupleMember; [SyntaxKind.NamespaceExport]: NamespaceExport; [SyntaxKind.NamespaceImport]: NamespaceImport; [SyntaxKind.NewExpression]: NewExpression; [SyntaxKind.NonNullExpression]: NonNullExpression; [SyntaxKind.NotEmittedStatement]: NotEmittedStatement; [SyntaxKind.NoSubstitutionTemplateLiteral]: NoSubstitutionTemplateLiteral; [SyntaxKind.NumericLiteral]: NumericLiteral; [SyntaxKind.ObjectBindingPattern]: ObjectBindingPattern; [SyntaxKind.ObjectLiteralExpression]: ObjectLiteralExpression; [SyntaxKind.OmittedExpression]: OmittedExpression; [SyntaxKind.Parameter]: ParameterDeclaration; [SyntaxKind.ParenthesizedExpression]: ParenthesizedExpression; [SyntaxKind.ParenthesizedType]: ParenthesizedTypeNode; [SyntaxKind.PartiallyEmittedExpression]: PartiallyEmittedExpression; [SyntaxKind.PostfixUnaryExpression]: PostfixUnaryExpression; [SyntaxKind.PrefixUnaryExpression]: PrefixUnaryExpression; [SyntaxKind.PrivateIdentifier]: PrivateIdentifier; [SyntaxKind.PropertyAccessExpression]: PropertyAccessExpression; [SyntaxKind.PropertyAssignment]: PropertyAssignment; [SyntaxKind.PropertyDeclaration]: PropertyDeclaration; [SyntaxKind.PropertySignature]: PropertySignature; [SyntaxKind.RegularExpressionLiteral]: RegularExpressionLiteral; [SyntaxKind.RestType]: RestTypeNode; [SyntaxKind.ReturnStatement]: ReturnStatement; [SyntaxKind.SatisfiesExpression]: SatisfiesExpression; [SyntaxKind.SetAccessor]: SetAccessorDeclaration; [SyntaxKind.ShorthandPropertyAssignment]: ShorthandPropertyAssignment; [SyntaxKind.SpreadAssignment]: SpreadAssignment; [SyntaxKind.SpreadElement]: SpreadElement; [SyntaxKind.StringLiteral]: StringLiteral; [SyntaxKind.SwitchStatement]: SwitchStatement; [SyntaxKind.SyntaxList]: SyntaxList; [SyntaxKind.TaggedTemplateExpression]: TaggedTemplateExpression; [SyntaxKind.TemplateExpression]: TemplateExpression; [SyntaxKind.TemplateHead]: TemplateHead; [SyntaxKind.TemplateLiteralType]: TemplateLiteralTypeNode; [SyntaxKind.TemplateMiddle]: TemplateMiddle; [SyntaxKind.TemplateSpan]: TemplateSpan; [SyntaxKind.TemplateTail]: TemplateTail; [SyntaxKind.ThisType]: ThisTypeNode; [SyntaxKind.ThrowStatement]: ThrowStatement; [SyntaxKind.TryStatement]: TryStatement; [SyntaxKind.TupleType]: TupleTypeNode; [SyntaxKind.TypeAliasDeclaration]: TypeAliasDeclaration; [SyntaxKind.TypeAssertionExpression]: TypeAssertion; [SyntaxKind.TypeLiteral]: TypeLiteralNode; [SyntaxKind.TypeOperator]: TypeOperatorTypeNode; [SyntaxKind.TypeParameter]: TypeParameterDeclaration; [SyntaxKind.TypePredicate]: TypePredicateNode; [SyntaxKind.TypeQuery]: TypeQueryNode; [SyntaxKind.TypeReference]: TypeReferenceNode; [SyntaxKind.UnionType]: UnionTypeNode; [SyntaxKind.VariableDeclaration]: VariableDeclaration; [SyntaxKind.VariableDeclarationList]: VariableDeclarationList; [SyntaxKind.VariableStatement]: VariableStatement; [SyntaxKind.JSDoc]: JSDoc; [SyntaxKind.TypeOfExpression]: TypeOfExpression; [SyntaxKind.WhileStatement]: WhileStatement; [SyntaxKind.WithStatement]: WithStatement; [SyntaxKind.YieldExpression]: YieldExpression; [SyntaxKind.SemicolonToken]: Node<ts.Token<SyntaxKind.SemicolonToken>>; [SyntaxKind.InferKeyword]: Node<ts.Token<SyntaxKind.InferKeyword>>; [SyntaxKind.NeverKeyword]: Node<ts.Token<SyntaxKind.NeverKeyword>>; [SyntaxKind.AnyKeyword]: Expression; [SyntaxKind.BooleanKeyword]: Expression; [SyntaxKind.NumberKeyword]: Expression; [SyntaxKind.ObjectKeyword]: Expression; [SyntaxKind.StringKeyword]: Expression; [SyntaxKind.SymbolKeyword]: Expression; [SyntaxKind.UndefinedKeyword]: Expression; [SyntaxKind.FalseKeyword]: FalseLiteral; [SyntaxKind.ImportKeyword]: ImportExpression; [SyntaxKind.NullKeyword]: NullLiteral; [SyntaxKind.SuperKeyword]: SuperExpression; [SyntaxKind.ThisKeyword]: ThisExpression; [SyntaxKind.TrueKeyword]: TrueLiteral; [SyntaxKind.VoidExpression]: VoidExpression;}
export interface KindToNodeMappings extends ImplementedKindToNodeMappings { [kind: number]: Node;}
export interface KindToExpressionMappings { [kind: number]: Node; [SyntaxKind.ArrayLiteralExpression]: ArrayLiteralExpression; [SyntaxKind.ArrowFunction]: ArrowFunction; [SyntaxKind.AsExpression]: AsExpression; [SyntaxKind.AwaitExpression]: AwaitExpression; [SyntaxKind.BigIntLiteral]: BigIntLiteral; [SyntaxKind.BinaryExpression]: BinaryExpression; [SyntaxKind.CallExpression]: CallExpression; [SyntaxKind.ClassExpression]: ClassExpression; [SyntaxKind.CommaListExpression]: CommaListExpression; [SyntaxKind.ConditionalExpression]: ConditionalExpression; [SyntaxKind.DeleteExpression]: DeleteExpression; [SyntaxKind.ElementAccessExpression]: ElementAccessExpression; [SyntaxKind.FunctionExpression]: FunctionExpression; [SyntaxKind.Identifier]: Identifier; [SyntaxKind.JsxClosingFragment]: JsxClosingFragment; [SyntaxKind.JsxElement]: JsxElement; [SyntaxKind.JsxExpression]: JsxExpression; [SyntaxKind.JsxFragment]: JsxFragment; [SyntaxKind.JsxOpeningElement]: JsxOpeningElement; [SyntaxKind.JsxOpeningFragment]: JsxOpeningFragment; [SyntaxKind.JsxSelfClosingElement]: JsxSelfClosingElement; [SyntaxKind.MetaProperty]: MetaProperty; [SyntaxKind.NewExpression]: NewExpression; [SyntaxKind.NonNullExpression]: NonNullExpression; [SyntaxKind.NoSubstitutionTemplateLiteral]: NoSubstitutionTemplateLiteral; [SyntaxKind.NumericLiteral]: NumericLiteral; [SyntaxKind.ObjectLiteralExpression]: ObjectLiteralExpression; [SyntaxKind.OmittedExpression]: OmittedExpression; [SyntaxKind.ParenthesizedExpression]: ParenthesizedExpression; [SyntaxKind.PartiallyEmittedExpression]: PartiallyEmittedExpression; [SyntaxKind.PostfixUnaryExpression]: PostfixUnaryExpression; [SyntaxKind.PrefixUnaryExpression]: PrefixUnaryExpression; [SyntaxKind.PropertyAccessExpression]: PropertyAccessExpression; [SyntaxKind.RegularExpressionLiteral]: RegularExpressionLiteral; [SyntaxKind.SatisfiesExpression]: SatisfiesExpression; [SyntaxKind.SpreadElement]: SpreadElement; [SyntaxKind.StringLiteral]: StringLiteral; [SyntaxKind.TaggedTemplateExpression]: TaggedTemplateExpression; [SyntaxKind.TemplateExpression]: TemplateExpression; [SyntaxKind.TypeAssertionExpression]: TypeAssertion; [SyntaxKind.TypeOfExpression]: TypeOfExpression; [SyntaxKind.YieldExpression]: YieldExpression; [SyntaxKind.AnyKeyword]: Expression; [SyntaxKind.BooleanKeyword]: Expression; [SyntaxKind.NumberKeyword]: Expression; [SyntaxKind.ObjectKeyword]: Expression; [SyntaxKind.StringKeyword]: Expression; [SyntaxKind.SymbolKeyword]: Expression; [SyntaxKind.UndefinedKeyword]: Expression; [SyntaxKind.FalseKeyword]: FalseLiteral; [SyntaxKind.ImportKeyword]: ImportExpression; [SyntaxKind.NullKeyword]: NullLiteral; [SyntaxKind.SuperKeyword]: SuperExpression; [SyntaxKind.ThisKeyword]: ThisExpression; [SyntaxKind.TrueKeyword]: TrueLiteral; [SyntaxKind.VoidExpression]: VoidExpression;}
declare const BigIntLiteralBase: typeof LiteralExpression;
export declare class BigIntLiteral extends BigIntLiteralBase<ts.BigIntLiteral> { /** * Gets the BigInt literal value. * * Assert this as a `bigint` in environments that support it. */ getLiteralValue(): unknown; /** * Sets the bigint literal value. * @param value - Value to set (must provide a bigint here at runtime). */ setLiteralValue(value: unknown): this; /** @inheritdoc **/ getParent(): NodeParentType<ts.BigIntLiteral>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.BigIntLiteral>>;}
declare const TrueLiteralBase: typeof PrimaryExpression;
export declare class TrueLiteral extends TrueLiteralBase<ts.TrueLiteral> { /** Gets the literal value. */ getLiteralValue(): boolean; /** * Sets the literal value. * * Note: This forgets the current node and returns the new node if the value changes. * @param value - Value to set. */ setLiteralValue(value: boolean): this | FalseLiteral; /** @inheritdoc **/ getParent(): NodeParentType<ts.TrueLiteral>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.TrueLiteral>>;}
declare const FalseLiteralBase: typeof PrimaryExpression;
export declare class FalseLiteral extends FalseLiteralBase<ts.FalseLiteral> { /** Gets the literal value. */ getLiteralValue(): boolean; /** * Sets the literal value. * * Note: This forgets the current node and returns the new node if the value changes. * @param value - Value to set. */ setLiteralValue(value: boolean): this | TrueLiteral; /** @inheritdoc **/ getParent(): NodeParentType<ts.FalseLiteral>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.FalseLiteral>>;}
declare const NullLiteralBase: typeof PrimaryExpression;
export declare class NullLiteral extends NullLiteralBase<ts.NullLiteral> { /** @inheritdoc **/ getParent(): NodeParentType<ts.NullLiteral>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.NullLiteral>>;}
declare const NumericLiteralBase: typeof LiteralExpression;
export declare class NumericLiteral extends NumericLiteralBase<ts.NumericLiteral> { /** Gets the literal value. */ getLiteralValue(): number; /** * Sets the literal value. * @param value - Value to set. */ setLiteralValue(value: number): this; /** @inheritdoc **/ getParent(): NodeParentType<ts.NumericLiteral>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.NumericLiteral>>;}
/** Quote type for a string literal. */export declare enum QuoteKind { /** Single quote */ Single = "'", /** Double quote */ Double = "\""}
declare const RegularExpressionLiteralBase: typeof LiteralExpression;
export declare class RegularExpressionLiteral extends RegularExpressionLiteralBase<ts.RegularExpressionLiteral> { /** Gets the literal value. */ getLiteralValue(): RegExp; /** * Sets the literal value according to a pattern and some flags. * @param pattern - Pattern. * @param flags - Flags. */ setLiteralValue(pattern: string, flags?: string): this; /** * Sets the literal value according to a regular expression object. * @param regExp - Regular expression. */ setLiteralValue(regExp: RegExp): this; /** @inheritdoc **/ getParent(): NodeParentType<ts.RegularExpressionLiteral>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.RegularExpressionLiteral>>;}
declare const StringLiteralBase: typeof LiteralExpression;
export declare class StringLiteral extends StringLiteralBase<ts.StringLiteral> { /** * Gets the literal value. * * This is equivalent to .getLiteralText() for string literals and only exists for consistency with other literals. */ getLiteralValue(): string; /** * Sets the literal value. * @param value - Value to set. */ setLiteralValue(value: string): this; /** Gets the quote kind. */ getQuoteKind(): QuoteKind; /** @inheritdoc **/ getParent(): NodeParentType<ts.StringLiteral>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.StringLiteral>>;}
declare const NoSubstitutionTemplateLiteralBase: typeof LiteralExpression;
export declare class NoSubstitutionTemplateLiteral extends NoSubstitutionTemplateLiteralBase<ts.NoSubstitutionTemplateLiteral> { /** Gets the literal value. */ getLiteralValue(): string; /** * Sets the literal value. * * Note: This could possibly replace the node if you add a tagged template. * @param value - Value to set. * @returns The new node if the kind changed; the current node otherwise. */ setLiteralValue(value: string): TemplateLiteral; /** @inheritdoc **/ getParent(): NodeParentType<ts.NoSubstitutionTemplateLiteral>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.NoSubstitutionTemplateLiteral>>;}
export declare class TaggedTemplateExpression extends MemberExpression<ts.TaggedTemplateExpression> { /** Gets the tag. */ getTag(): LeftHandSideExpression; /** Gets the template literal. */ getTemplate(): TemplateLiteral; /** * Removes the tag from the tagged template. * @returns The new template expression. */ removeTag(): TemplateLiteral; /** @inheritdoc **/ getParent(): NodeParentType<ts.TaggedTemplateExpression>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.TaggedTemplateExpression>>;}
declare const TemplateExpressionBase: typeof PrimaryExpression;
export declare class TemplateExpression extends TemplateExpressionBase<ts.TemplateExpression> { /** Gets the template head. */ getHead(): TemplateHead; /** Gets the template spans. */ getTemplateSpans(): TemplateSpan[]; /** * Sets the literal value. * * Note: This could possibly replace the node if you remove all the tagged templates. * @param value - Value to set. * @returns The new node if the kind changed; the current node otherwise. */ setLiteralValue(value: string): Node<ts.Node>; /** @inheritdoc **/ getParent(): NodeParentType<ts.TemplateExpression>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.TemplateExpression>>;}
declare const TemplateHeadBase: Constructor<LiteralLikeNode> & typeof Node;
export declare class TemplateHead extends TemplateHeadBase<ts.TemplateHead> { /** @inheritdoc **/ getParent(): NodeParentType<ts.TemplateHead>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.TemplateHead>>;}
declare const TemplateMiddleBase: Constructor<LiteralLikeNode> & typeof Node;
export declare class TemplateMiddle extends TemplateMiddleBase<ts.TemplateMiddle> { /** @inheritdoc **/ getParent(): NodeParentType<ts.TemplateMiddle>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.TemplateMiddle>>;}
declare const TemplateSpanBase: Constructor<ExpressionedNode> & typeof Node;
export declare class TemplateSpan extends TemplateSpanBase<ts.TemplateSpan> { /** Gets the template literal. */ getLiteral(): TemplateMiddle | TemplateTail; /** @inheritdoc **/ getParent(): NodeParentType<ts.TemplateSpan>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.TemplateSpan>>;}
declare const TemplateTailBase: Constructor<LiteralLikeNode> & typeof Node;
export declare class TemplateTail extends TemplateTailBase<ts.TemplateTail> { /** @inheritdoc **/ getParent(): NodeParentType<ts.TemplateTail>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.TemplateTail>>;}
declare const ExportAssignmentBase: Constructor<ExpressionedNode> & Constructor<JSDocableNode> & typeof Statement;
export declare class ExportAssignment extends ExportAssignmentBase<ts.ExportAssignment> { /** * Gets if this is an export equals assignment. * * If this is false, then it's `export default`. */ isExportEquals(): boolean; /** * Sets if this is an export equals assignment or export default. * @param value - Whether it should be an export equals assignment. */ setIsExportEquals(value: boolean): this; /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<ExportAssignmentStructure>): this; /** Gets the structure equivalent to this node. */ getStructure(): ExportAssignmentStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.ExportAssignment>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ExportAssignment>>;}
declare const ExportDeclarationBase: typeof Statement;
export declare class ExportDeclaration extends ExportDeclarationBase<ts.ExportDeclaration> { /** Gets if this export declaration is type only. */ isTypeOnly(): boolean; /** Sets if this export declaration is type only. */ setIsTypeOnly(value: boolean): this; /** Gets the namespace export or returns undefined if it doesn't exist. (ex. `* as ns`, but not `*`). */ getNamespaceExport(): NamespaceExport | undefined; /** Gets the namespace export or throws if it doesn't exist. (ex. `* as ns`, but not `*`) */ getNamespaceExportOrThrow(message?: string | (() => string)): NamespaceExport; /** Sets the namespace export name. */ setNamespaceExport(name: string): this; /** * Sets the import specifier. * @param text - Text to set as the module specifier. */ setModuleSpecifier(text: string): this; /** * Sets the import specifier. * @param sourceFile - Source file to set the module specifier from. */ setModuleSpecifier(sourceFile: SourceFile): this; /** Gets the module specifier or undefined if it doesn't exist. */ getModuleSpecifier(): StringLiteral | undefined; /** Gets the module specifier value or undefined if it doesn't exist. */ getModuleSpecifierValue(): string | undefined; /** Gets the source file referenced in the module specifier or throws if it can't find it or it doesn't exist. */ getModuleSpecifierSourceFileOrThrow(message?: string | (() => string)): SourceFile; /** Gets the source file referenced in the module specifier. */ getModuleSpecifierSourceFile(): SourceFile | undefined; /** Gets if the module specifier starts with `./` or `../`. */ isModuleSpecifierRelative(): boolean; /** Removes the module specifier. */ removeModuleSpecifier(): this; /** Gets if the module specifier exists */ hasModuleSpecifier(): boolean; /** Gets if this export declaration is a namespace export. */ isNamespaceExport(): boolean; /** Gets if the export declaration has named exports. */ hasNamedExports(): boolean; /** * Adds a named export. * @param namedExport - Structure, name, or writer function to write the named export. */ addNamedExport(namedExport: OptionalKind<ExportSpecifierStructure> | string | WriterFunction): ExportSpecifier; /** * Adds named exports. * @param namedExports - Structures, names, or writer function to write the named exports. */ addNamedExports(namedExports: ReadonlyArray<OptionalKind<ExportSpecifierStructure> | string | WriterFunction> | WriterFunction): ExportSpecifier[]; /** * Inserts a named export. * @param index - Child index to insert at. * @param namedExport - Structure, name, or writer function to write the named export. */ insertNamedExport(index: number, namedExport: OptionalKind<ExportSpecifierStructure> | string | WriterFunction): ExportSpecifier; /** * Inserts named exports into the export declaration. * @param index - Child index to insert at. * @param namedExports - Structures, names, or writer funciton to write the named exports. */ insertNamedExports(index: number, namedExports: ReadonlyArray<OptionalKind<ExportSpecifierStructure> | string | WriterFunction> | WriterFunction): ExportSpecifier[]; /** Gets the named exports. */ getNamedExports(): ExportSpecifier[]; /** Changes the export declaration to namespace export. Removes all the named exports. */ toNamespaceExport(): this; /** Sets the import attributes. */ setAttributes(elements: ReadonlyArray<OptionalKind<ImportAttributeStructure>> | undefined): this; /** Gets the import attributes or returns undefined if it doesn't exist. */ getAttributes(): ImportAttributes | undefined; /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<ExportDeclarationStructure>): this; /** Gets the structure equivalent to this node. */ getStructure(): ExportDeclarationStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.ExportDeclaration>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ExportDeclaration>>;}
declare const ExportSpecifierBase: typeof Node;
export declare class ExportSpecifier extends ExportSpecifierBase<ts.ExportSpecifier> { /** Sets the name of what's being exported. */ setName(name: string): this; /** Gets the name of the export specifier. */ getName(): string; /** Gets the name node of what's being exported. */ getNameNode(): Identifier; /** * Sets the alias for the name being exported and renames all the usages. * @param alias - Alias to set. */ renameAlias(alias: string): this; /** * Sets the alias without renaming all the usages. * @param alias - Alias to set. */ setAlias(alias: string): this; /** * Removes the alias without renaming. * @remarks Use removeAliasWithRename() if you want it to rename any usages to the name of the export specifier. */ removeAlias(): this; /** Removes the alias and renames any usages to the name of the export specifier. */ removeAliasWithRename(): this; /** Gets the alias identifier, if it exists. */ getAliasNode(): Identifier | undefined; /** Gets if this is a type only import specifier. */ isTypeOnly(): boolean; /** Sets if this is a type only import specifier. */ setIsTypeOnly(value: boolean): this; /** Gets the export declaration associated with this export specifier. */ getExportDeclaration(): ExportDeclaration; /** Gets the local target symbol of the export specifier or throws if it doesn't exist. */ getLocalTargetSymbolOrThrow(message?: string | (() => string)): Symbol; /** Gets the local target symbol of the export specifier or undefined if it doesn't exist. */ getLocalTargetSymbol(): Symbol | undefined; /** Gets all the declarations referenced by the export specifier. */ getLocalTargetDeclarations(): LocalTargetDeclarations[]; /** Removes the export specifier. */ remove(): void; /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<ExportSpecifierStructure>): this; /** Gets the structure equivalent to this node. */ getStructure(): ExportSpecifierStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.ExportSpecifier>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ExportSpecifier>>;}
declare const ExternalModuleReferenceBase: Constructor<ExpressionableNode> & typeof Node;
export declare class ExternalModuleReference extends ExternalModuleReferenceBase<ts.ExternalModuleReference> { /** Gets the source file referenced or throws if it can't find it. */ getReferencedSourceFileOrThrow(message?: string | (() => string)): SourceFile; /** Gets if the external module reference is relative. */ isRelative(): boolean; /** Gets the source file referenced or returns undefined if it can't find it. */ getReferencedSourceFile(): SourceFile | undefined; /** @inheritdoc **/ getParent(): NodeParentType<ts.ExternalModuleReference>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ExternalModuleReference>>;}
declare const ImportAttributeBase: Constructor<ImportAttributeNamedNode> & typeof Node;
export declare class ImportAttribute extends ImportAttributeBase<ts.ImportAttribute> { /** Gets the value of the assert entry. */ getValue(): Expression; /** Sets the name and value. */ set(structure: Partial<ImportAttributeStructure>): this; /** Gets the structure equivalent to this node. */ getStructure(): ImportAttributeStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.ImportAttribute>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ImportAttribute>>;}
declare const ImportAttributesBase: typeof Node;
export declare class ImportAttributes extends ImportAttributesBase<ts.ImportAttributes> { /** Sets the elements in the import attributes */ setElements(elements: ReadonlyArray<OptionalKind<ImportAttributeStructure>>): this; /** Gets the elements of the import attributes. */ getElements(): ImportAttribute[]; /** Removes the assert clause. */ remove(): void; /** @inheritdoc **/ getParent(): NodeParentType<ts.ImportAttributes>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ImportAttributes>>;}
declare const ImportClauseBase: typeof Node;
export declare class ImportClause extends ImportClauseBase<ts.ImportClause> { /** Gets if this import clause is type only. */ isTypeOnly(): boolean; /** Sets if this import declaration is type only. */ setIsTypeOnly(value: boolean): this; /** Gets the default import or throws if it doesn't exit. */ getDefaultImportOrThrow(message?: string | (() => string)): Identifier; /** Gets the default import or returns undefined if it doesn't exist. */ getDefaultImport(): Identifier | undefined; /** Gets the named bindings of the import clause or throws if it doesn't exist. */ getNamedBindingsOrThrow(message?: string | (() => string)): NamespaceImport | NamedImports; /** Gets the named bindings of the import clause or returns undefined if it doesn't exist. */ getNamedBindings(): NamespaceImport | NamedImports | undefined; /** Gets the namespace import if it exists or throws. */ getNamespaceImportOrThrow(message?: string | (() => string)): Identifier; /** Gets the namespace import identifier, if it exists. */ getNamespaceImport(): Identifier | undefined; /** Gets the namespace import identifier, if it exists. */ getNamedImports(): ImportSpecifier[]; /** @inheritdoc **/ getParent(): NodeParentType<ts.ImportClause>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ImportClause>>;}
declare const ImportDeclarationBase: typeof Statement;
export declare class ImportDeclaration extends ImportDeclarationBase<ts.ImportDeclaration> { /** Gets if this import declaration is type only. */ isTypeOnly(): boolean; /** Sets if this import declaration is type only. */ setIsTypeOnly(value: boolean): this; /** * Sets the import specifier. * @param text - Text to set as the module specifier. */ setModuleSpecifier(text: string): this; /** * Sets the import specifier. * @param sourceFile - Source file to set the module specifier from. */ setModuleSpecifier(sourceFile: SourceFile): this; /** Gets the module specifier. */ getModuleSpecifier(): StringLiteral; /** Gets the module specifier string literal value. */ getModuleSpecifierValue(): string; /** Gets the source file referenced in the module specifier or throws if it can't find it. */ getModuleSpecifierSourceFileOrThrow(message?: string | (() => string)): SourceFile; /** Gets the source file referenced in the module specifier or returns undefined if it can't find it. */ getModuleSpecifierSourceFile(): SourceFile | undefined; /** Gets if the module specifier starts with `./` or `../`. */ isModuleSpecifierRelative(): boolean; /** * Sets the default import. * @param text - Text to set as the default import. * @remarks Use renameDefaultImport to rename. */ setDefaultImport(text: string): this; /** * Renames or sets the provided default import. * @param text - Text to set or rename the default import with. */ renameDefaultImport(text: string): this; /** Gets the default import or throws if it doesn't exit. */ getDefaultImportOrThrow(message?: string | (() => string)): Identifier; /** Gets the default import or returns undefined if it doesn't exist. */ getDefaultImport(): Identifier | undefined; /** * Sets the namespace import. * @param text - Text to set as the namespace import. * @throws - InvalidOperationError if a named import exists. */ setNamespaceImport(text: string): this; /** Removes the namespace import. */ removeNamespaceImport(): this; /** Removes the default import. */ removeDefaultImport(): this; /** Gets the namespace import if it exists or throws. */ getNamespaceImportOrThrow(message?: string | (() => string)): Identifier; /** Gets the namespace import identifier, if it exists. */ getNamespaceImport(): Identifier | undefined; /** * Adds a named import. * @param namedImport - Name, structure, or writer to write the named import with. */ addNamedImport(namedImport: OptionalKind<ImportSpecifierStructure> | string | WriterFunction): ImportSpecifier; /** * Adds named imports. * @param namedImport - Structures, names, or writer function to write the named import with. */ addNamedImports(namedImports: ReadonlyArray<OptionalKind<ImportSpecifierStructure> | string | WriterFunction> | WriterFunction): ImportSpecifier[]; /** * Inserts a named import. * @param index - Child index to insert at. * @param namedImport - Structure, name, or writer function to write the named import with. */ insertNamedImport(index: number, namedImport: OptionalKind<ImportSpecifierStructure> | string | WriterFunction): ImportSpecifier; /** * Inserts named imports into the import declaration. * @param index - Child index to insert at. * @param namedImports - Structures, names, or writer function to write the named import with. */ insertNamedImports(index: number, namedImports: ReadonlyArray<OptionalKind<ImportSpecifierStructure> | string | WriterFunction> | WriterFunction): ImportSpecifier[]; /** Gets the named imports. */ getNamedImports(): ImportSpecifier[]; /** * Removes all the named imports. * @remarks To remove a single named import, get the named import and call `#remove()` on it. */ removeNamedImports(): this; /** Gets the import clause or throws if it doesn't exist. */ getImportClauseOrThrow(message?: string | (() => string)): ImportClause; /** Gets the import clause or returns undefined if it doesn't exist. */ getImportClause(): ImportClause | undefined; /** Sets the import attributes. */ setAttributes(elements: ReadonlyArray<OptionalKind<ImportAttributeStructure>> | undefined): this; /** Gets the import attributes or returns undefined if it doesn't exist. */ getAttributes(): ImportAttributes | undefined; /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<ImportDeclarationStructure>): this; /** Gets the structure equivalent to this node. */ getStructure(): ImportDeclarationStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.ImportDeclaration>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ImportDeclaration>>;}
declare const ImportEqualsDeclarationBase: Constructor<ExportableNode> & Constructor<ModifierableNode> & Constructor<JSDocableNode> & Constructor<NamedNode> & typeof Statement;
export declare class ImportEqualsDeclaration extends ImportEqualsDeclarationBase<ts.ImportEqualsDeclaration> { /** Gets if this import equals declaration is type only. */ isTypeOnly(): boolean; /** Sets if this import equals declaration is type only. */ setIsTypeOnly(value: boolean): this; /** Gets the module reference of the import equals declaration. */ getModuleReference(): ModuleReference; /** Gets if the external module reference is relative. */ isExternalModuleReferenceRelative(): boolean; /** * Sets the external module reference. * @param externalModuleReference - External module reference as a string. */ setExternalModuleReference(externalModuleReference: string): this; /** * Sets the external module reference. * @param sourceFile - Source file to set the external module reference to. */ setExternalModuleReference(sourceFile: SourceFile): this; /** Gets the source file referenced in the external module reference or throws if it doesn't exist. */ getExternalModuleReferenceSourceFileOrThrow(message?: string | (() => string)): SourceFile; /** Gets the source file referenced in the external module reference or returns undefined if it doesn't exist. */ getExternalModuleReferenceSourceFile(): SourceFile | undefined; /** @inheritdoc **/ getParent(): NodeParentType<ts.ImportEqualsDeclaration>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ImportEqualsDeclaration>>;}
declare const ImportSpecifierBase: typeof Node;
export declare class ImportSpecifier extends ImportSpecifierBase<ts.ImportSpecifier> { /** * Sets the identifier being imported. * @param name - Name being imported. */ setName(name: string): this; /** Gets the name of the import specifier. */ getName(): string; /** Gets the name node of what's being imported. */ getNameNode(): Identifier; /** * Sets the alias for the name being imported and renames all the usages. * @param alias - Alias to set. */ renameAlias(alias: string): this; /** * Sets the alias without renaming all the usages. * @param alias - Alias to set. */ setAlias(alias: string): this; /** * Removes the alias without renaming. * @remarks Use removeAliasWithRename() if you want it to rename any usages to the name of the import specifier. */ removeAlias(): this; /** Removes the alias and renames any usages to the name of the import specifier. */ removeAliasWithRename(): this; /** Gets the alias identifier, if it exists. */ getAliasNode(): Identifier | undefined; /** Gets if this is a type only import specifier. */ isTypeOnly(): boolean; /** Sets if this is a type only import specifier. */ setIsTypeOnly(value: boolean): this; /** Gets the import declaration associated with this import specifier. */ getImportDeclaration(): ImportDeclaration; /** Remove the import specifier. */ remove(): void; /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<ImportSpecifierStructure>): this; /** Gets the structure equivalent to this node. */ getStructure(): ImportSpecifierStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.ImportSpecifier>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ImportSpecifier>>;}
declare const ModuleBlockBase: Constructor<StatementedNode> & typeof Statement;
export declare class ModuleBlock extends ModuleBlockBase<ts.ModuleBlock> { /** @inheritdoc **/ getParent(): NodeParentType<ts.ModuleBlock>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ModuleBlock>>;}
export declare function ModuleChildableNode<T extends Constructor<ModuleChildableNodeExtensionType>>(Base: T): Constructor<ModuleChildableNode> & T;
export interface ModuleChildableNode { /** Gets the parent module declaration or undefined if it doesn't exist. */ getParentModule(): ModuleDeclaration | undefined; /** Gets the parent module declaration or throws if it doesn't exist. */ getParentModuleOrThrow(message?: string | (() => string)): ModuleDeclaration;}
type ModuleChildableNodeExtensionType = Node;declare const ModuleDeclarationBase: Constructor<ModuledNode> & Constructor<UnwrappableNode> & Constructor<TextInsertableNode> & Constructor<BodyableNode> & Constructor<ModuleChildableNode> & Constructor<StatementedNode> & Constructor<JSDocableNode> & Constructor<AmbientableNode> & Constructor<ExportableNode> & Constructor<ModifierableNode> & Constructor<ModuleNamedNode> & typeof Statement;
export declare class ModuleDeclaration extends ModuleDeclarationBase<ts.ModuleDeclaration> { /** Gets the full name of the namespace. */ getName(): string; /** * Sets the name without renaming references. * @param newName - New full namespace name. */ setName(newName: string): this; /** * Renames the module name. * * Note: The TS compiler does not update module declarations for string literal module names unfortunately. * @param newName - New name. * @param options - Options for renaming. */ rename(newName: string, options?: RenameOptions): this; /** Gets the name nodes or the string literal. */ getNameNodes(): Identifier[] | StringLiteral; /** Gets if this namespace has a namespace keyword. */ hasNamespaceKeyword(): boolean; /** Gets if this namespace has a namespace keyword. */ hasModuleKeyword(): boolean; /** * Sets the namespace declaration kind. * @param kind - Kind to set. */ setDeclarationKind(kind: ModuleDeclarationKind): this; /** Gets the namesapce declaration kind. */ getDeclarationKind(): ModuleDeclarationKind; /** Gets the namespace or module keyword or returns undefined if it's global. */ getDeclarationKindKeyword(): Node<ts.Node> | undefined; /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<ModuleDeclarationStructure>): this; /** Gets the structure equivalent to this node. */ getStructure(): ModuleDeclarationStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.ModuleDeclaration>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ModuleDeclaration>>;}
export declare enum ModuleDeclarationKind { Namespace = "namespace", Module = "module", Global = "global"}
declare const NamedExportsBase: typeof Node;
export declare class NamedExports extends NamedExportsBase<ts.NamedExports> { /** Gets the export specifiers. */ getElements(): ExportSpecifier[]; /** @inheritdoc **/ getParent(): NodeParentType<ts.NamedExports>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.NamedExports>>;}
declare const NamedImportsBase: typeof Node;
export declare class NamedImports extends NamedImportsBase<ts.NamedImports> { /** Gets the import specifiers. */ getElements(): ImportSpecifier[]; /** @inheritdoc **/ getParent(): NodeParentType<ts.NamedImports>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.NamedImports>>;}
declare const NamespaceExportBase: Constructor<RenameableNode> & typeof Node;
export declare class NamespaceExport extends NamespaceExportBase<ts.NamespaceExport> { /** Sets the name of the namespace export. */ setName(name: string): this; /** Gets the name of the namespace export. */ getName(): string; /** Gets the namespace export's name node. */ getNameNode(): Identifier; /** @inheritdoc **/ getParent(): NodeParentType<ts.NamespaceExport>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.NamespaceExport>>;}
declare const NamespaceImportBase: Constructor<RenameableNode> & typeof Node;
export declare class NamespaceImport extends NamespaceImportBase<ts.NamespaceImport> { /** Sets the name of the namespace import. */ setName(name: string): this; /** Gets the name of the namespace import. */ getName(): string; /** Gets the namespace import's name node. */ getNameNode(): Identifier; /** @inheritdoc **/ getParent(): NodeParentType<ts.NamespaceImport>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.NamespaceImport>>;}
export declare class FileReference extends TextRange<ts.FileReference> { constructor(compilerObject: ts.FileReference, sourceFile: SourceFile); /** Gets the referenced file name. */ getFileName(): string;}
/** Result of refreshing a source file from the file system. */export declare enum FileSystemRefreshResult { /** The source file did not change. */ NoChange = 0, /** The source file was updated from the file system. */ Updated = 1, /** The source file was deleted. */ Deleted = 2}
export interface SourceFileCopyOptions { overwrite?: boolean;}
export interface SourceFileMoveOptions { overwrite?: boolean;}
/** Options for emitting a source file. */export interface SourceFileEmitOptions extends EmitOptionsBase {}
declare const SourceFileBase: Constructor<ModuledNode> & Constructor<StatementedNode> & Constructor<TextInsertableNode> & typeof Node;
export declare class SourceFile extends SourceFileBase<ts.SourceFile> { #private; private constructor(); /** Gets the file path. */ getFilePath(): StandardizedFilePath; /** Gets the file path's base name. */ getBaseName(): string; /** Gets the file path's base name without the extension. */ getBaseNameWithoutExtension(): string; /** Gets the file path's extension. */ getExtension(): string; /** Gets the directory that the source file is contained in. */ getDirectory(): Directory; /** Gets the directory path that the source file is contained in. */ getDirectoryPath(): StandardizedFilePath; /** Gets the full text with leading trivia. */ getFullText(): string; /** * Gets the line and column number at the provided position (1-indexed). * @param pos - Position in the source file. */ getLineAndColumnAtPos(pos: number): { line: number; column: number; }; /** * Gets the character count from the start of the line to the provided position. * @param pos - Position. */ getLengthFromLineStartAtPos(pos: number): number; /** * Copies this source file to the specified directory. * * This will modify the module specifiers in the new file, if necessary. * @param dirPathOrDirectory Directory path or directory object to copy the file to. * @param options Options for copying. * @returns The source file the copy was made to. */ copyToDirectory(dirPathOrDirectory: string | Directory, options?: SourceFileCopyOptions): SourceFile; /** * Copy this source file to a new file. * * This will modify the module specifiers in the new file, if necessary. * @param filePath - New file path. Can be relative to the original file or an absolute path. * @param options - Options for copying. */ copy(filePath: string, options?: SourceFileCopyOptions): SourceFile; /** * Copy this source file to a new file and immediately saves it to the file system asynchronously. * * This will modify the module specifiers in the new file, if necessary. * @param filePath - New file path. Can be relative to the original file or an absolute path. * @param options - Options for copying. */ copyImmediately(filePath: string, options?: SourceFileCopyOptions): Promise<SourceFile>; /** * Copy this source file to a new file and immediately saves it to the file system synchronously. * * This will modify the module specifiers in the new file, if necessary. * @param filePath - New file path. Can be relative to the original file or an absolute path. * @param options - Options for copying. */ copyImmediatelySync(filePath: string, options?: SourceFileCopyOptions): SourceFile; /** * Moves this source file to the specified directory. * * This will modify the module specifiers in other files that specify this file and the module specifiers in the current file, if necessary. * @param dirPathOrDirectory Directory path or directory object to move the file to. * @param options Options for moving. */ moveToDirectory(dirPathOrDirectory: string | Directory, options?: SourceFileMoveOptions): SourceFile; /** * Moves this source file to a new file. * * This will modify the module specifiers in other files that specify this file and the module specifiers in the current file, if necessary. * @param filePath - New file path. Can be relative to the original file or an absolute path. * @param options - Options for moving. */ move(filePath: string, options?: SourceFileMoveOptions): SourceFile; /** * Moves this source file to a new file and asynchronously updates the file system immediately. * * This will modify the module specifiers in other files that specify this file and the module specifiers in the current file, if necessary. * @param filePath - New file path. Can be relative to the original file or an absolute path. * @param options - Options for moving. */ moveImmediately(filePath: string, options?: SourceFileMoveOptions): Promise<SourceFile>; /** * Moves this source file to a new file and synchronously updates the file system immediately. * * This will modify the module specifiers in other files that specify this file and the module specifiers in the current file, if necessary. * @param filePath - New file path. Can be relative to the original file or an absolute path. * @param options - Options for moving. */ moveImmediatelySync(filePath: string, options?: SourceFileMoveOptions): SourceFile; /** * Queues a deletion of the file to the file system. * * The file will be deleted when you call ast.save(). If you wish to immediately delete the file, then use deleteImmediately(). */ delete(): void; /** Asynchronously deletes the file from the file system. */ deleteImmediately(): Promise<void>; /** Synchronously deletes the file from the file system. */ deleteImmediatelySync(): void; /** Asynchronously saves this file with any changes. */ save(): Promise<void>; /** Synchronously saves this file with any changes. */ saveSync(): void; /** Gets any `/// <reference path="..." />` comments. */ getPathReferenceDirectives(): FileReference[]; /** Gets any `/// <reference types="..." />` comments. */ getTypeReferenceDirectives(): FileReference[]; /** Gets any `/// <reference lib="..." />` comments. */ getLibReferenceDirectives(): FileReference[]; /** Gets any source files that reference this source file. */ getReferencingSourceFiles(): SourceFile[]; /** Gets the import and exports in other source files that reference this source file. */ getReferencingNodesInOtherSourceFiles(): SourceFileReferencingNodes[]; /** Gets the string literals in other source files that reference this source file. */ getReferencingLiteralsInOtherSourceFiles(): StringLiteral[]; /** Gets the source files this source file references in string literals. */ getReferencedSourceFiles(): SourceFile[]; /** Gets the nodes that reference other source files in string literals. */ getNodesReferencingOtherSourceFiles(): SourceFileReferencingNodes[]; /** * Gets the string literals in this source file that references other source files. * @remarks This is similar to `getImportStringLiterals()`, but `getImportStringLiterals()` * will return import string literals that may not be referencing another source file * or have not been able to be resolved. */ getLiteralsReferencingOtherSourceFiles(): StringLiteral[]; /** Gets all the descendant string literals that reference a module. */ getImportStringLiterals(): StringLiteral[]; /** Gets the script target of the source file. */ getLanguageVersion(): ScriptTarget; /** Gets the language variant of the source file. */ getLanguageVariant(): LanguageVariant; /** Gets the script kind of the source file. */ getScriptKind(): ScriptKind; /** Gets if this is a declaration file. */ isDeclarationFile(): boolean; /** Gets if the source file was discovered while loading an external library. */ isFromExternalLibrary(): boolean; /** Gets if the source file is a descendant of a node_modules directory. */ isInNodeModules(): boolean; /** Gets if this source file has been saved or if the latest changes have been saved. */ isSaved(): boolean; /** Gets the pre-emit diagnostics of the specified source file. */ getPreEmitDiagnostics(): Diagnostic[]; /** * Deindents the line at the specified position. * @param pos - Position. * @param times - Times to unindent. Specify a negative value to indent. */ unindent(pos: number, times?: number): this; /** * Deindents the lines within the specified range. * @param positionRange - Position range. * @param times - Times to unindent. Specify a negative value to indent. */ unindent(positionRange: [number, number], times?: number): this; /** * Indents the line at the specified position. * @param pos - Position. * @param times - Times to indent. Specify a negative value to unindent. */ indent(pos: number, times?: number): this; /** * Indents the lines within the specified range. * @param positionRange - Position range. * @param times - Times to indent. Specify a negative value to unindent. */ indent(positionRange: [number, number], times?: number): this; /** Asynchronously emits the source file as a JavaScript file. */ emit(options?: SourceFileEmitOptions): Promise<EmitResult>; /** Synchronously emits the source file as a JavaScript file. */ emitSync(options?: SourceFileEmitOptions): EmitResult; /** * Gets the emit output of this source file. * @param options - Emit options. */ getEmitOutput(options?: { emitOnlyDtsFiles?: boolean; }): EmitOutput; /** * Formats the source file text using the internal TypeScript formatting API. * @param settings - Format code settings. */ formatText(settings?: FormatCodeSettings): void; /** * Refresh the source file from the file system. * * WARNING: When updating from the file system, this will "forget" any previously navigated nodes. * @returns What action ended up taking place. */ refreshFromFileSystem(): Promise<FileSystemRefreshResult>; /** * Synchronously refreshes the source file from the file system. * * WARNING: When updating from the file system, this will "forget" any previously navigated nodes. * @returns What action ended up taking place. */ refreshFromFileSystemSync(): FileSystemRefreshResult; /** * Gets the relative path to the specified path. * @param fileOrDirPath - The file or directory path. */ getRelativePathTo(fileOrDirPath: string): string; /** * Gets the relative path to another source file. * @param sourceFile - Source file. */ getRelativePathTo(sourceFile: SourceFile): string; /** * Gets the relative path to another directory. * @param directory - Directory. */ getRelativePathTo(directory: Directory): string; /** * Gets the relative path to the specified file path as a module specifier. * @param filePath - File path. * @remarks To get to a directory, provide `path/to/directory/index.ts`. */ getRelativePathAsModuleSpecifierTo(filePath: string): string; /** * Gets the relative path to the specified source file as a module specifier. * @param sourceFile - Source file. */ getRelativePathAsModuleSpecifierTo(sourceFile: SourceFile): string; /** * Gets the relative path to the specified directory as a module specifier. * @param directory - Directory. */ getRelativePathAsModuleSpecifierTo(directory: Directory): string; /** * Subscribe to when the source file is modified. * @param subscription - Subscription. * @param subscribe - Optional and defaults to true. Use an explicit false to unsubscribe. */ onModified(subscription: (sender: SourceFile) => void, subscribe?: boolean): this; /** * Organizes the imports in the file. * * WARNING! This will forget all the nodes in the file! It's best to do this after you're all done with the file. * @param formatSettings - Format code settings. * @param userPreferences - User preferences for refactoring. */ organizeImports(formatSettings?: FormatCodeSettings, userPreferences?: UserPreferences): this; /** * Removes all unused declarations like interfaces, classes, enums, functions, variables, parameters, * methods, properties, imports, etc. from this file. * * Tip: For optimal results, sometimes this method needs to be called more than once. There could be nodes * that are only referenced in unused declarations and in this case, another call will also remove them. * * WARNING! This will forget all the nodes in the file! It's best to do this after you're all done with the file. * @param formatSettings - Format code settings. * @param userPreferences - User preferences for refactoring. */ fixUnusedIdentifiers(formatSettings?: FormatCodeSettings, userPreferences?: UserPreferences): this; /** * Code fix to add import declarations for identifiers that are referenced, but not imported in the source file. * @param formatSettings - Format code settings. * @param userPreferences - User preferences for refactoring. */ fixMissingImports(formatSettings?: FormatCodeSettings, userPreferences?: UserPreferences): this; /** * Applies the text changes to the source file. * * WARNING! This will forget all the nodes in the file! It's best to do this after you're all done with the file. * @param textChanges - Text changes. */ applyTextChanges(textChanges: ReadonlyArray<ts.TextChange | TextChange>): this; /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<SourceFileStructure>): this; /** Gets the structure equivalent to this node. */ getStructure(): SourceFileStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.SourceFile>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.SourceFile>>;}
declare function CommonIdentifierBase<T extends Constructor<CommonIdentifierBaseExtensionType>>(Base: T): Constructor<CommonIdentifierBase> & T;
interface CommonIdentifierBase { /** Gets the text for the identifier. */ getText(): string; /** * Gets the definition nodes of the identifier. * @remarks This is similar to "go to definition" and `.getDefinitions()`, but only returns the nodes. */ getDefinitionNodes(): Node[]; /** * Gets the definitions of the identifier. * @remarks This is similar to "go to definition." Use `.getDefinitionNodes()` if you only care about the nodes. */ getDefinitions(): DefinitionInfo[];}
type CommonIdentifierBaseExtensionType = Node<ts.Node & { text: string; }>;declare const ComputedPropertyNameBase: Constructor<ExpressionedNode> & typeof Node;
export declare class ComputedPropertyName extends ComputedPropertyNameBase<ts.ComputedPropertyName> { /** @inheritdoc **/ getParent(): NodeParentType<ts.ComputedPropertyName>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ComputedPropertyName>>;}
declare const IdentifierBase: Constructor<CommonIdentifierBase> & Constructor<ReferenceFindableNode> & Constructor<RenameableNode> & typeof PrimaryExpression;
export declare class Identifier extends IdentifierBase<ts.Identifier> { /** * Gets the implementations of the identifier. * * This is similar to "go to implementation." */ getImplementations(): ImplementationLocation[]; /** @inheritdoc **/ getParent(): NodeParentType<ts.Identifier>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.Identifier>>;}
declare const PrivateIdentifierBase: Constructor<CommonIdentifierBase> & Constructor<ReferenceFindableNode> & Constructor<RenameableNode> & typeof Node;
export declare class PrivateIdentifier extends PrivateIdentifierBase<ts.PrivateIdentifier> { /** @inheritdoc **/ getParent(): NodeParentType<ts.PrivateIdentifier>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.PrivateIdentifier>>;}
export declare class QualifiedName extends Node<ts.QualifiedName> { /** Gets the left side of the qualified name. */ getLeft(): EntityName; /** Gets the right identifier of the qualified name. */ getRight(): Identifier; /** @inheritdoc **/ getParent(): NodeParentType<ts.QualifiedName>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.QualifiedName>>;}
declare const BlockBase: Constructor<TextInsertableNode> & Constructor<StatementedNode> & typeof Statement;
export declare class Block extends BlockBase<ts.Block> { /** @inheritdoc **/ getParent(): NodeParentType<ts.Block>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.Block>>;}
export declare class BreakStatement extends Statement<ts.BreakStatement> { /** Gets this break statement's label or undefined if it does not exist. */ getLabel(): Identifier | undefined; /** Gets this break statement's label or throw if it does not exist. */ getLabelOrThrow(message?: string | (() => string)): Identifier; /** @inheritdoc **/ getParent(): NodeParentType<ts.BreakStatement>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.BreakStatement>>;}
declare const CaseBlockBase: Constructor<TextInsertableNode> & typeof Node;
export declare class CaseBlock extends CaseBlockBase<ts.CaseBlock> { /** Gets the clauses. */ getClauses(): CaseOrDefaultClause[]; /** * Removes the clause at the specified index. * @param index - Index. */ removeClause(index: number): this; /** * Removes the clauses in the specified range. * @param indexRange - Index range. */ removeClauses(indexRange: [number, number]): this; /** @inheritdoc **/ getParent(): NodeParentType<ts.CaseBlock>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.CaseBlock>>;}
declare const CaseClauseBase: Constructor<JSDocableNode> & Constructor<ExpressionedNode> & Constructor<TextInsertableNode> & Constructor<StatementedNode> & typeof Node;
export declare class CaseClause extends CaseClauseBase<ts.CaseClause> { /** Removes this case clause. */ remove(): void; /** @inheritdoc **/ getParent(): NodeParentType<ts.CaseClause>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.CaseClause>>;}
declare const CatchClauseBase: typeof Node;
export declare class CatchClause extends CatchClauseBase<ts.CatchClause> { /** Gets this catch clause's block. */ getBlock(): Block; /** Gets this catch clause's variable declaration or undefined if none exists. */ getVariableDeclaration(): VariableDeclaration | undefined; /** Gets this catch clause's variable declaration or throws if none exists. */ getVariableDeclarationOrThrow(message?: string | (() => string)): VariableDeclaration; /** @inheritdoc **/ getParent(): NodeParentType<ts.CatchClause>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.CatchClause>>;}
export declare class CommentStatement extends Statement<CompilerCommentStatement> {}
export declare class ContinueStatement extends Statement<ts.ContinueStatement> { /** Gets this continue statement's label or undefined if it does not exist. */ getLabel(): Identifier | undefined; /** Gets this continue statement's label or throw if it does not exist. */ getLabelOrThrow(message?: string | (() => string)): Identifier; /** @inheritdoc **/ getParent(): NodeParentType<ts.ContinueStatement>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ContinueStatement>>;}
declare const DebuggerStatementBase: typeof Statement;
export declare class DebuggerStatement extends DebuggerStatementBase<ts.DebuggerStatement> { /** @inheritdoc **/ getParent(): NodeParentType<ts.DebuggerStatement>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.DebuggerStatement>>;}
declare const DefaultClauseBase: Constructor<TextInsertableNode> & Constructor<StatementedNode> & typeof Node;
export declare class DefaultClause extends DefaultClauseBase<ts.DefaultClause> { /** Removes the default clause. */ remove(): void; /** @inheritdoc **/ getParent(): NodeParentType<ts.DefaultClause>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.DefaultClause>>;}
declare const DoStatementBase: Constructor<ExpressionedNode> & typeof IterationStatement;
export declare class DoStatement extends DoStatementBase<ts.DoStatement> { /** @inheritdoc **/ getParent(): NodeParentType<ts.DoStatement>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.DoStatement>>;}
declare const EmptyStatementBase: typeof Statement;
export declare class EmptyStatement extends EmptyStatementBase<ts.EmptyStatement> { /** @inheritdoc **/ getParent(): NodeParentType<ts.EmptyStatement>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.EmptyStatement>>;}
declare const ExpressionStatementBase: Constructor<ExpressionedNode> & Constructor<JSDocableNode> & typeof Statement;
export declare class ExpressionStatement extends ExpressionStatementBase<ts.ExpressionStatement> { /** @inheritdoc **/ getParent(): NodeParentType<ts.ExpressionStatement>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ExpressionStatement>>;}
declare const ForInStatementBase: Constructor<ExpressionedNode> & typeof IterationStatement;
export declare class ForInStatement extends ForInStatementBase<ts.ForInStatement> { /** Gets this for in statement's initializer. */ getInitializer(): VariableDeclarationList | Expression; /** @inheritdoc **/ getParent(): NodeParentType<ts.ForInStatement>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ForInStatement>>;}
declare const ForOfStatementBase: Constructor<ExpressionedNode> & Constructor<AwaitableNode> & typeof IterationStatement;
export declare class ForOfStatement extends ForOfStatementBase<ts.ForOfStatement> { /** Gets this for of statement's initializer. */ getInitializer(): VariableDeclarationList | Expression; /** @inheritdoc **/ getParent(): NodeParentType<ts.ForOfStatement>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ForOfStatement>>;}
declare const ForStatementBase: typeof IterationStatement;
export declare class ForStatement extends ForStatementBase<ts.ForStatement> { /** Gets this for statement's initializer or undefined if none exists. */ getInitializer(): VariableDeclarationList | Expression | undefined; /** Gets this for statement's initializer or throws if none exists. */ getInitializerOrThrow(message?: string | (() => string)): Expression<ts.Expression> | VariableDeclarationList; /** Gets this for statement's condition or undefined if none exists. */ getCondition(): Expression | undefined; /** Gets this for statement's condition or throws if none exists. */ getConditionOrThrow(message?: string | (() => string)): Expression<ts.Expression>; /** Gets this for statement's incrementor. */ getIncrementor(): Expression | undefined; /** Gets this for statement's incrementor or throws if none exists. */ getIncrementorOrThrow(message?: string | (() => string)): Expression<ts.Expression>; /** @inheritdoc **/ getParent(): NodeParentType<ts.ForStatement>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ForStatement>>;}
declare const IfStatementBase: Constructor<ExpressionedNode> & typeof Statement;
export declare class IfStatement extends IfStatementBase<ts.IfStatement> { /** Gets this if statement's then statement. */ getThenStatement(): Statement; /** Gets this if statement's else statement. */ getElseStatement(): Statement | undefined; /** @inheritdoc */ remove(): void; /** @inheritdoc **/ getParent(): NodeParentType<ts.IfStatement>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.IfStatement>>;}
export declare class IterationStatement<T extends ts.IterationStatement = ts.IterationStatement> extends Statement<T> { /** Gets this iteration statement's statement. */ getStatement(): Statement;}
declare const LabeledStatementBase: Constructor<JSDocableNode> & typeof Statement;
export declare class LabeledStatement extends LabeledStatementBase<ts.LabeledStatement> { /** Gets this labeled statement's label */ getLabel(): Identifier; /** Gets this labeled statement's statement */ getStatement(): Statement; /** @inheritdoc **/ getParent(): NodeParentType<ts.LabeledStatement>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.LabeledStatement>>;}
declare const NotEmittedStatementBase: typeof Statement;
export declare class NotEmittedStatement extends NotEmittedStatementBase<ts.NotEmittedStatement> { /** @inheritdoc **/ getParent(): NodeParentType<ts.NotEmittedStatement>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.NotEmittedStatement>>;}
declare const ReturnStatementBase: Constructor<ExpressionableNode> & typeof Statement;
export declare class ReturnStatement extends ReturnStatementBase<ts.ReturnStatement> { /** @inheritdoc **/ getParent(): NodeParentType<ts.ReturnStatement>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ReturnStatement>>;}
declare const StatementBase: Constructor<ChildOrderableNode> & typeof Node;
export declare class Statement<T extends ts.Statement = ts.Statement> extends StatementBase<T> { /** Removes the statement. */ remove(): void;}
export declare function StatementedNode<T extends Constructor<StatementedNodeExtensionType>>(Base: T): Constructor<StatementedNode> & T;
export interface StatementedNode { /** Gets the node's statements. */ getStatements(): Statement[]; /** Gets the node's statements with comment statements. */ getStatementsWithComments(): Statement[]; /** * Gets the first statement that matches the provided condition or returns undefined if it doesn't exist. * @param findFunction - Function to find the statement by. */ getStatement<T extends Statement>(findFunction: (statement: Statement) => statement is T): T | undefined; /** * Gets the first statement that matches the provided condition or returns undefined if it doesn't exist. * @param findFunction - Function to find the statement by. */ getStatement(findFunction: (statement: Statement) => boolean): Statement | undefined; /** * Gets the first statement that matches the provided condition or throws if it doesn't exist. * @param findFunction - Function to find the statement by. */ getStatementOrThrow<T extends Statement>(findFunction: (statement: Statement) => statement is T): T; /** * Gets the first statement that matches the provided condition or throws if it doesn't exist. * @param findFunction - Function to find the statement by. */ getStatementOrThrow(findFunction: (statement: Statement) => boolean): Statement; /** * Gets the first statement that matches the provided syntax kind or returns undefined if it doesn't exist. * @param kind - Syntax kind to find the node by. */ getStatementByKind<TKind extends SyntaxKind>(kind: TKind): KindToNodeMappingsWithCommentStatements[TKind] | undefined; /** * Gets the first statement that matches the provided syntax kind or throws if it doesn't exist. * @param kind - Syntax kind to find the node by. */ getStatementByKindOrThrow<TKind extends SyntaxKind>(kind: TKind): KindToNodeMappingsWithCommentStatements[TKind]; /** * Add statements. * @param statements - statements to add. * @returns The statements that were added. */ addStatements(statements: string | WriterFunction | ReadonlyArray<string | WriterFunction | StatementStructures>): Statement[]; /** * Inserts statements at the specified index. * @param index - Child index to insert at. * @param statements - Statements to insert. * @returns The statements that were inserted. */ insertStatements(index: number, statements: string | WriterFunction | ReadonlyArray<string | WriterFunction | StatementStructures>): Statement[]; /** * Removes the statement at the specified index. * @param index - Child index to remove the statement at. */ removeStatement(index: number): this; /** * Removes the statements at the specified index range. * @param indexRange - The start and end inclusive index range to remove. */ removeStatements(indexRange: [number, number]): this; /** * Adds an class declaration as a child. * @param structure - Structure of the class declaration to add. */ addClass(structure: OptionalKind<ClassDeclarationStructure>): ClassDeclaration; /** * Adds class declarations as a child. * @param structures - Structures of the class declarations to add. */ addClasses(structures: ReadonlyArray<OptionalKind<ClassDeclarationStructure>>): ClassDeclaration[]; /** * Inserts an class declaration as a child. * @param index - Child index to insert at. * @param structure - Structure of the class declaration to insert. */ insertClass(index: number, structure: OptionalKind<ClassDeclarationStructure>): ClassDeclaration; /** * Inserts class declarations as a child. * @param index - Child index to insert at. * @param structures - Structures of the class declarations to insert. */ insertClasses(index: number, structures: ReadonlyArray<OptionalKind<ClassDeclarationStructure>>): ClassDeclaration[]; /** Gets the direct class declaration children. */ getClasses(): ClassDeclaration[]; /** * Gets a class. * @param name - Name of the class. */ getClass(name: string): ClassDeclaration | undefined; /** * Gets a class. * @param findFunction - Function to use to find the class. */ getClass(findFunction: (declaration: ClassDeclaration) => boolean): ClassDeclaration | undefined; /** * Gets a class or throws if it doesn't exist. * @param name - Name of the class. */ getClassOrThrow(name: string): ClassDeclaration; /** * Gets a class or throws if it doesn't exist. * @param findFunction - Function to use to find the class. */ getClassOrThrow(findFunction: (declaration: ClassDeclaration) => boolean): ClassDeclaration; /** * Adds an enum declaration as a child. * @param structure - Structure of the enum declaration to add. */ addEnum(structure: OptionalKind<EnumDeclarationStructure>): EnumDeclaration; /** * Adds enum declarations as a child. * @param structures - Structures of the enum declarations to add. */ addEnums(structures: ReadonlyArray<OptionalKind<EnumDeclarationStructure>>): EnumDeclaration[]; /** * Inserts an enum declaration as a child. * @param index - Child index to insert at. * @param structure - Structure of the enum declaration to insert. */ insertEnum(index: number, structure: OptionalKind<EnumDeclarationStructure>): EnumDeclaration; /** * Inserts enum declarations as a child. * @param index - Child index to insert at. * @param structures - Structures of the enum declarations to insert. */ insertEnums(index: number, structures: ReadonlyArray<OptionalKind<EnumDeclarationStructure>>): EnumDeclaration[]; /** Gets the direct enum declaration children. */ getEnums(): EnumDeclaration[]; /** * Gets an enum. * @param name - Name of the enum. */ getEnum(name: string): EnumDeclaration | undefined; /** * Gets an enum. * @param findFunction - Function to use to find the enum. */ getEnum(findFunction: (declaration: EnumDeclaration) => boolean): EnumDeclaration | undefined; /** * Gets an enum or throws if it doesn't exist. * @param name - Name of the enum. */ getEnumOrThrow(name: string): EnumDeclaration; /** * Gets an enum or throws if it doesn't exist. * @param findFunction - Function to use to find the enum. */ getEnumOrThrow(findFunction: (declaration: EnumDeclaration) => boolean): EnumDeclaration; /** * Adds a function declaration as a child. * @param structure - Structure of the function declaration to add. */ addFunction(structure: OptionalKind<FunctionDeclarationStructure>): FunctionDeclaration; /** * Adds function declarations as a child. * @param structures - Structures of the function declarations to add. */ addFunctions(structures: ReadonlyArray<OptionalKind<FunctionDeclarationStructure>>): FunctionDeclaration[]; /** * Inserts an function declaration as a child. * @param index - Child index to insert at. * @param structure - Structure of the function declaration to insert. */ insertFunction(index: number, structure: OptionalKind<FunctionDeclarationStructure>): FunctionDeclaration; /** * Inserts function declarations as a child. * @param index - Child index to insert at. * @param structures - Structures of the function declarations to insert. */ insertFunctions(index: number, structures: ReadonlyArray<OptionalKind<FunctionDeclarationStructure>>): FunctionDeclaration[]; /** Gets the direct function declaration children. */ getFunctions(): FunctionDeclaration[]; /** * Gets a function. * @param name - Name of the function. */ getFunction(name: string): FunctionDeclaration | undefined; /** * Gets a function. * @param findFunction - Function to use to find the function. */ getFunction(findFunction: (declaration: FunctionDeclaration) => boolean): FunctionDeclaration | undefined; /** * Gets a function or throws if it doesn't exist. * @param name - Name of the function. */ getFunctionOrThrow(name: string): FunctionDeclaration; /** * Gets a function or throws if it doesn't exist. * @param findFunction - Function to use to find the function. */ getFunctionOrThrow(findFunction: (declaration: FunctionDeclaration) => boolean): FunctionDeclaration; /** * Adds a interface declaration as a child. * @param structure - Structure of the interface declaration to add. */ addInterface(structure: OptionalKind<InterfaceDeclarationStructure>): InterfaceDeclaration; /** * Adds interface declarations as a child. * @param structures - Structures of the interface declarations to add. */ addInterfaces(structures: ReadonlyArray<OptionalKind<InterfaceDeclarationStructure>>): InterfaceDeclaration[]; /** * Inserts an interface declaration as a child. * @param index - Child index to insert at. * @param structure - Structure of the interface declaration to insert. */ insertInterface(index: number, structure: OptionalKind<InterfaceDeclarationStructure>): InterfaceDeclaration; /** * Inserts interface declarations as a child. * @param index - Child index to insert at. * @param structures - Structures of the interface declarations to insert. */ insertInterfaces(index: number, structures: ReadonlyArray<OptionalKind<InterfaceDeclarationStructure>>): InterfaceDeclaration[]; /** Gets the direct interface declaration children. */ getInterfaces(): InterfaceDeclaration[]; /** * Gets an interface. * @param name - Name of the interface. */ getInterface(name: string): InterfaceDeclaration | undefined; /** * Gets an interface. * @param findFunction - Function to use to find the interface. */ getInterface(findFunction: (declaration: InterfaceDeclaration) => boolean): InterfaceDeclaration | undefined; /** * Gets an interface or throws if it doesn't exist. * @param name - Name of the interface. */ getInterfaceOrThrow(name: string): InterfaceDeclaration; /** * Gets an interface or throws if it doesn't exist. * @param findFunction - Function to use to find the interface. */ getInterfaceOrThrow(findFunction: (declaration: InterfaceDeclaration) => boolean): InterfaceDeclaration; /** * Adds a module declaration as a child. * @param structure - Structure of the namespace declaration to add. */ addModule(structure: OptionalKind<ModuleDeclarationStructure>): ModuleDeclaration; /** * Adds module declarations as a child. * @param structures - Structures of the namespace declarations to add. */ addModules(structures: ReadonlyArray<OptionalKind<ModuleDeclarationStructure>>): ModuleDeclaration[]; /** * Inserts a module declaration as a child. * @param index - Child index to insert at. * @param structure - Structure of the namespace declaration to insert. */ insertModule(index: number, structure: OptionalKind<ModuleDeclarationStructure>): ModuleDeclaration; /** * Inserts module declarations as children. * @param index - Child index to insert at. * @param structures - Structures of the namespace declarations to insert. */ insertModules(index: number, structures: ReadonlyArray<OptionalKind<ModuleDeclarationStructure>>): ModuleDeclaration[]; /** Gets the module declaration children. */ getModules(): ModuleDeclaration[]; /** * Gets a module declaration child by name. * @param name - Name of the namespace. */ getModule(name: string): ModuleDeclaration | undefined; /** * Gets a module declaration child by condition. * @param findFunction - Function to use to find the namespace. */ getModule(findFunction: (declaration: ModuleDeclaration) => boolean): ModuleDeclaration | undefined; /** * Gets a module declaration child by name or throws if it doesn't exist. * @param name - Name of the namespace. */ getModuleOrThrow(name: string): ModuleDeclaration; /** * Gets a module declaration child by condition or throws if it doesn't exist. * @param findFunction - Function to use to find the namespace. */ getModuleOrThrow(findFunction: (declaration: ModuleDeclaration) => boolean): ModuleDeclaration; /** * Adds a type alias declaration as a child. * @param structure - Structure of the type alias declaration to add. */ addTypeAlias(structure: OptionalKind<TypeAliasDeclarationStructure>): TypeAliasDeclaration; /** * Adds type alias declarations as a child. * @param structures - Structures of the type alias declarations to add. */ addTypeAliases(structures: ReadonlyArray<OptionalKind<TypeAliasDeclarationStructure>>): TypeAliasDeclaration[]; /** * Inserts an type alias declaration as a child. * @param index - Child index to insert at. * @param structure - Structure of the type alias declaration to insert. */ insertTypeAlias(index: number, structure: OptionalKind<TypeAliasDeclarationStructure>): TypeAliasDeclaration; /** * Inserts type alias declarations as a child. * @param index - Child index to insert at. * @param structures - Structures of the type alias declarations to insert. */ insertTypeAliases(index: number, structures: ReadonlyArray<OptionalKind<TypeAliasDeclarationStructure>>): TypeAliasDeclaration[]; /** Gets the direct type alias declaration children. */ getTypeAliases(): TypeAliasDeclaration[]; /** * Gets a type alias. * @param name - Name of the type alias. */ getTypeAlias(name: string): TypeAliasDeclaration | undefined; /** * Gets a type alias. * @param findFunction - Function to use to find the type alias. */ getTypeAlias(findFunction: (declaration: TypeAliasDeclaration) => boolean): TypeAliasDeclaration | undefined; /** * Gets a type alias or throws if it doesn't exist. * @param name - Name of the type alias. */ getTypeAliasOrThrow(name: string): TypeAliasDeclaration; /** * Gets a type alias or throws if it doesn't exist. * @param findFunction - Function to use to find the type alias. */ getTypeAliasOrThrow(findFunction: (declaration: TypeAliasDeclaration) => boolean): TypeAliasDeclaration; /** * Adds a variable statement. * @param structure - Structure of the variable statement. */ addVariableStatement(structure: OptionalKind<VariableStatementStructure>): VariableStatement; /** * Adds variable statements. * @param structures - Structures of the variable statements. */ addVariableStatements(structures: ReadonlyArray<OptionalKind<VariableStatementStructure>>): VariableStatement[]; /** * Inserts a variable statement. * @param structure - Structure of the variable statement. */ insertVariableStatement(index: number, structure: OptionalKind<VariableStatementStructure>): VariableStatement; /** * Inserts variable statements. * @param structures - Structures of the variable statements. */ insertVariableStatements(index: number, structures: ReadonlyArray<OptionalKind<VariableStatementStructure>>): VariableStatement[]; /** Gets the direct variable statement children. */ getVariableStatements(): VariableStatement[]; /** * Gets a variable statement. * @param name - Name of one of the variable statement's declarations. */ getVariableStatement(name: string): VariableStatement | undefined; /** * Gets a variable statement. * @param findFunction - Function to use to find the variable statement. */ getVariableStatement(findFunction: (declaration: VariableStatement) => boolean): VariableStatement | undefined; /** * Gets a variable statement or throws if it doesn't exist. * @param name - Name of one of the variable statement's declarations. */ getVariableStatementOrThrow(name: string): VariableStatement; /** * Gets a variable statement or throws if it doesn't exist. * @param findFunction - Function to use to find the variable statement. */ getVariableStatementOrThrow(findFunction: (declaration: VariableStatement) => boolean): VariableStatement; /** * Gets all the variable declarations within the variable statement children. * @remarks This does not return the variable declarations within for statements or for of statements. */ getVariableDeclarations(): VariableDeclaration[]; /** * Gets a variable declaration. * @param name - Name of the variable declaration. */ getVariableDeclaration(name: string): VariableDeclaration | undefined; /** * Gets a variable declaration. * @param findFunction - Function to use to find the variable declaration. */ getVariableDeclaration(findFunction: (declaration: VariableDeclaration) => boolean): VariableDeclaration | undefined; /** * Gets a variable declaration or throws if it doesn't exist. * @param name - Name of the variable declaration. */ getVariableDeclarationOrThrow(name: string): VariableDeclaration; /** * Gets a variable declaration or throws if it doesn't exist. * @param findFunction - Function to use to find the variable declaration. */ getVariableDeclarationOrThrow(findFunction: (declaration: VariableDeclaration) => boolean): VariableDeclaration;}
type StatementedNodeExtensionType = Node<ts.SourceFile | ts.FunctionDeclaration | ts.ModuleDeclaration | ts.FunctionLikeDeclaration | ts.CaseClause | ts.DefaultClause | ts.ModuleBlock>;
export interface KindToNodeMappingsWithCommentStatements extends ImplementedKindToNodeMappings { [kind: number]: Node; [SyntaxKind.SingleLineCommentTrivia]: CommentStatement; [SyntaxKind.MultiLineCommentTrivia]: CommentStatement;}
declare const SwitchStatementBase: Constructor<ExpressionedNode> & typeof Statement;
export declare class SwitchStatement extends SwitchStatementBase<ts.SwitchStatement> { /** Gets this switch statement's case block. */ getCaseBlock(): CaseBlock; /** Gets the switch statement's case block's clauses. */ getClauses(): CaseOrDefaultClause[]; /** * Removes the specified clause based on the provided index. * @param index - Index. */ removeClause(index: number): CaseBlock; /** * Removes the specified clauses based on the provided index range. * @param indexRange - Index range. */ removeClauses(indexRange: [number, number]): CaseBlock; /** @inheritdoc **/ getParent(): NodeParentType<ts.SwitchStatement>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.SwitchStatement>>;}
declare const ThrowStatementBase: Constructor<ExpressionedNode> & typeof Statement;
export declare class ThrowStatement extends ThrowStatementBase<ts.ThrowStatement> { /** @inheritdoc **/ getParent(): NodeParentType<ts.ThrowStatement>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ThrowStatement>>;}
declare const TryStatementBase: typeof Statement;
export declare class TryStatement extends TryStatementBase<ts.TryStatement> { /** Gets this try statement's try block. */ getTryBlock(): Block; /** Gets this try statement's catch clause or undefined if none exists. */ getCatchClause(): CatchClause | undefined; /** Gets this try statement's catch clause or throws if none exists. */ getCatchClauseOrThrow(message?: string | (() => string)): CatchClause; /** Gets this try statement's finally block or undefined if none exists. */ getFinallyBlock(): Block | undefined; /** Gets this try statement's finally block or throws if none exists. */ getFinallyBlockOrThrow(message?: string | (() => string)): Block; /** @inheritdoc **/ getParent(): NodeParentType<ts.TryStatement>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.TryStatement>>;}
declare const VariableStatementBase: Constructor<ModuleChildableNode> & Constructor<JSDocableNode> & Constructor<AmbientableNode> & Constructor<ExportableNode> & Constructor<ModifierableNode> & typeof Statement;
export declare class VariableStatement extends VariableStatementBase<ts.VariableStatement> { /** Get variable declaration list. */ getDeclarationList(): VariableDeclarationList; /** Get the variable declarations. */ getDeclarations(): VariableDeclaration[]; /** Gets the variable declaration kind. */ getDeclarationKind(): VariableDeclarationKind; /** Gets the variable declaration kind keywords. */ getDeclarationKindKeywords(): Node<ts.Node>[]; /** * Sets the variable declaration kind. * @param type - Type to set. */ setDeclarationKind(type: VariableDeclarationKind): VariableDeclarationList; /** * Add a variable declaration to the statement. * @param structure - Structure representing the variable declaration to add. */ addDeclaration(structure: OptionalKind<VariableDeclarationStructure>): VariableDeclaration; /** * Adds variable declarations to the statement. * @param structures - Structures representing the variable declarations to add. */ addDeclarations(structures: ReadonlyArray<OptionalKind<VariableDeclarationStructure>>): VariableDeclaration[]; /** * Inserts a variable declaration at the specified index within the statement. * @param index - Child index to insert at. * @param structure - Structure representing the variable declaration to insert. */ insertDeclaration(index: number, structure: OptionalKind<VariableDeclarationStructure>): VariableDeclaration; /** * Inserts variable declarations at the specified index within the statement. * @param index - Child index to insert at. * @param structures - Structures representing the variable declarations to insert. */ insertDeclarations(index: number, structures: ReadonlyArray<OptionalKind<VariableDeclarationStructure>>): VariableDeclaration[]; /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<VariableStatementStructure>): this; /** Gets the structure equivalent to this node. */ getStructure(): VariableStatementStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.VariableStatement>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.VariableStatement>>;}
declare const WhileStatementBase: Constructor<ExpressionedNode> & typeof IterationStatement;
export declare class WhileStatement extends WhileStatementBase<ts.WhileStatement> { /** @inheritdoc **/ getParent(): NodeParentType<ts.WhileStatement>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.WhileStatement>>;}
declare const WithStatementBase: Constructor<ExpressionedNode> & typeof Statement;
export declare class WithStatement extends WithStatementBase<ts.WithStatement> { /** Gets this with statement's statement. */ getStatement(): Statement; /** @inheritdoc **/ getParent(): NodeParentType<ts.WithStatement>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.WithStatement>>;}
export declare class ArrayTypeNode extends TypeNode<ts.ArrayTypeNode> { /** Gets the array type node's element type node. */ getElementTypeNode(): TypeNode; /** @inheritdoc **/ getParent(): NodeParentType<ts.ArrayTypeNode>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ArrayTypeNode>>;}
export declare class ConditionalTypeNode extends TypeNode<ts.ConditionalTypeNode> { /** * Gets the conditional type node's check type. * * Ex. In `CheckType extends ExtendsType ? TrueType : FalseType` returns `CheckType`. */ getCheckType(): TypeNode<ts.TypeNode>; /** * Gets the conditional type node's extends type. * * Ex. In `CheckType extends ExtendsType ? TrueType : FalseType` returns `ExtendsType`. */ getExtendsType(): TypeNode<ts.TypeNode>; /** * Gets the conditional type node's true type. * * Ex. In `CheckType extends ExtendsType ? TrueType : FalseType` returns `TrueType`. */ getTrueType(): TypeNode<ts.TypeNode>; /** * Gets the conditional type node's false type. * * Ex. In `CheckType extends ExtendsType ? TrueType : FalseType` returns `FalseType`. */ getFalseType(): TypeNode<ts.TypeNode>; /** @inheritdoc **/ getParent(): NodeParentType<ts.ConditionalTypeNode>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ConditionalTypeNode>>;}
declare const ConstructorTypeNodeBase: Constructor<AbstractableNode> & Constructor<ModifierableNode> & typeof FunctionOrConstructorTypeNodeBase;
export declare class ConstructorTypeNode extends ConstructorTypeNodeBase<ts.ConstructorTypeNode> { /** @inheritdoc **/ getParent(): NodeParentType<ts.ConstructorTypeNode>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ConstructorTypeNode>>;}
declare const ExpressionWithTypeArgumentsBase: Constructor<LeftHandSideExpressionedNode> & typeof NodeWithTypeArguments;
export declare class ExpressionWithTypeArguments extends ExpressionWithTypeArgumentsBase<ts.ExpressionWithTypeArguments> { /** @inheritdoc **/ getParent(): NodeParentType<ts.ExpressionWithTypeArguments>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ExpressionWithTypeArguments>>;}
declare const FunctionOrConstructorTypeNodeBaseBase: Constructor<SignaturedDeclaration> & typeof TypeNode;
export declare class FunctionOrConstructorTypeNodeBase<T extends ts.FunctionOrConstructorTypeNode = ts.FunctionOrConstructorTypeNode> extends FunctionOrConstructorTypeNodeBaseBase<T> {}
declare const FunctionTypeNodeBase: Constructor<TypeParameteredNode> & typeof FunctionOrConstructorTypeNodeBase;
export declare class FunctionTypeNode extends FunctionTypeNodeBase<ts.FunctionTypeNode> { /** @inheritdoc **/ getParent(): NodeParentType<ts.FunctionTypeNode>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.FunctionTypeNode>>;}
export declare class ImportTypeNode extends NodeWithTypeArguments<ts.ImportTypeNode> { /** * Sets the argument text. * @param text - Text of the argument. */ setArgument(text: string): this; /** Gets the argument passed into the import type. */ getArgument(): TypeNode; /** * Sets the qualifier text. * @param text - Text. */ setQualifier(text: string): this; /** Gets the qualifier of the import type if it exists or throws */ getQualifierOrThrow(message?: string | (() => string)): EntityName; /** Gets the qualifier of the import type if it exists or returns undefined. */ getQualifier(): EntityName | undefined; /** Gets the import attributes container if it exists. */ getAttributes(): ImportAttributes | undefined; /** Gets the import attributes container if it exists or throws. */ getAttributesOrThrow(message?: string | (() => string)): ImportAttributes; /** @inheritdoc **/ getParent(): NodeParentType<ts.ImportTypeNode>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ImportTypeNode>>;}
export declare class IndexedAccessTypeNode extends TypeNode<ts.IndexedAccessTypeNode> { /** * Gets the indexed access type node's object type node. * * This is `MyObjectType` in `MyObjectType["myIndex"]`. */ getObjectTypeNode(): TypeNode; /** * Gets the indexed access type node's index type node. * * This is `"myIndex"` in `MyObjectType["myIndex"]`. */ getIndexTypeNode(): TypeNode; /** @inheritdoc **/ getParent(): NodeParentType<ts.IndexedAccessTypeNode>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.IndexedAccessTypeNode>>;}
export declare class InferTypeNode extends TypeNode<ts.InferTypeNode> { /** * Gets the infer type node's type parameter. * * Ex. In `infer R` returns `R`. */ getTypeParameter(): TypeParameterDeclaration; /** @inheritdoc **/ getParent(): NodeParentType<ts.InferTypeNode>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.InferTypeNode>>;}
export declare class IntersectionTypeNode extends TypeNode<ts.IntersectionTypeNode> { /** Gets the intersection type nodes. */ getTypeNodes(): TypeNode[]; /** @inheritdoc **/ getParent(): NodeParentType<ts.IntersectionTypeNode>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.IntersectionTypeNode>>;}
export declare class LiteralTypeNode extends TypeNode<ts.LiteralTypeNode> { /** Gets the literal type node's literal. */ getLiteral(): NullLiteral | BooleanLiteral | LiteralExpression | PrefixUnaryExpression; /** @inheritdoc **/ getParent(): NodeParentType<ts.LiteralTypeNode>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.LiteralTypeNode>>;}
export declare class MappedTypeNode extends TypeNode<ts.MappedTypeNode> { /** Gets the mapped type node's name type node if any. */ getNameTypeNode(): TypeNode | undefined; /** Gets the mapped type node's name type node or throws if it doesn't exist. */ getNameTypeNodeOrThrow(message?: string | (() => string)): TypeNode; /** Gets the mapped type's readonly token. */ getReadonlyToken(): Node<ts.ReadonlyKeyword> | Node<ts.PlusToken> | Node<ts.MinusToken> | undefined; /** Gets the mapped type's readonly token or throws if not exist. */ getReadonlyTokenOrThrow(message?: string | (() => string)): Node<ts.ReadonlyKeyword> | Node<ts.PlusToken> | Node<ts.MinusToken>; /** Gets the mapped type's question token. */ getQuestionToken(): Node<ts.QuestionToken> | Node<ts.PlusToken> | Node<ts.MinusToken> | undefined; /** Gets the mapped type's question token or throws if not exist. */ getQuestionTokenOrThrow(message?: string | (() => string)): Node<ts.QuestionToken> | Node<ts.PlusToken> | Node<ts.MinusToken>; /** Gets the mapped type node's type parameter. */ getTypeParameter(): TypeParameterDeclaration; /** Gets the mapped type node's type node if it exists or returns undefined when not. */ getTypeNode(): TypeNode | undefined; /** Gets the mapped type node's type node if it exists or throws when undefined. */ getTypeNodeOrThrow(message?: string | (() => string)): TypeNode; /** @inheritdoc **/ getParent(): NodeParentType<ts.MappedTypeNode>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.MappedTypeNode>>;}
declare const NamedTupleMemberBase: Constructor<TypedNode> & Constructor<QuestionTokenableNode> & Constructor<DotDotDotTokenableNode> & Constructor<JSDocableNode> & Constructor<NamedNode> & typeof TypeNode;
/** * A named/labeled tuple element. * * Ex. `start: number` in `type Range = [start: number, end: number]` */export declare class NamedTupleMember extends NamedTupleMemberBase<ts.NamedTupleMember> { /** Gets the named tuple type's type. */ getTypeNode(): TypeNode<ts.TypeNode>; /** Throws. This is not supported for NamedTupleMember. */ removeType(): never; /** @inheritdoc **/ getParent(): NodeParentType<ts.NamedTupleMember>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.NamedTupleMember>>;}
export declare class ParenthesizedTypeNode extends TypeNode<ts.ParenthesizedTypeNode> { /** Gets the node within the parentheses. */ getTypeNode(): TypeNode; /** * Sets the type within the parentheses. * @param textOrWriterFunction - Text or writer function to set the type with. */ setType(textOrWriterFunction: string | WriterFunction): this; /** @inheritdoc **/ getParent(): NodeParentType<ts.ParenthesizedTypeNode>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ParenthesizedTypeNode>>;}
export declare class RestTypeNode extends TypeNode<ts.RestTypeNode> { /** Gets the rest type node's inner type. */ getTypeNode(): TypeNode<ts.TypeNode>; /** @inheritdoc **/ getParent(): NodeParentType<ts.RestTypeNode>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.RestTypeNode>>;}
export declare class TemplateLiteralTypeNode extends TypeNode<ts.TemplateLiteralTypeNode> { /** Gets the template head. */ getHead(): TemplateHead; /** Gets the template spans. */ getTemplateSpans(): TypeNode<ts.TypeNode>[]; /** * Sets the literal value. * * Note: This could possibly replace the node if you remove all the tagged templates. * @param value - Value to set. * @returns The new node if the kind changed; the current node otherwise. */ setLiteralValue(value: string): Node<ts.Node>; /** @inheritdoc **/ getParent(): NodeParentType<ts.TemplateLiteralTypeNode>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.TemplateLiteralTypeNode>>;}
export declare class ThisTypeNode extends TypeNode<ts.ThisTypeNode> { /** @inheritdoc **/ getParent(): NodeParentType<ts.ThisTypeNode>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.ThisTypeNode>>;}
export declare class TupleTypeNode extends TypeNode<ts.TupleTypeNode> { /** Gets the tuple element type nodes. */ getElements(): (TypeNode<ts.TypeNode> | NamedTupleMember)[]; /** @inheritdoc **/ getParent(): NodeParentType<ts.TupleTypeNode>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.TupleTypeNode>>;}
declare const TypeAliasDeclarationBase: Constructor<TypeParameteredNode> & Constructor<TypedNode> & Constructor<JSDocableNode> & Constructor<AmbientableNode> & Constructor<ExportableNode> & Constructor<ModifierableNode> & Constructor<NamedNode> & typeof Statement;
export declare class TypeAliasDeclaration extends TypeAliasDeclarationBase<ts.TypeAliasDeclaration> { /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<TypeAliasDeclarationStructure>): this; /** Gets the structure equivalent to this node. */ getStructure(): TypeAliasDeclarationStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.TypeAliasDeclaration>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.TypeAliasDeclaration>>;}
declare const TypeLiteralNodeBase: Constructor<TypeElementMemberedNode> & typeof TypeNode;
export declare class TypeLiteralNode extends TypeLiteralNodeBase<ts.TypeLiteralNode> { /** @inheritdoc **/ getParent(): NodeParentType<ts.TypeLiteralNode>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.TypeLiteralNode>>;}
export declare class TypeNode<T extends ts.TypeNode = ts.TypeNode> extends Node<T> {}
declare const NodeWithTypeArgumentsBase: Constructor<TypeArgumentedNode> & typeof TypeNode;
export declare class NodeWithTypeArguments<T extends ts.NodeWithTypeArguments = ts.NodeWithTypeArguments> extends NodeWithTypeArgumentsBase<T> {}
export declare class TypeOperatorTypeNode extends TypeNode<ts.TypeOperatorNode> { /** Gets the operator of the type node. */ getOperator(): SyntaxKind.KeyOfKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.UniqueKeyword; /** Gets the node within the type operator. */ getTypeNode(): TypeNode; /** @inheritdoc **/ getParent(): NodeParentType<ts.TypeOperatorNode>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.TypeOperatorNode>>;}
/** Variance of the type parameter. */export declare enum TypeParameterVariance { /** Variance is not specified. */ None = 0, /** Contravariant. */ In = 1, /** Covariant. */ Out = 2, /** Invariant. */ InOut = 3}
declare const TypeParameterDeclarationBase: Constructor<ModifierableNode> & Constructor<NamedNode> & typeof Node;
export declare class TypeParameterDeclaration extends TypeParameterDeclarationBase<ts.TypeParameterDeclaration> { /** Gets if this is a const type parameter. */ isConst(): boolean; /** Sets if this is a const type parameter or not. */ setIsConst(value: boolean): this; /** Gets the constraint of the type parameter. */ getConstraint(): TypeNode | undefined; /** Gets the constraint of the type parameter or throws if it doesn't exist. */ getConstraintOrThrow(message?: string | (() => string)): TypeNode<ts.TypeNode>; /** * Sets the type parameter constraint. * @param text - Text to set as the constraint. */ setConstraint(text: string | WriterFunction): this; /** Removes the constraint type node. */ removeConstraint(): this; /** Gets the default node of the type parameter. */ getDefault(): TypeNode | undefined; /** Gets the default node of the type parameter or throws if it doesn't exist. */ getDefaultOrThrow(message?: string | (() => string)): TypeNode<ts.TypeNode>; /** * Sets the type parameter default type node. * @param text - Text to set as the default type node. */ setDefault(text: string | WriterFunction): this; /** Removes the default type node. */ removeDefault(): this; /** Set the variance of the type parameter. */ setVariance(variance: TypeParameterVariance): this; /** Gets the variance of the type parameter. */ getVariance(): TypeParameterVariance; /** Removes this type parameter. */ remove(): void; /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<TypeParameterDeclarationStructure>): this; /** Gets the structure equivalent to this node. */ getStructure(): TypeParameterDeclarationStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.TypeParameterDeclaration>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.TypeParameterDeclaration>>;}
/** * A type predicate node which says the specified parameter name is a specific type if the function returns true. * * Examples: * * `param is string` in `declare function isString(param: unknown): param is string;`. * * `asserts condition` in `declare function assert(condition: any): asserts condition;`. */export declare class TypePredicateNode extends TypeNode<ts.TypePredicateNode> { /** Gets the parameter name node */ getParameterNameNode(): Identifier | ThisTypeNode; /** Gets if the type predicate has an `asserts` modifier (ex. `asserts condition`). */ hasAssertsModifier(): boolean; /** Gets the asserts modifier if it exists. */ getAssertsModifier(): Node<ts.AssertsKeyword> | undefined; /** Gets the asserts modifier if it exists or throws otherwise. */ getAssertsModifierOrThrow(message?: string | (() => string)): Node<ts.AssertsKeyword>; /** Gets the type name if it exists or returns undefined when it asserts a condition. */ getTypeNode(): TypeNode | undefined; /** Gets the type name if it exists or throws when it asserts a condition. */ getTypeNodeOrThrow(message?: string | (() => string)): TypeNode; /** @inheritdoc **/ getParent(): NodeParentType<ts.TypePredicateNode>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.TypePredicateNode>>;}
export declare class TypeQueryNode extends NodeWithTypeArguments<ts.TypeQueryNode> { /** Gets the expression name. */ getExprName(): EntityName; /** @inheritdoc **/ getParent(): NodeParentType<ts.TypeQueryNode>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.TypeQueryNode>>;}
export declare class TypeReferenceNode extends NodeWithTypeArguments<ts.TypeReferenceNode> { /** Gets the type name. */ getTypeName(): EntityName; /** @inheritdoc **/ getParent(): NodeParentType<ts.TypeReferenceNode>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.TypeReferenceNode>>;}
export declare class UnionTypeNode extends TypeNode<ts.UnionTypeNode> { /** Gets the union type nodes. */ getTypeNodes(): TypeNode[]; /** @inheritdoc **/ getParent(): NodeParentType<ts.UnionTypeNode>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.UnionTypeNode>>;}
declare const VariableDeclarationBase: Constructor<ExportGetableNode> & Constructor<ExclamationTokenableNode> & Constructor<TypedNode> & Constructor<InitializerExpressionableNode> & Constructor<BindingNamedNode> & typeof Node;
export declare class VariableDeclaration extends VariableDeclarationBase<ts.VariableDeclaration> { /** Removes this variable declaration. */ remove(): void; /** Gets the corresponding variable statement if it exists. Throws for variable declarations in for statements. */ getVariableStatementOrThrow(message?: string | (() => string)): VariableStatement; /** Gets the corresponding variable statement if it exists. Returns undefined for variable declarations in for statements. */ getVariableStatement(): VariableStatement | undefined; /** * Sets the node from a structure. * @param structure - Structure to set the node with. */ set(structure: Partial<VariableDeclarationStructure>): this; /** Gets the structure equivalent to this node. */ getStructure(): VariableDeclarationStructure; /** @inheritdoc **/ getParent(): NodeParentType<ts.VariableDeclaration>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.VariableDeclaration>>;}
export declare enum VariableDeclarationKind { Var = "var", Let = "let", Const = "const", AwaitUsing = "await using", Using = "using"}
declare const VariableDeclarationListBase: Constructor<ModifierableNode> & typeof Node;
export declare class VariableDeclarationList extends VariableDeclarationListBase<ts.VariableDeclarationList> { /** Get the variable declarations. */ getDeclarations(): VariableDeclaration[]; /** Gets the variable declaration kind. */ getDeclarationKind(): VariableDeclarationKind; /** Gets the variable declaration kind keywords. */ getDeclarationKindKeywords(): Node[]; /** * Sets the variable declaration kind. * @param type - Type to set. */ setDeclarationKind(type: VariableDeclarationKind): this; /** * Add a variable declaration to the statement. * @param structure - Structure representing the variable declaration to add. */ addDeclaration(structure: OptionalKind<VariableDeclarationStructure>): VariableDeclaration; /** * Adds variable declarations to the statement. * @param structures - Structures representing the variable declarations to add. */ addDeclarations(structures: ReadonlyArray<OptionalKind<VariableDeclarationStructure>>): VariableDeclaration[]; /** * Inserts a variable declaration at the specified index within the statement. * @param index - Child index to insert at. * @param structure - Structure representing the variable declaration to insert. */ insertDeclaration(index: number, structure: OptionalKind<VariableDeclarationStructure>): VariableDeclaration; /** * Inserts variable declarations at the specified index within the statement. * @param index - Child index to insert at. * @param structures - Structures representing the variable declarations to insert. */ insertDeclarations(index: number, structures: ReadonlyArray<OptionalKind<VariableDeclarationStructure>>): VariableDeclaration[]; /** @inheritdoc **/ getParent(): NodeParentType<ts.VariableDeclarationList>; /** @inheritdoc **/ getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.VariableDeclarationList>>;}
export declare class Signature { #private; private constructor(); /** Gets the underlying compiler signature. */ get compilerSignature(): ts.Signature; /** Gets the type parameters. */ getTypeParameters(): TypeParameter[]; /** Gets the parameters. */ getParameters(): Symbol[]; /** Gets the signature return type. */ getReturnType(): Type; /** Get the documentation comments. */ getDocumentationComments(): SymbolDisplayPart[]; /** Gets the JS doc tags. */ getJsDocTags(): JSDocTagInfo[]; /** Gets the signature's declaration. */ getDeclaration(): MethodSignature | MethodDeclaration | ConstructorDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | CallSignatureDeclaration | ConstructSignatureDeclaration | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | FunctionExpression | ArrowFunction | FunctionDeclaration | JSDocFunctionType;}
export declare class Symbol { #private; private constructor(); /** Gets the underlying compiler symbol. */ get compilerSymbol(): ts.Symbol; /** Gets the symbol name. */ getName(): string; /** Gets the escaped name. */ getEscapedName(): string; /** Gets the aliased symbol or throws if it doesn't exist. */ getAliasedSymbolOrThrow(message?: string | (() => string)): Symbol; /** Follows a single alias to get the immediately aliased symbol or returns undefined if it doesn't exist. */ getImmediatelyAliasedSymbol(): Symbol | undefined; /** Follows a single alias to get the immediately aliased symbol or throws if it doesn't exist. */ getImmediatelyAliasedSymbolOrThrow(message?: string | (() => string)): Symbol; /** Gets the aliased symbol or returns undefined if it doesn't exist. */ getAliasedSymbol(): Symbol | undefined; /** * Gets the export symbol of the symbol if its a local symbol with a corresponding export symbol. Otherwise returns the current symbol. * * The following is from the compiler API documentation: * * For example, at `export type T = number;`: * - `getSymbolAtLocation` at the location `T` will return the exported symbol for `T`. * - But the result of `getSymbolsInScope` will contain the *local* symbol for `T`, not the exported symbol. * - Calling `getExportSymbol` on that local symbol will return the exported symbol. */ getExportSymbol(): Symbol; /** Gets if the symbol is an alias. */ isAlias(): boolean; /** Gets if the symbol is optional. */ isOptional(): boolean; /** Gets the symbol flags. */ getFlags(): SymbolFlags; /** * Gets if the symbol has the specified flags. * @param flags - Flags to check if the symbol has. */ hasFlags(flags: SymbolFlags): boolean; /** Gets the value declaration of a symbol or throws if it doesn't exist. */ getValueDeclarationOrThrow(message?: string | (() => string)): Node; /** Gets the value declaration of the symbol or returns undefined if it doesn't exist. */ getValueDeclaration(): Node | undefined; /** Gets the symbol declarations. */ getDeclarations(): Node[]; /** * Gets the export of the symbol by the specified name or throws if not exists. * @param name - Name of the export. */ getExportOrThrow(name: string, message?: string | (() => string)): Symbol; /** * Gets the export of the symbol by the specified name or returns undefined if not exists. * @param name - Name of the export. */ getExport(name: string): Symbol | undefined; /** Gets the exports from the symbol. */ getExports(): Symbol[]; /** * Gets the global export of the symbol by the specified name or throws if not exists. * @param name - Name of the global export. */ getGlobalExportOrThrow(name: string, message?: string | (() => string)): Symbol; /** * Gets the global export of the symbol by the specified name or returns undefined if not exists. * @param name - Name of the global export. */ getGlobalExport(name: string): Symbol | undefined; /** Gets the global exports from the symbol. */ getGlobalExports(): Symbol[]; /** * Gets the member of the symbol by the specified name or throws if not exists. * @param name - Name of the export. */ getMemberOrThrow(name: string, message?: string | (() => string)): Symbol; /** * Gets the member of the symbol by the specified name or returns undefined if not exists. * @param name - Name of the member. */ getMember(name: string): Symbol | undefined; /** Gets the members of the symbol */ getMembers(): Symbol[]; /** Gets the declared type of the symbol. */ getDeclaredType(): Type; /** * Gets the type of the symbol at a location. * @param node - Location to get the type at for this symbol. */ getTypeAtLocation(node: Node): Type<ts.Type>; /** Gets the fully qualified name. */ getFullyQualifiedName(): string; /** Gets the JS doc tag infos of the symbol. */ getJsDocTags(): JSDocTagInfo[];}
export interface FormatCodeSettings extends ts.FormatCodeSettings { ensureNewLineAtEndOfFile?: boolean;}
/** Options for renaming a node. */export interface RenameOptions { /** * Whether comments referencing this node should be renamed. * @remarks False by default. */ renameInComments?: boolean; /** * Whether strings referencing this node should be renamed. * @remarks False by default. */ renameInStrings?: boolean; /** * Whether to enable renaming shorthand property assignments, binding elements, and import & export specifiers without changing behaviour. * @remarks Defaults to the `usePrefixAndSuffixTextForRename` manipulation setting. * This setting is only available when using TypeScript 3.4+. */ usePrefixAndSuffixText?: boolean;}
/** User preferences for refactoring. */export interface UserPreferences extends ts.UserPreferences {}
export declare class LanguageService { #private; private constructor(); /** Gets the compiler language service. */ get compilerObject(): ts.LanguageService; /** Gets the language service's program. */ getProgram(): Program; /** * Gets the definitions for the specified node. * @param node - Node. */ getDefinitions(node: Node): DefinitionInfo[]; /** * Gets the definitions at the specified position. * @param sourceFile - Source file. * @param pos - Position. */ getDefinitionsAtPosition(sourceFile: SourceFile, pos: number): DefinitionInfo[]; /** * Gets the implementations for the specified node. * @param node - Node. */ getImplementations(node: Node): ImplementationLocation[]; /** * Gets the implementations at the specified position. * @param sourceFile - Source file. * @param pos - Position. */ getImplementationsAtPosition(sourceFile: SourceFile, pos: number): ImplementationLocation[]; /** * Finds references based on the specified node. * @param node - Node to find references for. */ findReferences(node: Node): ReferencedSymbol[]; /** * Finds the nodes that reference the definition(s) of the specified node. * @param node - Node. */ findReferencesAsNodes(node: Node): Node<ts.Node>[]; /** * Finds references based on the specified position. * @param sourceFile - Source file. * @param pos - Position to find the reference at. */ findReferencesAtPosition(sourceFile: SourceFile, pos: number): ReferencedSymbol[]; /** * Find the rename locations for the specified node. * @param node - Node to get the rename locations for. * @param options - Options for renaming. */ findRenameLocations(node: Node, options?: RenameOptions): RenameLocation[]; /** * Gets the suggestion diagnostics. * @param filePathOrSourceFile - The source file or file path to get suggestions for. */ getSuggestionDiagnostics(filePathOrSourceFile: SourceFile | string): DiagnosticWithLocation[]; /** * Gets the formatting edits for a range. * @param filePath - File path. * @param range - Position range. * @param formatSettings - Format code settings. */ getFormattingEditsForRange(filePath: string, range: [number, number], formatSettings: FormatCodeSettings): TextChange[]; /** * Gets the formatting edits for a document. * @param filePath - File path of the source file. * @param formatSettings - Format code settings. */ getFormattingEditsForDocument(filePath: string, formatSettings: FormatCodeSettings): TextChange[]; /** * Gets the formatted text for a document. * @param filePath - File path of the source file. * @param formatSettings - Format code settings. */ getFormattedDocumentText(filePath: string, formatSettings: FormatCodeSettings): string; /** * Gets the emit output of a source file. * @param sourceFile - Source file. * @param emitOnlyDtsFiles - Whether to only emit the d.ts files. */ getEmitOutput(sourceFile: SourceFile, emitOnlyDtsFiles?: boolean): EmitOutput; /** * Gets the emit output of a source file. * @param filePath - File path. * @param emitOnlyDtsFiles - Whether to only emit the d.ts files. */ getEmitOutput(filePath: string, emitOnlyDtsFiles?: boolean): EmitOutput; /** * Gets the indentation at the specified position. * @param sourceFile - Source file. * @param position - Position. * @param settings - Editor settings. */ getIdentationAtPosition(sourceFile: SourceFile, position: number, settings?: EditorSettings): number; /** * Gets the indentation at the specified position. * @param filePath - File path. * @param position - Position. * @param settings - Editor settings. */ getIdentationAtPosition(filePath: string, position: number, settings?: EditorSettings): number; /** * Gets the file text changes for organizing the imports in a source file. * * @param sourceFile - Source file. * @param formatSettings - Format code settings. * @param userPreferences - User preferences for refactoring. */ organizeImports(sourceFile: SourceFile, formatSettings?: FormatCodeSettings, userPreferences?: UserPreferences): FileTextChanges[]; /** * Gets the file text changes for organizing the imports in a source file. * * @param filePath - File path of the source file. * @param formatSettings - Format code settings. * @param userPreferences - User preferences for refactoring. */ organizeImports(filePath: string, formatSettings?: FormatCodeSettings, userPreferences?: UserPreferences): FileTextChanges[]; /** * Gets the edit information for applying a refactor at a the provided position in a source file. * @param filePathOrSourceFile - File path or source file to get the edits for. * @param formatSettings - Fomat code settings. * @param positionOrRange - Position in the source file where to apply given refactor. * @param refactorName - Refactor name. * @param actionName - Refactor action name. * @param preferences - User preferences for refactoring. */ getEditsForRefactor(filePathOrSourceFile: string | SourceFile, formatSettings: FormatCodeSettings, positionOrRange: number | { getPos(): number; getEnd(): number; }, refactorName: string, actionName: string, preferences?: UserPreferences): RefactorEditInfo | undefined; /** * Gets file changes and actions to perform for the provided fixId. * @param filePathOrSourceFile - File path or source file to get the combined code fixes for. * @param fixId - Identifier for the code fix (ex. "fixMissingImport"). These ids are found in the `ts.codefix` namespace in the compiler api source. * @param formatSettings - Format code settings. * @param preferences - User preferences for refactoring. */ getCombinedCodeFix(filePathOrSourceFile: string | SourceFile, fixId: {}, formatSettings?: FormatCodeSettings, preferences?: UserPreferences): CombinedCodeActions; /** * Gets the edit information for applying a code fix at the provided text range in a source file. * @param filePathOrSourceFile - File path or source file to get the code fixes for. * @param start - Start position of the text range to be fixed. * @param end - End position of the text range to be fixed. * @param errorCodes - One or more error codes associated with the code fixes to retrieve. * @param formatOptions - Format code settings. * @param preferences - User preferences for refactoring. */ getCodeFixesAtPosition(filePathOrSourceFile: string | SourceFile, start: number, end: number, errorCodes: ReadonlyArray<number>, formatOptions?: FormatCodeSettings, preferences?: UserPreferences): CodeFixAction[];}
/** Options for emitting from a Program. */export interface ProgramEmitOptions extends EmitOptions { writeFile?: ts.WriteFileCallback;}
/** Options for emitting. */export interface EmitOptions extends EmitOptionsBase { /** Optional source file to only emit. */ targetSourceFile?: SourceFile;}
export interface EmitOptionsBase { /** Whether only .d.ts files should be emitted. */ emitOnlyDtsFiles?: boolean; /** Transformers to act on the files when emitting. */ customTransformers?: ts.CustomTransformers;}
/** Wrapper around Program. */export declare class Program { #private; private constructor(); /** Gets the underlying compiler program. */ get compilerObject(): ts.Program; /** Get the program's type checker. */ getTypeChecker(): TypeChecker; /** * Asynchronously emits the TypeScript files as JavaScript files. * @param options - Options for emitting. */ emit(options?: ProgramEmitOptions): Promise<EmitResult>; /** * Synchronously emits the TypeScript files as JavaScript files. * @param options - Options for emitting. * @remarks Use `emit()` as the asynchronous version will be much faster. */ emitSync(options?: ProgramEmitOptions): EmitResult; /** * Emits the TypeScript files to JavaScript files to memory. * @param options - Options for emitting. */ emitToMemory(options?: EmitOptions): MemoryEmitResult; /** * Gets the syntactic diagnostics. * @param sourceFile - Optional source file to filter by. */ getSyntacticDiagnostics(sourceFile?: SourceFile): DiagnosticWithLocation[]; /** * Gets the semantic diagnostics. * @param sourceFile - Optional source file to filter by. */ getSemanticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; /** * Gets the declaration diagnostics. * @param sourceFile - Optional source file to filter by. */ getDeclarationDiagnostics(sourceFile?: SourceFile): DiagnosticWithLocation[]; /** Gets the global diagnostics. */ getGlobalDiagnostics(): Diagnostic[]; /** Gets the diagnostics found when parsing the tsconfig.json file. */ getConfigFileParsingDiagnostics(): Diagnostic[]; /** Gets the emit module resolution kind. */ getEmitModuleResolutionKind(): ModuleResolutionKind; /** * Gets if the provided source file was discovered while loading an external library. * @param sourceFile - Source file. */ isSourceFileFromExternalLibrary(sourceFile: SourceFile): boolean;}
/** Represents a code action. */export declare class CodeAction<TCompilerObject extends ts.CodeAction = ts.CodeAction> { #private; protected constructor(); /** Gets the compiler object. */ get compilerObject(): TCompilerObject; /** Description of the code action. */ getDescription(): string; /** Text changes to apply to each file as part of the code action. */ getChanges(): FileTextChanges[];}
/** Represents a code fix action. */export declare class CodeFixAction extends CodeAction<ts.CodeFixAction> { /** Short name to identify the fix, for use by telemetry. */ getFixName(): string; /** * If present, one may call 'getCombinedCodeFix' with this fixId. * This may be omitted to indicate that the code fix can't be applied in a group. */ getFixId(): {} | undefined; /** Gets the description of the code fix when fixing everything. */ getFixAllDescription(): string | undefined;}
/** * Represents file changes. * * @remarks Commands are currently not implemented. */export declare class CombinedCodeActions { #private; private constructor(); /** Gets the compiler object. */ get compilerObject(): ts.CombinedCodeActions; /** Text changes to apply to each file. */ getChanges(): FileTextChanges[]; /** * Executes the combined code actions. * * WARNING: This will cause all nodes to be forgotten in the changed files. * @options - Options used when applying the changes. */ applyChanges(options?: ApplyFileTextChangesOptions): this;}
/** Definition info. */export declare class DefinitionInfo<TCompilerObject extends ts.DefinitionInfo = ts.DefinitionInfo> extends DocumentSpan<TCompilerObject> { protected constructor(); /** Gets the kind. */ getKind(): ts.ScriptElementKind; /** Gets the name. */ getName(): string; /** Gets the container kind. */ getContainerKind(): ts.ScriptElementKind; /** Gets the container name. */ getContainerName(): string; /** Gets the declaration node. */ getDeclarationNode(): Node | undefined;}
/** Diagnostic. */export declare class Diagnostic<TCompilerObject extends ts.Diagnostic = ts.Diagnostic> { protected constructor(); /** Gets the underlying compiler diagnostic. */ get compilerObject(): TCompilerObject; /** Gets the source file. */ getSourceFile(): SourceFile | undefined; /** Gets the message text. */ getMessageText(): string | DiagnosticMessageChain; /** Gets the line number. */ getLineNumber(): number | undefined; /** Gets the start. */ getStart(): number | undefined; /** Gets the length. */ getLength(): number | undefined; /** Gets the diagnostic category. */ getCategory(): DiagnosticCategory; /** Gets the code of the diagnostic. */ getCode(): number; /** Gets the source. */ getSource(): string | undefined;}
/** Diagnostic message chain. */export declare class DiagnosticMessageChain { private constructor(); /** Gets the underlying compiler object. */ get compilerObject(): ts.DiagnosticMessageChain; /** Gets the message text. */ getMessageText(): string; /** Gets the next diagnostic message chains in the chain. */ getNext(): DiagnosticMessageChain[] | undefined; /** Gets the code of the diagnostic message chain. */ getCode(): number; /** Gets the category of the diagnostic message chain. */ getCategory(): DiagnosticCategory;}
export declare class DiagnosticWithLocation extends Diagnostic<ts.DiagnosticWithLocation> { private constructor(); /** Gets the line number. */ getLineNumber(): number; /** Gets the start. */ getStart(): number; /** Gets the length */ getLength(): number; /** Gets the source file. */ getSourceFile(): SourceFile;}
/** Document span. */export declare class DocumentSpan<TCompilerObject extends ts.DocumentSpan = ts.DocumentSpan> { protected constructor(); /** Gets the compiler object. */ get compilerObject(): TCompilerObject; /** Gets the source file this reference is in. */ getSourceFile(): SourceFile; /** Gets the text span. */ getTextSpan(): TextSpan; /** Gets the node at the start of the text span. */ getNode(): Node<ts.Node>; /** Gets the original text span if the span represents a location that was remapped. */ getOriginalTextSpan(): TextSpan | undefined; /** Gets the original file name if the span represents a location that was remapped. */ getOriginalFileName(): string | undefined;}
/** Output of an emit on a single file. */export declare class EmitOutput { #private; private constructor(); /** TypeScript compiler emit result. */ get compilerObject(): ts.EmitOutput; /** Gets if the emit was skipped. */ getEmitSkipped(): boolean; /** Gets the output files. */ getOutputFiles(): OutputFile[];}
/** Result of an emit. */export declare class EmitResult { protected constructor(); /** TypeScript compiler emit result. */ get compilerObject(): ts.EmitResult; /** If the emit was skipped. */ getEmitSkipped(): boolean; /** * Contains declaration emit diagnostics. * * If the `noEmitOnError` compiler option is true, this will also include the program's semantic, syntactic, global, options, and if enabled declaration diagnostics. * @remarks If you are looking for non-declaration emit diagnostics, then call `Project#getPreEmitDiagnostics()` or get specific diagnostics available from the program. */ getDiagnostics(): Diagnostic<ts.Diagnostic>[];}
export interface ApplyFileTextChangesOptions { /** If a file should be overwritten when the file text change is for a new file, but the file currently exists. */ overwrite?: boolean;}
export declare class FileTextChanges { #private; private constructor(); /** Gets the file path. */ getFilePath(): string; /** Gets the source file if it was in the cache at the time of this class' creation. */ getSourceFile(): SourceFile | undefined; /** Gets the text changes */ getTextChanges(): TextChange[]; /** * Applies the text changes to the file. This modifies and possibly creates a new source file. * * WARNING: This will forget any previously navigated descendant nodes in the source file. * @param options - Options for applying the text changes to the file. */ applyChanges(options?: ApplyFileTextChangesOptions): this | undefined; /** Gets if this change is for creating a new file. */ isNewFile(): boolean;}
export declare class ImplementationLocation extends DocumentSpan<ts.ImplementationLocation> { private constructor(); /** Gets the kind. */ getKind(): ts.ScriptElementKind; /** Gets the display parts. */ getDisplayParts(): SymbolDisplayPart[];}
/** The emitted file in memory. */export interface MemoryEmitResultFile { /** File path that was emitted to. */ filePath: StandardizedFilePath; /** The text that was emitted. */ text: string; /** Whether the byte order mark should be written. */ writeByteOrderMark: boolean;}
/** Result of an emit to memory. */export declare class MemoryEmitResult extends EmitResult { #private; private constructor(); /** Gets the files that were emitted to memory. */ getFiles(): MemoryEmitResultFile[]; /** Asynchronously writes the files to the file system. */ saveFiles(): Promise<void[]>; /** * Synchronously writes the files to the file system. * @remarks Use `saveFiles()` as the asynchronous version will be much faster. */ saveFilesSync(): void;}
/** Output file of an emit. */export declare class OutputFile { #private; private constructor(); /** TypeScript compiler output file. */ get compilerObject(): ts.OutputFile; /** Gets the file path. */ getFilePath(): StandardizedFilePath; /** Gets whether the byte order mark should be written. */ getWriteByteOrderMark(): boolean; /** Gets the file text. */ getText(): string;}
/** Set of edits to make in response to a refactor action, plus an optional location where renaming should be invoked from. */export declare class RefactorEditInfo { #private; private constructor(); /** Gets the compiler refactor edit info. */ get compilerObject(): ts.RefactorEditInfo; /** Gets refactor file text changes */ getEdits(): FileTextChanges[]; /** Gets the file path for a rename refactor. */ getRenameFilePath(): string | undefined; /** Location where renaming should be invoked from. */ getRenameLocation(): number | undefined; /** * Executes the combined code actions. * * WARNING: This will cause all nodes to be forgotten in the changed files. * @options - Options used when applying the changes. */ applyChanges(options?: ApplyFileTextChangesOptions): this;}
/** Referenced symbol. */export declare class ReferencedSymbol { #private; private constructor(); /** Gets the compiler referenced symbol. */ get compilerObject(): ts.ReferencedSymbol; /** Gets the definition. */ getDefinition(): ReferencedSymbolDefinitionInfo; /** Gets the references. */ getReferences(): ReferencedSymbolEntry[];}
export declare class ReferencedSymbolDefinitionInfo extends DefinitionInfo<ts.ReferencedSymbolDefinitionInfo> { private constructor(); /** Gets the display parts. */ getDisplayParts(): SymbolDisplayPart[];}
export declare class ReferenceEntry<T extends ts.ReferenceEntry = ts.ReferenceEntry> extends DocumentSpan<T> { protected constructor(); isWriteAccess(): boolean; isInString(): true | undefined;}
export declare class ReferencedSymbolEntry extends ReferenceEntry<ts.ReferencedSymbolEntry> { private constructor(); /** If this is the definition reference. */ isDefinition(): boolean | undefined;}
/** Rename location. */export declare class RenameLocation extends DocumentSpan<ts.RenameLocation> { /** Gets the text to insert before the rename. */ getPrefixText(): string | undefined; /** Gets the text to insert after the rename. */ getSuffixText(): string | undefined;}
/** Symbol display part. */export declare class SymbolDisplayPart { #private; private constructor(); /** Gets the compiler symbol display part. */ get compilerObject(): ts.SymbolDisplayPart; /** Gets the text. */ getText(): string; /** * Gets the kind. * * Examples: "text", "lineBreak" */ getKind(): string;}
/** Represents a text change. */export declare class TextChange { #private; private constructor(); /** Gets the compiler text change. */ get compilerObject(): ts.TextChange; /** Gets the text span. */ getSpan(): TextSpan; /** Gets the new text. */ getNewText(): string;}
/** Represents a span of text. */export declare class TextSpan { #private; private constructor(); /** Gets the compiler text span. */ get compilerObject(): ts.TextSpan; /** Gets the start. */ getStart(): number; /** Gets the start + length. */ getEnd(): number; /** Gets the length. */ getLength(): number;}
/** Wrapper around the TypeChecker. */export declare class TypeChecker { #private; private constructor(); /** Gets the compiler's TypeChecker. */ get compilerObject(): ts.TypeChecker; /** * Gets the ambient module symbols (ex. modules in the * @types folder or node_modules). */ getAmbientModules(): Symbol[]; /** * Gets the apparent type of a type. * @param type - Type to get the apparent type of. */ getApparentType(type: Type): Type<ts.Type>; /** * Gets the constant value of a declaration. * @param node - Node to get the constant value from. */ getConstantValue(node: EnumMember): string | number | undefined; /** * Gets the fully qualified name of a symbol. * @param symbol - Symbol to get the fully qualified name of. */ getFullyQualifiedName(symbol: Symbol): string; /** * Gets the type at the specified location. * @param node - Node to get the type for. */ getTypeAtLocation(node: Node): Type; /** * Gets the contextual type of an expression. * @param expression - Expression. */ getContextualType(expression: Expression): Type | undefined; /** * Gets the type of a symbol at the specified location. * @param symbol - Symbol to get the type for. * @param node - Location to get the type for. */ getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type; /** * Gets the declared type of a symbol. * @param symbol - Symbol to get the type for. */ getDeclaredTypeOfSymbol(symbol: Symbol): Type; /** * Gets the symbol at the specified location or undefined if none exists. * @param node - Node to get the symbol for. */ getSymbolAtLocation(node: Node): Symbol | undefined; /** * Gets the aliased symbol of a symbol. * @param symbol - Symbol to get the alias symbol of. */ getAliasedSymbol(symbol: Symbol): Symbol | undefined; /** * Follow a single alias to get the immediately aliased symbol. * @param symbol - Symbol to get the immediate alias symbol of. */ getImmediatelyAliasedSymbol(symbol: Symbol): Symbol | undefined; /** * Gets the export symbol of a local symbol with a corresponding export symbol. Otherwise returns the input symbol. * * The following is from the compiler API documentation: * * For example, at `export type T = number;`: * - `getSymbolAtLocation` at the location `T` will return the exported symbol for `T`. * - But the result of `getSymbolsInScope` will contain the *local* symbol for `T`, not the exported symbol. * - Calling `getExportSymbolOfSymbol` on that local symbol will return the exported symbol. */ getExportSymbolOfSymbol(symbol: Symbol): Symbol; /** * Gets the properties of a type. * @param type - Type. */ getPropertiesOfType(type: Type): Symbol[]; /** * Gets the type text * @param type - Type to get the text of. * @param enclosingNode - Enclosing node. * @param typeFormatFlags - Type format flags. */ getTypeText(type: Type, enclosingNode?: Node, typeFormatFlags?: TypeFormatFlags): string; /** * Gets the return type of a signature. * @param signature - Signature to get the return type of. */ getReturnTypeOfSignature(signature: Signature): Type; /** * Gets a signature from a node. * @param node - Node to get the signature from. */ getSignatureFromNode(node: Node<ts.SignatureDeclaration>): Signature | undefined; /** * Gets the exports of a module. * @param moduleSymbol - Module symbol. */ getExportsOfModule(moduleSymbol: Symbol): Symbol[]; /** * Gets the local target symbol of the provided export specifier. * @param exportSpecifier - Export specifier. */ getExportSpecifierLocalTargetSymbol(exportSpecifier: ExportSpecifier): Symbol | undefined; /** * Gets the resolved signature from a node or returns undefined if the signature can't be resolved. * @param node - Node to get the signature from. */ getResolvedSignature(node: CallLikeExpression): Signature | undefined; /** * Gets the resolved signature from a node or throws if the signature cannot be resolved. * @param node - Node to get the signature from. */ getResolvedSignatureOrThrow(node: CallLikeExpression, message?: string | (() => string)): Signature; /** * Gets the base type of a literal type. * * For example, for a number literal type it will return the number type. * @param type - Literal type to get the base type of. */ getBaseTypeOfLiteralType(type: Type): Type<ts.Type>; /** * Gets the symbols in the scope of the provided node. * * Note: This will always return the local symbols. If you want the export symbol from a local symbol, then * use the `#getExportSymbolOfSymbol(symbol)` method. * @param node - Node to check the scope for. * @param meaning - Meaning of symbol to filter by. */ getSymbolsInScope(node: Node, meaning: SymbolFlags): Symbol[]; /** * Gets the type arguments from a type reference. * @param typeReference - Type reference. */ getTypeArguments(typeReference: Type): Type<ts.Type>[]; /** Checks if a type is assignable to another type. */ isTypeAssignableTo(sourceType: Type, targetType: Type): boolean; /** Gets the shorthand assignment value symbol of the provided node. */ getShorthandAssignmentValueSymbol(node: Node): Symbol | undefined; resolveName(name: string, location: Node | undefined, meaning: SymbolFlags, excludeGlobals: boolean): Symbol | undefined;}
export declare class Type<TType extends ts.Type = ts.Type> { #private; protected constructor(); /** Gets the underlying compiler type. */ get compilerType(): TType; /** * Gets the type text. * @param enclosingNode - The enclosing node. * @param typeFormatFlags - Format flags for the type text. */ getText(enclosingNode?: Node, typeFormatFlags?: TypeFormatFlags): string; /** Gets the alias symbol if it exists. */ getAliasSymbol(): Symbol | undefined; /** Gets the alias symbol if it exists, or throws. */ getAliasSymbolOrThrow(message?: string | (() => string)): Symbol; /** Gets the alias type arguments. */ getAliasTypeArguments(): Type[]; /** Gets the apparent type. */ getApparentType(): Type; /** Gets the array element type or throws if it doesn't exist (ex. for `T[]` it would be `T`). */ getArrayElementTypeOrThrow(message?: string | (() => string)): Type<ts.Type>; /** Gets the array element type or returns undefined if it doesn't exist (ex. for `T[]` it would be `T`). */ getArrayElementType(): Type<ts.Type> | undefined; /** Gets the base types. */ getBaseTypes(): Type<ts.BaseType>[]; /** * Gets the base type of a literal type. * * For example, for a number literal type it will return the number type. */ getBaseTypeOfLiteralType(): Type<ts.Type>; /** Gets the call signatures. */ getCallSignatures(): Signature[]; /** Gets the construct signatures. */ getConstructSignatures(): Signature[]; /** Gets the constraint or throws if it doesn't exist. */ getConstraintOrThrow(message?: string | (() => string)): Type<ts.Type>; /** Gets the constraint or returns undefined if it doesn't exist. */ getConstraint(): Type<ts.Type> | undefined; /** Gets the default type or throws if it doesn't exist. */ getDefaultOrThrow(message?: string | (() => string)): Type<ts.Type>; /** Gets the default type or returns undefined if it doesn't exist. */ getDefault(): Type<ts.Type> | undefined; /** Gets the properties of the type. */ getProperties(): Symbol[]; /** * Gets a property or throws if it doesn't exist. * @param name - By a name. */ getPropertyOrThrow(name: string): Symbol; /** * Gets a property or throws if it doesn't exist. * @param findFunction - Function for searching for a property. */ getPropertyOrThrow(findFunction: (declaration: Symbol) => boolean): Symbol; /** * Gets a property or returns undefined if it does not exist. * @param name - By a name. */ getProperty(name: string): Symbol | undefined; /** * Gets a property or returns undefined if it does not exist. * @param findFunction - Function for searching for a property. */ getProperty(findFunction: (declaration: Symbol) => boolean): Symbol | undefined; /** Gets the apparent properties of the type. */ getApparentProperties(): Symbol[]; /** * Gets an apparent property. * @param name - By a name. * @param findFunction - Function for searching for an apparent property. */ getApparentProperty(name: string): Symbol | undefined; getApparentProperty(findFunction: (declaration: Symbol) => boolean): Symbol | undefined; /** Gets if the type is possibly null or undefined. */ isNullable(): boolean; /** Gets the non-nullable type. */ getNonNullableType(): Type; /** Gets the number index type. */ getNumberIndexType(): Type | undefined; /** Gets the string index type. */ getStringIndexType(): Type | undefined; /** * Returns the generic type when the type is a type reference, returns itself when it's * already a generic type, or otherwise returns undefined. * * For example: * * - Given type reference `Promise<string>` returns `Promise<T>`. * - Given generic type `Promise<T>` returns the same `Promise<T>`. * - Given `string` returns `undefined`. */ getTargetType(): Type<ts.GenericType> | undefined; /** * Returns the generic type when the type is a type reference, returns itself when it's * already a generic type, or otherwise throws an error. * * For example: * * - Given type reference `Promise<string>` returns `Promise<T>`. * - Given generic type `Promise<T>` returns the same `Promise<T>`. * - Given `string` throws an error. */ getTargetTypeOrThrow(message?: string | (() => string)): Type<ts.GenericType>; /** Gets type arguments. */ getTypeArguments(): Type[]; /** Gets the individual element types of the tuple. */ getTupleElements(): Type[]; /** Gets the union types (ex. for `T | U` it returns the array `[T, U]`). */ getUnionTypes(): Type[]; /** Gets the intersection types (ex. for `T & U` it returns the array `[T, U]`). */ getIntersectionTypes(): Type[]; /** Gets the value of a literal or returns undefined if this is not a literal type. */ getLiteralValue(): string | number | ts.PseudoBigInt | undefined; /** Gets the value of the literal or throws if this is not a literal type. */ getLiteralValueOrThrow(message?: string | (() => string)): string | number | ts.PseudoBigInt; /** * Gets the fresh type of the literal or returns undefined if this is not a literal type. * * Note: I have no idea what this means. Please help contribute to these js docs if you know. */ getLiteralFreshType(): Type<ts.FreshableType> | undefined; /** * Gets the fresh type of the literal or throws if this is not a literal type. * * Note: I have no idea what this means. Please help contribute to these js docs if you know. */ getLiteralFreshTypeOrThrow(message?: string | (() => string)): Type<ts.FreshableType>; /** * Gets the regular type of the literal or returns undefined if this is not a literal type. * * Note: I have no idea what this means. Please help contribute to these js docs if you know. */ getLiteralRegularType(): Type<ts.FreshableType> | undefined; /** * Gets the regular type of the literal or throws if this is not a literal type. * * Note: I have no idea what this means. Please help contribute to these js docs if you know. */ getLiteralRegularTypeOrThrow(message?: string | (() => string)): Type<ts.FreshableType>; /** Gets the symbol of the type. */ getSymbol(): Symbol | undefined; /** Gets the symbol of the type or throws. */ getSymbolOrThrow(message?: string | (() => string)): Symbol; /** Gets if the type is assignable to another type. */ isAssignableTo(target: Type): boolean; /** Gets if this is an anonymous type. */ isAnonymous(): boolean; /** Gets if this is an any type. */ isAny(): boolean; /** Gets if this is a never type. */ isNever(): boolean; /** Gets if this is an array type. */ isArray(): boolean; /** Gets if this is a readonly array type. */ isReadonlyArray(): boolean; /** Gets if this is a template literal type. */ isTemplateLiteral(): this is Type<ts.TemplateLiteralType>; /** Gets if this is a boolean type. */ isBoolean(): boolean; /** Gets if this is a string type. */ isString(): boolean; /** Gets if this is a number type. */ isNumber(): boolean; /** Gets if this is a literal type. */ isLiteral(): boolean; /** Gets if this is a boolean literal type. */ isBooleanLiteral(): boolean; /** Gets if this is an enum literal type. */ isEnumLiteral(): boolean; /** Gets if this is a number literal type. */ isNumberLiteral(): this is Type<ts.NumberLiteralType>; /** Gets if this is a string literal type. */ isStringLiteral(): this is Type<ts.StringLiteralType>; /** Gets if this is a class type. */ isClass(): this is Type<ts.InterfaceType>; /** Gets if this is a class or interface type. */ isClassOrInterface(): this is Type<ts.InterfaceType>; /** Gets if this is an enum type. */ isEnum(): boolean; /** Gets if this is an interface type. */ isInterface(): this is Type<ts.InterfaceType>; /** Gets if this is an object type. */ isObject(): this is Type<ts.ObjectType>; /** Gets if this is a type parameter. */ isTypeParameter(): this is TypeParameter; /** Gets if this is a tuple type. */ isTuple(): this is Type<ts.TupleType>; /** Gets if this is a union type. */ isUnion(): this is Type<ts.UnionType>; /** Gets if this is an intersection type. */ isIntersection(): this is Type<ts.IntersectionType>; /** Gets if this is a union or intersection type. */ isUnionOrIntersection(): this is Type<ts.UnionOrIntersectionType>; /** Gets if this is the unknown type. */ isUnknown(): boolean; /** Gets if this is the null type. */ isNull(): boolean; /** Gets if this is the undefined type. */ isUndefined(): boolean; /** Gets if this is the void type. */ isVoid(): boolean; /** Gets the type flags. */ getFlags(): TypeFlags; /** * Gets the object flags. * @remarks Returns 0 for a non-object type. */ getObjectFlags(): 0 | ObjectFlags.Class | ObjectFlags.Interface | ObjectFlags.Reference | ObjectFlags.Tuple | ObjectFlags.Anonymous | ObjectFlags.Mapped | ObjectFlags.Instantiated | ObjectFlags.ObjectLiteral | ObjectFlags.EvolvingArray | ObjectFlags.ObjectLiteralPatternWithComputedProperties | ObjectFlags.ReverseMapped | ObjectFlags.JsxAttributes | ObjectFlags.JSLiteral | ObjectFlags.FreshLiteral | ObjectFlags.ArrayLiteral | ObjectFlags.ClassOrInterface | ObjectFlags.ContainsSpread | ObjectFlags.ObjectRestType | ObjectFlags.InstantiationExpressionType;}
export declare class TypeParameter extends Type<ts.TypeParameter> { #private; /** Gets the constraint or throws if it doesn't exist. */ getConstraintOrThrow(message?: string | (() => string)): Type; /** Gets the constraint type. */ getConstraint(): Type | undefined; /** Gets the default type or throws if it doesn't exist. */ getDefaultOrThrow(message?: string | (() => string)): Type; /** Gets the default type or undefined if it doesn't exist. */ getDefault(): Type | undefined;}
/** Kinds of indentation */export declare enum IndentationText { /** Two spaces */ TwoSpaces = " ", /** Four spaces */ FourSpaces = " ", /** Eight spaces */ EightSpaces = " ", /** Tab */ Tab = "\t"}
/** Manipulation settings. */export interface ManipulationSettings extends SupportedFormatCodeSettingsOnly { /** Indentation text */ indentationText: IndentationText; /** New line kind */ newLineKind: NewLineKind; /** Quote type used for string literals. */ quoteKind: QuoteKind; /** * Whether to enable renaming shorthand property assignments, binding elements, * and import & export specifiers without changing behaviour. * @remarks Defaults to true. * This setting is only available when using TypeScript 3.4+. */ usePrefixAndSuffixTextForRename: boolean; /** Whether to use trailing commas when inserting or removing nodes. */ useTrailingCommas: boolean;}
/** FormatCodeSettings that are currently supported in the library. */export interface SupportedFormatCodeSettings extends SupportedFormatCodeSettingsOnly, EditorSettings {}
/** FormatCodeSettings that are currently supported in the library. */export interface SupportedFormatCodeSettingsOnly { /** * Whether to insert a space after opening and before closing non-empty braces. * * ex. `import { Item } from "./Item";` or `import {Item} from "./Item";` * @remarks Defaults to true. */ insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces: boolean;}
/** Holds the manipulation settings. */export declare class ManipulationSettingsContainer extends SettingsContainer<ManipulationSettings> { #private; constructor(); /** Gets the editor settings based on the current manipulation settings. */ getEditorSettings(): Readonly<EditorSettings>; /** Gets the format code settings. */ getFormatCodeSettings(): Readonly<SupportedFormatCodeSettings>; /** Gets the user preferences. */ getUserPreferences(): Readonly<UserPreferences>; /** Gets the quote kind used for string literals. */ getQuoteKind(): QuoteKind; /** Gets the new line kind. */ getNewLineKind(): NewLineKind; /** Gets the new line kind as a string. */ getNewLineKindAsString(): "\r\n" | "\n"; /** Gets the indentation text. */ getIndentationText(): IndentationText; /** Gets whether to use prefix and suffix text when renaming. */ getUsePrefixAndSuffixTextForRename(): boolean; /** Gets whether trailing commas should be used. */ getUseTrailingCommas(): boolean; /** * Sets one or all of the settings. * @param settings - Settings to set. */ set(settings: Partial<ManipulationSettings>): void;}
export type StatementStructures = ClassDeclarationStructure | EnumDeclarationStructure | FunctionDeclarationStructure | InterfaceDeclarationStructure | ModuleDeclarationStructure | TypeAliasDeclarationStructure | ImportDeclarationStructure | ExportDeclarationStructure | ExportAssignmentStructure | VariableStatementStructure;export type ClassMemberStructures = ConstructorDeclarationStructure | GetAccessorDeclarationStructure | SetAccessorDeclarationStructure | MethodDeclarationStructure | PropertyDeclarationStructure | ClassStaticBlockDeclarationStructure;export type TypeElementMemberStructures = CallSignatureDeclarationStructure | ConstructSignatureDeclarationStructure | IndexSignatureDeclarationStructure | MethodSignatureStructure | PropertySignatureStructure;export type InterfaceMemberStructures = TypeElementMemberStructures;export type ObjectLiteralExpressionPropertyStructures = PropertyAssignmentStructure | ShorthandPropertyAssignmentStructure | SpreadAssignmentStructure | GetAccessorDeclarationStructure | SetAccessorDeclarationStructure | MethodDeclarationStructure;export type JsxStructures = JsxAttributeStructure | JsxSpreadAttributeStructure | JsxElementStructure | JsxSelfClosingElementStructure;export type Structures = ImportAttributeStructure | StatementStructures | ClassMemberStructures | EnumMemberStructure | InterfaceMemberStructures | ObjectLiteralExpressionPropertyStructures | JsxStructures | FunctionDeclarationOverloadStructure | MethodDeclarationOverloadStructure | ConstructorDeclarationOverloadStructure | ParameterDeclarationStructure | TypeParameterDeclarationStructure | SourceFileStructure | ExportSpecifierStructure | ImportSpecifierStructure | VariableDeclarationStructure | JSDocStructure | JSDocTagStructure | DecoratorStructure;
export interface AbstractableNodeStructure { isAbstract?: boolean;}
export interface AmbientableNodeStructure { hasDeclareKeyword?: boolean;}
export interface AsyncableNodeStructure { isAsync?: boolean;}
export interface AwaitableNodeStructure { isAwaited?: boolean;}
export interface DecoratableNodeStructure { decorators?: OptionalKind<DecoratorStructure>[];}
export interface ExclamationTokenableNodeStructure { hasExclamationToken?: boolean;}
export interface ExportableNodeStructure { isExported?: boolean; isDefaultExport?: boolean;}
export interface ExtendsClauseableNodeStructure { extends?: (string | WriterFunction)[] | WriterFunction;}
export interface GeneratorableNodeStructure { isGenerator?: boolean;}
export interface ImplementsClauseableNodeStructure { implements?: (string | WriterFunction)[] | WriterFunction;}
export interface InitializerExpressionableNodeStructure { initializer?: string | WriterFunction;}
export interface JSDocableNodeStructure { docs?: (OptionalKind<JSDocStructure> | string)[];}
export interface BindingNamedNodeStructure { name: string;}
export interface ImportAttributeNamedNodeStructure { name: string;}
export interface ModuleNamedNodeStructure { name: string;}
export interface NameableNodeStructure { name?: string;}
export interface NamedNodeStructure { name: string;}
export interface PropertyNameableNodeStructure { name?: string;}
export interface PropertyNamedNodeStructure { name: string;}
export interface OverrideableNodeStructure { hasOverrideKeyword?: boolean;}
export interface ParameteredNodeStructure { parameters?: OptionalKind<ParameterDeclarationStructure>[];}
export interface QuestionDotTokenableNodeStructure { hasQuestionDotToken?: boolean;}
export interface QuestionTokenableNodeStructure { hasQuestionToken?: boolean;}
export interface ReadonlyableNodeStructure { isReadonly?: boolean;}
export interface ReturnTypedNodeStructure { returnType?: string | WriterFunction;}
export interface ScopeableNodeStructure { scope?: Scope;}
export interface ScopedNodeStructure { scope?: Scope;}
export interface SignaturedDeclarationStructure extends ParameteredNodeStructure, ReturnTypedNodeStructure {}
export interface StaticableNodeStructure { isStatic?: boolean;}
export interface TypedNodeStructure { type?: string | WriterFunction;}
export interface TypeElementMemberedNodeStructure { callSignatures?: OptionalKind<CallSignatureDeclarationStructure>[]; constructSignatures?: OptionalKind<ConstructSignatureDeclarationStructure>[]; getAccessors?: OptionalKind<GetAccessorDeclarationStructure>[]; indexSignatures?: OptionalKind<IndexSignatureDeclarationStructure>[]; methods?: OptionalKind<MethodSignatureStructure>[]; properties?: OptionalKind<PropertySignatureStructure>[]; setAccessors?: OptionalKind<SetAccessorDeclarationStructure>[];}
export interface TypeParameteredNodeStructure { typeParameters?: (OptionalKind<TypeParameterDeclarationStructure> | string)[];}
export interface ClassLikeDeclarationBaseStructure extends NameableNodeStructure, ClassLikeDeclarationBaseSpecificStructure, ImplementsClauseableNodeStructure, DecoratableNodeStructure, TypeParameteredNodeStructure, JSDocableNodeStructure, AbstractableNodeStructure {}
interface ClassLikeDeclarationBaseSpecificStructure { extends?: string | WriterFunction; ctors?: OptionalKind<ConstructorDeclarationStructure>[]; staticBlocks?: OptionalKind<ClassStaticBlockDeclarationStructure>[]; properties?: OptionalKind<PropertyDeclarationStructure>[]; getAccessors?: OptionalKind<GetAccessorDeclarationStructure>[]; setAccessors?: OptionalKind<SetAccessorDeclarationStructure>[]; methods?: OptionalKind<MethodDeclarationStructure>[];}
export interface ClassDeclarationStructure extends Structure, ClassLikeDeclarationBaseStructure, ClassDeclarationSpecificStructure, AmbientableNodeStructure, ExportableNodeStructure { /** * The class name. * @remarks Can be undefined. For example: `export default class { ... }` */ name?: string;}
interface ClassDeclarationSpecificStructure extends KindedStructure<StructureKind.Class> {}
export interface ClassStaticBlockDeclarationStructure extends Structure, ClassStaticBlockDeclarationSpecificStructure, JSDocableNodeStructure, StatementedNodeStructure {}
interface ClassStaticBlockDeclarationSpecificStructure extends KindedStructure<StructureKind.ClassStaticBlock> {}
export interface ConstructorDeclarationStructure extends Structure, ConstructorDeclarationSpecificStructure, ScopedNodeStructure, FunctionLikeDeclarationStructure {}
interface ConstructorDeclarationSpecificStructure extends KindedStructure<StructureKind.Constructor> { overloads?: OptionalKind<ConstructorDeclarationOverloadStructure>[];}
export interface ConstructorDeclarationOverloadStructure extends Structure, ConstructorDeclarationOverloadSpecificStructure, ScopedNodeStructure, SignaturedDeclarationStructure, TypeParameteredNodeStructure, JSDocableNodeStructure {}
interface ConstructorDeclarationOverloadSpecificStructure extends KindedStructure<StructureKind.ConstructorOverload> {}
export interface GetAccessorDeclarationStructure extends Structure, GetAccessorDeclarationSpecificStructure, PropertyNamedNodeStructure, StaticableNodeStructure, DecoratableNodeStructure, AbstractableNodeStructure, ScopedNodeStructure, FunctionLikeDeclarationStructure {}
interface GetAccessorDeclarationSpecificStructure extends KindedStructure<StructureKind.GetAccessor> {}
export interface MethodDeclarationStructure extends Structure, MethodDeclarationSpecificStructure, PropertyNamedNodeStructure, StaticableNodeStructure, DecoratableNodeStructure, AbstractableNodeStructure, ScopedNodeStructure, AsyncableNodeStructure, GeneratorableNodeStructure, FunctionLikeDeclarationStructure, QuestionTokenableNodeStructure, OverrideableNodeStructure {}
interface MethodDeclarationSpecificStructure extends KindedStructure<StructureKind.Method> { overloads?: OptionalKind<MethodDeclarationOverloadStructure>[];}
export interface MethodDeclarationOverloadStructure extends Structure, MethodDeclarationOverloadSpecificStructure, StaticableNodeStructure, AbstractableNodeStructure, ScopedNodeStructure, AsyncableNodeStructure, GeneratorableNodeStructure, SignaturedDeclarationStructure, TypeParameteredNodeStructure, JSDocableNodeStructure, QuestionTokenableNodeStructure, OverrideableNodeStructure {}
interface MethodDeclarationOverloadSpecificStructure extends KindedStructure<StructureKind.MethodOverload> {}
export interface PropertyDeclarationStructure extends Structure, PropertyDeclarationSpecificStructure, PropertyNamedNodeStructure, TypedNodeStructure, QuestionTokenableNodeStructure, ExclamationTokenableNodeStructure, StaticableNodeStructure, ScopedNodeStructure, JSDocableNodeStructure, ReadonlyableNodeStructure, InitializerExpressionableNodeStructure, DecoratableNodeStructure, AbstractableNodeStructure, AmbientableNodeStructure, OverrideableNodeStructure {}
interface PropertyDeclarationSpecificStructure extends KindedStructure<StructureKind.Property> { hasAccessorKeyword?: boolean;}
export interface SetAccessorDeclarationStructure extends Structure, SetAccessorDeclarationSpecificStructure, PropertyNamedNodeStructure, StaticableNodeStructure, DecoratableNodeStructure, AbstractableNodeStructure, ScopedNodeStructure, FunctionLikeDeclarationStructure {}
interface SetAccessorDeclarationSpecificStructure extends KindedStructure<StructureKind.SetAccessor> {}
export interface DecoratorStructure extends Structure, DecoratorSpecificStructure {}
interface DecoratorSpecificStructure extends KindedStructure<StructureKind.Decorator> { name: string; /** * Arguments for a decorator factory. * @remarks Provide an empty array to make the structure a decorator factory. */ arguments?: (string | WriterFunction)[] | WriterFunction; typeArguments?: string[];}
export interface JSDocStructure extends Structure, JSDocSpecificStructure {}
interface JSDocSpecificStructure extends KindedStructure<StructureKind.JSDoc> { /** * The description of the JS doc. * @remarks To force this to be multi-line, add a newline to the front of the string. */ description?: string | WriterFunction; /** JS doc tags (ex. `&#64;param value - Some description.`). */ tags?: OptionalKind<JSDocTagStructure>[];}
export interface JSDocTagStructure extends Structure, JSDocTagSpecificStructure {}
interface JSDocTagSpecificStructure extends KindedStructure<StructureKind.JSDocTag> { /** The name for the JS doc tag that comes after the "at" symbol. */ tagName: string; /** The text that follows the tag name. */ text?: string | WriterFunction;}
export interface EnumDeclarationStructure extends Structure, NamedNodeStructure, EnumDeclarationSpecificStructure, JSDocableNodeStructure, AmbientableNodeStructure, ExportableNodeStructure {}
interface EnumDeclarationSpecificStructure extends KindedStructure<StructureKind.Enum> { isConst?: boolean; members?: OptionalKind<EnumMemberStructure>[];}
export interface EnumMemberStructure extends Structure, EnumMemberSpecificStructure, PropertyNamedNodeStructure, JSDocableNodeStructure, InitializerExpressionableNodeStructure {}
interface EnumMemberSpecificStructure extends KindedStructure<StructureKind.EnumMember> { /** Convenience property for setting the initializer. */ value?: number | string;}
export interface ExpressionedNodeStructure { expression: string | WriterFunction;}
export interface PropertyAssignmentStructure extends Structure, PropertyAssignmentSpecificStructure, PropertyNamedNodeStructure {}
interface PropertyAssignmentSpecificStructure extends KindedStructure<StructureKind.PropertyAssignment> { initializer: string | WriterFunction;}
export interface ShorthandPropertyAssignmentStructure extends Structure, ShorthandPropertyAssignmentSpecificStructure, NamedNodeStructure {}
interface ShorthandPropertyAssignmentSpecificStructure extends KindedStructure<StructureKind.ShorthandPropertyAssignment> {}
export interface SpreadAssignmentStructure extends Structure, SpreadAssignmentSpecificStructure, ExpressionedNodeStructure {}
interface SpreadAssignmentSpecificStructure extends KindedStructure<StructureKind.SpreadAssignment> {}
export interface FunctionDeclarationStructure extends Structure, FunctionDeclarationSpecificStructure, NameableNodeStructure, FunctionLikeDeclarationStructure, AsyncableNodeStructure, GeneratorableNodeStructure, AmbientableNodeStructure, ExportableNodeStructure {}
interface FunctionDeclarationSpecificStructure extends KindedStructure<StructureKind.Function> { overloads?: OptionalKind<FunctionDeclarationOverloadStructure>[];}
export interface FunctionDeclarationOverloadStructure extends Structure, FunctionDeclarationOverloadSpecificStructure, SignaturedDeclarationStructure, TypeParameteredNodeStructure, JSDocableNodeStructure, AsyncableNodeStructure, GeneratorableNodeStructure, AmbientableNodeStructure, ExportableNodeStructure {}
interface FunctionDeclarationOverloadSpecificStructure extends KindedStructure<StructureKind.FunctionOverload> {}
export interface FunctionLikeDeclarationStructure extends SignaturedDeclarationStructure, TypeParameteredNodeStructure, JSDocableNodeStructure, StatementedNodeStructure {}
export interface ParameterDeclarationStructure extends Structure, BindingNamedNodeStructure, TypedNodeStructure, ReadonlyableNodeStructure, DecoratableNodeStructure, QuestionTokenableNodeStructure, ScopeableNodeStructure, InitializerExpressionableNodeStructure, ParameterDeclarationSpecificStructure, OverrideableNodeStructure {}
interface ParameterDeclarationSpecificStructure extends KindedStructure<StructureKind.Parameter> { isRestParameter?: boolean;}
export interface CallSignatureDeclarationStructure extends Structure, CallSignatureDeclarationSpecificStructure, JSDocableNodeStructure, SignaturedDeclarationStructure, TypeParameteredNodeStructure {}
interface CallSignatureDeclarationSpecificStructure extends KindedStructure<StructureKind.CallSignature> {}
export interface ConstructSignatureDeclarationStructure extends Structure, ConstructSignatureDeclarationSpecificStructure, JSDocableNodeStructure, SignaturedDeclarationStructure, TypeParameteredNodeStructure {}
interface ConstructSignatureDeclarationSpecificStructure extends KindedStructure<StructureKind.ConstructSignature> {}
export interface IndexSignatureDeclarationStructure extends Structure, IndexSignatureDeclarationSpecificStructure, JSDocableNodeStructure, ReadonlyableNodeStructure, ReturnTypedNodeStructure {}
interface IndexSignatureDeclarationSpecificStructure extends KindedStructure<StructureKind.IndexSignature> { keyName?: string; keyType?: string;}
export interface InterfaceDeclarationStructure extends Structure, NamedNodeStructure, InterfaceDeclarationSpecificStructure, ExtendsClauseableNodeStructure, TypeParameteredNodeStructure, JSDocableNodeStructure, AmbientableNodeStructure, ExportableNodeStructure, TypeElementMemberedNodeStructure {}
interface InterfaceDeclarationSpecificStructure extends KindedStructure<StructureKind.Interface> {}
export interface MethodSignatureStructure extends Structure, PropertyNamedNodeStructure, MethodSignatureSpecificStructure, QuestionTokenableNodeStructure, JSDocableNodeStructure, SignaturedDeclarationStructure, TypeParameteredNodeStructure {}
interface MethodSignatureSpecificStructure extends KindedStructure<StructureKind.MethodSignature> {}
export interface PropertySignatureStructure extends Structure, PropertySignatureSpecificStructure, PropertyNamedNodeStructure, TypedNodeStructure, QuestionTokenableNodeStructure, JSDocableNodeStructure, ReadonlyableNodeStructure, InitializerExpressionableNodeStructure {}
interface PropertySignatureSpecificStructure extends KindedStructure<StructureKind.PropertySignature> {}
export interface JsxAttributedNodeStructure { attributes?: (OptionalKind<JsxAttributeStructure> | JsxSpreadAttributeStructure)[];}
export interface JsxTagNamedNodeStructure { name: string;}
export interface JsxAttributeStructure extends Structure, JsxAttributeSpecificStructure {}
interface JsxAttributeSpecificStructure extends KindedStructure<StructureKind.JsxAttribute> { name: string | JsxNamespacedNameStructure; initializer?: string;}
export interface JsxElementStructure extends Structure, JsxElementSpecificStructure {}
interface JsxElementSpecificStructure extends KindedStructure<StructureKind.JsxElement> { name: string; attributes?: (OptionalKind<JsxAttributeStructure> | JsxSpreadAttributeStructure)[]; children?: (OptionalKind<JsxElementStructure> | JsxSelfClosingElementStructure)[]; bodyText?: string;}
export interface JsxNamespacedNameStructure { namespace: string; name: string;}
export interface JsxSelfClosingElementStructure extends Structure, JsxTagNamedNodeStructure, JsxSelfClosingElementSpecificStructure, JsxAttributedNodeStructure {}
interface JsxSelfClosingElementSpecificStructure extends KindedStructure<StructureKind.JsxSelfClosingElement> {}
export interface JsxSpreadAttributeStructure extends Structure, JsxSpreadAttributeSpecificStructure {}
interface JsxSpreadAttributeSpecificStructure extends KindedStructure<StructureKind.JsxSpreadAttribute> { expression: string;}
export interface ExportAssignmentStructure extends Structure, ExportAssignmentSpecificStructure, JSDocableNodeStructure {}
interface ExportAssignmentSpecificStructure extends KindedStructure<StructureKind.ExportAssignment> { isExportEquals?: boolean; expression: string | WriterFunction;}
export interface ExportDeclarationStructure extends Structure, ExportDeclarationSpecificStructure {}
interface ExportDeclarationSpecificStructure extends KindedStructure<StructureKind.ExportDeclaration> { isTypeOnly?: boolean; namespaceExport?: string; namedExports?: (string | OptionalKind<ExportSpecifierStructure> | WriterFunction)[] | WriterFunction; moduleSpecifier?: string; attributes?: OptionalKind<ImportAttributeStructure>[] | undefined;}
export interface ExportSpecifierStructure extends Structure, ExportSpecifierSpecificStructure {}
interface ExportSpecifierSpecificStructure extends KindedStructure<StructureKind.ExportSpecifier> { name: string; alias?: string; isTypeOnly?: boolean;}
export interface ImportAttributeStructure extends Structure, ImportAttributeStructureSpecificStructure, ImportAttributeNamedNodeStructure {}
interface ImportAttributeStructureSpecificStructure extends KindedStructure<StructureKind.ImportAttribute> { /** Expression value. Quote this when providing a string. */ value: string;}
export interface ImportDeclarationStructure extends Structure, ImportDeclarationSpecificStructure {}
interface ImportDeclarationSpecificStructure extends KindedStructure<StructureKind.ImportDeclaration> { isTypeOnly?: boolean; defaultImport?: string; namespaceImport?: string; namedImports?: (OptionalKind<ImportSpecifierStructure> | string | WriterFunction)[] | WriterFunction; moduleSpecifier: string; attributes?: OptionalKind<ImportAttributeStructure>[] | undefined;}
export interface ImportSpecifierStructure extends Structure, ImportSpecifierSpecificStructure {}
interface ImportSpecifierSpecificStructure extends KindedStructure<StructureKind.ImportSpecifier> { name: string; isTypeOnly?: boolean; alias?: string;}
export interface ModuleDeclarationStructure extends Structure, ModuleNamedNodeStructure, ModuleDeclarationSpecificStructure, JSDocableNodeStructure, AmbientableNodeStructure, ExportableNodeStructure, StatementedNodeStructure {}
interface ModuleDeclarationSpecificStructure extends KindedStructure<StructureKind.Module> { /** * The module declaration kind. * * @remarks Defaults to "namespace". */ declarationKind?: ModuleDeclarationKind;}
export interface SourceFileStructure extends Structure, SourceFileSpecificStructure, StatementedNodeStructure {}
interface SourceFileSpecificStructure { kind: StructureKind.SourceFile;}
export interface StatementedNodeStructure { statements?: (string | WriterFunction | StatementStructures)[] | string | WriterFunction;}
export interface VariableDeclarationStructure extends Structure, VariableDeclarationSpecificStructure, BindingNamedNodeStructure, InitializerExpressionableNodeStructure, TypedNodeStructure, ExclamationTokenableNodeStructure {}
interface VariableDeclarationSpecificStructure extends KindedStructure<StructureKind.VariableDeclaration> {}
export interface VariableStatementStructure extends Structure, VariableStatementSpecificStructure, JSDocableNodeStructure, AmbientableNodeStructure, ExportableNodeStructure {}
interface VariableStatementSpecificStructure extends KindedStructure<StructureKind.VariableStatement> { declarationKind?: VariableDeclarationKind; declarations: OptionalKind<VariableDeclarationStructure>[];}
export interface Structure { /** Leading comments or whitespace. */ leadingTrivia?: string | WriterFunction | (string | WriterFunction)[]; /** Trailing comments or whitespace. */ trailingTrivia?: string | WriterFunction | (string | WriterFunction)[];}
/** Type guards for use on structures. */export declare const Structure: { /** * Gets if the provided structure has a name. */ readonly hasName: <T extends Structure>(structure: T) => structure is T & { name: string; }; /** Gets if the provided structure is a CallSignatureDeclarationStructure. */ readonly isCallSignature: (structure: unknown) => structure is CallSignatureDeclarationStructure; /** Gets if the provided structure is a JSDocableNodeStructure. */ readonly isJSDocable: <T_1>(structure: T_1) => structure is T_1 & JSDocableNodeStructure; /** Gets if the provided structure is a SignaturedDeclarationStructure. */ readonly isSignatured: <T_2>(structure: T_2) => structure is T_2 & SignaturedDeclarationStructure; /** Gets if the provided structure is a ParameteredNodeStructure. */ readonly isParametered: <T_3>(structure: T_3) => structure is T_3 & ParameteredNodeStructure; /** Gets if the provided structure is a ReturnTypedNodeStructure. */ readonly isReturnTyped: <T_4>(structure: T_4) => structure is T_4 & ReturnTypedNodeStructure; /** Gets if the provided structure is a TypeParameteredNodeStructure. */ readonly isTypeParametered: <T_5>(structure: T_5) => structure is T_5 & TypeParameteredNodeStructure; /** Gets if the provided structure is a ClassDeclarationStructure. */ readonly isClass: (structure: unknown) => structure is ClassDeclarationStructure; /** Gets if the provided structure is a ClassLikeDeclarationBaseStructure. */ readonly isClassLikeDeclarationBase: <T_6>(structure: T_6) => structure is T_6 & ClassLikeDeclarationBaseStructure; /** Gets if the provided structure is a NameableNodeStructure. */ readonly isNameable: <T_7>(structure: T_7) => structure is T_7 & NameableNodeStructure; /** Gets if the provided structure is a ImplementsClauseableNodeStructure. */ readonly isImplementsClauseable: <T_8>(structure: T_8) => structure is T_8 & ImplementsClauseableNodeStructure; /** Gets if the provided structure is a DecoratableNodeStructure. */ readonly isDecoratable: <T_9>(structure: T_9) => structure is T_9 & DecoratableNodeStructure; /** Gets if the provided structure is a AbstractableNodeStructure. */ readonly isAbstractable: <T_10>(structure: T_10) => structure is T_10 & AbstractableNodeStructure; /** Gets if the provided structure is a AmbientableNodeStructure. */ readonly isAmbientable: <T_11>(structure: T_11) => structure is T_11 & AmbientableNodeStructure; /** Gets if the provided structure is a ExportableNodeStructure. */ readonly isExportable: <T_12>(structure: T_12) => structure is T_12 & ExportableNodeStructure; /** Gets if the provided structure is a ClassStaticBlockDeclarationStructure. */ readonly isClassStaticBlock: (structure: unknown) => structure is ClassStaticBlockDeclarationStructure; /** Gets if the provided structure is a StatementedNodeStructure. */ readonly isStatemented: <T_13>(structure: T_13) => structure is T_13 & StatementedNodeStructure; /** Gets if the provided structure is a ConstructorDeclarationOverloadStructure. */ readonly isConstructorDeclarationOverload: (structure: unknown) => structure is ConstructorDeclarationOverloadStructure; /** Gets if the provided structure is a ScopedNodeStructure. */ readonly isScoped: <T_14>(structure: T_14) => structure is T_14 & ScopedNodeStructure; /** Gets if the provided structure is a ConstructorDeclarationStructure. */ readonly isConstructor: (structure: unknown) => structure is ConstructorDeclarationStructure; /** Gets if the provided structure is a FunctionLikeDeclarationStructure. */ readonly isFunctionLike: <T_15>(structure: T_15) => structure is T_15 & FunctionLikeDeclarationStructure; /** Gets if the provided structure is a ConstructSignatureDeclarationStructure. */ readonly isConstructSignature: (structure: unknown) => structure is ConstructSignatureDeclarationStructure; /** Gets if the provided structure is a DecoratorStructure. */ readonly isDecorator: (structure: unknown) => structure is DecoratorStructure; /** Gets if the provided structure is a EnumDeclarationStructure. */ readonly isEnum: (structure: unknown) => structure is EnumDeclarationStructure; /** Gets if the provided structure is a NamedNodeStructure. */ readonly isNamed: <T_16>(structure: T_16) => structure is T_16 & NamedNodeStructure; /** Gets if the provided structure is a EnumMemberStructure. */ readonly isEnumMember: (structure: unknown) => structure is EnumMemberStructure; /** Gets if the provided structure is a PropertyNamedNodeStructure. */ readonly isPropertyNamed: <T_17>(structure: T_17) => structure is T_17 & PropertyNamedNodeStructure; /** Gets if the provided structure is a InitializerExpressionableNodeStructure. */ readonly isInitializerExpressionable: <T_18>(structure: T_18) => structure is T_18 & InitializerExpressionableNodeStructure; /** Gets if the provided structure is a ExportAssignmentStructure. */ readonly isExportAssignment: (structure: unknown) => structure is ExportAssignmentStructure; /** Gets if the provided structure is a ExportDeclarationStructure. */ readonly isExportDeclaration: (structure: unknown) => structure is ExportDeclarationStructure; /** Gets if the provided structure is a ExportSpecifierStructure. */ readonly isExportSpecifier: (structure: unknown) => structure is ExportSpecifierStructure; /** Gets if the provided structure is a FunctionDeclarationOverloadStructure. */ readonly isFunctionDeclarationOverload: (structure: unknown) => structure is FunctionDeclarationOverloadStructure; /** Gets if the provided structure is a AsyncableNodeStructure. */ readonly isAsyncable: <T_19>(structure: T_19) => structure is T_19 & AsyncableNodeStructure; /** Gets if the provided structure is a GeneratorableNodeStructure. */ readonly isGeneratorable: <T_20>(structure: T_20) => structure is T_20 & GeneratorableNodeStructure; /** Gets if the provided structure is a FunctionDeclarationStructure. */ readonly isFunction: (structure: unknown) => structure is FunctionDeclarationStructure; /** Gets if the provided structure is a GetAccessorDeclarationStructure. */ readonly isGetAccessor: (structure: unknown) => structure is GetAccessorDeclarationStructure; /** Gets if the provided structure is a StaticableNodeStructure. */ readonly isStaticable: <T_21>(structure: T_21) => structure is T_21 & StaticableNodeStructure; /** Gets if the provided structure is a ImportAttributeStructure. */ readonly isImportAttribute: (structure: unknown) => structure is ImportAttributeStructure; /** Gets if the provided structure is a ImportAttributeNamedNodeStructure. */ readonly isImportAttributeNamed: <T_22>(structure: T_22) => structure is T_22 & ImportAttributeNamedNodeStructure; /** Gets if the provided structure is a ImportDeclarationStructure. */ readonly isImportDeclaration: (structure: unknown) => structure is ImportDeclarationStructure; /** Gets if the provided structure is a ImportSpecifierStructure. */ readonly isImportSpecifier: (structure: unknown) => structure is ImportSpecifierStructure; /** Gets if the provided structure is a IndexSignatureDeclarationStructure. */ readonly isIndexSignature: (structure: unknown) => structure is IndexSignatureDeclarationStructure; /** Gets if the provided structure is a ReadonlyableNodeStructure. */ readonly isReadonlyable: <T_23>(structure: T_23) => structure is T_23 & ReadonlyableNodeStructure; /** Gets if the provided structure is a InterfaceDeclarationStructure. */ readonly isInterface: (structure: unknown) => structure is InterfaceDeclarationStructure; /** Gets if the provided structure is a ExtendsClauseableNodeStructure. */ readonly isExtendsClauseable: <T_24>(structure: T_24) => structure is T_24 & ExtendsClauseableNodeStructure; /** Gets if the provided structure is a TypeElementMemberedNodeStructure. */ readonly isTypeElementMembered: <T_25>(structure: T_25) => structure is T_25 & TypeElementMemberedNodeStructure; /** Gets if the provided structure is a JSDocStructure. */ readonly isJSDoc: (structure: unknown) => structure is JSDocStructure; /** Gets if the provided structure is a JSDocTagStructure. */ readonly isJSDocTag: (structure: unknown) => structure is JSDocTagStructure; /** Gets if the provided structure is a JsxAttributeStructure. */ readonly isJsxAttribute: (structure: unknown) => structure is JsxAttributeStructure; /** Gets if the provided structure is a JsxElementStructure. */ readonly isJsxElement: (structure: unknown) => structure is JsxElementStructure; /** Gets if the provided structure is a JsxSelfClosingElementStructure. */ readonly isJsxSelfClosingElement: (structure: unknown) => structure is JsxSelfClosingElementStructure; /** Gets if the provided structure is a JsxTagNamedNodeStructure. */ readonly isJsxTagNamed: <T_26>(structure: T_26) => structure is T_26 & JsxTagNamedNodeStructure; /** Gets if the provided structure is a JsxAttributedNodeStructure. */ readonly isJsxAttributed: <T_27>(structure: T_27) => structure is T_27 & JsxAttributedNodeStructure; /** Gets if the provided structure is a JsxSpreadAttributeStructure. */ readonly isJsxSpreadAttribute: (structure: unknown) => structure is JsxSpreadAttributeStructure; /** Gets if the provided structure is a MethodDeclarationOverloadStructure. */ readonly isMethodDeclarationOverload: (structure: unknown) => structure is MethodDeclarationOverloadStructure; /** Gets if the provided structure is a QuestionTokenableNodeStructure. */ readonly isQuestionTokenable: <T_28>(structure: T_28) => structure is T_28 & QuestionTokenableNodeStructure; /** Gets if the provided structure is a OverrideableNodeStructure. */ readonly isOverrideable: <T_29>(structure: T_29) => structure is T_29 & OverrideableNodeStructure; /** Gets if the provided structure is a MethodDeclarationStructure. */ readonly isMethod: (structure: unknown) => structure is MethodDeclarationStructure; /** Gets if the provided structure is a MethodSignatureStructure. */ readonly isMethodSignature: (structure: unknown) => structure is MethodSignatureStructure; /** Gets if the provided structure is a ModuleDeclarationStructure. */ readonly isModule: (structure: unknown) => structure is ModuleDeclarationStructure; /** Gets if the provided structure is a ModuleNamedNodeStructure. */ readonly isModuleNamed: <T_30>(structure: T_30) => structure is T_30 & ModuleNamedNodeStructure; /** Gets if the provided structure is a ParameterDeclarationStructure. */ readonly isParameter: (structure: unknown) => structure is ParameterDeclarationStructure; /** Gets if the provided structure is a BindingNamedNodeStructure. */ readonly isBindingNamed: <T_31>(structure: T_31) => structure is T_31 & BindingNamedNodeStructure; /** Gets if the provided structure is a TypedNodeStructure. */ readonly isTyped: <T_32>(structure: T_32) => structure is T_32 & TypedNodeStructure; /** Gets if the provided structure is a ScopeableNodeStructure. */ readonly isScopeable: <T_33>(structure: T_33) => structure is T_33 & ScopeableNodeStructure; /** Gets if the provided structure is a PropertyAssignmentStructure. */ readonly isPropertyAssignment: (structure: unknown) => structure is PropertyAssignmentStructure; /** Gets if the provided structure is a PropertyDeclarationStructure. */ readonly isProperty: (structure: unknown) => structure is PropertyDeclarationStructure; /** Gets if the provided structure is a ExclamationTokenableNodeStructure. */ readonly isExclamationTokenable: <T_34>(structure: T_34) => structure is T_34 & ExclamationTokenableNodeStructure; /** Gets if the provided structure is a PropertySignatureStructure. */ readonly isPropertySignature: (structure: unknown) => structure is PropertySignatureStructure; /** Gets if the provided structure is a SetAccessorDeclarationStructure. */ readonly isSetAccessor: (structure: unknown) => structure is SetAccessorDeclarationStructure; /** Gets if the provided structure is a ShorthandPropertyAssignmentStructure. */ readonly isShorthandPropertyAssignment: (structure: unknown) => structure is ShorthandPropertyAssignmentStructure; /** Gets if the provided structure is a SourceFileStructure. */ readonly isSourceFile: (structure: unknown) => structure is SourceFileStructure; /** Gets if the provided structure is a SpreadAssignmentStructure. */ readonly isSpreadAssignment: (structure: unknown) => structure is SpreadAssignmentStructure; /** Gets if the provided structure is a ExpressionedNodeStructure. */ readonly isExpressioned: <T_35>(structure: T_35) => structure is T_35 & ExpressionedNodeStructure; /** Gets if the provided structure is a TypeAliasDeclarationStructure. */ readonly isTypeAlias: (structure: unknown) => structure is TypeAliasDeclarationStructure; /** Gets if the provided structure is a TypeParameterDeclarationStructure. */ readonly isTypeParameter: (structure: unknown) => structure is TypeParameterDeclarationStructure; /** Gets if the provided structure is a VariableDeclarationStructure. */ readonly isVariableDeclaration: (structure: unknown) => structure is VariableDeclarationStructure; /** Gets if the provided structure is a VariableStatementStructure. */ readonly isVariableStatement: (structure: unknown) => structure is VariableStatementStructure; };export interface KindedStructure<TKind extends StructureKind> { kind: TKind;}
export declare enum StructureKind { ImportAttribute = 0, CallSignature = 1, Class = 2, ClassStaticBlock = 3, ConstructSignature = 4, Constructor = 5, ConstructorOverload = 6, Decorator = 7, Enum = 8, EnumMember = 9, ExportAssignment = 10, ExportDeclaration = 11, ExportSpecifier = 12, Function = 13, FunctionOverload = 14, GetAccessor = 15, ImportDeclaration = 16, ImportSpecifier = 17, IndexSignature = 18, Interface = 19, JsxAttribute = 20, JsxSpreadAttribute = 21, JsxElement = 22, JsxSelfClosingElement = 23, JSDoc = 24, JSDocTag = 25, Method = 26, MethodOverload = 27, MethodSignature = 28, Module = 29, Parameter = 30, Property = 31, PropertyAssignment = 32, PropertySignature = 33, SetAccessor = 34, ShorthandPropertyAssignment = 35, SourceFile = 36, SpreadAssignment = 37, TypeAlias = 38, TypeParameter = 39, VariableDeclaration = 40, VariableStatement = 41}
export interface TypeAliasDeclarationStructure extends Structure, TypeAliasDeclarationSpecificStructure, NamedNodeStructure, TypedNodeStructure, TypeParameteredNodeStructure, JSDocableNodeStructure, AmbientableNodeStructure, ExportableNodeStructure { type: string | WriterFunction;}
interface TypeAliasDeclarationSpecificStructure extends KindedStructure<StructureKind.TypeAlias> { type: string | WriterFunction;}
export interface TypeParameterDeclarationStructure extends Structure, TypeParameterDeclarationSpecificStructure, NamedNodeStructure {}
interface TypeParameterDeclarationSpecificStructure extends KindedStructure<StructureKind.TypeParameter> { isConst?: boolean; constraint?: string | WriterFunction; default?: string | WriterFunction; variance?: TypeParameterVariance;}
export type OptionalKind<TStructure extends { kind?: StructureKind; }> = Pick<TStructure, Exclude<keyof TStructure, "kind">> & Partial<Pick<TStructure, "kind">>;/** * Iterates over the elements in the provided array. * @param structures - Array of structures to iterate over. * @param callback - Callback to do on each element in the array. Returning a truthy value will return that value in the main function call. */export declare function forEachStructureChild<TStructure>(structures: ReadonlyArray<Structures>, callback: (child: Structures) => TStructure | void): TStructure | undefined;/** * Iterates over the children of the provided array. * @remarks If the children do not have a `kind` property, it will be automatically added. * @param structure - Structure to iterate over. * @param callback - Callback to do on each child of the provided structure. Returning a truthy value will return that value in the main function call. */export declare function forEachStructureChild<TStructure>(structure: Structures, callback: (child: Structures) => TStructure | void): TStructure | undefined;import { CompilerOptions, DiagnosticCategory, EditorSettings, EmitHint, LanguageVariant, ModuleKind, ModuleResolutionKind, NewLineKind, NodeFlags, ObjectFlags, ScriptKind, ScriptTarget, SymbolFlags, SyntaxKind, TypeFlags, TypeFormatFlags } from "./common/mod.ts";export { ts, CompilerOptions, DiagnosticCategory, EditorSettings, EmitHint, LanguageVariant, ModuleKind, ModuleResolutionKind, NewLineKind, NodeFlags, ObjectFlags, ScriptKind, ScriptTarget, SymbolFlags, SyntaxKind, TypeFlags, TypeFormatFlags };
/** Code writer that assists with formatting and visualizing blocks of JavaScript or TypeScript code. */export declare class CodeBlockWriter { /** * Constructor. * @param opts - Options for the writer. */ constructor(opts?: Partial<CodeBlockWriterOptions>); /** Gets the options. */ getOptions(): CodeBlockWriterOptions; /** * Queues the indentation level for the next lines written. * @param indentationLevel - Indentation level to queue. */ queueIndentationLevel(indentationLevel: number): this; /** * Queues the indentation level for the next lines written using the provided indentation text. * @param whitespaceText - Gets the indentation level from the indentation text. */ queueIndentationLevel(whitespaceText: string): this; /** * Writes the text within the provided action with hanging indentation. * @param action - Action to perform with hanging indentation. */ hangingIndent(action: () => void): this; /** * Writes the text within the provided action with hanging indentation unless writing a block. * @param action - Action to perform with hanging indentation unless a block is written. */ hangingIndentUnlessBlock(action: () => void): this; /** * Sets the current indentation level. * @param indentationLevel - Indentation level to be at. */ setIndentationLevel(indentationLevel: number): this; /** * Sets the current indentation using the provided indentation text. * @param whitespaceText - Gets the indentation level from the indentation text. */ setIndentationLevel(whitespaceText: string): this; /** * Sets the indentation level within the provided action and restores the writer's indentation * state afterwards. * @remarks Restores the writer's state after the action. * @param indentationLevel - Indentation level to set. * @param action - Action to perform with the indentation. */ withIndentationLevel(indentationLevel: number, action: () => void): this; /** * Sets the indentation level with the provided indentation text within the provided action * and restores the writer's indentation state afterwards. * @param whitespaceText - Gets the indentation level from the indentation text. * @param action - Action to perform with the indentation. */ withIndentationLevel(whitespaceText: string, action: () => void): this; /** Gets the current indentation level. */ getIndentationLevel(): number; /** * Writes a block using braces. * @param block - Write using the writer within this block. */ block(block?: () => void): this; /** * Writes an inline block with braces. * @param block - Write using the writer within this block. */ inlineBlock(block?: () => void): this; /** Indents the code one level for the current line. */ indent(times?: number): this; /** * Indents a block of code. * @param block - Block to indent. */ indent(block: () => void): this; /** * Conditionally writes a line of text. * @param condition - Condition to evaluate. * @param textFunc - A function that returns a string to write if the condition is true. */ conditionalWriteLine(condition: boolean | undefined, textFunc: () => string): this; /** * Conditionally writes a line of text. * @param condition - Condition to evaluate. * @param text - Text to write if the condition is true. */ conditionalWriteLine(condition: boolean | undefined, text: string): this; /** * Writes a line of text. * @param text - String to write. */ writeLine(text: string): this; /** Writes a newline if the last line was not a newline. */ newLineIfLastNot(): this; /** Writes a blank line if the last written text was not a blank line. */ blankLineIfLastNot(): this; /** * Writes a blank line if the condition is true. * @param condition - Condition to evaluate. */ conditionalBlankLine(condition: boolean | undefined): this; /** Writes a blank line. */ blankLine(): this; /** * Writes a newline if the condition is true. * @param condition - Condition to evaluate. */ conditionalNewLine(condition: boolean | undefined): this; /** Writes a newline. */ newLine(): this; /** Writes a quote character. */ quote(): this; /** * Writes text surrounded in quotes. * @param text - Text to write. */ quote(text: string): this; /** Writes a space if the last character was not a space. */ spaceIfLastNot(): this; /** * Writes a space. * @param times - Number of times to write a space. */ space(times?: number): this; /** Writes a tab if the last character was not a tab. */ tabIfLastNot(): this; /** * Writes a tab. * @param times - Number of times to write a tab. */ tab(times?: number): this; /** * Conditionally writes text. * @param condition - Condition to evaluate. * @param textFunc - A function that returns a string to write if the condition is true. */ conditionalWrite(condition: boolean | undefined, textFunc: () => string): this; /** * Conditionally writes text. * @param condition - Condition to evaluate. * @param text - Text to write if the condition is true. */ conditionalWrite(condition: boolean | undefined, text: string): this; /** * Writes the provided text. * @param text - Text to write. */ write(text: string): this; /** Writes text to exit a comment if in a comment. */ closeComment(): this; /** * Inserts text at the provided position. * * This method is "unsafe" because it won't update the state of the writer unless * inserting at the end position. It is biased towards being fast at inserting closer * to the start or end, but slower to insert in the middle. Only use this if * absolutely necessary. * @param pos - Position to insert at. * @param text - Text to insert. */ unsafeInsert(pos: number, text: string): this; /** Gets the length of the string in the writer. */ getLength(): number; /** Gets if the writer is currently in a comment. */ isInComment(): boolean; /** Gets if the writer is currently at the start of the first line of the text, block, or indentation block. */ isAtStartOfFirstLineOfBlock(): boolean; /** Gets if the writer is currently on the first line of the text, block, or indentation block. */ isOnFirstLineOfBlock(): boolean; /** Gets if the writer is currently in a string. */ isInString(): boolean; /** Gets if the last chars written were for a newline. */ isLastNewLine(): boolean; /** Gets if the last chars written were for a blank line. */ isLastBlankLine(): boolean; /** Gets if the last char written was a space. */ isLastSpace(): boolean; /** Gets if the last char written was a tab. */ isLastTab(): boolean; /** Gets the last char written. */ getLastChar(): string | undefined; /** * Gets if the writer ends with the provided text. * @param text - Text to check if the writer ends with the provided text. */ endsWith(text: string): boolean; /** * Iterates over the writer characters in reverse order. The iteration stops when a non-null or * undefined value is returned from the action. The returned value is then returned by the method. * * @remarks It is much more efficient to use this method rather than `#toString()` since `#toString()` * will combine the internal array into a string. */ iterateLastChars<T>(action: (char: string, index: number) => T | undefined): T | undefined; /** * Iterates over the writer character char codes in reverse order. The iteration stops when a non-null or * undefined value is returned from the action. The returned value is then returned by the method. * * @remarks It is much more efficient to use this method rather than `#toString()` since `#toString()` * will combine the internal array into a string. Additionally, this is slightly more efficient that * `iterateLastChars` as this won't allocate a string per character. */ iterateLastCharCodes<T>(action: (charCode: number, index: number) => T | undefined): T | undefined; /** Gets the writer's text. */ toString(): string;}
/** Options for the writer. */export interface CodeBlockWriterOptions { /** * Newline character. * @remarks Defaults to \n. */ newLine: "\n" | "\r\n"; /** * Number of spaces to indent when `useTabs` is false. * @remarks Defaults to 4. */ indentNumberOfSpaces: number; /** * Whether to use tabs (true) or spaces (false). * @remarks Defaults to false. */ useTabs: boolean; /** * Whether to use a single quote (true) or double quote (false). * @remarks Defaults to false. */ useSingleQuote: boolean;}
ts_morph

Version Info

Tagged at
a month ago