|
624 | 624 |
|
625 | 625 | export interface TypeParameterDeclaration extends Declaration { |
626 | 626 | kind: SyntaxKind.TypeParameter; |
| 627 | + parent?: DeclarationWithTypeParameters; |
627 | 628 | name: Identifier; |
628 | 629 | constraint?: TypeNode; |
629 | 630 | default?: TypeNode; |
|
659 | 660 |
|
660 | 661 | export interface VariableDeclarationList extends Node { |
661 | 662 | kind: SyntaxKind.VariableDeclarationList; |
| 663 | + parent?: VariableStatement | ForStatement | ForOfStatement | ForInStatement; |
662 | 664 | declarations: NodeArray<VariableDeclaration>; |
663 | 665 | } |
664 | 666 |
|
665 | 667 | export interface ParameterDeclaration extends Declaration { |
666 | 668 | kind: SyntaxKind.Parameter; |
| 669 | + parent?: SignatureDeclaration; |
667 | 670 | dotDotDotToken?: DotDotDotToken; // Present on rest parameter |
668 | 671 | name: BindingName; // Declared parameter name |
669 | 672 | questionToken?: QuestionToken; // Present on optional parameter |
|
673 | 676 |
|
674 | 677 | export interface BindingElement extends Declaration { |
675 | 678 | kind: SyntaxKind.BindingElement; |
| 679 | + parent?: BindingPattern; |
676 | 680 | propertyName?: PropertyName; // Binding property name (in object binding pattern) |
677 | 681 | dotDotDotToken?: DotDotDotToken; // Present on rest element (in object binding pattern) |
678 | 682 | name: BindingName; // Declared binding element name |
|
754 | 758 |
|
755 | 759 | export interface ObjectBindingPattern extends Node { |
756 | 760 | kind: SyntaxKind.ObjectBindingPattern; |
| 761 | + parent?: VariableDeclaration | ParameterDeclaration | BindingElement; |
757 | 762 | elements: NodeArray<BindingElement>; |
758 | 763 | } |
759 | 764 |
|
760 | 765 | export interface ArrayBindingPattern extends Node { |
761 | 766 | kind: SyntaxKind.ArrayBindingPattern; |
| 767 | + parent?: VariableDeclaration | ParameterDeclaration | BindingElement; |
762 | 768 | elements: NodeArray<ArrayBindingElement>; |
763 | 769 | } |
764 | 770 |
|
|
1327 | 1333 |
|
1328 | 1334 | export interface TemplateHead extends LiteralLikeNode { |
1329 | 1335 | kind: SyntaxKind.TemplateHead; |
| 1336 | + parent?: TemplateExpression; |
1330 | 1337 | } |
1331 | 1338 |
|
1332 | 1339 | export interface TemplateMiddle extends LiteralLikeNode { |
1333 | 1340 | kind: SyntaxKind.TemplateMiddle; |
| 1341 | + parent?: TemplateSpan; |
1334 | 1342 | } |
1335 | 1343 |
|
1336 | 1344 | export interface TemplateTail extends LiteralLikeNode { |
1337 | 1345 | kind: SyntaxKind.TemplateTail; |
| 1346 | + parent?: TemplateSpan; |
1338 | 1347 | } |
1339 | 1348 |
|
1340 | 1349 | export type TemplateLiteral = TemplateExpression | NoSubstitutionTemplateLiteral; |
|
1349 | 1358 | // The template literal must have kind TemplateMiddleLiteral or TemplateTailLiteral. |
1350 | 1359 | export interface TemplateSpan extends Node { |
1351 | 1360 | kind: SyntaxKind.TemplateSpan; |
| 1361 | + parent?: TemplateExpression; |
1352 | 1362 | expression: Expression; |
1353 | 1363 | literal: TemplateMiddle | TemplateTail; |
1354 | 1364 | } |
|
1503 | 1513 | /// The opening element of a <Tag>...</Tag> JsxElement |
1504 | 1514 | export interface JsxOpeningElement extends Expression { |
1505 | 1515 | kind: SyntaxKind.JsxOpeningElement; |
| 1516 | + parent?: JsxElement; |
1506 | 1517 | tagName: JsxTagNameExpression; |
1507 | 1518 | attributes: JsxAttributes; |
1508 | 1519 | } |
|
1516 | 1527 |
|
1517 | 1528 | export interface JsxAttribute extends ObjectLiteralElement { |
1518 | 1529 | kind: SyntaxKind.JsxAttribute; |
| 1530 | + parent?: JsxOpeningLikeElement; |
1519 | 1531 | name: Identifier; |
1520 | 1532 | /// JSX attribute initializers are optional; <X y /> is sugar for <X y={true} /> |
1521 | 1533 | initializer?: StringLiteral | JsxExpression; |
1522 | 1534 | } |
1523 | 1535 |
|
1524 | 1536 | export interface JsxSpreadAttribute extends ObjectLiteralElement { |
1525 | 1537 | kind: SyntaxKind.JsxSpreadAttribute; |
| 1538 | + parent?: JsxOpeningLikeElement; |
1526 | 1539 | expression: Expression; |
1527 | 1540 | } |
1528 | 1541 |
|
1529 | 1542 | export interface JsxClosingElement extends Node { |
1530 | 1543 | kind: SyntaxKind.JsxClosingElement; |
| 1544 | + parent?: JsxElement; |
1531 | 1545 | tagName: JsxTagNameExpression; |
1532 | 1546 | } |
1533 | 1547 |
|
1534 | 1548 | export interface JsxExpression extends Expression { |
1535 | 1549 | kind: SyntaxKind.JsxExpression; |
| 1550 | + parent?: JsxElement | JsxAttributeLike; |
1536 | 1551 | dotDotDotToken?: Token<SyntaxKind.DotDotDotToken>; |
1537 | 1552 | expression?: Expression; |
1538 | 1553 | } |
1539 | 1554 |
|
1540 | 1555 | export interface JsxText extends Node { |
1541 | 1556 | kind: SyntaxKind.JsxText; |
| 1557 | + parent?: JsxElement; |
1542 | 1558 | } |
1543 | 1559 |
|
1544 | 1560 | export type JsxChild = JsxText | JsxExpression | JsxElement | JsxSelfClosingElement; |
|
1680 | 1696 |
|
1681 | 1697 | export interface CaseBlock extends Node { |
1682 | 1698 | kind: SyntaxKind.CaseBlock; |
| 1699 | + parent?: SwitchStatement; |
1683 | 1700 | clauses: NodeArray<CaseOrDefaultClause>; |
1684 | 1701 | } |
1685 | 1702 |
|
1686 | 1703 | export interface CaseClause extends Node { |
1687 | 1704 | kind: SyntaxKind.CaseClause; |
| 1705 | + parent?: CaseBlock; |
1688 | 1706 | expression: Expression; |
1689 | 1707 | statements: NodeArray<Statement>; |
1690 | 1708 | } |
1691 | 1709 |
|
1692 | 1710 | export interface DefaultClause extends Node { |
1693 | 1711 | kind: SyntaxKind.DefaultClause; |
| 1712 | + parent?: CaseBlock; |
1694 | 1713 | statements: NodeArray<Statement>; |
1695 | 1714 | } |
1696 | 1715 |
|
|
1716 | 1735 |
|
1717 | 1736 | export interface CatchClause extends Node { |
1718 | 1737 | kind: SyntaxKind.CatchClause; |
| 1738 | + parent?: TryStatement; |
1719 | 1739 | variableDeclaration: VariableDeclaration; |
1720 | 1740 | block: Block; |
1721 | 1741 | } |
|
1759 | 1779 |
|
1760 | 1780 | export interface HeritageClause extends Node { |
1761 | 1781 | kind: SyntaxKind.HeritageClause; |
| 1782 | + parent?: InterfaceDeclaration | ClassDeclaration | ClassExpression; |
1762 | 1783 | token: SyntaxKind; |
1763 | 1784 | types?: NodeArray<ExpressionWithTypeArguments>; |
1764 | 1785 | } |
|
1772 | 1793 |
|
1773 | 1794 | export interface EnumMember extends Declaration { |
1774 | 1795 | kind: SyntaxKind.EnumMember; |
| 1796 | + parent?: EnumDeclaration; |
1775 | 1797 | // This does include ComputedPropertyName, but the parser will give an error |
1776 | 1798 | // if it parses a ComputedPropertyName in an EnumMember |
1777 | 1799 | name: PropertyName; |
|
1790 | 1812 |
|
1791 | 1813 | export interface ModuleDeclaration extends DeclarationStatement { |
1792 | 1814 | kind: SyntaxKind.ModuleDeclaration; |
1793 | | - name: Identifier | StringLiteral; |
| 1815 | + parent?: ModuleBody | SourceFile; |
| 1816 | + name: ModuleName; |
1794 | 1817 | body?: ModuleBody | JSDocNamespaceDeclaration | Identifier; |
1795 | 1818 | } |
1796 | 1819 |
|
|
1810 | 1833 |
|
1811 | 1834 | export interface ModuleBlock extends Node, Statement { |
1812 | 1835 | kind: SyntaxKind.ModuleBlock; |
| 1836 | + parent?: ModuleDeclaration; |
1813 | 1837 | statements: NodeArray<Statement>; |
1814 | 1838 | } |
1815 | 1839 |
|
1816 | 1840 | export type ModuleReference = EntityName | ExternalModuleReference; |
1817 | 1841 |
|
1818 | 1842 | export interface ImportEqualsDeclaration extends DeclarationStatement { |
1819 | 1843 | kind: SyntaxKind.ImportEqualsDeclaration; |
| 1844 | + parent?: SourceFile | ModuleBlock; |
1820 | 1845 | name: Identifier; |
1821 | 1846 |
|
1822 | 1847 | // 'EntityName' for an internal module reference, 'ExternalModuleReference' for an external |
|
1826 | 1851 |
|
1827 | 1852 | export interface ExternalModuleReference extends Node { |
1828 | 1853 | kind: SyntaxKind.ExternalModuleReference; |
| 1854 | + parent?: ImportEqualsDeclaration; |
1829 | 1855 | expression?: Expression; |
1830 | 1856 | } |
1831 | 1857 |
|
|
1835 | 1861 | // ImportClause information is shown at its declaration below. |
1836 | 1862 | export interface ImportDeclaration extends Statement { |
1837 | 1863 | kind: SyntaxKind.ImportDeclaration; |
| 1864 | + parent?: SourceFile | ModuleBlock; |
1838 | 1865 | importClause?: ImportClause; |
1839 | 1866 | moduleSpecifier: Expression; |
1840 | 1867 | } |
|
1849 | 1876 | // import d, { a, b as x } from "mod" => name = d, namedBinding: NamedImports = { elements: [{ name: a }, { name: x, propertyName: b}]} |
1850 | 1877 | export interface ImportClause extends Declaration { |
1851 | 1878 | kind: SyntaxKind.ImportClause; |
| 1879 | + parent?: ImportDeclaration; |
1852 | 1880 | name?: Identifier; // Default binding |
1853 | 1881 | namedBindings?: NamedImportBindings; |
1854 | 1882 | } |
1855 | 1883 |
|
1856 | 1884 | export interface NamespaceImport extends Declaration { |
1857 | 1885 | kind: SyntaxKind.NamespaceImport; |
| 1886 | + parent?: ImportClause; |
1858 | 1887 | name: Identifier; |
1859 | 1888 | } |
1860 | 1889 |
|
|
1866 | 1895 |
|
1867 | 1896 | export interface ExportDeclaration extends DeclarationStatement { |
1868 | 1897 | kind: SyntaxKind.ExportDeclaration; |
| 1898 | + parent?: SourceFile | ModuleBlock; |
1869 | 1899 | exportClause?: NamedExports; |
1870 | 1900 | moduleSpecifier?: Expression; |
1871 | 1901 | } |
1872 | 1902 |
|
1873 | 1903 | export interface NamedImports extends Node { |
1874 | 1904 | kind: SyntaxKind.NamedImports; |
| 1905 | + parent?: ImportClause; |
1875 | 1906 | elements: NodeArray<ImportSpecifier>; |
1876 | 1907 | } |
1877 | 1908 |
|
1878 | 1909 | export interface NamedExports extends Node { |
1879 | 1910 | kind: SyntaxKind.NamedExports; |
| 1911 | + parent?: ExportDeclaration; |
1880 | 1912 | elements: NodeArray<ExportSpecifier>; |
1881 | 1913 | } |
1882 | 1914 |
|
1883 | 1915 | export type NamedImportsOrExports = NamedImports | NamedExports; |
1884 | 1916 |
|
1885 | 1917 | export interface ImportSpecifier extends Declaration { |
1886 | 1918 | kind: SyntaxKind.ImportSpecifier; |
| 1919 | + parent?: NamedImports; |
1887 | 1920 | propertyName?: Identifier; // Name preceding "as" keyword (or undefined when "as" is absent) |
1888 | 1921 | name: Identifier; // Declared name |
1889 | 1922 | } |
1890 | 1923 |
|
1891 | 1924 | export interface ExportSpecifier extends Declaration { |
1892 | 1925 | kind: SyntaxKind.ExportSpecifier; |
| 1926 | + parent?: NamedExports; |
1893 | 1927 | propertyName?: Identifier; // Name preceding "as" keyword (or undefined when "as" is absent) |
1894 | 1928 | name: Identifier; // Declared name |
1895 | 1929 | } |
|
1898 | 1932 |
|
1899 | 1933 | export interface ExportAssignment extends DeclarationStatement { |
1900 | 1934 | kind: SyntaxKind.ExportAssignment; |
| 1935 | + parent?: SourceFile; |
1901 | 1936 | isExportEquals?: boolean; |
1902 | 1937 | expression: Expression; |
1903 | 1938 | } |
|
0 commit comments