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