UNPKG

2.05 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 MagicString from 'magic-string';
17export declare const IMPORT_DECLARATION = "ImportDeclaration";
18export declare const IMPORT_SPECIFIER = "ImportSpecifier";
19export declare const IMPORT_DEFAULT_SPECIFIER = "ImportDefaultSpecifier";
20export declare const IMPORT_NAMESPACE_SPECIFIER = "ImportNamespaceSpecifier";
21export declare const EXPORT_NAMED_DECLARATION = "ExportNamedDeclaration";
22export declare const EXPORT_SPECIFIER = "ExportSpecifier";
23export declare const EXPORT_DEFAULT_DECLARATION = "ExportDefaultDeclaration";
24export declare const EXPORT_ALL_DECLARATION = "ExportAllDeclaration";
25export declare const ALL_EXPORT_DECLARATIONS: string[];
26export declare type Range = [number, number];
27export declare type CollectedExports = Map<string | null, Array<string>>;
28export declare enum ExportClosureMapping {
29 NAMED_FUNCTION = 0,
30 NAMED_CLASS = 1,
31 NAMED_DEFAULT_FUNCTION = 2,
32 DEFAULT_FUNCTION = 3,
33 NAMED_DEFAULT_CLASS = 4,
34 DEFAULT_CLASS = 5,
35 NAMED_CONSTANT = 6,
36 DEFAULT = 7,
37 DEFAULT_VALUE = 8,
38 DEFAULT_OBJECT = 9
39}
40export interface ExportDetails {
41 local: string;
42 exported: string;
43 type: ExportClosureMapping;
44 range: Range;
45 source: string | null;
46}
47export declare type TransformMethod = (code: string) => Promise<MagicString>;
48export interface TransformInterface {
49 name: string;
50}
51export interface PluginOptions {
52 [key: string]: string | boolean;
53}