UNPKG

2.08 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
4 * This code may only be used under the BSD style license found at
5 * http://polymer.github.io/LICENSE.txt
6 * The complete set of authors may be found at
7 * http://polymer.github.io/AUTHORS.txt
8 * The complete set of contributors may be found at
9 * http://polymer.github.io/CONTRIBUTORS.txt
10 * Code distributed by Google as part of the polymer project is also
11 * subject to an additional IP rights grant found at
12 * http://polymer.github.io/PATENTS.txt
13 */
14import { NodePath } from '@babel/traverse';
15import * as babel from '@babel/types';
16import { Document, Feature, JsAstNode, SourceRange, Warning } from '../model/model';
17import { Resolvable } from '../model/resolvable';
18import { Visitor } from './estree-visitor';
19import { JavaScriptDocument } from './javascript-document';
20import { JavaScriptScanner } from './javascript-scanner';
21export declare type ExportNode = babel.ExportNamedDeclaration | babel.ExportAllDeclaration | babel.ExportDefaultDeclaration;
22declare module '../model/queryable' {
23 interface FeatureKindMap {
24 'export': Export;
25 }
26}
27export declare class Export implements Resolvable, Feature {
28 readonly kinds: ReadonlySet<string>;
29 readonly identifiers: Set<string>;
30 readonly description: undefined;
31 readonly jsdoc: undefined;
32 readonly sourceRange: SourceRange | undefined;
33 readonly astNodePath: NodePath<babel.Node>;
34 readonly astNode: JsAstNode<ExportNode>;
35 readonly statementAst: babel.Statement;
36 readonly warnings: ReadonlyArray<Warning>;
37 constructor(astNode: JsAstNode<ExportNode>, statementAst: babel.Statement, sourceRange: SourceRange | undefined, nodePath: NodePath<babel.Node>, exportingAllFrom?: Iterable<Export>);
38 resolve(document: Document): Feature | undefined;
39}
40export declare class JavaScriptExportScanner implements JavaScriptScanner {
41 scan(document: JavaScriptDocument, visit: (visitor: Visitor) => Promise<void>): Promise<{
42 features: Export[];
43 warnings: Warning[];
44 }>;
45}