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