1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | import { GeneratorOptions } from '@babel/generator';
|
12 | import traverse, { Visitor, NodePath, Hub, Scope } from '@babel/traverse';
|
13 | import template from '@babel/template';
|
14 | import * as t from '@babel/types';
|
15 | import { ParserOptions } from '@babel/parser';
|
16 |
|
17 | export { ParserOptions, GeneratorOptions, t as types, template, traverse, NodePath, Visitor };
|
18 |
|
19 | export type Node = t.Node;
|
20 | export type ParseResult = t.File | t.Program;
|
21 | export const version: string;
|
22 | export const DEFAULT_EXTENSIONS: ['.js', '.jsx', '.es6', '.es', '.mjs'];
|
23 |
|
24 | export interface TransformOptions {
|
25 | |
26 |
|
27 |
|
28 |
|
29 |
|
30 | ast?: boolean | null;
|
31 |
|
32 | |
33 |
|
34 |
|
35 |
|
36 |
|
37 | auxiliaryCommentAfter?: string | null;
|
38 |
|
39 | |
40 |
|
41 |
|
42 |
|
43 |
|
44 | auxiliaryCommentBefore?: string | null;
|
45 |
|
46 | |
47 |
|
48 |
|
49 |
|
50 |
|
51 | root?: string | null;
|
52 |
|
53 | |
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 | rootMode?: 'root' | 'upward' | 'upward-optional';
|
61 |
|
62 | |
63 |
|
64 |
|
65 |
|
66 |
|
67 | configFile?: string | boolean | null;
|
68 |
|
69 | |
70 |
|
71 |
|
72 |
|
73 |
|
74 |
|
75 | babelrc?: boolean | null;
|
76 |
|
77 | |
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 | babelrcRoots?: boolean | MatchPattern | MatchPattern[] | null;
|
84 |
|
85 | |
86 |
|
87 |
|
88 |
|
89 |
|
90 | envName?: string;
|
91 |
|
92 | |
93 |
|
94 |
|
95 | exclude?: MatchPattern | MatchPattern[];
|
96 |
|
97 | |
98 |
|
99 |
|
100 |
|
101 |
|
102 | code?: boolean | null;
|
103 |
|
104 | |
105 |
|
106 |
|
107 |
|
108 |
|
109 | comments?: boolean | null;
|
110 |
|
111 | |
112 |
|
113 |
|
114 |
|
115 |
|
116 | compact?: boolean | 'auto' | null;
|
117 |
|
118 | |
119 |
|
120 |
|
121 |
|
122 |
|
123 | cwd?: string | null;
|
124 |
|
125 | |
126 |
|
127 |
|
128 |
|
129 |
|
130 |
|
131 | caller?: TransformCaller;
|
132 |
|
133 | |
134 |
|
135 |
|
136 |
|
137 |
|
138 |
|
139 | env?: { [index: string]: TransformOptions | null | undefined } | null;
|
140 |
|
141 | |
142 |
|
143 |
|
144 |
|
145 |
|
146 | extends?: string | null;
|
147 |
|
148 | |
149 |
|
150 |
|
151 |
|
152 |
|
153 | filename?: string | null;
|
154 |
|
155 | |
156 |
|
157 |
|
158 |
|
159 |
|
160 | filenameRelative?: string | null;
|
161 |
|
162 | |
163 |
|
164 |
|
165 |
|
166 |
|
167 | generatorOpts?: GeneratorOptions | null;
|
168 |
|
169 | |
170 |
|
171 |
|
172 |
|
173 |
|
174 | getModuleId?: ((moduleName: string) => string | null | undefined) | null;
|
175 |
|
176 | /**
|
177 | * ANSI highlight syntax error code frames
|
178 | *
|
179 | * Default: `true`
|
180 | */
|
181 | highlightCode?: boolean | null;
|
182 |
|
183 | /**
|
184 | * Opposite to the `only` option. `ignore` is disregarded if `only` is specified
|
185 | *
|
186 | * Default: `null`
|
187 | */
|
188 | ignore?: MatchPattern[] | null;
|
189 |
|
190 | /**
|
191 | * This option is a synonym for "test"
|
192 | */
|
193 | include?: MatchPattern | MatchPattern[];
|
194 |
|
195 | /**
|
196 | * A source map object that the output source map will be based on
|
197 | *
|
198 | * Default: `null`
|
199 | */
|
200 | inputSourceMap?: object | null;
|
201 |
|
202 | /**
|
203 | * Should the output be minified (not printing last semicolons in blocks, printing literal string values instead of escaped ones, stripping `()` from `new` when safe)
|
204 | *
|
205 | * Default: `false`
|
206 | */
|
207 | minified?: boolean | null;
|
208 |
|
209 | /**
|
210 | * Specify a custom name for module ids
|
211 | *
|
212 | * Default: `null`
|
213 | */
|
214 | moduleId?: string | null;
|
215 |
|
216 | /**
|
217 | * If truthy, insert an explicit id for modules. By default, all modules are anonymous. (Not available for `common` modules)
|
218 | *
|
219 | * Default: `false`
|
220 | */
|
221 | moduleIds?: boolean | null;
|
222 |
|
223 | /**
|
224 | * Optional prefix for the AMD module formatter that will be prepend to the filename on module definitions
|
225 | *
|
226 | * Default: `(sourceRoot)`
|
227 | */
|
228 | moduleRoot?: string | null;
|
229 |
|
230 | /**
|
231 | * A glob, regex, or mixed array of both, matching paths to **only** compile. Can also be an array of arrays containing paths to explicitly match. When attempting to compile
|
232 | * a non-matching file it's returned verbatim
|
233 | *
|
234 | * Default: `null`
|
235 | */
|
236 | only?: MatchPattern[] | null;
|
237 |
|
238 | /**
|
239 | * Allows users to provide an array of options that will be merged into the current configuration one at a time.
|
240 | * This feature is best used alongside the "test"/"include"/"exclude" options to provide conditions for which an override should apply
|
241 | */
|
242 | overrides?: TransformOptions[];
|
243 |
|
244 | /**
|
245 | * An object containing the options to be passed down to the babel parser, @babel/parser
|
246 | *
|
247 | * Default: `{}`
|
248 | */
|
249 | parserOpts?: ParserOptions | null;
|
250 |
|
251 | /**
|
252 | * List of plugins to load and use
|
253 | *
|
254 | * Default: `[]`
|
255 | */
|
256 | plugins?: PluginItem[] | null;
|
257 |
|
258 | /**
|
259 | * List of presets (a set of plugins) to load and use
|
260 | *
|
261 | * Default: `[]`
|
262 | */
|
263 | presets?: PluginItem[] | null;
|
264 |
|
265 | /**
|
266 | * Retain line numbers. This will lead to wacky code but is handy for scenarios where you can't use source maps. (**NOTE**: This will not retain the columns)
|
267 | *
|
268 | * Default: `false`
|
269 | */
|
270 | retainLines?: boolean | null;
|
271 |
|
272 | /**
|
273 | * An optional callback that controls whether a comment should be output or not. Called as `shouldPrintComment(commentContents)`. **NOTE**: This overrides the `comment` option when used
|
274 | *
|
275 | * Default: `null`
|
276 | */
|
277 | shouldPrintComment?: ((commentContents: string) => boolean) | null;
|
278 |
|
279 | /**
|
280 | * Set `sources[0]` on returned source map
|
281 | *
|
282 | * Default: `(filenameRelative)`
|
283 | */
|
284 | sourceFileName?: string | null;
|
285 |
|
286 | /**
|
287 | * If truthy, adds a `map` property to returned output. If set to `"inline"`, a comment with a sourceMappingURL directive is added to the bottom of the returned code. If set to `"both"`
|
288 | * then a `map` property is returned as well as a source map comment appended. **This does not emit sourcemap files by itself!**
|
289 | *
|
290 | * Default: `false`
|
291 | */
|
292 | sourceMaps?: boolean | 'inline' | 'both' | null;
|
293 |
|
294 | /**
|
295 | * The root from which all sources are relative
|
296 | *
|
297 | * Default: `(moduleRoot)`
|
298 | */
|
299 | sourceRoot?: string | null;
|
300 |
|
301 | /**
|
302 | * Indicate the mode the code should be parsed in. Can be one of "script", "module", or "unambiguous". `"unambiguous"` will make Babel attempt to guess, based on the presence of ES6
|
303 | * `import` or `export` statements. Files with ES6 `import`s and `export`s are considered `"module"` and are otherwise `"script"`.
|
304 | *
|
305 | * Default: `("module")`
|
306 | */
|
307 | sourceType?: 'script' | 'module' | 'unambiguous' | null;
|
308 |
|
309 | /**
|
310 | * If all patterns fail to match, the current configuration object is considered inactive and is ignored during config processing.
|
311 | */
|
312 | test?: MatchPattern | MatchPattern[];
|
313 |
|
314 | /**
|
315 | * An optional callback that can be used to wrap visitor methods. **NOTE**: This is useful for things like introspection, and not really needed for implementing anything. Called as
|
316 | * `wrapPluginVisitorMethod(pluginAlias, visitorType, callback)`.
|
317 | */
|
318 | wrapPluginVisitorMethod?:
|
319 | | ((
|
320 | pluginAlias: string,
|
321 | visitorType: 'enter' | 'exit',
|
322 | callback: (path: NodePath, state: any) => void,
|
323 | ) => (path: NodePath, state: any) => void)
|
324 | | null;
|
325 | }
|
326 |
|
327 | export interface TransformCaller {
|
328 | // the only required property
|
329 | name: string;
|
330 | // e.g. set to true by `babel-loader` and false by `babel-jest`
|
331 | supportsStaticESM?: boolean;
|
332 | supportsDynamicImport?: boolean;
|
333 | // augment this with a "declare module '@babel/core' { ... }" if you need more keys
|
334 | }
|
335 |
|
336 | export type FileResultCallback = (err: Error | null, result: BabelFileResult | null) => any;
|
337 |
|
338 | export interface MatchPatternContext {
|
339 | envName: string;
|
340 | dirname: string;
|
341 | caller: TransformCaller | undefined;
|
342 | }
|
343 | export type MatchPattern = string | RegExp | ((filename: string | undefined, context: MatchPatternContext) => boolean);
|
344 |
|
345 | /**
|
346 | * Transforms the passed in code. Calling a callback with an object with the generated code, source map, and AST.
|
347 | */
|
348 | export function transform(code: string, callback: FileResultCallback): void;
|
349 |
|
350 | /**
|
351 | * Transforms the passed in code. Calling a callback with an object with the generated code, source map, and AST.
|
352 | */
|
353 | export function transform(code: string, opts: TransformOptions | undefined, callback: FileResultCallback): void;
|
354 |
|
355 | /**
|
356 | * Here for backward-compatibility. Ideally use `transformSync` if you want a synchronous API.
|
357 | */
|
358 | export function transform(code: string, opts?: TransformOptions): BabelFileResult | null;
|
359 |
|
360 | /**
|
361 | * Transforms the passed in code. Returning an object with the generated code, source map, and AST.
|
362 | */
|
363 | export function transformSync(code: string, opts?: TransformOptions): BabelFileResult | null;
|
364 |
|
365 | /**
|
366 | * Transforms the passed in code. Calling a callback with an object with the generated code, source map, and AST.
|
367 | */
|
368 | export function transformAsync(code: string, opts?: TransformOptions): Promise<BabelFileResult | null>;
|
369 |
|
370 | /**
|
371 | * Asynchronously transforms the entire contents of a file.
|
372 | */
|
373 | export function transformFile(filename: string, callback: FileResultCallback): void;
|
374 |
|
375 | /**
|
376 | * Asynchronously transforms the entire contents of a file.
|
377 | */
|
378 | export function transformFile(filename: string, opts: TransformOptions | undefined, callback: FileResultCallback): void;
|
379 |
|
380 | /**
|
381 | * Synchronous version of `babel.transformFile`. Returns the transformed contents of the `filename`.
|
382 | */
|
383 | export function transformFileSync(filename: string, opts?: TransformOptions): BabelFileResult | null;
|
384 |
|
385 | /**
|
386 | * Asynchronously transforms the entire contents of a file.
|
387 | */
|
388 | export function transformFileAsync(filename: string, opts?: TransformOptions): Promise<BabelFileResult | null>;
|
389 |
|
390 | /**
|
391 | * Given an AST, transform it.
|
392 | */
|
393 | export function transformFromAst(ast: Node, code: string | undefined, callback: FileResultCallback): void;
|
394 |
|
395 | /**
|
396 | * Given an AST, transform it.
|
397 | */
|
398 | export function transformFromAst(
|
399 | ast: Node,
|
400 | code: string | undefined,
|
401 | opts: TransformOptions | undefined,
|
402 | callback: FileResultCallback,
|
403 | ): void;
|
404 |
|
405 | /**
|
406 | * Here for backward-compatibility. Ideally use ".transformSync" if you want a synchronous API.
|
407 | */
|
408 | export function transformFromAstSync(ast: Node, code?: string, opts?: TransformOptions): BabelFileResult | null;
|
409 |
|
410 | /**
|
411 | * Given an AST, transform it.
|
412 | */
|
413 | export function transformFromAstAsync(
|
414 | ast: Node,
|
415 | code?: string,
|
416 | opts?: TransformOptions,
|
417 | ): Promise<BabelFileResult | null>;
|
418 |
|
419 | // A babel plugin is a simple function which must return an object matching
|
420 | // the following interface. Babel will throw if it finds unknown properties.
|
421 | // The list of allowed plugin keys is here:
|
422 | // https://github.com/babel/babel/blob/4e50b2d9d9c376cee7a2cbf56553fe5b982ea53c/packages/babel-core/src/config/option-manager.js#L71
|
423 | export interface PluginObj<S = PluginPass> {
|
424 | name?: string;
|
425 | manipulateOptions?(opts: any, parserOpts: any): void;
|
426 | pre?(this: S, state: S): void;
|
427 | visitor: Visitor<S>;
|
428 | post?(this: S, state: S): void;
|
429 | inherits?: any;
|
430 | }
|
431 |
|
432 | export interface BabelFile {
|
433 | ast: t.File;
|
434 | opts: TransformOptions;
|
435 | hub: Hub;
|
436 | metadata: object;
|
437 | path: NodePath;
|
438 | scope: Scope;
|
439 | inputMap: object | null;
|
440 | code: string;
|
441 | }
|
442 |
|
443 | export interface PluginPass {
|
444 | file: BabelFile;
|
445 | key: string;
|
446 | opts: PluginOptions;
|
447 | cwd: string;
|
448 | filename: string;
|
449 | [key: string]: unknown;
|
450 | }
|
451 |
|
452 | export interface BabelFileResult {
|
453 | ast?: t.File | null;
|
454 | code?: string | null;
|
455 | ignored?: boolean;
|
456 | map?: {
|
457 | version: number;
|
458 | sources: string[];
|
459 | names: string[];
|
460 | sourceRoot?: string;
|
461 | sourcesContent?: string[];
|
462 | mappings: string;
|
463 | file: string;
|
464 | } | null;
|
465 | metadata?: BabelFileMetadata;
|
466 | }
|
467 |
|
468 | export interface BabelFileMetadata {
|
469 | usedHelpers: string[];
|
470 | marked: Array<{
|
471 | type: string;
|
472 | message: string;
|
473 | loc: object;
|
474 | }>;
|
475 | modules: BabelFileModulesMetadata;
|
476 | }
|
477 |
|
478 | export interface BabelFileModulesMetadata {
|
479 | imports: object[];
|
480 | exports: {
|
481 | exported: object[];
|
482 | specifiers: object[];
|
483 | };
|
484 | }
|
485 |
|
486 | export type FileParseCallback = (err: Error | null, result: ParseResult | null) => any;
|
487 |
|
488 |
|
489 |
|
490 |
|
491 |
|
492 | export function parse(code: string, callback: FileParseCallback): void;
|
493 |
|
494 |
|
495 |
|
496 |
|
497 |
|
498 | export function parse(code: string, options: TransformOptions | undefined, callback: FileParseCallback): void;
|
499 |
|
500 |
|
501 |
|
502 |
|
503 |
|
504 | export function parse(code: string, options?: TransformOptions): ParseResult | null;
|
505 |
|
506 |
|
507 |
|
508 |
|
509 |
|
510 | export function parseSync(code: string, options?: TransformOptions): ParseResult | null;
|
511 |
|
512 |
|
513 |
|
514 |
|
515 |
|
516 | export function parseAsync(code: string, options?: TransformOptions): Promise<ParseResult | null>;
|
517 |
|
518 |
|
519 |
|
520 |
|
521 |
|
522 |
|
523 |
|
524 |
|
525 |
|
526 |
|
527 |
|
528 |
|
529 |
|
530 | export function loadOptions(options?: TransformOptions): object | null;
|
531 |
|
532 |
|
533 |
|
534 |
|
535 |
|
536 |
|
537 |
|
538 |
|
539 |
|
540 |
|
541 |
|
542 |
|
543 |
|
544 |
|
545 |
|
546 |
|
547 |
|
548 |
|
549 |
|
550 |
|
551 | export function loadPartialConfig(options?: TransformOptions): Readonly<PartialConfig> | null;
|
552 |
|
553 | export interface PartialConfig {
|
554 | options: TransformOptions;
|
555 | babelrc?: string;
|
556 | babelignore?: string;
|
557 | config?: string;
|
558 | hasFilesystemConfig: () => boolean;
|
559 | }
|
560 |
|
561 | export interface ConfigItem {
|
562 | |
563 |
|
564 |
|
565 | name?: string;
|
566 |
|
567 | |
568 |
|
569 |
|
570 | value: object | ((...args: any[]) => any);
|
571 |
|
572 | /**
|
573 | * The options object passed to the plugin.
|
574 | */
|
575 | options?: object | false;
|
576 |
|
577 | /**
|
578 | * The path that the options are relative to.
|
579 | */
|
580 | dirname: string;
|
581 |
|
582 | /**
|
583 | * Information about the plugin's file, if Babel knows it.
|
584 | * *
|
585 | */
|
586 | file?: {
|
587 | /**
|
588 | * The file that the user requested, e.g. `"@babel/env"`
|
589 | */
|
590 | request: string;
|
591 |
|
592 | /**
|
593 | * The full path of the resolved file, e.g. `"/tmp/node_modules/@babel/preset-env/lib/index.js"`
|
594 | */
|
595 | resolved: string;
|
596 | } | null;
|
597 | }
|
598 |
|
599 | export type PluginOptions = object | undefined | false;
|
600 |
|
601 | export type PluginTarget = string | object | ((...args: any[]) => any);
|
602 |
|
603 | export type PluginItem =
|
604 | | ConfigItem
|
605 | | PluginObj<any>
|
606 | | PluginTarget
|
607 | | [PluginTarget, PluginOptions]
|
608 | | [PluginTarget, PluginOptions, string | undefined];
|
609 |
|
610 | export function resolvePlugin(name: string, dirname: string): string | null;
|
611 | export function resolvePreset(name: string, dirname: string): string | null;
|
612 |
|
613 | export interface CreateConfigItemOptions {
|
614 | dirname?: string;
|
615 | type?: 'preset' | 'plugin';
|
616 | }
|
617 |
|
618 | /**
|
619 | * Allows build tooling to create and cache config items up front. If this function is called multiple times for a
|
620 | * given plugin, Babel will call the plugin's function itself multiple times. If you have a clear set of expected
|
621 | * plugins and presets to inject, pre-constructing the config items would be recommended.
|
622 | */
|
623 | export function createConfigItem(
|
624 | value: PluginTarget | [PluginTarget, PluginOptions] | [PluginTarget, PluginOptions, string | undefined],
|
625 | options?: CreateConfigItemOptions,
|
626 | ): ConfigItem;
|
627 |
|
628 | // NOTE: the documentation says the ConfigAPI also exposes @babel/core's exports, but it actually doesn't
|
629 | /**
|
630 | * @see https://babeljs.io/docs/en/next/config-files#config-function-api
|
631 | */
|
632 | export interface ConfigAPI {
|
633 | /**
|
634 | * The version string for the Babel version that is loading the config file.
|
635 | *
|
636 | * @see https://babeljs.io/docs/en/next/config-files#apiversion
|
637 | */
|
638 | version: string;
|
639 | /**
|
640 | * @see https://babeljs.io/docs/en/next/config-files#apicache
|
641 | */
|
642 | cache: SimpleCacheConfigurator;
|
643 | /**
|
644 | * @see https://babeljs.io/docs/en/next/config-files#apienv
|
645 | */
|
646 | env: EnvFunction;
|
647 | // undocumented; currently hardcoded to return 'false'
|
648 | // async(): boolean
|
649 | /**
|
650 | * This API is used as a way to access the `caller` data that has been passed to Babel.
|
651 | * Since many instances of Babel may be running in the same process with different `caller` values,
|
652 | * this API is designed to automatically configure `api.cache`, the same way `api.env()` does.
|
653 | *
|
654 | * The `caller` value is available as the first parameter of the callback function.
|
655 | * It is best used with something like this to toggle configuration behavior
|
656 | * based on a specific environment:
|
657 | *
|
658 | * @example
|
659 | * function isBabelRegister(caller?: { name: string }) {
|
660 | * return !!(caller && caller.name === "@babel/register")
|
661 | * }
|
662 | * api.caller(isBabelRegister)
|
663 | *
|
664 | * @see https://babeljs.io/docs/en/next/config-files#apicallercb
|
665 | */
|
666 | caller<T extends SimpleCacheKey>(callerCallback: (caller: TransformOptions['caller']) => T): T;
|
667 | /**
|
668 | * While `api.version` can be useful in general, it's sometimes nice to just declare your version.
|
669 | * This API exposes a simple way to do that with:
|
670 | *
|
671 | * @example
|
672 | * api.assertVersion(7) // major version only
|
673 | * api.assertVersion("^7.2")
|
674 | *
|
675 | * @see https://babeljs.io/docs/en/next/config-files#apiassertversionrange
|
676 | */
|
677 | assertVersion(versionRange: number | string): boolean;
|
678 | // NOTE: this is an undocumented reexport from "@babel/parser" but it's missing from its types
|
679 | // tokTypes: typeof tokTypes
|
680 | }
|
681 |
|
682 | /**
|
683 | * JS configs are great because they can compute a config on the fly,
|
684 | * but the downside there is that it makes caching harder.
|
685 | * Babel wants to avoid re-executing the config function every time a file is compiled,
|
686 | * because then it would also need to re-execute any plugin and preset functions
|
687 | * referenced in that config.
|
688 | *
|
689 | * To avoid this, Babel expects users of config functions to tell it how to manage caching
|
690 | * within a config file.
|
691 | *
|
692 | * @see https://babeljs.io/docs/en/next/config-files#apicache
|
693 | */
|
694 | export interface SimpleCacheConfigurator {
|
695 | // there is an undocumented call signature that is a shorthand for forever()/never()/using().
|
696 | // (ever: boolean): void
|
697 | // <T extends SimpleCacheKey>(callback: CacheCallback<T>): T
|
698 | /**
|
699 | * Permacache the computed config and never call the function again.
|
700 | */
|
701 | forever(): void;
|
702 | /**
|
703 | * Do not cache this config, and re-execute the function every time.
|
704 | */
|
705 | never(): void;
|
706 | /**
|
707 | * Any time the using callback returns a value other than the one that was expected,
|
708 | * the overall config function will be called again and a new entry will be added to the cache.
|
709 | *
|
710 | * @example
|
711 | * api.cache.using(() => process.env.NODE_ENV)
|
712 | */
|
713 | using<T extends SimpleCacheKey>(callback: SimpleCacheCallback<T>): T;
|
714 | /**
|
715 | * Any time the using callback returns a value other than the one that was expected,
|
716 | * the overall config function will be called again and all entries in the cache will
|
717 | * be replaced with the result.
|
718 | *
|
719 | * @example
|
720 | * api.cache.invalidate(() => process.env.NODE_ENV)
|
721 | */
|
722 | invalidate<T extends SimpleCacheKey>(callback: SimpleCacheCallback<T>): T;
|
723 | }
|
724 |
|
725 | // https://github.com/babel/babel/blob/v7.3.3/packages/babel-core/src/config/caching.js#L231
|
726 | export type SimpleCacheKey = string | boolean | number | null | undefined;
|
727 | export type SimpleCacheCallback<T extends SimpleCacheKey> = () => T;
|
728 |
|
729 |
|
730 |
|
731 |
|
732 |
|
733 |
|
734 |
|
735 |
|
736 | export interface EnvFunction {
|
737 | |
738 |
|
739 |
|
740 | (): string;
|
741 | |
742 |
|
743 |
|
744 | (envName: string | ReadonlyArray<string>): boolean;
|
745 |
|
746 |
|
747 |
|
748 | <T extends SimpleCacheKey>(envCallback: (envName: NonNullable<TransformOptions['envName']>) => T): T;
|
749 | }
|
750 |
|
751 | export type ConfigFunction = (api: ConfigAPI) => TransformOptions;
|
752 |
|
753 | export as namespace babel;
|