UNPKG

3.99 kBTypeScriptView Raw
1import ts from 'typescript';
2export declare type StatementedNode = ts.Block | ts.SourceFile | ts.FunctionDeclaration | ts.ModuleDeclaration | ts.FunctionLikeDeclaration | ts.CaseClause | ts.DefaultClause;
3export declare function getStatements(node: StatementedNode): readonly ts.Statement[];
4export declare function getClasses(node: StatementedNode): readonly ts.ClassDeclaration[];
5export declare function getClass(node: StatementedNode, name: string): ts.ClassDeclaration | undefined;
6export declare function getClassOrThrow(node: StatementedNode, name: string): ts.ClassDeclaration;
7export declare function getInterfaces(node: StatementedNode): readonly ts.InterfaceDeclaration[];
8export declare function getInterface(node: StatementedNode, name: string): ts.InterfaceDeclaration | undefined;
9export declare function getInterfaceOrThrow(node: StatementedNode, name: string): ts.InterfaceDeclaration;
10export declare function getNamespaces(node: StatementedNode): readonly ts.ModuleDeclaration[];
11export declare function getNamespace(node: StatementedNode, name: string): ts.ModuleDeclaration | undefined;
12export declare function getNamespaceOrThrow(node: StatementedNode, name: string): ts.ModuleDeclaration;
13export declare function getVariableStatements(node: StatementedNode): readonly ts.VariableStatement[];
14export declare function getVariableDeclarations(node: StatementedNode): readonly ts.VariableDeclaration[];
15export declare function getVariableDeclaration(node: StatementedNode, name: string): ts.VariableDeclaration | undefined;
16export declare function getVariableDeclarationOrThrow(node: StatementedNode, name: string): ts.VariableDeclaration;
17export declare function getTypeAliases(node: StatementedNode): readonly ts.TypeAliasDeclaration[];
18export declare function getTypeAlias(node: StatementedNode, name: string): ts.TypeAliasDeclaration | undefined;
19export declare function getTypeAliasOrThrow(node: StatementedNode, name: string): ts.TypeAliasDeclaration;
20export declare function getFunctions(node: StatementedNode): readonly ts.FunctionDeclaration[];
21export declare function getFunction(node: StatementedNode, name: string): ts.FunctionDeclaration | undefined;
22export declare function getFunctionOrThrow(node: StatementedNode, name: string): ts.FunctionDeclaration;
23export declare function getEnums(node: StatementedNode): readonly ts.EnumDeclaration[];
24export declare function getEnum(node: StatementedNode, name: string): ts.EnumDeclaration | undefined;
25export declare function getEnumOrThrow(node: StatementedNode, name: string): ts.EnumDeclaration;
26export declare function getLabel(node: ts.BreakStatement | ts.ContinueStatement): ts.Identifier | undefined;
27export declare function getClauses(node: ts.CaseBlock): readonly ts.CaseOrDefaultClause[];
28export declare function getOnlyVariableDeclaration(node: ts.CatchClause): ts.VariableDeclaration | undefined;
29export declare function getBlock(node: ts.CatchClause): ts.Block;
30export declare function getStatement(node: ts.DoStatement | ts.ForStatement | ts.WhileStatement | ts.ForInOrOfStatement): ts.Statement;
31export declare function getInitializer(node: ts.ForInOrOfStatement): ts.VariableDeclarationList | ts.Expression;
32export declare function getInitializer(node: ts.ForStatement): ts.VariableDeclarationList | ts.Expression | undefined;
33export declare function getCondition(node: ts.ForStatement): ts.Expression | undefined;
34export declare function getIncrementor(node: ts.ForStatement): ts.Expression | undefined;
35export declare function getThenStatement(node: ts.IfStatement): ts.Statement;
36export declare function getElseStatement(node: ts.IfStatement): ts.Statement | undefined;
37export declare function getCaseBlock(node: ts.SwitchStatement): ts.CaseBlock;
38export declare function getCatchClause(node: ts.TryStatement): ts.CatchClause | undefined;
39export declare function getTryBlock(node: ts.TryStatement): ts.Block;
40export declare function getFinallyBlock(node: ts.TryStatement): ts.Block | undefined;