forked from babel/babel
/
types.d.ts
57 lines (50 loc) 路 1.42 KB
/
types.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import type { ModulesOption, UseBuiltInsOption } from "./options";
import type { NormalizedCorejsOption } from "./normalize-options";
import type { Targets, InputTargets } from "@babel/helper-compilation-targets";
// Options
// Use explicit modules to prevent typo errors.
export type ModuleOption = typeof ModulesOption[keyof typeof ModulesOption];
export type BuiltInsOption =
typeof UseBuiltInsOption[keyof typeof UseBuiltInsOption];
type CorejsVersion = 2 | 3 | string;
export type CorejsOption =
| false
| CorejsVersion
| {
version: CorejsVersion;
proposals: boolean;
};
export type PluginListItem = string | RegExp;
export type PluginListOption = Array<PluginListItem>;
export type Options = {
bugfixes: boolean;
configPath: string;
corejs: CorejsOption;
debug: boolean;
exclude: PluginListOption;
forceAllTransforms: boolean;
ignoreBrowserslistConfig: boolean;
include: PluginListOption;
loose: boolean;
modules: ModuleOption;
shippedProposals: boolean;
spec: boolean;
targets: {
uglify?: boolean;
esmodules?: boolean;
} & InputTargets;
useBuiltIns: BuiltInsOption;
browserslistEnv: string;
};
// Babel
export type Plugin = [any, any];
export type InternalPluginOptions = {
corejs: NormalizedCorejsOption;
include: Set<string>;
exclude: Set<string>;
polyfillTargets: Targets;
debug: boolean;
proposals: boolean;
shippedProposals: boolean;
regenerator: boolean;
};