UNPKG

2.24 kBTypeScriptView Raw
1/**
2 * Copyright 2018 The AMP HTML Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS-IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16import { Program, BaseNode, Identifier, ImportDeclaration, VariableDeclarator, BlockStatement, ExportNamedDeclaration, ExportDefaultDeclaration, ExportAllDeclaration, FunctionDeclaration, VariableDeclaration, ClassDeclaration, ExportSpecifier, Property } from 'estree';
17export declare const walk: {
18 simple: any;
19 ancestor: any;
20};
21export declare function parse(fileName: string, source: string): Promise<Program>;
22export declare function isIdentifier(node: BaseNode): node is Identifier;
23export declare function isImportDeclaration(node: BaseNode): node is ImportDeclaration;
24export declare function isImportExpression(node: BaseNode): boolean;
25export declare function isVariableDeclarator(node: BaseNode): node is VariableDeclarator;
26export declare function isBlockStatement(node: BaseNode): node is BlockStatement;
27export declare function isProgram(node: BaseNode): node is Program;
28export declare function isExportNamedDeclaration(node: BaseNode): node is ExportNamedDeclaration;
29export declare function isExportDefaultDeclaration(node: BaseNode): node is ExportDefaultDeclaration;
30export declare function isExportAllDeclaration(node: BaseNode): node is ExportAllDeclaration;
31export declare function isFunctionDeclaration(node: BaseNode): node is FunctionDeclaration;
32export declare function isVariableDeclaration(node: BaseNode): node is VariableDeclaration;
33export declare function isClassDeclaration(node: BaseNode): node is ClassDeclaration;
34export declare function isExportSpecifier(node: BaseNode): node is ExportSpecifier;
35export declare function isProperty(node: BaseNode): node is Property;