typescript 7.1.0-dev.20260918.1 → 7.1.0-dev.20260919.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/api/async/api.d.ts +23 -8
  2. package/dist/api/async/api.d.ts.map +1 -1
  3. package/dist/api/async/api.js +7 -7
  4. package/dist/api/async/api.js.map +1 -1
  5. package/dist/api/async/types.d.ts +2 -2
  6. package/dist/api/async/types.d.ts.map +1 -1
  7. package/dist/api/fs.d.ts +11 -11
  8. package/dist/api/fs.d.ts.map +1 -1
  9. package/dist/api/fs.js +5 -5
  10. package/dist/api/fs.js.map +1 -1
  11. package/dist/api/node/node.generated.d.ts +3 -1
  12. package/dist/api/node/node.generated.d.ts.map +1 -1
  13. package/dist/api/node/node.generated.js +31 -0
  14. package/dist/api/node/node.generated.js.map +1 -1
  15. package/dist/api/node/node.infrastructure.d.ts +1 -1
  16. package/dist/api/node/node.infrastructure.d.ts.map +1 -1
  17. package/dist/api/node/wtf8.d.ts +1 -1
  18. package/dist/api/node/wtf8.d.ts.map +1 -1
  19. package/dist/api/options.d.ts +7 -7
  20. package/dist/api/options.d.ts.map +1 -1
  21. package/dist/api/proto.d.ts +1 -1
  22. package/dist/api/proto.d.ts.map +1 -1
  23. package/dist/api/proto.generated.d.ts +4 -3
  24. package/dist/api/proto.generated.d.ts.map +1 -1
  25. package/dist/api/proto.js +1 -1
  26. package/dist/api/proto.js.map +1 -1
  27. package/dist/api/sync/api.d.ts +24 -9
  28. package/dist/api/sync/api.d.ts.map +1 -1
  29. package/dist/api/sync/api.js +12 -12
  30. package/dist/api/sync/api.js.map +1 -1
  31. package/dist/api/sync/types.d.ts +2 -2
  32. package/dist/api/sync/types.d.ts.map +1 -1
  33. package/dist/api/timing.d.ts +2 -2
  34. package/dist/api/timing.d.ts.map +1 -1
  35. package/dist/ast/ast.d.ts +1 -0
  36. package/dist/ast/ast.d.ts.map +1 -1
  37. package/dist/ast/factory.generated.d.ts +1 -0
  38. package/dist/ast/factory.generated.d.ts.map +1 -1
  39. package/dist/ast/factory.generated.js +2651 -1
  40. package/dist/ast/factory.generated.js.map +1 -1
  41. package/dist/ast/visitor.d.ts +2 -0
  42. package/dist/ast/visitor.d.ts.map +1 -1
  43. package/dist/ast/visitor.js +40 -0
  44. package/dist/ast/visitor.js.map +1 -1
  45. package/package.json +9 -9
@@ -4,7 +4,7 @@ import { SyntaxKind } from "#enums/syntaxKind";
4
4
  import { TokenFlags } from "#enums/tokenFlags";
5
5
  import { getChildren, getFirstToken, getLastToken, getTokenPosOfNode, } from "./astnav.js";
6
6
  import { cloneSourceFileData } from "./utils.js";
7
- import { forEachChildOfJSDocParameterTag, forEachChildOfJSDocPropertyTag, } from "./visitor.js";
7
+ import { forEachChildOfJSDocParameterTag, forEachChildOfJSDocPropertyTag, yieldEachChildOfJSDocParameterTag, yieldEachChildOfJSDocPropertyTag, } from "./visitor.js";
8
8
  export class NodeObject {
9
9
  kind;
10
10
  flags = 0;
@@ -422,6 +422,10 @@ export class NodeObject {
422
422
  const fn = forEachChildTable[this.kind];
423
423
  return fn ? fn(this._data, visitor, visitArray) : undefined;
424
424
  }
425
+ childrenIter() {
426
+ const fn = yieldEachChildTable[this.kind];
427
+ return fn ? fn(this._data) : emptyChildrenIter();
428
+ }
425
429
  getSourceFile() {
426
430
  let node = this;
427
431
  while (node.parent)
@@ -1292,6 +1296,2652 @@ const forEachChildTable = {
1292
1296
  [SyntaxKind.SourceFile]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.statements) ||
1293
1297
  visitNode(cbNode, data.endOfFileToken),
1294
1298
  };
1299
+ function* emptyChildrenIter() {
1300
+ return undefined;
1301
+ }
1302
+ const yieldEachChildTable = {
1303
+ [SyntaxKind.QualifiedName]: function* (data) {
1304
+ if (data.left) {
1305
+ const res = yield data.left;
1306
+ if (res)
1307
+ return res;
1308
+ }
1309
+ if (data.right) {
1310
+ const res = yield data.right;
1311
+ if (res)
1312
+ return res;
1313
+ }
1314
+ },
1315
+ [SyntaxKind.ComputedPropertyName]: function* (data) {
1316
+ if (data.expression) {
1317
+ const res = yield data.expression;
1318
+ if (res)
1319
+ return res;
1320
+ }
1321
+ },
1322
+ [SyntaxKind.Decorator]: function* (data) {
1323
+ if (data.expression) {
1324
+ const res = yield data.expression;
1325
+ if (res)
1326
+ return res;
1327
+ }
1328
+ },
1329
+ [SyntaxKind.IfStatement]: function* (data) {
1330
+ if (data.expression) {
1331
+ const res = yield data.expression;
1332
+ if (res)
1333
+ return res;
1334
+ }
1335
+ if (data.thenStatement) {
1336
+ const res = yield data.thenStatement;
1337
+ if (res)
1338
+ return res;
1339
+ }
1340
+ if (data.elseStatement) {
1341
+ const res = yield data.elseStatement;
1342
+ if (res)
1343
+ return res;
1344
+ }
1345
+ },
1346
+ [SyntaxKind.DoStatement]: function* (data) {
1347
+ if (data.statement) {
1348
+ const res = yield data.statement;
1349
+ if (res)
1350
+ return res;
1351
+ }
1352
+ if (data.expression) {
1353
+ const res = yield data.expression;
1354
+ if (res)
1355
+ return res;
1356
+ }
1357
+ },
1358
+ [SyntaxKind.WhileStatement]: function* (data) {
1359
+ if (data.expression) {
1360
+ const res = yield data.expression;
1361
+ if (res)
1362
+ return res;
1363
+ }
1364
+ if (data.statement) {
1365
+ const res = yield data.statement;
1366
+ if (res)
1367
+ return res;
1368
+ }
1369
+ },
1370
+ [SyntaxKind.ForStatement]: function* (data) {
1371
+ if (data.initializer) {
1372
+ const res = yield data.initializer;
1373
+ if (res)
1374
+ return res;
1375
+ }
1376
+ if (data.condition) {
1377
+ const res = yield data.condition;
1378
+ if (res)
1379
+ return res;
1380
+ }
1381
+ if (data.incrementor) {
1382
+ const res = yield data.incrementor;
1383
+ if (res)
1384
+ return res;
1385
+ }
1386
+ if (data.statement) {
1387
+ const res = yield data.statement;
1388
+ if (res)
1389
+ return res;
1390
+ }
1391
+ },
1392
+ [SyntaxKind.BreakStatement]: function* (data) {
1393
+ if (data.label) {
1394
+ const res = yield data.label;
1395
+ if (res)
1396
+ return res;
1397
+ }
1398
+ },
1399
+ [SyntaxKind.ContinueStatement]: function* (data) {
1400
+ if (data.label) {
1401
+ const res = yield data.label;
1402
+ if (res)
1403
+ return res;
1404
+ }
1405
+ },
1406
+ [SyntaxKind.ReturnStatement]: function* (data) {
1407
+ if (data.expression) {
1408
+ const res = yield data.expression;
1409
+ if (res)
1410
+ return res;
1411
+ }
1412
+ },
1413
+ [SyntaxKind.WithStatement]: function* (data) {
1414
+ if (data.expression) {
1415
+ const res = yield data.expression;
1416
+ if (res)
1417
+ return res;
1418
+ }
1419
+ if (data.statement) {
1420
+ const res = yield data.statement;
1421
+ if (res)
1422
+ return res;
1423
+ }
1424
+ },
1425
+ [SyntaxKind.SwitchStatement]: function* (data) {
1426
+ if (data.expression) {
1427
+ const res = yield data.expression;
1428
+ if (res)
1429
+ return res;
1430
+ }
1431
+ if (data.caseBlock) {
1432
+ const res = yield data.caseBlock;
1433
+ if (res)
1434
+ return res;
1435
+ }
1436
+ },
1437
+ [SyntaxKind.CaseBlock]: function* (data) {
1438
+ for (const n of data.clauses) {
1439
+ const res = yield n;
1440
+ if (res)
1441
+ return res;
1442
+ }
1443
+ },
1444
+ [SyntaxKind.ThrowStatement]: function* (data) {
1445
+ if (data.expression) {
1446
+ const res = yield data.expression;
1447
+ if (res)
1448
+ return res;
1449
+ }
1450
+ },
1451
+ [SyntaxKind.TryStatement]: function* (data) {
1452
+ if (data.tryBlock) {
1453
+ const res = yield data.tryBlock;
1454
+ if (res)
1455
+ return res;
1456
+ }
1457
+ if (data.catchClause) {
1458
+ const res = yield data.catchClause;
1459
+ if (res)
1460
+ return res;
1461
+ }
1462
+ if (data.finallyBlock) {
1463
+ const res = yield data.finallyBlock;
1464
+ if (res)
1465
+ return res;
1466
+ }
1467
+ },
1468
+ [SyntaxKind.CatchClause]: function* (data) {
1469
+ if (data.variableDeclaration) {
1470
+ const res = yield data.variableDeclaration;
1471
+ if (res)
1472
+ return res;
1473
+ }
1474
+ if (data.block) {
1475
+ const res = yield data.block;
1476
+ if (res)
1477
+ return res;
1478
+ }
1479
+ },
1480
+ [SyntaxKind.LabeledStatement]: function* (data) {
1481
+ if (data.label) {
1482
+ const res = yield data.label;
1483
+ if (res)
1484
+ return res;
1485
+ }
1486
+ if (data.statement) {
1487
+ const res = yield data.statement;
1488
+ if (res)
1489
+ return res;
1490
+ }
1491
+ },
1492
+ [SyntaxKind.ExpressionStatement]: function* (data) {
1493
+ if (data.expression) {
1494
+ const res = yield data.expression;
1495
+ if (res)
1496
+ return res;
1497
+ }
1498
+ },
1499
+ [SyntaxKind.Block]: function* (data) {
1500
+ for (const n of data.statements) {
1501
+ const res = yield n;
1502
+ if (res)
1503
+ return res;
1504
+ }
1505
+ },
1506
+ [SyntaxKind.VariableStatement]: function* (data) {
1507
+ if (data.modifiers) {
1508
+ for (const n of data.modifiers) {
1509
+ const res = yield n;
1510
+ if (res)
1511
+ return res;
1512
+ }
1513
+ }
1514
+ if (data.declarationList) {
1515
+ const res = yield data.declarationList;
1516
+ if (res)
1517
+ return res;
1518
+ }
1519
+ },
1520
+ [SyntaxKind.VariableDeclaration]: function* (data) {
1521
+ if (data.name) {
1522
+ const res = yield data.name;
1523
+ if (res)
1524
+ return res;
1525
+ }
1526
+ if (data.exclamationToken) {
1527
+ const res = yield data.exclamationToken;
1528
+ if (res)
1529
+ return res;
1530
+ }
1531
+ if (data.type) {
1532
+ const res = yield data.type;
1533
+ if (res)
1534
+ return res;
1535
+ }
1536
+ if (data.initializer) {
1537
+ const res = yield data.initializer;
1538
+ if (res)
1539
+ return res;
1540
+ }
1541
+ },
1542
+ [SyntaxKind.VariableDeclarationList]: function* (data) {
1543
+ for (const n of data.declarations) {
1544
+ const res = yield n;
1545
+ if (res)
1546
+ return res;
1547
+ }
1548
+ },
1549
+ [SyntaxKind.Parameter]: function* (data) {
1550
+ if (data.modifiers) {
1551
+ for (const n of data.modifiers) {
1552
+ const res = yield n;
1553
+ if (res)
1554
+ return res;
1555
+ }
1556
+ }
1557
+ if (data.dotDotDotToken) {
1558
+ const res = yield data.dotDotDotToken;
1559
+ if (res)
1560
+ return res;
1561
+ }
1562
+ if (data.name) {
1563
+ const res = yield data.name;
1564
+ if (res)
1565
+ return res;
1566
+ }
1567
+ if (data.questionToken) {
1568
+ const res = yield data.questionToken;
1569
+ if (res)
1570
+ return res;
1571
+ }
1572
+ if (data.type) {
1573
+ const res = yield data.type;
1574
+ if (res)
1575
+ return res;
1576
+ }
1577
+ if (data.initializer) {
1578
+ const res = yield data.initializer;
1579
+ if (res)
1580
+ return res;
1581
+ }
1582
+ },
1583
+ [SyntaxKind.BindingElement]: function* (data) {
1584
+ if (data.dotDotDotToken) {
1585
+ const res = yield data.dotDotDotToken;
1586
+ if (res)
1587
+ return res;
1588
+ }
1589
+ if (data.propertyName) {
1590
+ const res = yield data.propertyName;
1591
+ if (res)
1592
+ return res;
1593
+ }
1594
+ if (data.name) {
1595
+ const res = yield data.name;
1596
+ if (res)
1597
+ return res;
1598
+ }
1599
+ if (data.initializer) {
1600
+ const res = yield data.initializer;
1601
+ if (res)
1602
+ return res;
1603
+ }
1604
+ },
1605
+ [SyntaxKind.MissingDeclaration]: function* (data) {
1606
+ if (data.modifiers) {
1607
+ for (const n of data.modifiers) {
1608
+ const res = yield n;
1609
+ if (res)
1610
+ return res;
1611
+ }
1612
+ }
1613
+ },
1614
+ [SyntaxKind.FunctionDeclaration]: function* (data) {
1615
+ if (data.modifiers) {
1616
+ for (const n of data.modifiers) {
1617
+ const res = yield n;
1618
+ if (res)
1619
+ return res;
1620
+ }
1621
+ }
1622
+ if (data.asteriskToken) {
1623
+ const res = yield data.asteriskToken;
1624
+ if (res)
1625
+ return res;
1626
+ }
1627
+ if (data.name) {
1628
+ const res = yield data.name;
1629
+ if (res)
1630
+ return res;
1631
+ }
1632
+ if (data.typeParameters) {
1633
+ for (const n of data.typeParameters) {
1634
+ const res = yield n;
1635
+ if (res)
1636
+ return res;
1637
+ }
1638
+ }
1639
+ for (const n of data.parameters) {
1640
+ const res = yield n;
1641
+ if (res)
1642
+ return res;
1643
+ }
1644
+ if (data.type) {
1645
+ const res = yield data.type;
1646
+ if (res)
1647
+ return res;
1648
+ }
1649
+ if (data.body) {
1650
+ const res = yield data.body;
1651
+ if (res)
1652
+ return res;
1653
+ }
1654
+ },
1655
+ [SyntaxKind.ClassDeclaration]: function* (data) {
1656
+ if (data.modifiers) {
1657
+ for (const n of data.modifiers) {
1658
+ const res = yield n;
1659
+ if (res)
1660
+ return res;
1661
+ }
1662
+ }
1663
+ if (data.name) {
1664
+ const res = yield data.name;
1665
+ if (res)
1666
+ return res;
1667
+ }
1668
+ if (data.typeParameters) {
1669
+ for (const n of data.typeParameters) {
1670
+ const res = yield n;
1671
+ if (res)
1672
+ return res;
1673
+ }
1674
+ }
1675
+ if (data.heritageClauses) {
1676
+ for (const n of data.heritageClauses) {
1677
+ const res = yield n;
1678
+ if (res)
1679
+ return res;
1680
+ }
1681
+ }
1682
+ for (const n of data.members) {
1683
+ const res = yield n;
1684
+ if (res)
1685
+ return res;
1686
+ }
1687
+ },
1688
+ [SyntaxKind.ClassExpression]: function* (data) {
1689
+ if (data.modifiers) {
1690
+ for (const n of data.modifiers) {
1691
+ const res = yield n;
1692
+ if (res)
1693
+ return res;
1694
+ }
1695
+ }
1696
+ if (data.name) {
1697
+ const res = yield data.name;
1698
+ if (res)
1699
+ return res;
1700
+ }
1701
+ if (data.typeParameters) {
1702
+ for (const n of data.typeParameters) {
1703
+ const res = yield n;
1704
+ if (res)
1705
+ return res;
1706
+ }
1707
+ }
1708
+ if (data.heritageClauses) {
1709
+ for (const n of data.heritageClauses) {
1710
+ const res = yield n;
1711
+ if (res)
1712
+ return res;
1713
+ }
1714
+ }
1715
+ for (const n of data.members) {
1716
+ const res = yield n;
1717
+ if (res)
1718
+ return res;
1719
+ }
1720
+ },
1721
+ [SyntaxKind.HeritageClause]: function* (data) {
1722
+ for (const n of data.types) {
1723
+ const res = yield n;
1724
+ if (res)
1725
+ return res;
1726
+ }
1727
+ },
1728
+ [SyntaxKind.InterfaceDeclaration]: function* (data) {
1729
+ if (data.modifiers) {
1730
+ for (const n of data.modifiers) {
1731
+ const res = yield n;
1732
+ if (res)
1733
+ return res;
1734
+ }
1735
+ }
1736
+ if (data.name) {
1737
+ const res = yield data.name;
1738
+ if (res)
1739
+ return res;
1740
+ }
1741
+ if (data.typeParameters) {
1742
+ for (const n of data.typeParameters) {
1743
+ const res = yield n;
1744
+ if (res)
1745
+ return res;
1746
+ }
1747
+ }
1748
+ if (data.heritageClauses) {
1749
+ for (const n of data.heritageClauses) {
1750
+ const res = yield n;
1751
+ if (res)
1752
+ return res;
1753
+ }
1754
+ }
1755
+ for (const n of data.members) {
1756
+ const res = yield n;
1757
+ if (res)
1758
+ return res;
1759
+ }
1760
+ },
1761
+ [SyntaxKind.TypeAliasDeclaration]: function* (data) {
1762
+ if (data.modifiers) {
1763
+ for (const n of data.modifiers) {
1764
+ const res = yield n;
1765
+ if (res)
1766
+ return res;
1767
+ }
1768
+ }
1769
+ if (data.name) {
1770
+ const res = yield data.name;
1771
+ if (res)
1772
+ return res;
1773
+ }
1774
+ if (data.typeParameters) {
1775
+ for (const n of data.typeParameters) {
1776
+ const res = yield n;
1777
+ if (res)
1778
+ return res;
1779
+ }
1780
+ }
1781
+ if (data.type) {
1782
+ const res = yield data.type;
1783
+ if (res)
1784
+ return res;
1785
+ }
1786
+ },
1787
+ [SyntaxKind.JSTypeAliasDeclaration]: function* (data) {
1788
+ if (data.modifiers) {
1789
+ for (const n of data.modifiers) {
1790
+ const res = yield n;
1791
+ if (res)
1792
+ return res;
1793
+ }
1794
+ }
1795
+ if (data.name) {
1796
+ const res = yield data.name;
1797
+ if (res)
1798
+ return res;
1799
+ }
1800
+ if (data.typeParameters) {
1801
+ for (const n of data.typeParameters) {
1802
+ const res = yield n;
1803
+ if (res)
1804
+ return res;
1805
+ }
1806
+ }
1807
+ if (data.type) {
1808
+ const res = yield data.type;
1809
+ if (res)
1810
+ return res;
1811
+ }
1812
+ },
1813
+ [SyntaxKind.EnumMember]: function* (data) {
1814
+ if (data.name) {
1815
+ const res = yield data.name;
1816
+ if (res)
1817
+ return res;
1818
+ }
1819
+ if (data.initializer) {
1820
+ const res = yield data.initializer;
1821
+ if (res)
1822
+ return res;
1823
+ }
1824
+ },
1825
+ [SyntaxKind.EnumDeclaration]: function* (data) {
1826
+ if (data.modifiers) {
1827
+ for (const n of data.modifiers) {
1828
+ const res = yield n;
1829
+ if (res)
1830
+ return res;
1831
+ }
1832
+ }
1833
+ if (data.name) {
1834
+ const res = yield data.name;
1835
+ if (res)
1836
+ return res;
1837
+ }
1838
+ for (const n of data.members) {
1839
+ const res = yield n;
1840
+ if (res)
1841
+ return res;
1842
+ }
1843
+ },
1844
+ [SyntaxKind.ModuleBlock]: function* (data) {
1845
+ for (const n of data.statements) {
1846
+ const res = yield n;
1847
+ if (res)
1848
+ return res;
1849
+ }
1850
+ },
1851
+ [SyntaxKind.ImportDeclaration]: function* (data) {
1852
+ if (data.modifiers) {
1853
+ for (const n of data.modifiers) {
1854
+ const res = yield n;
1855
+ if (res)
1856
+ return res;
1857
+ }
1858
+ }
1859
+ if (data.importClause) {
1860
+ const res = yield data.importClause;
1861
+ if (res)
1862
+ return res;
1863
+ }
1864
+ if (data.moduleSpecifier) {
1865
+ const res = yield data.moduleSpecifier;
1866
+ if (res)
1867
+ return res;
1868
+ }
1869
+ if (data.attributes) {
1870
+ const res = yield data.attributes;
1871
+ if (res)
1872
+ return res;
1873
+ }
1874
+ },
1875
+ [SyntaxKind.JSImportDeclaration]: function* (data) {
1876
+ if (data.modifiers) {
1877
+ for (const n of data.modifiers) {
1878
+ const res = yield n;
1879
+ if (res)
1880
+ return res;
1881
+ }
1882
+ }
1883
+ if (data.importClause) {
1884
+ const res = yield data.importClause;
1885
+ if (res)
1886
+ return res;
1887
+ }
1888
+ if (data.moduleSpecifier) {
1889
+ const res = yield data.moduleSpecifier;
1890
+ if (res)
1891
+ return res;
1892
+ }
1893
+ if (data.attributes) {
1894
+ const res = yield data.attributes;
1895
+ if (res)
1896
+ return res;
1897
+ }
1898
+ },
1899
+ [SyntaxKind.ExternalModuleReference]: function* (data) {
1900
+ if (data.expression) {
1901
+ const res = yield data.expression;
1902
+ if (res)
1903
+ return res;
1904
+ }
1905
+ },
1906
+ [SyntaxKind.NamespaceImport]: function* (data) {
1907
+ if (data.name) {
1908
+ const res = yield data.name;
1909
+ if (res)
1910
+ return res;
1911
+ }
1912
+ },
1913
+ [SyntaxKind.NamedImports]: function* (data) {
1914
+ for (const n of data.elements) {
1915
+ const res = yield n;
1916
+ if (res)
1917
+ return res;
1918
+ }
1919
+ },
1920
+ [SyntaxKind.ExportAssignment]: function* (data) {
1921
+ if (data.modifiers) {
1922
+ for (const n of data.modifiers) {
1923
+ const res = yield n;
1924
+ if (res)
1925
+ return res;
1926
+ }
1927
+ }
1928
+ if (data.type) {
1929
+ const res = yield data.type;
1930
+ if (res)
1931
+ return res;
1932
+ }
1933
+ if (data.expression) {
1934
+ const res = yield data.expression;
1935
+ if (res)
1936
+ return res;
1937
+ }
1938
+ },
1939
+ [SyntaxKind.NamespaceExportDeclaration]: function* (data) {
1940
+ if (data.modifiers) {
1941
+ for (const n of data.modifiers) {
1942
+ const res = yield n;
1943
+ if (res)
1944
+ return res;
1945
+ }
1946
+ }
1947
+ if (data.name) {
1948
+ const res = yield data.name;
1949
+ if (res)
1950
+ return res;
1951
+ }
1952
+ },
1953
+ [SyntaxKind.NamespaceExport]: function* (data) {
1954
+ if (data.name) {
1955
+ const res = yield data.name;
1956
+ if (res)
1957
+ return res;
1958
+ }
1959
+ },
1960
+ [SyntaxKind.NamedExports]: function* (data) {
1961
+ for (const n of data.elements) {
1962
+ const res = yield n;
1963
+ if (res)
1964
+ return res;
1965
+ }
1966
+ },
1967
+ [SyntaxKind.ExportSpecifier]: function* (data) {
1968
+ if (data.propertyName) {
1969
+ const res = yield data.propertyName;
1970
+ if (res)
1971
+ return res;
1972
+ }
1973
+ if (data.name) {
1974
+ const res = yield data.name;
1975
+ if (res)
1976
+ return res;
1977
+ }
1978
+ },
1979
+ [SyntaxKind.CallSignature]: function* (data) {
1980
+ if (data.typeParameters) {
1981
+ for (const n of data.typeParameters) {
1982
+ const res = yield n;
1983
+ if (res)
1984
+ return res;
1985
+ }
1986
+ }
1987
+ for (const n of data.parameters) {
1988
+ const res = yield n;
1989
+ if (res)
1990
+ return res;
1991
+ }
1992
+ if (data.type) {
1993
+ const res = yield data.type;
1994
+ if (res)
1995
+ return res;
1996
+ }
1997
+ },
1998
+ [SyntaxKind.ConstructSignature]: function* (data) {
1999
+ if (data.typeParameters) {
2000
+ for (const n of data.typeParameters) {
2001
+ const res = yield n;
2002
+ if (res)
2003
+ return res;
2004
+ }
2005
+ }
2006
+ for (const n of data.parameters) {
2007
+ const res = yield n;
2008
+ if (res)
2009
+ return res;
2010
+ }
2011
+ if (data.type) {
2012
+ const res = yield data.type;
2013
+ if (res)
2014
+ return res;
2015
+ }
2016
+ },
2017
+ [SyntaxKind.Constructor]: function* (data) {
2018
+ if (data.modifiers) {
2019
+ for (const n of data.modifiers) {
2020
+ const res = yield n;
2021
+ if (res)
2022
+ return res;
2023
+ }
2024
+ }
2025
+ if (data.typeParameters) {
2026
+ for (const n of data.typeParameters) {
2027
+ const res = yield n;
2028
+ if (res)
2029
+ return res;
2030
+ }
2031
+ }
2032
+ for (const n of data.parameters) {
2033
+ const res = yield n;
2034
+ if (res)
2035
+ return res;
2036
+ }
2037
+ if (data.type) {
2038
+ const res = yield data.type;
2039
+ if (res)
2040
+ return res;
2041
+ }
2042
+ if (data.body) {
2043
+ const res = yield data.body;
2044
+ if (res)
2045
+ return res;
2046
+ }
2047
+ },
2048
+ [SyntaxKind.GetAccessor]: function* (data) {
2049
+ if (data.modifiers) {
2050
+ for (const n of data.modifiers) {
2051
+ const res = yield n;
2052
+ if (res)
2053
+ return res;
2054
+ }
2055
+ }
2056
+ if (data.name) {
2057
+ const res = yield data.name;
2058
+ if (res)
2059
+ return res;
2060
+ }
2061
+ if (data.typeParameters) {
2062
+ for (const n of data.typeParameters) {
2063
+ const res = yield n;
2064
+ if (res)
2065
+ return res;
2066
+ }
2067
+ }
2068
+ for (const n of data.parameters) {
2069
+ const res = yield n;
2070
+ if (res)
2071
+ return res;
2072
+ }
2073
+ if (data.type) {
2074
+ const res = yield data.type;
2075
+ if (res)
2076
+ return res;
2077
+ }
2078
+ if (data.body) {
2079
+ const res = yield data.body;
2080
+ if (res)
2081
+ return res;
2082
+ }
2083
+ },
2084
+ [SyntaxKind.SetAccessor]: function* (data) {
2085
+ if (data.modifiers) {
2086
+ for (const n of data.modifiers) {
2087
+ const res = yield n;
2088
+ if (res)
2089
+ return res;
2090
+ }
2091
+ }
2092
+ if (data.name) {
2093
+ const res = yield data.name;
2094
+ if (res)
2095
+ return res;
2096
+ }
2097
+ if (data.typeParameters) {
2098
+ for (const n of data.typeParameters) {
2099
+ const res = yield n;
2100
+ if (res)
2101
+ return res;
2102
+ }
2103
+ }
2104
+ for (const n of data.parameters) {
2105
+ const res = yield n;
2106
+ if (res)
2107
+ return res;
2108
+ }
2109
+ if (data.type) {
2110
+ const res = yield data.type;
2111
+ if (res)
2112
+ return res;
2113
+ }
2114
+ if (data.body) {
2115
+ const res = yield data.body;
2116
+ if (res)
2117
+ return res;
2118
+ }
2119
+ },
2120
+ [SyntaxKind.IndexSignature]: function* (data) {
2121
+ if (data.modifiers) {
2122
+ for (const n of data.modifiers) {
2123
+ const res = yield n;
2124
+ if (res)
2125
+ return res;
2126
+ }
2127
+ }
2128
+ for (const n of data.parameters) {
2129
+ const res = yield n;
2130
+ if (res)
2131
+ return res;
2132
+ }
2133
+ if (data.type) {
2134
+ const res = yield data.type;
2135
+ if (res)
2136
+ return res;
2137
+ }
2138
+ },
2139
+ [SyntaxKind.MethodSignature]: function* (data) {
2140
+ if (data.modifiers) {
2141
+ for (const n of data.modifiers) {
2142
+ const res = yield n;
2143
+ if (res)
2144
+ return res;
2145
+ }
2146
+ }
2147
+ if (data.name) {
2148
+ const res = yield data.name;
2149
+ if (res)
2150
+ return res;
2151
+ }
2152
+ if (data.postfixToken) {
2153
+ const res = yield data.postfixToken;
2154
+ if (res)
2155
+ return res;
2156
+ }
2157
+ if (data.typeParameters) {
2158
+ for (const n of data.typeParameters) {
2159
+ const res = yield n;
2160
+ if (res)
2161
+ return res;
2162
+ }
2163
+ }
2164
+ for (const n of data.parameters) {
2165
+ const res = yield n;
2166
+ if (res)
2167
+ return res;
2168
+ }
2169
+ if (data.type) {
2170
+ const res = yield data.type;
2171
+ if (res)
2172
+ return res;
2173
+ }
2174
+ },
2175
+ [SyntaxKind.MethodDeclaration]: function* (data) {
2176
+ if (data.modifiers) {
2177
+ for (const n of data.modifiers) {
2178
+ const res = yield n;
2179
+ if (res)
2180
+ return res;
2181
+ }
2182
+ }
2183
+ if (data.asteriskToken) {
2184
+ const res = yield data.asteriskToken;
2185
+ if (res)
2186
+ return res;
2187
+ }
2188
+ if (data.name) {
2189
+ const res = yield data.name;
2190
+ if (res)
2191
+ return res;
2192
+ }
2193
+ if (data.postfixToken) {
2194
+ const res = yield data.postfixToken;
2195
+ if (res)
2196
+ return res;
2197
+ }
2198
+ if (data.typeParameters) {
2199
+ for (const n of data.typeParameters) {
2200
+ const res = yield n;
2201
+ if (res)
2202
+ return res;
2203
+ }
2204
+ }
2205
+ for (const n of data.parameters) {
2206
+ const res = yield n;
2207
+ if (res)
2208
+ return res;
2209
+ }
2210
+ if (data.type) {
2211
+ const res = yield data.type;
2212
+ if (res)
2213
+ return res;
2214
+ }
2215
+ if (data.body) {
2216
+ const res = yield data.body;
2217
+ if (res)
2218
+ return res;
2219
+ }
2220
+ },
2221
+ [SyntaxKind.PropertySignature]: function* (data) {
2222
+ if (data.modifiers) {
2223
+ for (const n of data.modifiers) {
2224
+ const res = yield n;
2225
+ if (res)
2226
+ return res;
2227
+ }
2228
+ }
2229
+ if (data.name) {
2230
+ const res = yield data.name;
2231
+ if (res)
2232
+ return res;
2233
+ }
2234
+ if (data.postfixToken) {
2235
+ const res = yield data.postfixToken;
2236
+ if (res)
2237
+ return res;
2238
+ }
2239
+ if (data.type) {
2240
+ const res = yield data.type;
2241
+ if (res)
2242
+ return res;
2243
+ }
2244
+ if (data.initializer) {
2245
+ const res = yield data.initializer;
2246
+ if (res)
2247
+ return res;
2248
+ }
2249
+ },
2250
+ [SyntaxKind.PropertyDeclaration]: function* (data) {
2251
+ if (data.modifiers) {
2252
+ for (const n of data.modifiers) {
2253
+ const res = yield n;
2254
+ if (res)
2255
+ return res;
2256
+ }
2257
+ }
2258
+ if (data.name) {
2259
+ const res = yield data.name;
2260
+ if (res)
2261
+ return res;
2262
+ }
2263
+ if (data.postfixToken) {
2264
+ const res = yield data.postfixToken;
2265
+ if (res)
2266
+ return res;
2267
+ }
2268
+ if (data.type) {
2269
+ const res = yield data.type;
2270
+ if (res)
2271
+ return res;
2272
+ }
2273
+ if (data.initializer) {
2274
+ const res = yield data.initializer;
2275
+ if (res)
2276
+ return res;
2277
+ }
2278
+ },
2279
+ [SyntaxKind.ClassStaticBlockDeclaration]: function* (data) {
2280
+ if (data.modifiers) {
2281
+ for (const n of data.modifiers) {
2282
+ const res = yield n;
2283
+ if (res)
2284
+ return res;
2285
+ }
2286
+ }
2287
+ if (data.body) {
2288
+ const res = yield data.body;
2289
+ if (res)
2290
+ return res;
2291
+ }
2292
+ },
2293
+ [SyntaxKind.BinaryExpression]: function* (data) {
2294
+ if (data.modifiers) {
2295
+ for (const n of data.modifiers) {
2296
+ const res = yield n;
2297
+ if (res)
2298
+ return res;
2299
+ }
2300
+ }
2301
+ if (data.left) {
2302
+ const res = yield data.left;
2303
+ if (res)
2304
+ return res;
2305
+ }
2306
+ if (data.type) {
2307
+ const res = yield data.type;
2308
+ if (res)
2309
+ return res;
2310
+ }
2311
+ if (data.operatorToken) {
2312
+ const res = yield data.operatorToken;
2313
+ if (res)
2314
+ return res;
2315
+ }
2316
+ if (data.right) {
2317
+ const res = yield data.right;
2318
+ if (res)
2319
+ return res;
2320
+ }
2321
+ },
2322
+ [SyntaxKind.PrefixUnaryExpression]: function* (data) {
2323
+ if (data.operand) {
2324
+ const res = yield data.operand;
2325
+ if (res)
2326
+ return res;
2327
+ }
2328
+ },
2329
+ [SyntaxKind.PostfixUnaryExpression]: function* (data) {
2330
+ if (data.operand) {
2331
+ const res = yield data.operand;
2332
+ if (res)
2333
+ return res;
2334
+ }
2335
+ },
2336
+ [SyntaxKind.YieldExpression]: function* (data) {
2337
+ if (data.asteriskToken) {
2338
+ const res = yield data.asteriskToken;
2339
+ if (res)
2340
+ return res;
2341
+ }
2342
+ if (data.expression) {
2343
+ const res = yield data.expression;
2344
+ if (res)
2345
+ return res;
2346
+ }
2347
+ },
2348
+ [SyntaxKind.ArrowFunction]: function* (data) {
2349
+ if (data.modifiers) {
2350
+ for (const n of data.modifiers) {
2351
+ const res = yield n;
2352
+ if (res)
2353
+ return res;
2354
+ }
2355
+ }
2356
+ if (data.typeParameters) {
2357
+ for (const n of data.typeParameters) {
2358
+ const res = yield n;
2359
+ if (res)
2360
+ return res;
2361
+ }
2362
+ }
2363
+ for (const n of data.parameters) {
2364
+ const res = yield n;
2365
+ if (res)
2366
+ return res;
2367
+ }
2368
+ if (data.type) {
2369
+ const res = yield data.type;
2370
+ if (res)
2371
+ return res;
2372
+ }
2373
+ if (data.equalsGreaterThanToken) {
2374
+ const res = yield data.equalsGreaterThanToken;
2375
+ if (res)
2376
+ return res;
2377
+ }
2378
+ if (data.body) {
2379
+ const res = yield data.body;
2380
+ if (res)
2381
+ return res;
2382
+ }
2383
+ },
2384
+ [SyntaxKind.FunctionExpression]: function* (data) {
2385
+ if (data.modifiers) {
2386
+ for (const n of data.modifiers) {
2387
+ const res = yield n;
2388
+ if (res)
2389
+ return res;
2390
+ }
2391
+ }
2392
+ if (data.asteriskToken) {
2393
+ const res = yield data.asteriskToken;
2394
+ if (res)
2395
+ return res;
2396
+ }
2397
+ if (data.name) {
2398
+ const res = yield data.name;
2399
+ if (res)
2400
+ return res;
2401
+ }
2402
+ if (data.typeParameters) {
2403
+ for (const n of data.typeParameters) {
2404
+ const res = yield n;
2405
+ if (res)
2406
+ return res;
2407
+ }
2408
+ }
2409
+ for (const n of data.parameters) {
2410
+ const res = yield n;
2411
+ if (res)
2412
+ return res;
2413
+ }
2414
+ if (data.type) {
2415
+ const res = yield data.type;
2416
+ if (res)
2417
+ return res;
2418
+ }
2419
+ if (data.body) {
2420
+ const res = yield data.body;
2421
+ if (res)
2422
+ return res;
2423
+ }
2424
+ },
2425
+ [SyntaxKind.AsExpression]: function* (data) {
2426
+ if (data.expression) {
2427
+ const res = yield data.expression;
2428
+ if (res)
2429
+ return res;
2430
+ }
2431
+ if (data.type) {
2432
+ const res = yield data.type;
2433
+ if (res)
2434
+ return res;
2435
+ }
2436
+ },
2437
+ [SyntaxKind.SatisfiesExpression]: function* (data) {
2438
+ if (data.expression) {
2439
+ const res = yield data.expression;
2440
+ if (res)
2441
+ return res;
2442
+ }
2443
+ if (data.type) {
2444
+ const res = yield data.type;
2445
+ if (res)
2446
+ return res;
2447
+ }
2448
+ },
2449
+ [SyntaxKind.ConditionalExpression]: function* (data) {
2450
+ if (data.condition) {
2451
+ const res = yield data.condition;
2452
+ if (res)
2453
+ return res;
2454
+ }
2455
+ if (data.questionToken) {
2456
+ const res = yield data.questionToken;
2457
+ if (res)
2458
+ return res;
2459
+ }
2460
+ if (data.whenTrue) {
2461
+ const res = yield data.whenTrue;
2462
+ if (res)
2463
+ return res;
2464
+ }
2465
+ if (data.colonToken) {
2466
+ const res = yield data.colonToken;
2467
+ if (res)
2468
+ return res;
2469
+ }
2470
+ if (data.whenFalse) {
2471
+ const res = yield data.whenFalse;
2472
+ if (res)
2473
+ return res;
2474
+ }
2475
+ },
2476
+ [SyntaxKind.PropertyAccessExpression]: function* (data) {
2477
+ if (data.expression) {
2478
+ const res = yield data.expression;
2479
+ if (res)
2480
+ return res;
2481
+ }
2482
+ if (data.questionDotToken) {
2483
+ const res = yield data.questionDotToken;
2484
+ if (res)
2485
+ return res;
2486
+ }
2487
+ if (data.name) {
2488
+ const res = yield data.name;
2489
+ if (res)
2490
+ return res;
2491
+ }
2492
+ },
2493
+ [SyntaxKind.ElementAccessExpression]: function* (data) {
2494
+ if (data.expression) {
2495
+ const res = yield data.expression;
2496
+ if (res)
2497
+ return res;
2498
+ }
2499
+ if (data.questionDotToken) {
2500
+ const res = yield data.questionDotToken;
2501
+ if (res)
2502
+ return res;
2503
+ }
2504
+ if (data.argumentExpression) {
2505
+ const res = yield data.argumentExpression;
2506
+ if (res)
2507
+ return res;
2508
+ }
2509
+ },
2510
+ [SyntaxKind.CallExpression]: function* (data) {
2511
+ if (data.expression) {
2512
+ const res = yield data.expression;
2513
+ if (res)
2514
+ return res;
2515
+ }
2516
+ if (data.questionDotToken) {
2517
+ const res = yield data.questionDotToken;
2518
+ if (res)
2519
+ return res;
2520
+ }
2521
+ if (data.typeArguments) {
2522
+ for (const n of data.typeArguments) {
2523
+ const res = yield n;
2524
+ if (res)
2525
+ return res;
2526
+ }
2527
+ }
2528
+ for (const n of data.arguments) {
2529
+ const res = yield n;
2530
+ if (res)
2531
+ return res;
2532
+ }
2533
+ },
2534
+ [SyntaxKind.NewExpression]: function* (data) {
2535
+ if (data.expression) {
2536
+ const res = yield data.expression;
2537
+ if (res)
2538
+ return res;
2539
+ }
2540
+ if (data.typeArguments) {
2541
+ for (const n of data.typeArguments) {
2542
+ const res = yield n;
2543
+ if (res)
2544
+ return res;
2545
+ }
2546
+ }
2547
+ if (data.arguments) {
2548
+ for (const n of data.arguments) {
2549
+ const res = yield n;
2550
+ if (res)
2551
+ return res;
2552
+ }
2553
+ }
2554
+ },
2555
+ [SyntaxKind.MetaProperty]: function* (data) {
2556
+ if (data.name) {
2557
+ const res = yield data.name;
2558
+ if (res)
2559
+ return res;
2560
+ }
2561
+ },
2562
+ [SyntaxKind.NonNullExpression]: function* (data) {
2563
+ if (data.expression) {
2564
+ const res = yield data.expression;
2565
+ if (res)
2566
+ return res;
2567
+ }
2568
+ },
2569
+ [SyntaxKind.SpreadElement]: function* (data) {
2570
+ if (data.expression) {
2571
+ const res = yield data.expression;
2572
+ if (res)
2573
+ return res;
2574
+ }
2575
+ },
2576
+ [SyntaxKind.TemplateExpression]: function* (data) {
2577
+ if (data.head) {
2578
+ const res = yield data.head;
2579
+ if (res)
2580
+ return res;
2581
+ }
2582
+ for (const n of data.templateSpans) {
2583
+ const res = yield n;
2584
+ if (res)
2585
+ return res;
2586
+ }
2587
+ },
2588
+ [SyntaxKind.TemplateSpan]: function* (data) {
2589
+ if (data.expression) {
2590
+ const res = yield data.expression;
2591
+ if (res)
2592
+ return res;
2593
+ }
2594
+ if (data.literal) {
2595
+ const res = yield data.literal;
2596
+ if (res)
2597
+ return res;
2598
+ }
2599
+ },
2600
+ [SyntaxKind.TaggedTemplateExpression]: function* (data) {
2601
+ if (data.tag) {
2602
+ const res = yield data.tag;
2603
+ if (res)
2604
+ return res;
2605
+ }
2606
+ if (data.questionDotToken) {
2607
+ const res = yield data.questionDotToken;
2608
+ if (res)
2609
+ return res;
2610
+ }
2611
+ if (data.typeArguments) {
2612
+ for (const n of data.typeArguments) {
2613
+ const res = yield n;
2614
+ if (res)
2615
+ return res;
2616
+ }
2617
+ }
2618
+ if (data.template) {
2619
+ const res = yield data.template;
2620
+ if (res)
2621
+ return res;
2622
+ }
2623
+ },
2624
+ [SyntaxKind.ParenthesizedExpression]: function* (data) {
2625
+ if (data.expression) {
2626
+ const res = yield data.expression;
2627
+ if (res)
2628
+ return res;
2629
+ }
2630
+ },
2631
+ [SyntaxKind.ArrayLiteralExpression]: function* (data) {
2632
+ for (const n of data.elements) {
2633
+ const res = yield n;
2634
+ if (res)
2635
+ return res;
2636
+ }
2637
+ },
2638
+ [SyntaxKind.ObjectLiteralExpression]: function* (data) {
2639
+ for (const n of data.properties) {
2640
+ const res = yield n;
2641
+ if (res)
2642
+ return res;
2643
+ }
2644
+ },
2645
+ [SyntaxKind.SpreadAssignment]: function* (data) {
2646
+ if (data.expression) {
2647
+ const res = yield data.expression;
2648
+ if (res)
2649
+ return res;
2650
+ }
2651
+ },
2652
+ [SyntaxKind.PropertyAssignment]: function* (data) {
2653
+ if (data.modifiers) {
2654
+ for (const n of data.modifiers) {
2655
+ const res = yield n;
2656
+ if (res)
2657
+ return res;
2658
+ }
2659
+ }
2660
+ if (data.name) {
2661
+ const res = yield data.name;
2662
+ if (res)
2663
+ return res;
2664
+ }
2665
+ if (data.postfixToken) {
2666
+ const res = yield data.postfixToken;
2667
+ if (res)
2668
+ return res;
2669
+ }
2670
+ if (data.type) {
2671
+ const res = yield data.type;
2672
+ if (res)
2673
+ return res;
2674
+ }
2675
+ if (data.initializer) {
2676
+ const res = yield data.initializer;
2677
+ if (res)
2678
+ return res;
2679
+ }
2680
+ },
2681
+ [SyntaxKind.ShorthandPropertyAssignment]: function* (data) {
2682
+ if (data.modifiers) {
2683
+ for (const n of data.modifiers) {
2684
+ const res = yield n;
2685
+ if (res)
2686
+ return res;
2687
+ }
2688
+ }
2689
+ if (data.name) {
2690
+ const res = yield data.name;
2691
+ if (res)
2692
+ return res;
2693
+ }
2694
+ if (data.postfixToken) {
2695
+ const res = yield data.postfixToken;
2696
+ if (res)
2697
+ return res;
2698
+ }
2699
+ if (data.type) {
2700
+ const res = yield data.type;
2701
+ if (res)
2702
+ return res;
2703
+ }
2704
+ if (data.equalsToken) {
2705
+ const res = yield data.equalsToken;
2706
+ if (res)
2707
+ return res;
2708
+ }
2709
+ if (data.objectAssignmentInitializer) {
2710
+ const res = yield data.objectAssignmentInitializer;
2711
+ if (res)
2712
+ return res;
2713
+ }
2714
+ },
2715
+ [SyntaxKind.DeleteExpression]: function* (data) {
2716
+ if (data.expression) {
2717
+ const res = yield data.expression;
2718
+ if (res)
2719
+ return res;
2720
+ }
2721
+ },
2722
+ [SyntaxKind.TypeOfExpression]: function* (data) {
2723
+ if (data.expression) {
2724
+ const res = yield data.expression;
2725
+ if (res)
2726
+ return res;
2727
+ }
2728
+ },
2729
+ [SyntaxKind.VoidExpression]: function* (data) {
2730
+ if (data.expression) {
2731
+ const res = yield data.expression;
2732
+ if (res)
2733
+ return res;
2734
+ }
2735
+ },
2736
+ [SyntaxKind.AwaitExpression]: function* (data) {
2737
+ if (data.expression) {
2738
+ const res = yield data.expression;
2739
+ if (res)
2740
+ return res;
2741
+ }
2742
+ },
2743
+ [SyntaxKind.TypeAssertionExpression]: function* (data) {
2744
+ if (data.type) {
2745
+ const res = yield data.type;
2746
+ if (res)
2747
+ return res;
2748
+ }
2749
+ if (data.expression) {
2750
+ const res = yield data.expression;
2751
+ if (res)
2752
+ return res;
2753
+ }
2754
+ },
2755
+ [SyntaxKind.UnionType]: function* (data) {
2756
+ for (const n of data.types) {
2757
+ const res = yield n;
2758
+ if (res)
2759
+ return res;
2760
+ }
2761
+ },
2762
+ [SyntaxKind.IntersectionType]: function* (data) {
2763
+ for (const n of data.types) {
2764
+ const res = yield n;
2765
+ if (res)
2766
+ return res;
2767
+ }
2768
+ },
2769
+ [SyntaxKind.ConditionalType]: function* (data) {
2770
+ if (data.checkType) {
2771
+ const res = yield data.checkType;
2772
+ if (res)
2773
+ return res;
2774
+ }
2775
+ if (data.extendsType) {
2776
+ const res = yield data.extendsType;
2777
+ if (res)
2778
+ return res;
2779
+ }
2780
+ if (data.trueType) {
2781
+ const res = yield data.trueType;
2782
+ if (res)
2783
+ return res;
2784
+ }
2785
+ if (data.falseType) {
2786
+ const res = yield data.falseType;
2787
+ if (res)
2788
+ return res;
2789
+ }
2790
+ },
2791
+ [SyntaxKind.TypeOperator]: function* (data) {
2792
+ if (data.type) {
2793
+ const res = yield data.type;
2794
+ if (res)
2795
+ return res;
2796
+ }
2797
+ },
2798
+ [SyntaxKind.InferType]: function* (data) {
2799
+ if (data.typeParameter) {
2800
+ const res = yield data.typeParameter;
2801
+ if (res)
2802
+ return res;
2803
+ }
2804
+ },
2805
+ [SyntaxKind.ArrayType]: function* (data) {
2806
+ if (data.elementType) {
2807
+ const res = yield data.elementType;
2808
+ if (res)
2809
+ return res;
2810
+ }
2811
+ },
2812
+ [SyntaxKind.IndexedAccessType]: function* (data) {
2813
+ if (data.objectType) {
2814
+ const res = yield data.objectType;
2815
+ if (res)
2816
+ return res;
2817
+ }
2818
+ if (data.indexType) {
2819
+ const res = yield data.indexType;
2820
+ if (res)
2821
+ return res;
2822
+ }
2823
+ },
2824
+ [SyntaxKind.TypeReference]: function* (data) {
2825
+ if (data.typeName) {
2826
+ const res = yield data.typeName;
2827
+ if (res)
2828
+ return res;
2829
+ }
2830
+ if (data.typeArguments) {
2831
+ for (const n of data.typeArguments) {
2832
+ const res = yield n;
2833
+ if (res)
2834
+ return res;
2835
+ }
2836
+ }
2837
+ },
2838
+ [SyntaxKind.ExpressionWithTypeArguments]: function* (data) {
2839
+ if (data.expression) {
2840
+ const res = yield data.expression;
2841
+ if (res)
2842
+ return res;
2843
+ }
2844
+ if (data.typeArguments) {
2845
+ for (const n of data.typeArguments) {
2846
+ const res = yield n;
2847
+ if (res)
2848
+ return res;
2849
+ }
2850
+ }
2851
+ },
2852
+ [SyntaxKind.LiteralType]: function* (data) {
2853
+ if (data.literal) {
2854
+ const res = yield data.literal;
2855
+ if (res)
2856
+ return res;
2857
+ }
2858
+ },
2859
+ [SyntaxKind.TypePredicate]: function* (data) {
2860
+ if (data.assertsModifier) {
2861
+ const res = yield data.assertsModifier;
2862
+ if (res)
2863
+ return res;
2864
+ }
2865
+ if (data.parameterName) {
2866
+ const res = yield data.parameterName;
2867
+ if (res)
2868
+ return res;
2869
+ }
2870
+ if (data.type) {
2871
+ const res = yield data.type;
2872
+ if (res)
2873
+ return res;
2874
+ }
2875
+ },
2876
+ [SyntaxKind.ImportAttribute]: function* (data) {
2877
+ if (data.name) {
2878
+ const res = yield data.name;
2879
+ if (res)
2880
+ return res;
2881
+ }
2882
+ if (data.value) {
2883
+ const res = yield data.value;
2884
+ if (res)
2885
+ return res;
2886
+ }
2887
+ },
2888
+ [SyntaxKind.ImportAttributes]: function* (data) {
2889
+ for (const n of data.attributes) {
2890
+ const res = yield n;
2891
+ if (res)
2892
+ return res;
2893
+ }
2894
+ },
2895
+ [SyntaxKind.TypeQuery]: function* (data) {
2896
+ if (data.exprName) {
2897
+ const res = yield data.exprName;
2898
+ if (res)
2899
+ return res;
2900
+ }
2901
+ if (data.typeArguments) {
2902
+ for (const n of data.typeArguments) {
2903
+ const res = yield n;
2904
+ if (res)
2905
+ return res;
2906
+ }
2907
+ }
2908
+ },
2909
+ [SyntaxKind.MappedType]: function* (data) {
2910
+ if (data.readonlyToken) {
2911
+ const res = yield data.readonlyToken;
2912
+ if (res)
2913
+ return res;
2914
+ }
2915
+ if (data.typeParameter) {
2916
+ const res = yield data.typeParameter;
2917
+ if (res)
2918
+ return res;
2919
+ }
2920
+ if (data.nameType) {
2921
+ const res = yield data.nameType;
2922
+ if (res)
2923
+ return res;
2924
+ }
2925
+ if (data.questionToken) {
2926
+ const res = yield data.questionToken;
2927
+ if (res)
2928
+ return res;
2929
+ }
2930
+ if (data.type) {
2931
+ const res = yield data.type;
2932
+ if (res)
2933
+ return res;
2934
+ }
2935
+ if (data.members) {
2936
+ for (const n of data.members) {
2937
+ const res = yield n;
2938
+ if (res)
2939
+ return res;
2940
+ }
2941
+ }
2942
+ },
2943
+ [SyntaxKind.TypeLiteral]: function* (data) {
2944
+ for (const n of data.members) {
2945
+ const res = yield n;
2946
+ if (res)
2947
+ return res;
2948
+ }
2949
+ },
2950
+ [SyntaxKind.TupleType]: function* (data) {
2951
+ for (const n of data.elements) {
2952
+ const res = yield n;
2953
+ if (res)
2954
+ return res;
2955
+ }
2956
+ },
2957
+ [SyntaxKind.NamedTupleMember]: function* (data) {
2958
+ if (data.dotDotDotToken) {
2959
+ const res = yield data.dotDotDotToken;
2960
+ if (res)
2961
+ return res;
2962
+ }
2963
+ if (data.name) {
2964
+ const res = yield data.name;
2965
+ if (res)
2966
+ return res;
2967
+ }
2968
+ if (data.questionToken) {
2969
+ const res = yield data.questionToken;
2970
+ if (res)
2971
+ return res;
2972
+ }
2973
+ if (data.type) {
2974
+ const res = yield data.type;
2975
+ if (res)
2976
+ return res;
2977
+ }
2978
+ },
2979
+ [SyntaxKind.OptionalType]: function* (data) {
2980
+ if (data.type) {
2981
+ const res = yield data.type;
2982
+ if (res)
2983
+ return res;
2984
+ }
2985
+ },
2986
+ [SyntaxKind.RestType]: function* (data) {
2987
+ if (data.type) {
2988
+ const res = yield data.type;
2989
+ if (res)
2990
+ return res;
2991
+ }
2992
+ },
2993
+ [SyntaxKind.ParenthesizedType]: function* (data) {
2994
+ if (data.type) {
2995
+ const res = yield data.type;
2996
+ if (res)
2997
+ return res;
2998
+ }
2999
+ },
3000
+ [SyntaxKind.FunctionType]: function* (data) {
3001
+ if (data.typeParameters) {
3002
+ for (const n of data.typeParameters) {
3003
+ const res = yield n;
3004
+ if (res)
3005
+ return res;
3006
+ }
3007
+ }
3008
+ for (const n of data.parameters) {
3009
+ const res = yield n;
3010
+ if (res)
3011
+ return res;
3012
+ }
3013
+ if (data.type) {
3014
+ const res = yield data.type;
3015
+ if (res)
3016
+ return res;
3017
+ }
3018
+ },
3019
+ [SyntaxKind.ConstructorType]: function* (data) {
3020
+ if (data.modifiers) {
3021
+ for (const n of data.modifiers) {
3022
+ const res = yield n;
3023
+ if (res)
3024
+ return res;
3025
+ }
3026
+ }
3027
+ if (data.typeParameters) {
3028
+ for (const n of data.typeParameters) {
3029
+ const res = yield n;
3030
+ if (res)
3031
+ return res;
3032
+ }
3033
+ }
3034
+ for (const n of data.parameters) {
3035
+ const res = yield n;
3036
+ if (res)
3037
+ return res;
3038
+ }
3039
+ if (data.type) {
3040
+ const res = yield data.type;
3041
+ if (res)
3042
+ return res;
3043
+ }
3044
+ },
3045
+ [SyntaxKind.TemplateLiteralType]: function* (data) {
3046
+ if (data.head) {
3047
+ const res = yield data.head;
3048
+ if (res)
3049
+ return res;
3050
+ }
3051
+ for (const n of data.templateSpans) {
3052
+ const res = yield n;
3053
+ if (res)
3054
+ return res;
3055
+ }
3056
+ },
3057
+ [SyntaxKind.TemplateLiteralTypeSpan]: function* (data) {
3058
+ if (data.type) {
3059
+ const res = yield data.type;
3060
+ if (res)
3061
+ return res;
3062
+ }
3063
+ if (data.literal) {
3064
+ const res = yield data.literal;
3065
+ if (res)
3066
+ return res;
3067
+ }
3068
+ },
3069
+ [SyntaxKind.SyntheticExpression]: function* (data) {
3070
+ if (data.tupleNameSource) {
3071
+ const res = yield data.tupleNameSource;
3072
+ if (res)
3073
+ return res;
3074
+ }
3075
+ },
3076
+ [SyntaxKind.PartiallyEmittedExpression]: function* (data) {
3077
+ if (data.expression) {
3078
+ const res = yield data.expression;
3079
+ if (res)
3080
+ return res;
3081
+ }
3082
+ },
3083
+ [SyntaxKind.JsxElement]: function* (data) {
3084
+ if (data.openingElement) {
3085
+ const res = yield data.openingElement;
3086
+ if (res)
3087
+ return res;
3088
+ }
3089
+ for (const n of data.children) {
3090
+ const res = yield n;
3091
+ if (res)
3092
+ return res;
3093
+ }
3094
+ if (data.closingElement) {
3095
+ const res = yield data.closingElement;
3096
+ if (res)
3097
+ return res;
3098
+ }
3099
+ },
3100
+ [SyntaxKind.JsxAttributes]: function* (data) {
3101
+ for (const n of data.properties) {
3102
+ const res = yield n;
3103
+ if (res)
3104
+ return res;
3105
+ }
3106
+ },
3107
+ [SyntaxKind.JsxNamespacedName]: function* (data) {
3108
+ if (data.namespace) {
3109
+ const res = yield data.namespace;
3110
+ if (res)
3111
+ return res;
3112
+ }
3113
+ if (data.name) {
3114
+ const res = yield data.name;
3115
+ if (res)
3116
+ return res;
3117
+ }
3118
+ },
3119
+ [SyntaxKind.JsxOpeningElement]: function* (data) {
3120
+ if (data.tagName) {
3121
+ const res = yield data.tagName;
3122
+ if (res)
3123
+ return res;
3124
+ }
3125
+ if (data.typeArguments) {
3126
+ for (const n of data.typeArguments) {
3127
+ const res = yield n;
3128
+ if (res)
3129
+ return res;
3130
+ }
3131
+ }
3132
+ if (data.attributes) {
3133
+ const res = yield data.attributes;
3134
+ if (res)
3135
+ return res;
3136
+ }
3137
+ },
3138
+ [SyntaxKind.JsxSelfClosingElement]: function* (data) {
3139
+ if (data.tagName) {
3140
+ const res = yield data.tagName;
3141
+ if (res)
3142
+ return res;
3143
+ }
3144
+ if (data.typeArguments) {
3145
+ for (const n of data.typeArguments) {
3146
+ const res = yield n;
3147
+ if (res)
3148
+ return res;
3149
+ }
3150
+ }
3151
+ if (data.attributes) {
3152
+ const res = yield data.attributes;
3153
+ if (res)
3154
+ return res;
3155
+ }
3156
+ },
3157
+ [SyntaxKind.JsxFragment]: function* (data) {
3158
+ if (data.openingFragment) {
3159
+ const res = yield data.openingFragment;
3160
+ if (res)
3161
+ return res;
3162
+ }
3163
+ for (const n of data.children) {
3164
+ const res = yield n;
3165
+ if (res)
3166
+ return res;
3167
+ }
3168
+ if (data.closingFragment) {
3169
+ const res = yield data.closingFragment;
3170
+ if (res)
3171
+ return res;
3172
+ }
3173
+ },
3174
+ [SyntaxKind.JsxAttribute]: function* (data) {
3175
+ if (data.name) {
3176
+ const res = yield data.name;
3177
+ if (res)
3178
+ return res;
3179
+ }
3180
+ if (data.initializer) {
3181
+ const res = yield data.initializer;
3182
+ if (res)
3183
+ return res;
3184
+ }
3185
+ },
3186
+ [SyntaxKind.JsxSpreadAttribute]: function* (data) {
3187
+ if (data.expression) {
3188
+ const res = yield data.expression;
3189
+ if (res)
3190
+ return res;
3191
+ }
3192
+ },
3193
+ [SyntaxKind.JsxClosingElement]: function* (data) {
3194
+ if (data.tagName) {
3195
+ const res = yield data.tagName;
3196
+ if (res)
3197
+ return res;
3198
+ }
3199
+ },
3200
+ [SyntaxKind.JsxExpression]: function* (data) {
3201
+ if (data.dotDotDotToken) {
3202
+ const res = yield data.dotDotDotToken;
3203
+ if (res)
3204
+ return res;
3205
+ }
3206
+ if (data.expression) {
3207
+ const res = yield data.expression;
3208
+ if (res)
3209
+ return res;
3210
+ }
3211
+ },
3212
+ [SyntaxKind.SyntaxList]: function* (data) {
3213
+ for (const n of data.children) {
3214
+ const res = yield n;
3215
+ if (res)
3216
+ return res;
3217
+ }
3218
+ },
3219
+ [SyntaxKind.JSDoc]: function* (data) {
3220
+ for (const n of data.comment) {
3221
+ const res = yield n;
3222
+ if (res)
3223
+ return res;
3224
+ }
3225
+ if (data.tags) {
3226
+ for (const n of data.tags) {
3227
+ const res = yield n;
3228
+ if (res)
3229
+ return res;
3230
+ }
3231
+ }
3232
+ },
3233
+ [SyntaxKind.JSDocTypeExpression]: function* (data) {
3234
+ if (data.type) {
3235
+ const res = yield data.type;
3236
+ if (res)
3237
+ return res;
3238
+ }
3239
+ },
3240
+ [SyntaxKind.JSDocNonNullableType]: function* (data) {
3241
+ if (data.type) {
3242
+ const res = yield data.type;
3243
+ if (res)
3244
+ return res;
3245
+ }
3246
+ },
3247
+ [SyntaxKind.JSDocNullableType]: function* (data) {
3248
+ if (data.type) {
3249
+ const res = yield data.type;
3250
+ if (res)
3251
+ return res;
3252
+ }
3253
+ },
3254
+ [SyntaxKind.JSDocVariadicType]: function* (data) {
3255
+ if (data.type) {
3256
+ const res = yield data.type;
3257
+ if (res)
3258
+ return res;
3259
+ }
3260
+ },
3261
+ [SyntaxKind.JSDocOptionalType]: function* (data) {
3262
+ if (data.type) {
3263
+ const res = yield data.type;
3264
+ if (res)
3265
+ return res;
3266
+ }
3267
+ },
3268
+ [SyntaxKind.JSDocTypeTag]: function* (data) {
3269
+ if (data.tagName) {
3270
+ const res = yield data.tagName;
3271
+ if (res)
3272
+ return res;
3273
+ }
3274
+ if (data.typeExpression) {
3275
+ const res = yield data.typeExpression;
3276
+ if (res)
3277
+ return res;
3278
+ }
3279
+ if (data.comment) {
3280
+ for (const n of data.comment) {
3281
+ const res = yield n;
3282
+ if (res)
3283
+ return res;
3284
+ }
3285
+ }
3286
+ },
3287
+ [SyntaxKind.JSDocUnknownTag]: function* (data) {
3288
+ if (data.tagName) {
3289
+ const res = yield data.tagName;
3290
+ if (res)
3291
+ return res;
3292
+ }
3293
+ if (data.comment) {
3294
+ for (const n of data.comment) {
3295
+ const res = yield n;
3296
+ if (res)
3297
+ return res;
3298
+ }
3299
+ }
3300
+ },
3301
+ [SyntaxKind.JSDocTemplateTag]: function* (data) {
3302
+ if (data.tagName) {
3303
+ const res = yield data.tagName;
3304
+ if (res)
3305
+ return res;
3306
+ }
3307
+ if (data.constraint) {
3308
+ const res = yield data.constraint;
3309
+ if (res)
3310
+ return res;
3311
+ }
3312
+ for (const n of data.typeParameters) {
3313
+ const res = yield n;
3314
+ if (res)
3315
+ return res;
3316
+ }
3317
+ if (data.comment) {
3318
+ for (const n of data.comment) {
3319
+ const res = yield n;
3320
+ if (res)
3321
+ return res;
3322
+ }
3323
+ }
3324
+ },
3325
+ [SyntaxKind.JSDocReturnTag]: function* (data) {
3326
+ if (data.tagName) {
3327
+ const res = yield data.tagName;
3328
+ if (res)
3329
+ return res;
3330
+ }
3331
+ if (data.typeExpression) {
3332
+ const res = yield data.typeExpression;
3333
+ if (res)
3334
+ return res;
3335
+ }
3336
+ if (data.comment) {
3337
+ for (const n of data.comment) {
3338
+ const res = yield n;
3339
+ if (res)
3340
+ return res;
3341
+ }
3342
+ }
3343
+ },
3344
+ [SyntaxKind.JSDocPublicTag]: function* (data) {
3345
+ if (data.tagName) {
3346
+ const res = yield data.tagName;
3347
+ if (res)
3348
+ return res;
3349
+ }
3350
+ if (data.comment) {
3351
+ for (const n of data.comment) {
3352
+ const res = yield n;
3353
+ if (res)
3354
+ return res;
3355
+ }
3356
+ }
3357
+ },
3358
+ [SyntaxKind.JSDocPrivateTag]: function* (data) {
3359
+ if (data.tagName) {
3360
+ const res = yield data.tagName;
3361
+ if (res)
3362
+ return res;
3363
+ }
3364
+ if (data.comment) {
3365
+ for (const n of data.comment) {
3366
+ const res = yield n;
3367
+ if (res)
3368
+ return res;
3369
+ }
3370
+ }
3371
+ },
3372
+ [SyntaxKind.JSDocProtectedTag]: function* (data) {
3373
+ if (data.tagName) {
3374
+ const res = yield data.tagName;
3375
+ if (res)
3376
+ return res;
3377
+ }
3378
+ if (data.comment) {
3379
+ for (const n of data.comment) {
3380
+ const res = yield n;
3381
+ if (res)
3382
+ return res;
3383
+ }
3384
+ }
3385
+ },
3386
+ [SyntaxKind.JSDocReadonlyTag]: function* (data) {
3387
+ if (data.tagName) {
3388
+ const res = yield data.tagName;
3389
+ if (res)
3390
+ return res;
3391
+ }
3392
+ if (data.comment) {
3393
+ for (const n of data.comment) {
3394
+ const res = yield n;
3395
+ if (res)
3396
+ return res;
3397
+ }
3398
+ }
3399
+ },
3400
+ [SyntaxKind.JSDocOverrideTag]: function* (data) {
3401
+ if (data.tagName) {
3402
+ const res = yield data.tagName;
3403
+ if (res)
3404
+ return res;
3405
+ }
3406
+ if (data.comment) {
3407
+ for (const n of data.comment) {
3408
+ const res = yield n;
3409
+ if (res)
3410
+ return res;
3411
+ }
3412
+ }
3413
+ },
3414
+ [SyntaxKind.JSDocDeprecatedTag]: function* (data) {
3415
+ if (data.tagName) {
3416
+ const res = yield data.tagName;
3417
+ if (res)
3418
+ return res;
3419
+ }
3420
+ if (data.comment) {
3421
+ for (const n of data.comment) {
3422
+ const res = yield n;
3423
+ if (res)
3424
+ return res;
3425
+ }
3426
+ }
3427
+ },
3428
+ [SyntaxKind.JSDocSeeTag]: function* (data) {
3429
+ if (data.tagName) {
3430
+ const res = yield data.tagName;
3431
+ if (res)
3432
+ return res;
3433
+ }
3434
+ if (data.nameExpression) {
3435
+ const res = yield data.nameExpression;
3436
+ if (res)
3437
+ return res;
3438
+ }
3439
+ if (data.comment) {
3440
+ for (const n of data.comment) {
3441
+ const res = yield n;
3442
+ if (res)
3443
+ return res;
3444
+ }
3445
+ }
3446
+ },
3447
+ [SyntaxKind.JSDocImplementsTag]: function* (data) {
3448
+ if (data.tagName) {
3449
+ const res = yield data.tagName;
3450
+ if (res)
3451
+ return res;
3452
+ }
3453
+ if (data.className) {
3454
+ const res = yield data.className;
3455
+ if (res)
3456
+ return res;
3457
+ }
3458
+ if (data.comment) {
3459
+ for (const n of data.comment) {
3460
+ const res = yield n;
3461
+ if (res)
3462
+ return res;
3463
+ }
3464
+ }
3465
+ },
3466
+ [SyntaxKind.JSDocAugmentsTag]: function* (data) {
3467
+ if (data.tagName) {
3468
+ const res = yield data.tagName;
3469
+ if (res)
3470
+ return res;
3471
+ }
3472
+ if (data.className) {
3473
+ const res = yield data.className;
3474
+ if (res)
3475
+ return res;
3476
+ }
3477
+ if (data.comment) {
3478
+ for (const n of data.comment) {
3479
+ const res = yield n;
3480
+ if (res)
3481
+ return res;
3482
+ }
3483
+ }
3484
+ },
3485
+ [SyntaxKind.JSDocSatisfiesTag]: function* (data) {
3486
+ if (data.tagName) {
3487
+ const res = yield data.tagName;
3488
+ if (res)
3489
+ return res;
3490
+ }
3491
+ if (data.typeExpression) {
3492
+ const res = yield data.typeExpression;
3493
+ if (res)
3494
+ return res;
3495
+ }
3496
+ if (data.comment) {
3497
+ for (const n of data.comment) {
3498
+ const res = yield n;
3499
+ if (res)
3500
+ return res;
3501
+ }
3502
+ }
3503
+ },
3504
+ [SyntaxKind.JSDocThrowsTag]: function* (data) {
3505
+ if (data.tagName) {
3506
+ const res = yield data.tagName;
3507
+ if (res)
3508
+ return res;
3509
+ }
3510
+ if (data.typeExpression) {
3511
+ const res = yield data.typeExpression;
3512
+ if (res)
3513
+ return res;
3514
+ }
3515
+ if (data.comment) {
3516
+ for (const n of data.comment) {
3517
+ const res = yield n;
3518
+ if (res)
3519
+ return res;
3520
+ }
3521
+ }
3522
+ },
3523
+ [SyntaxKind.JSDocThisTag]: function* (data) {
3524
+ if (data.tagName) {
3525
+ const res = yield data.tagName;
3526
+ if (res)
3527
+ return res;
3528
+ }
3529
+ if (data.typeExpression) {
3530
+ const res = yield data.typeExpression;
3531
+ if (res)
3532
+ return res;
3533
+ }
3534
+ if (data.comment) {
3535
+ for (const n of data.comment) {
3536
+ const res = yield n;
3537
+ if (res)
3538
+ return res;
3539
+ }
3540
+ }
3541
+ },
3542
+ [SyntaxKind.JSDocImportTag]: function* (data) {
3543
+ if (data.tagName) {
3544
+ const res = yield data.tagName;
3545
+ if (res)
3546
+ return res;
3547
+ }
3548
+ if (data.importClause) {
3549
+ const res = yield data.importClause;
3550
+ if (res)
3551
+ return res;
3552
+ }
3553
+ if (data.moduleSpecifier) {
3554
+ const res = yield data.moduleSpecifier;
3555
+ if (res)
3556
+ return res;
3557
+ }
3558
+ if (data.attributes) {
3559
+ const res = yield data.attributes;
3560
+ if (res)
3561
+ return res;
3562
+ }
3563
+ if (data.comment) {
3564
+ for (const n of data.comment) {
3565
+ const res = yield n;
3566
+ if (res)
3567
+ return res;
3568
+ }
3569
+ }
3570
+ },
3571
+ [SyntaxKind.JSDocCallbackTag]: function* (data) {
3572
+ if (data.tagName) {
3573
+ const res = yield data.tagName;
3574
+ if (res)
3575
+ return res;
3576
+ }
3577
+ if (data.typeExpression) {
3578
+ const res = yield data.typeExpression;
3579
+ if (res)
3580
+ return res;
3581
+ }
3582
+ if (data.name) {
3583
+ const res = yield data.name;
3584
+ if (res)
3585
+ return res;
3586
+ }
3587
+ if (data.comment) {
3588
+ for (const n of data.comment) {
3589
+ const res = yield n;
3590
+ if (res)
3591
+ return res;
3592
+ }
3593
+ }
3594
+ },
3595
+ [SyntaxKind.JSDocOverloadTag]: function* (data) {
3596
+ if (data.tagName) {
3597
+ const res = yield data.tagName;
3598
+ if (res)
3599
+ return res;
3600
+ }
3601
+ if (data.typeExpression) {
3602
+ const res = yield data.typeExpression;
3603
+ if (res)
3604
+ return res;
3605
+ }
3606
+ if (data.comment) {
3607
+ for (const n of data.comment) {
3608
+ const res = yield n;
3609
+ if (res)
3610
+ return res;
3611
+ }
3612
+ }
3613
+ },
3614
+ [SyntaxKind.JSDocTypedefTag]: function* (data) {
3615
+ if (data.tagName) {
3616
+ const res = yield data.tagName;
3617
+ if (res)
3618
+ return res;
3619
+ }
3620
+ if (data.typeExpression) {
3621
+ const res = yield data.typeExpression;
3622
+ if (res)
3623
+ return res;
3624
+ }
3625
+ if (data.name) {
3626
+ const res = yield data.name;
3627
+ if (res)
3628
+ return res;
3629
+ }
3630
+ if (data.comment) {
3631
+ for (const n of data.comment) {
3632
+ const res = yield n;
3633
+ if (res)
3634
+ return res;
3635
+ }
3636
+ }
3637
+ },
3638
+ [SyntaxKind.JSDocSignature]: function* (data) {
3639
+ if (data.typeParameters) {
3640
+ for (const n of data.typeParameters) {
3641
+ const res = yield n;
3642
+ if (res)
3643
+ return res;
3644
+ }
3645
+ }
3646
+ for (const n of data.parameters) {
3647
+ const res = yield n;
3648
+ if (res)
3649
+ return res;
3650
+ }
3651
+ if (data.type) {
3652
+ const res = yield data.type;
3653
+ if (res)
3654
+ return res;
3655
+ }
3656
+ },
3657
+ [SyntaxKind.JSDocNameReference]: function* (data) {
3658
+ if (data.name) {
3659
+ const res = yield data.name;
3660
+ if (res)
3661
+ return res;
3662
+ }
3663
+ },
3664
+ [SyntaxKind.ModuleDeclaration]: function* (data) {
3665
+ if (data.modifiers) {
3666
+ for (const n of data.modifiers) {
3667
+ const res = yield n;
3668
+ if (res)
3669
+ return res;
3670
+ }
3671
+ }
3672
+ if (data.name) {
3673
+ const res = yield data.name;
3674
+ if (res)
3675
+ return res;
3676
+ }
3677
+ if (data.attributes) {
3678
+ const res = yield data.attributes;
3679
+ if (res)
3680
+ return res;
3681
+ }
3682
+ if (data.body) {
3683
+ const res = yield data.body;
3684
+ if (res)
3685
+ return res;
3686
+ }
3687
+ },
3688
+ [SyntaxKind.ImportEqualsDeclaration]: function* (data) {
3689
+ if (data.modifiers) {
3690
+ for (const n of data.modifiers) {
3691
+ const res = yield n;
3692
+ if (res)
3693
+ return res;
3694
+ }
3695
+ }
3696
+ if (data.name) {
3697
+ const res = yield data.name;
3698
+ if (res)
3699
+ return res;
3700
+ }
3701
+ if (data.moduleReference) {
3702
+ const res = yield data.moduleReference;
3703
+ if (res)
3704
+ return res;
3705
+ }
3706
+ },
3707
+ [SyntaxKind.ExportDeclaration]: function* (data) {
3708
+ if (data.modifiers) {
3709
+ for (const n of data.modifiers) {
3710
+ const res = yield n;
3711
+ if (res)
3712
+ return res;
3713
+ }
3714
+ }
3715
+ if (data.exportClause) {
3716
+ const res = yield data.exportClause;
3717
+ if (res)
3718
+ return res;
3719
+ }
3720
+ if (data.moduleSpecifier) {
3721
+ const res = yield data.moduleSpecifier;
3722
+ if (res)
3723
+ return res;
3724
+ }
3725
+ if (data.attributes) {
3726
+ const res = yield data.attributes;
3727
+ if (res)
3728
+ return res;
3729
+ }
3730
+ },
3731
+ [SyntaxKind.ImportType]: function* (data) {
3732
+ if (data.argument) {
3733
+ const res = yield data.argument;
3734
+ if (res)
3735
+ return res;
3736
+ }
3737
+ if (data.attributes) {
3738
+ const res = yield data.attributes;
3739
+ if (res)
3740
+ return res;
3741
+ }
3742
+ if (data.qualifier) {
3743
+ const res = yield data.qualifier;
3744
+ if (res)
3745
+ return res;
3746
+ }
3747
+ if (data.typeArguments) {
3748
+ for (const n of data.typeArguments) {
3749
+ const res = yield n;
3750
+ if (res)
3751
+ return res;
3752
+ }
3753
+ }
3754
+ },
3755
+ [SyntaxKind.ImportClause]: function* (data) {
3756
+ if (data.name) {
3757
+ const res = yield data.name;
3758
+ if (res)
3759
+ return res;
3760
+ }
3761
+ if (data.namedBindings) {
3762
+ const res = yield data.namedBindings;
3763
+ if (res)
3764
+ return res;
3765
+ }
3766
+ },
3767
+ [SyntaxKind.ImportSpecifier]: function* (data) {
3768
+ if (data.propertyName) {
3769
+ const res = yield data.propertyName;
3770
+ if (res)
3771
+ return res;
3772
+ }
3773
+ if (data.name) {
3774
+ const res = yield data.name;
3775
+ if (res)
3776
+ return res;
3777
+ }
3778
+ },
3779
+ [SyntaxKind.JSDocLink]: function* (data) {
3780
+ if (data.name) {
3781
+ const res = yield data.name;
3782
+ if (res)
3783
+ return res;
3784
+ }
3785
+ },
3786
+ [SyntaxKind.JSDocLinkPlain]: function* (data) {
3787
+ if (data.name) {
3788
+ const res = yield data.name;
3789
+ if (res)
3790
+ return res;
3791
+ }
3792
+ },
3793
+ [SyntaxKind.JSDocLinkCode]: function* (data) {
3794
+ if (data.name) {
3795
+ const res = yield data.name;
3796
+ if (res)
3797
+ return res;
3798
+ }
3799
+ },
3800
+ [SyntaxKind.TypeParameter]: function* (data) {
3801
+ if (data.modifiers) {
3802
+ for (const n of data.modifiers) {
3803
+ const res = yield n;
3804
+ if (res)
3805
+ return res;
3806
+ }
3807
+ }
3808
+ if (data.name) {
3809
+ const res = yield data.name;
3810
+ if (res)
3811
+ return res;
3812
+ }
3813
+ if (data.constraint) {
3814
+ const res = yield data.constraint;
3815
+ if (res)
3816
+ return res;
3817
+ }
3818
+ if (data.expression) {
3819
+ const res = yield data.expression;
3820
+ if (res)
3821
+ return res;
3822
+ }
3823
+ if (data.defaultType) {
3824
+ const res = yield data.defaultType;
3825
+ if (res)
3826
+ return res;
3827
+ }
3828
+ },
3829
+ [SyntaxKind.SyntheticReferenceExpression]: function* (data) {
3830
+ if (data.expression) {
3831
+ const res = yield data.expression;
3832
+ if (res)
3833
+ return res;
3834
+ }
3835
+ if (data.thisArg) {
3836
+ const res = yield data.thisArg;
3837
+ if (res)
3838
+ return res;
3839
+ }
3840
+ },
3841
+ [SyntaxKind.JSDocTypeLiteral]: function* (data) {
3842
+ if (data.jsdocPropertyTags) {
3843
+ for (const n of data.jsdocPropertyTags) {
3844
+ const res = yield n;
3845
+ if (res)
3846
+ return res;
3847
+ }
3848
+ }
3849
+ },
3850
+ [SyntaxKind.ForInStatement]: function* (data) {
3851
+ if (data.awaitModifier) {
3852
+ const res = yield data.awaitModifier;
3853
+ if (res)
3854
+ return res;
3855
+ }
3856
+ if (data.initializer) {
3857
+ const res = yield data.initializer;
3858
+ if (res)
3859
+ return res;
3860
+ }
3861
+ if (data.expression) {
3862
+ const res = yield data.expression;
3863
+ if (res)
3864
+ return res;
3865
+ }
3866
+ if (data.statement) {
3867
+ const res = yield data.statement;
3868
+ if (res)
3869
+ return res;
3870
+ }
3871
+ },
3872
+ [SyntaxKind.ForOfStatement]: function* (data) {
3873
+ if (data.awaitModifier) {
3874
+ const res = yield data.awaitModifier;
3875
+ if (res)
3876
+ return res;
3877
+ }
3878
+ if (data.initializer) {
3879
+ const res = yield data.initializer;
3880
+ if (res)
3881
+ return res;
3882
+ }
3883
+ if (data.expression) {
3884
+ const res = yield data.expression;
3885
+ if (res)
3886
+ return res;
3887
+ }
3888
+ if (data.statement) {
3889
+ const res = yield data.statement;
3890
+ if (res)
3891
+ return res;
3892
+ }
3893
+ },
3894
+ [SyntaxKind.CaseClause]: function* (data) {
3895
+ if (data.expression) {
3896
+ const res = yield data.expression;
3897
+ if (res)
3898
+ return res;
3899
+ }
3900
+ for (const n of data.statements) {
3901
+ const res = yield n;
3902
+ if (res)
3903
+ return res;
3904
+ }
3905
+ },
3906
+ [SyntaxKind.DefaultClause]: function* (data) {
3907
+ if (data.expression) {
3908
+ const res = yield data.expression;
3909
+ if (res)
3910
+ return res;
3911
+ }
3912
+ for (const n of data.statements) {
3913
+ const res = yield n;
3914
+ if (res)
3915
+ return res;
3916
+ }
3917
+ },
3918
+ [SyntaxKind.ObjectBindingPattern]: function* (data) {
3919
+ for (const n of data.elements) {
3920
+ const res = yield n;
3921
+ if (res)
3922
+ return res;
3923
+ }
3924
+ },
3925
+ [SyntaxKind.ArrayBindingPattern]: function* (data) {
3926
+ for (const n of data.elements) {
3927
+ const res = yield n;
3928
+ if (res)
3929
+ return res;
3930
+ }
3931
+ },
3932
+ [SyntaxKind.JSDocParameterTag]: yieldEachChildOfJSDocParameterTag,
3933
+ [SyntaxKind.JSDocPropertyTag]: yieldEachChildOfJSDocPropertyTag,
3934
+ [SyntaxKind.SourceFile]: function* (data) {
3935
+ for (const n of data.statements) {
3936
+ const res = yield n;
3937
+ if (res)
3938
+ return res;
3939
+ }
3940
+ const res = yield data.endOfFileToken;
3941
+ if (res)
3942
+ return res;
3943
+ },
3944
+ };
1295
3945
  function visitNode(cbNode, node) {
1296
3946
  return node ? cbNode(node) : undefined;
1297
3947
  }