ast-typeguard
Version:
Typeguards for working with typescript's AST
80 lines (79 loc) • 7.04 kB
TypeScript
import * as ts from 'typescript';
export declare function isAsExpression(node: ts.Node): node is ts.AsExpression;
export declare function isAccessorDeclaration(node: ts.Node): node is ts.AccessorDeclaration;
export declare function isArrayBindingPattern(node: ts.Node): node is ts.ArrayBindingPattern;
export declare function isArrayLiteralExpression(node: ts.Node): node is ts.ArrayLiteralExpression;
export declare function isArrowFunction(node: ts.Node): node is ts.ArrowFunction;
export declare function isAwaitExpression(node: ts.Node): node is ts.AwaitExpression;
export declare function isBinaryExpression(node: ts.Node): node is ts.BinaryExpression;
export declare function isBindingElement(node: ts.Node): node is ts.BindingElement;
export declare function isBindingPattern(node: ts.Node): node is ts.BindingPattern;
export declare function isBlock(node: ts.Node): node is ts.Block;
export declare function isBlockLike(node: ts.Node): node is ts.BlockLike;
export declare function isCallExpression(node: ts.Node): node is ts.CallExpression;
export declare function isCallSignatureDeclaration(node: ts.Node): node is ts.CallSignatureDeclaration;
export declare function isCaseClause(node: ts.Node): node is ts.CaseClause;
export declare function isCaseOrDefaultClause(node: ts.Node): node is ts.CaseOrDefaultClause;
export declare function isClassDeclaration(node: ts.Node): node is ts.ClassDeclaration;
export declare function isClassExpression(node: ts.Node): node is ts.ClassExpression;
export declare function isClassLikeDeclaration(node: ts.Node): node is ts.ClassLikeDeclaration;
export declare function isConstructorDeclaration(node: ts.Node): node is ts.ConstructorDeclaration;
export declare function isConstructorTypeNode(node: ts.Node): node is ts.ConstructorTypeNode;
export declare function isComputedPropertyName(node: ts.Node): node is ts.ComputedPropertyName;
export declare function isDefaultClause(node: ts.Node): node is ts.DefaultClause;
export declare function isElementAccessExpression(node: ts.Node): node is ts.ElementAccessExpression;
export declare function isEntityNameExpression(node: ts.Node): node is ts.EntityNameExpression;
export declare function isExpressionStatement(node: ts.Node): node is ts.ExpressionStatement;
export declare function isExternalModuleReference(node: ts.Node): node is ts.ExternalModuleReference;
export declare function isForInStatement(node: ts.Node): node is ts.ForInStatement;
export declare function isForOfStatement(node: ts.Node): node is ts.ForOfStatement;
export declare function isForStatement(node: ts.Node): node is ts.ForStatement;
export declare function isFunctionDeclaration(node: ts.Node): node is ts.FunctionDeclaration;
export declare function isFunctionExpression(node: ts.Node): node is ts.FunctionExpression;
export declare function isFunctionTypeNode(node: ts.Node): node is ts.FunctionTypeNode;
export declare function isGetAccessorDeclaration(node: ts.Node): node is ts.GetAccessorDeclaration;
export declare function isIdentifier(node: ts.Node): node is ts.Identifier;
export declare function isIfStatement(node: ts.Node): node is ts.IfStatement;
export declare function isImportClause(node: ts.Node): node is ts.ImportClause;
export declare function isImportDeclaration(node: ts.Node): node is ts.ImportDeclaration;
export declare function isImportEqualsDeclaration(node: ts.Node): node is ts.ImportEqualsDeclaration;
export declare function isInterfaceDeclaration(node: ts.Node): node is ts.InterfaceDeclaration;
export declare function isLiteralExpression(node: ts.Node): node is ts.LiteralExpression;
export declare function isMethodDeclaration(node: ts.Node): node is ts.MethodDeclaration;
export declare function isModuleBlock(node: ts.Node): node is ts.ModuleBlock;
export declare function isModuleDeclaration(node: ts.Node): node is ts.ModuleDeclaration;
export declare function isNamedExports(node: ts.Node): node is ts.NamedExports;
export declare function isNamedImports(node: ts.Node): node is ts.NamedImports;
export declare function isNamespaceDeclaration(node: ts.Node): node is ts.NamespaceDeclaration;
export declare function isNamespaceImport(node: ts.Node): node is ts.NamespaceImport;
export declare function isNewExpression(node: ts.Node): node is ts.NewExpression;
export declare function isNoSubstitutionTemplateLiteral(node: ts.Node): node is ts.NoSubstitutionTemplateLiteral;
export declare function isNumericliteral(node: ts.Node): node is ts.NumericLiteral;
export declare function isObjectBindingPattern(node: ts.Node): node is ts.ObjectBindingPattern;
export declare function isObjectLiteralExpression(node: ts.Node): node is ts.ObjectLiteralExpression;
export declare function isOmittedExpression(node: ts.Node): node is ts.OmittedExpression;
export declare function isParenthesizedExpression(node: ts.Node): node is ts.ParenthesizedExpression;
export declare function isPostfixUnaryExpression(node: ts.Node): node is ts.PostfixUnaryExpression;
export declare function isPrefixUnaryExpression(node: ts.Node): node is ts.PrefixUnaryExpression;
export declare function isPropertyAccessExpression(node: ts.Node): node is ts.PropertyAccessExpression;
export declare function isPropertyAssignment(node: ts.Node): node is ts.PropertyAssignment;
export declare function isPropertyDeclaration(node: ts.Node): node is ts.PropertyDeclaration;
export declare function isQualifiedName(node: ts.Node): node is ts.QualifiedName;
export declare function isReturnStatement(node: ts.Node): node is ts.ReturnStatement;
export declare function isSetAccessorDeclaration(node: ts.Node): node is ts.SetAccessorDeclaration;
export declare function isSignatureDeclaration(node: ts.Node): node is ts.SignatureDeclaration;
export declare function isSourceFile(node: ts.Node): node is ts.SourceFile;
export declare function isStringLiteral(node: ts.Node): node is ts.StringLiteral;
export declare function isSwitchStatement(node: ts.Node): node is ts.SwitchStatement;
export declare function isTaggedTemplateExpression(node: ts.Node): node is ts.TaggedTemplateExpression;
export declare function isTemplateExpression(node: ts.Node): node is ts.TemplateExpression;
export declare function isTemplateLiteral(node: ts.Node): node is ts.TemplateLiteral;
export declare function isTextualLiteral(node: ts.Node): node is ts.LiteralExpression;
export declare function isTryStatement(node: ts.Node): node is ts.TryStatement;
export declare function isTypeAssertion(node: ts.Node): node is ts.TypeAssertion;
export declare function isTypeOfExpression(node: ts.Node): node is ts.TypeOfExpression;
export declare function isTypeReferenceNode(node: ts.Node): node is ts.TypeReferenceNode;
export declare function isVariableDeclaration(node: ts.Node): node is ts.VariableDeclaration;
export declare function isVariableStatement(node: ts.Node): node is ts.VariableStatement;
export declare function isVariableDeclarationList(node: ts.Node): node is ts.VariableDeclarationList;
export declare function isVoidExpression(node: ts.Node): node is ts.VoidExpression;