@storybook/react-webpack5 8.0.0-alpha.8 → 8.0.0-alpha.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/dist/preset.d.ts +6 -1907
  2. package/package.json +4 -8
package/dist/preset.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { FileSystemCache } from 'file-system-cache';
2
- import { TransformOptions } from '@babel/core';
3
2
  import { Server } from 'http';
4
3
  import { StorybookConfig } from './index.js';
5
4
  import '@storybook/preset-react-webpack';
@@ -726,1886 +725,6 @@ type ComponentTitle = string;
726
725
  type StoryName = string;
727
726
  type Tag = string;
728
727
 
729
- interface Plugin {
730
- (module: Program): Program;
731
- }
732
- type TerserEcmaVersion = 5 | 2015 | 2016 | string | number;
733
- interface JsMinifyOptions {
734
- compress?: TerserCompressOptions | boolean;
735
- format?: JsFormatOptions & ToSnakeCaseProperties<JsFormatOptions>;
736
- mangle?: TerserMangleOptions | boolean;
737
- ecma?: TerserEcmaVersion;
738
- keep_classnames?: boolean;
739
- keep_fnames?: boolean;
740
- module?: boolean;
741
- safari10?: boolean;
742
- toplevel?: boolean;
743
- sourceMap?: boolean;
744
- outputPath?: string;
745
- inlineSourcesContent?: boolean;
746
- }
747
- /**
748
- * @example ToSnakeCase<'indentLevel'> == 'indent_level'
749
- */
750
- type ToSnakeCase<T extends string> = T extends `${infer A}${infer B}` ? `${A extends Lowercase<A> ? A : `_${Lowercase<A>}`}${ToSnakeCase<B>}` : T;
751
- /**
752
- * @example ToSnakeCaseProperties<{indentLevel: 3}> == {indent_level: 3}
753
- */
754
- type ToSnakeCaseProperties<T> = {
755
- [K in keyof T as K extends string ? ToSnakeCase<K> : K]: T[K];
756
- };
757
- /**
758
- * These properties are mostly not implemented yet,
759
- * but it exists to support passing terser config to swc minify
760
- * without modification.
761
- */
762
- interface JsFormatOptions {
763
- /**
764
- * Currently noop.
765
- * @default false
766
- * @alias ascii_only
767
- */
768
- asciiOnly?: boolean;
769
- /**
770
- * Currently noop.
771
- * @default false
772
- */
773
- beautify?: boolean;
774
- /**
775
- * Currently noop.
776
- * @default false
777
- */
778
- braces?: boolean;
779
- /**
780
- * - `false`: removes all comments
781
- * - `'some'`: preserves some comments
782
- * - `'all'`: preserves all comments
783
- * @default false
784
- */
785
- comments?: false | "some" | "all";
786
- /**
787
- * Currently noop.
788
- * @default 5
789
- */
790
- ecma?: TerserEcmaVersion;
791
- /**
792
- * Currently noop.
793
- * @alias indent_level
794
- */
795
- indentLevel?: number;
796
- /**
797
- * Currently noop.
798
- * @alias indent_start
799
- */
800
- indentStart?: number;
801
- /**
802
- * Currently noop.
803
- * @alias inline_script
804
- */
805
- inlineScript?: number;
806
- /**
807
- * Currently noop.
808
- * @alias keep_numbers
809
- */
810
- keepNumbers?: number;
811
- /**
812
- * Currently noop.
813
- * @alias keep_quoted_props
814
- */
815
- keepQuotedProps?: boolean;
816
- /**
817
- * Currently noop.
818
- * @alias max_line_len
819
- */
820
- maxLineLen?: number | false;
821
- /**
822
- * Currently noop.
823
- */
824
- preamble?: string;
825
- /**
826
- * Currently noop.
827
- * @alias quote_keys
828
- */
829
- quoteKeys?: boolean;
830
- /**
831
- * Currently noop.
832
- * @alias quote_style
833
- */
834
- quoteStyle?: boolean;
835
- /**
836
- * Currently noop.
837
- * @alias preserve_annotations
838
- */
839
- preserveAnnotations?: boolean;
840
- /**
841
- * Currently noop.
842
- */
843
- safari10?: boolean;
844
- /**
845
- * Currently noop.
846
- */
847
- semicolons?: boolean;
848
- /**
849
- * Currently noop.
850
- */
851
- shebang?: boolean;
852
- /**
853
- * Currently noop.
854
- */
855
- webkit?: boolean;
856
- /**
857
- * Currently noop.
858
- * @alias wrap_iife
859
- */
860
- wrapIife?: boolean;
861
- /**
862
- * Currently noop.
863
- * @alias wrap_func_args
864
- */
865
- wrapFuncArgs?: boolean;
866
- }
867
- interface TerserCompressOptions {
868
- arguments?: boolean;
869
- arrows?: boolean;
870
- booleans?: boolean;
871
- booleans_as_integers?: boolean;
872
- collapse_vars?: boolean;
873
- comparisons?: boolean;
874
- computed_props?: boolean;
875
- conditionals?: boolean;
876
- dead_code?: boolean;
877
- defaults?: boolean;
878
- directives?: boolean;
879
- drop_console?: boolean;
880
- drop_debugger?: boolean;
881
- ecma?: TerserEcmaVersion;
882
- evaluate?: boolean;
883
- expression?: boolean;
884
- global_defs?: any;
885
- hoist_funs?: boolean;
886
- hoist_props?: boolean;
887
- hoist_vars?: boolean;
888
- ie8?: boolean;
889
- if_return?: boolean;
890
- inline?: 0 | 1 | 2 | 3;
891
- join_vars?: boolean;
892
- keep_classnames?: boolean;
893
- keep_fargs?: boolean;
894
- keep_fnames?: boolean;
895
- keep_infinity?: boolean;
896
- loops?: boolean;
897
- negate_iife?: boolean;
898
- passes?: number;
899
- properties?: boolean;
900
- pure_getters?: any;
901
- pure_funcs?: string[];
902
- reduce_funcs?: boolean;
903
- reduce_vars?: boolean;
904
- sequences?: any;
905
- side_effects?: boolean;
906
- switches?: boolean;
907
- top_retain?: any;
908
- toplevel?: any;
909
- typeofs?: boolean;
910
- unsafe?: boolean;
911
- unsafe_passes?: boolean;
912
- unsafe_arrows?: boolean;
913
- unsafe_comps?: boolean;
914
- unsafe_function?: boolean;
915
- unsafe_math?: boolean;
916
- unsafe_symbols?: boolean;
917
- unsafe_methods?: boolean;
918
- unsafe_proto?: boolean;
919
- unsafe_regexp?: boolean;
920
- unsafe_undefined?: boolean;
921
- unused?: boolean;
922
- const_to_let?: boolean;
923
- module?: boolean;
924
- }
925
- interface TerserMangleOptions {
926
- props?: TerserManglePropertiesOptions;
927
- toplevel?: boolean;
928
- keep_classnames?: boolean;
929
- keep_fnames?: boolean;
930
- keep_private_props?: boolean;
931
- ie8?: boolean;
932
- safari10?: boolean;
933
- reserved?: string[];
934
- }
935
- interface TerserManglePropertiesOptions {
936
- }
937
- /**
938
- * Programmatic options.
939
- */
940
- interface Options$2 extends Config {
941
- /**
942
- * If true, a file is parsed as a script instead of module.
943
- */
944
- script?: boolean;
945
- /**
946
- * The working directory that all paths in the programmatic
947
- * options will be resolved relative to.
948
- *
949
- * Defaults to `process.cwd()`.
950
- */
951
- cwd?: string;
952
- caller?: CallerOptions;
953
- /** The filename associated with the code currently being compiled,
954
- * if there is one. The filename is optional, but not all of Swc's
955
- * functionality is available when the filename is unknown, because a
956
- * subset of options rely on the filename for their functionality.
957
- *
958
- * The three primary cases users could run into are:
959
- *
960
- * - The filename is exposed to plugins. Some plugins may require the
961
- * presence of the filename.
962
- * - Options like "test", "exclude", and "ignore" require the filename
963
- * for string/RegExp matching.
964
- * - .swcrc files are loaded relative to the file being compiled.
965
- * If this option is omitted, Swc will behave as if swcrc: false has been set.
966
- */
967
- filename?: string;
968
- /**
969
- * The initial path that will be processed based on the "rootMode" to
970
- * determine the conceptual root folder for the current Swc project.
971
- * This is used in two primary cases:
972
- *
973
- * - The base directory when checking for the default "configFile" value
974
- * - The default value for "swcrcRoots".
975
- *
976
- * Defaults to `opts.cwd`
977
- */
978
- root?: string;
979
- /**
980
- * This option, combined with the "root" value, defines how Swc chooses
981
- * its project root. The different modes define different ways that Swc
982
- * can process the "root" value to get the final project root.
983
- *
984
- * "root" - Passes the "root" value through as unchanged.
985
- * "upward" - Walks upward from the "root" directory, looking for a directory
986
- * containing a swc.config.js file, and throws an error if a swc.config.js
987
- * is not found.
988
- * "upward-optional" - Walk upward from the "root" directory, looking for
989
- * a directory containing a swc.config.js file, and falls back to "root"
990
- * if a swc.config.js is not found.
991
- *
992
- *
993
- * "root" is the default mode because it avoids the risk that Swc
994
- * will accidentally load a swc.config.js that is entirely outside
995
- * of the current project folder. If you use "upward-optional",
996
- * be aware that it will walk up the directory structure all the
997
- * way to the filesystem root, and it is always possible that someone
998
- * will have a forgotten swc.config.js in their home directory,
999
- * which could cause unexpected errors in your builds.
1000
- *
1001
- *
1002
- * Users with monorepo project structures that run builds/tests on a
1003
- * per-package basis may well want to use "upward" since monorepos
1004
- * often have a swc.config.js in the project root. Running Swc
1005
- * in a monorepo subdirectory without "upward", will cause Swc
1006
- * to skip loading any swc.config.js files in the project root,
1007
- * which can lead to unexpected errors and compilation failure.
1008
- */
1009
- rootMode?: "root" | "upward" | "upward-optional";
1010
- /**
1011
- * The current active environment used during configuration loading.
1012
- * This value is used as the key when resolving "env" configs,
1013
- * and is also available inside configuration functions, plugins,
1014
- * and presets, via the api.env() function.
1015
- *
1016
- * Defaults to `process.env.SWC_ENV || process.env.NODE_ENV || "development"`
1017
- */
1018
- envName?: string;
1019
- /**
1020
- * Defaults to searching for a default `.swcrc` file, but can
1021
- * be passed the path of any JS or JSON5 config file.
1022
- *
1023
- *
1024
- * NOTE: This option does not affect loading of .swcrc files,
1025
- * so while it may be tempting to do configFile: "./foo/.swcrc",
1026
- * it is not recommended. If the given .swcrc is loaded via the
1027
- * standard file-relative logic, you'll end up loading the same
1028
- * config file twice, merging it with itself. If you are linking
1029
- * a specific config file, it is recommended to stick with a
1030
- * naming scheme that is independent of the "swcrc" name.
1031
- *
1032
- * Defaults to `path.resolve(opts.root, ".swcrc")`
1033
- */
1034
- configFile?: string | boolean;
1035
- /**
1036
- * true will enable searching for configuration files relative to the "filename" provided to Swc.
1037
- *
1038
- * A swcrc value passed in the programmatic options will override one set within a configuration file.
1039
- *
1040
- * Note: .swcrc files are only loaded if the current "filename" is inside of
1041
- * a package that matches one of the "swcrcRoots" packages.
1042
- *
1043
- *
1044
- * Defaults to true as long as the filename option has been specified
1045
- */
1046
- swcrc?: boolean;
1047
- /**
1048
- * By default, Babel will only search for .babelrc files within the "root" package
1049
- * because otherwise Babel cannot know if a given .babelrc is meant to be loaded,
1050
- * or if it's "plugins" and "presets" have even been installed, since the file
1051
- * being compiled could be inside node_modules, or have been symlinked into the project.
1052
- *
1053
- *
1054
- * This option allows users to provide a list of other packages that should be
1055
- * considered "root" packages when considering whether to load .babelrc files.
1056
- *
1057
- *
1058
- * For example, a monorepo setup that wishes to allow individual packages
1059
- * to have their own configs might want to do
1060
- *
1061
- *
1062
- *
1063
- * Defaults to `opts.root`
1064
- */
1065
- swcrcRoots?: boolean | MatchPattern | MatchPattern[];
1066
- /**
1067
- * `true` will attempt to load an input sourcemap from the file itself, if it
1068
- * contains a //# sourceMappingURL=... comment. If no map is found, or the
1069
- * map fails to load and parse, it will be silently discarded.
1070
- *
1071
- * If an object is provided, it will be treated as the source map object itself.
1072
- *
1073
- * Defaults to `true`.
1074
- */
1075
- inputSourceMap?: boolean | string;
1076
- /**
1077
- * The name to use for the file inside the source map object.
1078
- *
1079
- * Defaults to `path.basename(opts.filenameRelative)` when available, or `"unknown"`.
1080
- */
1081
- sourceFileName?: string;
1082
- /**
1083
- * The sourceRoot fields to set in the generated source map, if one is desired.
1084
- */
1085
- sourceRoot?: string;
1086
- plugin?: Plugin;
1087
- isModule?: boolean | "unknown";
1088
- /**
1089
- * Destination path. Note that this value is used only to fix source path
1090
- * of source map files and swc does not write output to this path.
1091
- */
1092
- outputPath?: string;
1093
- }
1094
- interface CallerOptions {
1095
- name: string;
1096
- [key: string]: any;
1097
- }
1098
- /**
1099
- * .swcrc
1100
- */
1101
- interface Config {
1102
- /**
1103
- * Note: The type is string because it follows rust's regex syntax.
1104
- */
1105
- test?: string | string[];
1106
- /**
1107
- * Note: The type is string because it follows rust's regex syntax.
1108
- */
1109
- exclude?: string | string[];
1110
- env?: EnvConfig;
1111
- jsc?: JscConfig;
1112
- module?: ModuleConfig;
1113
- minify?: boolean;
1114
- /**
1115
- * - true to generate a sourcemap for the code and include it in the result object.
1116
- * - "inline" to generate a sourcemap and append it as a data URL to the end of the code, but not include it in the result object.
1117
- *
1118
- * `swc-cli` overloads some of these to also affect how maps are written to disk:
1119
- *
1120
- * - true will write the map to a .map file on disk
1121
- * - "inline" will write the file directly, so it will have a data: containing the map
1122
- * - Note: These options are bit weird, so it may make the most sense to just use true
1123
- * and handle the rest in your own code, depending on your use case.
1124
- */
1125
- sourceMaps?: boolean | "inline";
1126
- inlineSourcesContent?: boolean;
1127
- }
1128
- /**
1129
- * Configuration ported from babel-preset-env
1130
- */
1131
- interface EnvConfig {
1132
- mode?: "usage" | "entry";
1133
- debug?: boolean;
1134
- dynamicImport?: boolean;
1135
- loose?: boolean;
1136
- skip?: string[];
1137
- include?: string[];
1138
- exclude?: string[];
1139
- /**
1140
- * The version of the used core js.
1141
- *
1142
- */
1143
- coreJs?: string;
1144
- targets?: any;
1145
- path?: string;
1146
- shippedProposals?: boolean;
1147
- /**
1148
- * Enable all transforms
1149
- */
1150
- forceAllTransforms?: boolean;
1151
- }
1152
- interface JscConfig {
1153
- loose?: boolean;
1154
- /**
1155
- * Defaults to EsParserConfig
1156
- */
1157
- parser?: ParserConfig;
1158
- transform?: TransformConfig;
1159
- /**
1160
- * Use `@swc/helpers` instead of inline helpers.
1161
- */
1162
- externalHelpers?: boolean;
1163
- /**
1164
- * Defaults to `es3` (which enabled **all** pass).
1165
- */
1166
- target?: JscTarget;
1167
- /**
1168
- * Keep class names.
1169
- */
1170
- keepClassNames?: boolean;
1171
- /**
1172
- * This is experimental, and can be removed without a major version bump.
1173
- */
1174
- experimental?: {
1175
- optimizeHygiene?: boolean;
1176
- /**
1177
- * Preserve `with` in imports and exports.
1178
- */
1179
- keepImportAttributes?: boolean;
1180
- /**
1181
- * Use `assert` instead of `with` for imports and exports.
1182
- * This option only works when `keepImportAttributes` is `true`.
1183
- */
1184
- emitAssertForImportAttributes?: boolean;
1185
- /**
1186
- * Specify the location where SWC stores its intermediate cache files.
1187
- * Currently only transform plugin uses this. If not specified, SWC will
1188
- * create `.swc` directories.
1189
- */
1190
- cacheRoot?: string;
1191
- /**
1192
- * List of custom transform plugins written in WebAssembly.
1193
- * First parameter of tuple indicates the name of the plugin - it can be either
1194
- * a name of the npm package can be resolved, or absolute path to .wasm binary.
1195
- *
1196
- * Second parameter of tuple is JSON based configuration for the plugin.
1197
- */
1198
- plugins?: Array<[string, Record<string, any>]>;
1199
- /**
1200
- * Disable builtin transforms. If enabled, only Wasm plugins are used.
1201
- */
1202
- disableBuiltinTransformsForInternalTesting?: boolean;
1203
- };
1204
- baseUrl?: string;
1205
- paths?: {
1206
- [from: string]: string[];
1207
- };
1208
- minify?: JsMinifyOptions;
1209
- preserveAllComments?: boolean;
1210
- }
1211
- type JscTarget = "es3" | "es5" | "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022" | "esnext";
1212
- type ParserConfig = TsParserConfig | EsParserConfig;
1213
- interface TsParserConfig {
1214
- syntax: "typescript";
1215
- /**
1216
- * Defaults to `false`.
1217
- */
1218
- tsx?: boolean;
1219
- /**
1220
- * Defaults to `false`.
1221
- */
1222
- decorators?: boolean;
1223
- /**
1224
- * Defaults to `false`
1225
- */
1226
- dynamicImport?: boolean;
1227
- }
1228
- interface EsParserConfig {
1229
- syntax: "ecmascript";
1230
- /**
1231
- * Defaults to false.
1232
- */
1233
- jsx?: boolean;
1234
- /**
1235
- * @deprecated Always true because it's in ecmascript spec.
1236
- */
1237
- numericSeparator?: boolean;
1238
- /**
1239
- * @deprecated Always true because it's in ecmascript spec.
1240
- */
1241
- classPrivateProperty?: boolean;
1242
- /**
1243
- * @deprecated Always true because it's in ecmascript spec.
1244
- */
1245
- privateMethod?: boolean;
1246
- /**
1247
- * @deprecated Always true because it's in ecmascript spec.
1248
- */
1249
- classProperty?: boolean;
1250
- /**
1251
- * Defaults to `false`
1252
- */
1253
- functionBind?: boolean;
1254
- /**
1255
- * Defaults to `false`
1256
- */
1257
- decorators?: boolean;
1258
- /**
1259
- * Defaults to `false`
1260
- */
1261
- decoratorsBeforeExport?: boolean;
1262
- /**
1263
- * Defaults to `false`
1264
- */
1265
- exportDefaultFrom?: boolean;
1266
- /**
1267
- * @deprecated Always true because it's in ecmascript spec.
1268
- */
1269
- exportNamespaceFrom?: boolean;
1270
- /**
1271
- * @deprecated Always true because it's in ecmascript spec.
1272
- */
1273
- dynamicImport?: boolean;
1274
- /**
1275
- * @deprecated Always true because it's in ecmascript spec.
1276
- */
1277
- nullishCoalescing?: boolean;
1278
- /**
1279
- * @deprecated Always true because it's in ecmascript spec.
1280
- */
1281
- optionalChaining?: boolean;
1282
- /**
1283
- * @deprecated Always true because it's in ecmascript spec.
1284
- */
1285
- importMeta?: boolean;
1286
- /**
1287
- * @deprecated Always true because it's in ecmascript spec.
1288
- */
1289
- topLevelAwait?: boolean;
1290
- /**
1291
- * Defaults to `false`
1292
- */
1293
- importAssertions?: boolean;
1294
- }
1295
- /**
1296
- * Options for transform.
1297
- */
1298
- interface TransformConfig {
1299
- /**
1300
- * Effective only if `syntax` supports ƒ.
1301
- */
1302
- react?: ReactConfig;
1303
- constModules?: ConstModulesConfig;
1304
- /**
1305
- * Defaults to null, which skips optimizer pass.
1306
- */
1307
- optimizer?: OptimizerConfig;
1308
- /**
1309
- * https://swc.rs/docs/configuring-swc.html#jsctransformlegacydecorator
1310
- */
1311
- legacyDecorator?: boolean;
1312
- /**
1313
- * https://swc.rs/docs/configuring-swc.html#jsctransformdecoratormetadata
1314
- */
1315
- decoratorMetadata?: boolean;
1316
- treatConstEnumAsEnum?: boolean;
1317
- useDefineForClassFields?: boolean;
1318
- }
1319
- interface ReactConfig {
1320
- /**
1321
- * Replace the function used when compiling JSX expressions.
1322
- *
1323
- * Defaults to `React.createElement`.
1324
- */
1325
- pragma?: string;
1326
- /**
1327
- * Replace the component used when compiling JSX fragments.
1328
- *
1329
- * Defaults to `React.Fragment`
1330
- */
1331
- pragmaFrag?: string;
1332
- /**
1333
- * Toggles whether or not to throw an error if a XML namespaced tag name is used. For example:
1334
- * `<f:image />`
1335
- *
1336
- * Though the JSX spec allows this, it is disabled by default since React's
1337
- * JSX does not currently have support for it.
1338
- *
1339
- */
1340
- throwIfNamespace?: boolean;
1341
- /**
1342
- * Toggles plugins that aid in development, such as @swc/plugin-transform-react-jsx-self
1343
- * and @swc/plugin-transform-react-jsx-source.
1344
- *
1345
- * Defaults to `false`,
1346
- *
1347
- */
1348
- development?: boolean;
1349
- /**
1350
- * Use `Object.assign()` instead of `_extends`. Defaults to false.
1351
- * @deprecated
1352
- */
1353
- useBuiltins?: boolean;
1354
- /**
1355
- * Enable fast refresh feature for React app
1356
- */
1357
- refresh?: boolean;
1358
- /**
1359
- * jsx runtime
1360
- */
1361
- runtime?: "automatic" | "classic";
1362
- /**
1363
- * Declares the module specifier to be used for importing the `jsx` and `jsxs` factory functions when using `runtime` 'automatic'
1364
- */
1365
- importSource?: string;
1366
- }
1367
- /**
1368
- * - `import { DEBUG } from '@ember/env-flags';`
1369
- * - `import { FEATURE_A, FEATURE_B } from '@ember/features';`
1370
- *
1371
- * See: https://github.com/swc-project/swc/issues/18#issuecomment-466272558
1372
- */
1373
- interface ConstModulesConfig {
1374
- globals?: {
1375
- [module: string]: {
1376
- [name: string]: string;
1377
- };
1378
- };
1379
- }
1380
- interface OptimizerConfig {
1381
- simplify?: boolean;
1382
- globals?: GlobalPassOption;
1383
- jsonify?: {
1384
- minCost: number;
1385
- };
1386
- }
1387
- /**
1388
- * Options for inline-global pass.
1389
- */
1390
- interface GlobalPassOption {
1391
- /**
1392
- * Global variables that should be inlined with passed value.
1393
- *
1394
- * e.g. `{ __DEBUG__: true }`
1395
- */
1396
- vars?: Record<string, string>;
1397
- /**
1398
- * Names of environment variables that should be inlined with the value of corresponding env during build.
1399
- *
1400
- * Defaults to `["NODE_ENV", "SWC_ENV"]`
1401
- */
1402
- envs?: string[];
1403
- /**
1404
- * Replaces typeof calls for passed variables with corresponding value
1405
- *
1406
- * e.g. `{ window: 'object' }`
1407
- */
1408
- typeofs?: Record<string, string>;
1409
- }
1410
- type ModuleConfig = Es6Config | CommonJsConfig | UmdConfig | AmdConfig | NodeNextConfig | SystemjsConfig;
1411
- interface BaseModuleConfig {
1412
- /**
1413
- * By default, when using exports with babel a non-enumerable `__esModule`
1414
- * property is exported. In some cases this property is used to determine
1415
- * if the import is the default export or if it contains the default export.
1416
- *
1417
- * In order to prevent the __esModule property from being exported, you
1418
- * can set the strict option to true.
1419
- *
1420
- * Defaults to `false`.
1421
- */
1422
- strict?: boolean;
1423
- /**
1424
- * Emits 'use strict' directive.
1425
- *
1426
- * Defaults to `true`.
1427
- */
1428
- strictMode?: boolean;
1429
- /**
1430
- * Changes Babel's compiled import statements to be lazily evaluated when their imported bindings are used for the first time.
1431
- *
1432
- * This can improve initial load time of your module because evaluating dependencies up
1433
- * front is sometimes entirely un-necessary. This is especially the case when implementing
1434
- * a library module.
1435
- *
1436
- *
1437
- * The value of `lazy` has a few possible effects:
1438
- *
1439
- * - `false` - No lazy initialization of any imported module.
1440
- * - `true` - Do not lazy-initialize local `./foo` imports, but lazy-init `foo` dependencies.
1441
- *
1442
- * Local paths are much more likely to have circular dependencies, which may break if loaded lazily,
1443
- * so they are not lazy by default, whereas dependencies between independent modules are rarely cyclical.
1444
- *
1445
- * - `Array<string>` - Lazy-initialize all imports with source matching one of the given strings.
1446
- *
1447
- * -----
1448
- *
1449
- * The two cases where imports can never be lazy are:
1450
- *
1451
- * - `import "foo";`
1452
- *
1453
- * Side-effect imports are automatically non-lazy since their very existence means
1454
- * that there is no binding to later kick off initialization.
1455
- *
1456
- * - `export * from "foo"`
1457
- *
1458
- * Re-exporting all names requires up-front execution because otherwise there is no
1459
- * way to know what names need to be exported.
1460
- *
1461
- * Defaults to `false`.
1462
- */
1463
- lazy?: boolean | string[];
1464
- /**
1465
- * @deprecated Use the `importInterop` option instead.
1466
- *
1467
- * By default, when using exports with swc a non-enumerable __esModule property is exported.
1468
- * This property is then used to determine if the import is the default export or if
1469
- * it contains the default export.
1470
- *
1471
- * In cases where the auto-unwrapping of default is not needed, you can set the noInterop option
1472
- * to true to avoid the usage of the interopRequireDefault helper (shown in inline form above).
1473
- *
1474
- * Defaults to `false`.
1475
- */
1476
- noInterop?: boolean;
1477
- /**
1478
- * Defaults to `swc`.
1479
- *
1480
- * CommonJS modules and ECMAScript modules are not fully compatible.
1481
- * However, compilers, bundlers and JavaScript runtimes developed different strategies
1482
- * to make them work together as well as possible.
1483
- *
1484
- * - `swc` (alias: `babel`)
1485
- *
1486
- * When using exports with `swc` a non-enumerable `__esModule` property is exported
1487
- * This property is then used to determine if the import is the default export
1488
- * or if it contains the default export.
1489
- *
1490
- * ```javascript
1491
- * import foo from "foo";
1492
- * import { bar } from "bar";
1493
- * foo;
1494
- * bar;
1495
- *
1496
- * // Is compiled to ...
1497
- *
1498
- * "use strict";
1499
- *
1500
- * function _interop_require_default(obj) {
1501
- * return obj && obj.__esModule ? obj : { default: obj };
1502
- * }
1503
- *
1504
- * var _foo = _interop_require_default(require("foo"));
1505
- * var _bar = require("bar");
1506
- *
1507
- * _foo.default;
1508
- * _bar.bar;
1509
- * ```
1510
- *
1511
- * When this import interop is used, if both the imported and the importer module are compiled
1512
- * with swc they behave as if none of them was compiled.
1513
- *
1514
- * This is the default behavior.
1515
- *
1516
- * - `node`
1517
- *
1518
- * When importing CommonJS files (either directly written in CommonJS, or generated with a compiler)
1519
- * Node.js always binds the `default` export to the value of `module.exports`.
1520
- *
1521
- * ```javascript
1522
- * import foo from "foo";
1523
- * import { bar } from "bar";
1524
- * foo;
1525
- * bar;
1526
- *
1527
- * // Is compiled to ...
1528
- *
1529
- * "use strict";
1530
- *
1531
- * var _foo = require("foo");
1532
- * var _bar = require("bar");
1533
- *
1534
- * _foo;
1535
- * _bar.bar;
1536
- * ```
1537
- * This is not exactly the same as what Node.js does since swc allows accessing any property of `module.exports`
1538
- * as a named export, while Node.js only allows importing statically analyzable properties of `module.exports`.
1539
- * However, any import working in Node.js will also work when compiled with swc using `importInterop: "node"`.
1540
- *
1541
- * - `none`
1542
- *
1543
- * If you know that the imported file has been transformed with a compiler that stores the `default` export on
1544
- * `exports.default` (such as swc or Babel), you can safely omit the `_interop_require_default` helper.
1545
- *
1546
- * ```javascript
1547
- * import foo from "foo";
1548
- * import { bar } from "bar";
1549
- * foo;
1550
- * bar;
1551
- *
1552
- * // Is compiled to ...
1553
- *
1554
- * "use strict";
1555
- *
1556
- * var _foo = require("foo");
1557
- * var _bar = require("bar");
1558
- *
1559
- * _foo.default;
1560
- * _bar.bar;
1561
- * ```
1562
- */
1563
- importInterop?: "swc" | "babel" | "node" | "none";
1564
- /**
1565
- * Emits `cjs-module-lexer` annotation
1566
- * `cjs-module-lexer` is used in Node.js core for detecting the named exports available when importing a CJS module into ESM.
1567
- * swc will emit `cjs-module-lexer` detectable annotation with this option enabled.
1568
- *
1569
- * Defaults to `true` if import_interop is Node, else `false`
1570
- */
1571
- exportInteropAnnotation?: boolean;
1572
- /**
1573
- * If set to true, dynamic imports will be preserved.
1574
- */
1575
- ignoreDynamic?: boolean;
1576
- allowTopLevelThis?: boolean;
1577
- preserveImportMeta?: boolean;
1578
- }
1579
- interface Es6Config extends BaseModuleConfig {
1580
- type: "es6";
1581
- }
1582
- interface NodeNextConfig extends BaseModuleConfig {
1583
- type: "nodenext";
1584
- }
1585
- interface CommonJsConfig extends BaseModuleConfig {
1586
- type: "commonjs";
1587
- }
1588
- interface UmdConfig extends BaseModuleConfig {
1589
- type: "umd";
1590
- globals?: {
1591
- [key: string]: string;
1592
- };
1593
- }
1594
- interface AmdConfig extends BaseModuleConfig {
1595
- type: "amd";
1596
- moduleId?: string;
1597
- }
1598
- interface SystemjsConfig {
1599
- type: "systemjs";
1600
- allowTopLevelThis?: boolean;
1601
- }
1602
- interface MatchPattern {
1603
- }
1604
- interface Span {
1605
- start: number;
1606
- end: number;
1607
- ctxt: number;
1608
- }
1609
- interface Node {
1610
- type: string;
1611
- }
1612
- interface HasSpan {
1613
- span: Span;
1614
- }
1615
- interface HasDecorator {
1616
- decorators?: Decorator[];
1617
- }
1618
- interface Class extends HasSpan, HasDecorator {
1619
- body: ClassMember[];
1620
- superClass?: Expression;
1621
- isAbstract: boolean;
1622
- typeParams?: TsTypeParameterDeclaration;
1623
- superTypeParams?: TsTypeParameterInstantiation;
1624
- implements: TsExpressionWithTypeArguments[];
1625
- }
1626
- type ClassMember = Constructor | ClassMethod | PrivateMethod | ClassProperty | PrivateProperty | TsIndexSignature | EmptyStatement | StaticBlock;
1627
- interface ClassPropertyBase extends Node, HasSpan, HasDecorator {
1628
- value?: Expression;
1629
- typeAnnotation?: TsTypeAnnotation;
1630
- isStatic: boolean;
1631
- accessibility?: Accessibility;
1632
- isOptional: boolean;
1633
- isOverride: boolean;
1634
- readonly: boolean;
1635
- definite: boolean;
1636
- }
1637
- interface ClassProperty extends ClassPropertyBase {
1638
- type: "ClassProperty";
1639
- key: PropertyName;
1640
- isAbstract: boolean;
1641
- declare: boolean;
1642
- }
1643
- interface PrivateProperty extends ClassPropertyBase {
1644
- type: "PrivateProperty";
1645
- key: PrivateName;
1646
- }
1647
- interface Param extends Node, HasSpan, HasDecorator {
1648
- type: "Parameter";
1649
- pat: Pattern;
1650
- }
1651
- interface Constructor extends Node, HasSpan {
1652
- type: "Constructor";
1653
- key: PropertyName;
1654
- params: (TsParameterProperty | Param)[];
1655
- body?: BlockStatement;
1656
- accessibility?: Accessibility;
1657
- isOptional: boolean;
1658
- }
1659
- interface ClassMethodBase extends Node, HasSpan {
1660
- function: Fn;
1661
- kind: MethodKind;
1662
- isStatic: boolean;
1663
- accessibility?: Accessibility;
1664
- isAbstract: boolean;
1665
- isOptional: boolean;
1666
- isOverride: boolean;
1667
- }
1668
- interface ClassMethod extends ClassMethodBase {
1669
- type: "ClassMethod";
1670
- key: PropertyName;
1671
- }
1672
- interface PrivateMethod extends ClassMethodBase {
1673
- type: "PrivateMethod";
1674
- key: PrivateName;
1675
- }
1676
- interface StaticBlock extends Node, HasSpan {
1677
- type: "StaticBlock";
1678
- body: BlockStatement;
1679
- }
1680
- interface Decorator extends Node, HasSpan {
1681
- type: "Decorator";
1682
- expression: Expression;
1683
- }
1684
- type MethodKind = "method" | "getter" | "setter";
1685
- type Declaration = ClassDeclaration | FunctionDeclaration | VariableDeclaration | TsInterfaceDeclaration | TsTypeAliasDeclaration | TsEnumDeclaration | TsModuleDeclaration;
1686
- interface FunctionDeclaration extends Fn {
1687
- type: "FunctionDeclaration";
1688
- identifier: Identifier;
1689
- declare: boolean;
1690
- }
1691
- interface ClassDeclaration extends Class, Node {
1692
- type: "ClassDeclaration";
1693
- identifier: Identifier;
1694
- declare: boolean;
1695
- }
1696
- interface VariableDeclaration extends Node, HasSpan {
1697
- type: "VariableDeclaration";
1698
- kind: VariableDeclarationKind;
1699
- declare: boolean;
1700
- declarations: VariableDeclarator[];
1701
- }
1702
- type VariableDeclarationKind = "var" | "let" | "const";
1703
- interface VariableDeclarator extends Node, HasSpan {
1704
- type: "VariableDeclarator";
1705
- id: Pattern;
1706
- init?: Expression;
1707
- definite: boolean;
1708
- }
1709
- type Expression = ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | MemberExpression | SuperPropExpression | ConditionalExpression | CallExpression | NewExpression | SequenceExpression | Identifier | Literal | TemplateLiteral | TaggedTemplateExpression | ArrowFunctionExpression | ClassExpression | YieldExpression | MetaProperty | AwaitExpression | ParenthesisExpression | JSXMemberExpression | JSXNamespacedName | JSXEmptyExpression | JSXElement | JSXFragment | TsTypeAssertion | TsConstAssertion | TsNonNullExpression | TsAsExpression | TsSatisfiesExpression | TsInstantiation | PrivateName | OptionalChainingExpression | Invalid;
1710
- interface ExpressionBase extends Node, HasSpan {
1711
- }
1712
- interface Identifier extends ExpressionBase {
1713
- type: "Identifier";
1714
- value: string;
1715
- optional: boolean;
1716
- }
1717
- interface OptionalChainingExpression extends ExpressionBase {
1718
- type: "OptionalChainingExpression";
1719
- questionDotToken: Span;
1720
- /**
1721
- * Call expression or member expression.
1722
- */
1723
- base: MemberExpression | OptionalChainingCall;
1724
- }
1725
- interface OptionalChainingCall extends ExpressionBase {
1726
- type: "CallExpression";
1727
- callee: Expression;
1728
- arguments: ExprOrSpread[];
1729
- typeArguments?: TsTypeParameterInstantiation;
1730
- }
1731
- interface ThisExpression extends ExpressionBase {
1732
- type: "ThisExpression";
1733
- }
1734
- interface ArrayExpression extends ExpressionBase {
1735
- type: "ArrayExpression";
1736
- elements: (ExprOrSpread | undefined)[];
1737
- }
1738
- interface ExprOrSpread {
1739
- spread?: Span;
1740
- expression: Expression;
1741
- }
1742
- interface ObjectExpression extends ExpressionBase {
1743
- type: "ObjectExpression";
1744
- properties: (SpreadElement | Property)[];
1745
- }
1746
- interface Argument {
1747
- spread?: Span;
1748
- expression: Expression;
1749
- }
1750
- interface SpreadElement extends Node {
1751
- type: "SpreadElement";
1752
- spread: Span;
1753
- arguments: Expression;
1754
- }
1755
- interface UnaryExpression extends ExpressionBase {
1756
- type: "UnaryExpression";
1757
- operator: UnaryOperator;
1758
- argument: Expression;
1759
- }
1760
- interface UpdateExpression extends ExpressionBase {
1761
- type: "UpdateExpression";
1762
- operator: UpdateOperator;
1763
- prefix: boolean;
1764
- argument: Expression;
1765
- }
1766
- interface BinaryExpression extends ExpressionBase {
1767
- type: "BinaryExpression";
1768
- operator: BinaryOperator;
1769
- left: Expression;
1770
- right: Expression;
1771
- }
1772
- interface FunctionExpression extends Fn, ExpressionBase {
1773
- type: "FunctionExpression";
1774
- identifier?: Identifier;
1775
- }
1776
- interface ClassExpression extends Class, ExpressionBase {
1777
- type: "ClassExpression";
1778
- identifier?: Identifier;
1779
- }
1780
- interface AssignmentExpression extends ExpressionBase {
1781
- type: "AssignmentExpression";
1782
- operator: AssignmentOperator;
1783
- left: Expression | Pattern;
1784
- right: Expression;
1785
- }
1786
- interface MemberExpression extends ExpressionBase {
1787
- type: "MemberExpression";
1788
- object: Expression;
1789
- property: Identifier | PrivateName | ComputedPropName;
1790
- }
1791
- interface SuperPropExpression extends ExpressionBase {
1792
- type: "SuperPropExpression";
1793
- obj: Super;
1794
- property: Identifier | ComputedPropName;
1795
- }
1796
- interface ConditionalExpression extends ExpressionBase {
1797
- type: "ConditionalExpression";
1798
- test: Expression;
1799
- consequent: Expression;
1800
- alternate: Expression;
1801
- }
1802
- interface Super extends Node, HasSpan {
1803
- type: "Super";
1804
- }
1805
- interface Import extends Node, HasSpan {
1806
- type: "Import";
1807
- }
1808
- interface CallExpression extends ExpressionBase {
1809
- type: "CallExpression";
1810
- callee: Super | Import | Expression;
1811
- arguments: Argument[];
1812
- typeArguments?: TsTypeParameterInstantiation;
1813
- }
1814
- interface NewExpression extends ExpressionBase {
1815
- type: "NewExpression";
1816
- callee: Expression;
1817
- arguments?: Argument[];
1818
- typeArguments?: TsTypeParameterInstantiation;
1819
- }
1820
- interface SequenceExpression extends ExpressionBase {
1821
- type: "SequenceExpression";
1822
- expressions: Expression[];
1823
- }
1824
- interface ArrowFunctionExpression extends ExpressionBase {
1825
- type: "ArrowFunctionExpression";
1826
- params: Pattern[];
1827
- body: BlockStatement | Expression;
1828
- async: boolean;
1829
- generator: boolean;
1830
- typeParameters?: TsTypeParameterDeclaration;
1831
- returnType?: TsTypeAnnotation;
1832
- }
1833
- interface YieldExpression extends ExpressionBase {
1834
- type: "YieldExpression";
1835
- argument?: Expression;
1836
- delegate: boolean;
1837
- }
1838
- interface MetaProperty extends Node, HasSpan {
1839
- type: "MetaProperty";
1840
- kind: "new.target" | "import.meta";
1841
- }
1842
- interface AwaitExpression extends ExpressionBase {
1843
- type: "AwaitExpression";
1844
- argument: Expression;
1845
- }
1846
- interface TemplateLiteral extends ExpressionBase {
1847
- type: "TemplateLiteral";
1848
- expressions: Expression[];
1849
- quasis: TemplateElement[];
1850
- }
1851
- interface TaggedTemplateExpression extends ExpressionBase {
1852
- type: "TaggedTemplateExpression";
1853
- tag: Expression;
1854
- typeParameters?: TsTypeParameterInstantiation;
1855
- template: TemplateLiteral;
1856
- }
1857
- interface TemplateElement extends ExpressionBase {
1858
- type: "TemplateElement";
1859
- tail: boolean;
1860
- cooked?: string;
1861
- raw: string;
1862
- }
1863
- interface ParenthesisExpression extends ExpressionBase {
1864
- type: "ParenthesisExpression";
1865
- expression: Expression;
1866
- }
1867
- interface Fn extends HasSpan, HasDecorator {
1868
- params: Param[];
1869
- body?: BlockStatement;
1870
- generator: boolean;
1871
- async: boolean;
1872
- typeParameters?: TsTypeParameterDeclaration;
1873
- returnType?: TsTypeAnnotation;
1874
- }
1875
- interface PatternBase extends Node, HasSpan {
1876
- typeAnnotation?: TsTypeAnnotation;
1877
- }
1878
- interface PrivateName extends ExpressionBase {
1879
- type: "PrivateName";
1880
- id: Identifier;
1881
- }
1882
- type JSXObject = JSXMemberExpression | Identifier;
1883
- interface JSXMemberExpression extends Node {
1884
- type: "JSXMemberExpression";
1885
- object: JSXObject;
1886
- property: Identifier;
1887
- }
1888
- /**
1889
- * XML-based namespace syntax:
1890
- */
1891
- interface JSXNamespacedName extends Node {
1892
- type: "JSXNamespacedName";
1893
- namespace: Identifier;
1894
- name: Identifier;
1895
- }
1896
- interface JSXEmptyExpression extends Node, HasSpan {
1897
- type: "JSXEmptyExpression";
1898
- }
1899
- interface JSXExpressionContainer extends Node, HasSpan {
1900
- type: "JSXExpressionContainer";
1901
- expression: JSXExpression;
1902
- }
1903
- type JSXExpression = JSXEmptyExpression | Expression;
1904
- interface JSXSpreadChild extends Node, HasSpan {
1905
- type: "JSXSpreadChild";
1906
- expression: Expression;
1907
- }
1908
- type JSXElementName = Identifier | JSXMemberExpression | JSXNamespacedName;
1909
- interface JSXOpeningElement extends Node, HasSpan {
1910
- type: "JSXOpeningElement";
1911
- name: JSXElementName;
1912
- attributes: JSXAttributeOrSpread[];
1913
- selfClosing: boolean;
1914
- typeArguments?: TsTypeParameterInstantiation;
1915
- }
1916
- type JSXAttributeOrSpread = JSXAttribute | SpreadElement;
1917
- interface JSXClosingElement extends Node, HasSpan {
1918
- type: "JSXClosingElement";
1919
- name: JSXElementName;
1920
- }
1921
- interface JSXAttribute extends Node, HasSpan {
1922
- type: "JSXAttribute";
1923
- name: JSXAttributeName;
1924
- value?: JSXAttrValue;
1925
- }
1926
- type JSXAttributeName = Identifier | JSXNamespacedName;
1927
- type JSXAttrValue = Literal | JSXExpressionContainer | JSXElement | JSXFragment;
1928
- interface JSXText extends Node, HasSpan {
1929
- type: "JSXText";
1930
- value: string;
1931
- raw: string;
1932
- }
1933
- interface JSXElement extends Node, HasSpan {
1934
- type: "JSXElement";
1935
- opening: JSXOpeningElement;
1936
- children: JSXElementChild[];
1937
- closing?: JSXClosingElement;
1938
- }
1939
- type JSXElementChild = JSXText | JSXExpressionContainer | JSXSpreadChild | JSXElement | JSXFragment;
1940
- interface JSXFragment extends Node, HasSpan {
1941
- type: "JSXFragment";
1942
- opening: JSXOpeningFragment;
1943
- children: JSXElementChild[];
1944
- closing: JSXClosingFragment;
1945
- }
1946
- interface JSXOpeningFragment extends Node, HasSpan {
1947
- type: "JSXOpeningFragment";
1948
- }
1949
- interface JSXClosingFragment extends Node, HasSpan {
1950
- type: "JSXClosingFragment";
1951
- }
1952
- type Literal = StringLiteral | BooleanLiteral | NullLiteral | NumericLiteral | BigIntLiteral | RegExpLiteral | JSXText;
1953
- interface StringLiteral extends Node, HasSpan {
1954
- type: "StringLiteral";
1955
- value: string;
1956
- raw?: string;
1957
- }
1958
- interface BooleanLiteral extends Node, HasSpan {
1959
- type: "BooleanLiteral";
1960
- value: boolean;
1961
- }
1962
- interface NullLiteral extends Node, HasSpan {
1963
- type: "NullLiteral";
1964
- }
1965
- interface RegExpLiteral extends Node, HasSpan {
1966
- type: "RegExpLiteral";
1967
- pattern: string;
1968
- flags: string;
1969
- }
1970
- interface NumericLiteral extends Node, HasSpan {
1971
- type: "NumericLiteral";
1972
- value: number;
1973
- raw?: string;
1974
- }
1975
- interface BigIntLiteral extends Node, HasSpan {
1976
- type: "BigIntLiteral";
1977
- value: bigint;
1978
- raw?: string;
1979
- }
1980
- type ModuleDeclaration = ImportDeclaration | ExportDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration | ExportDefaultExpression | ExportAllDeclaration | TsImportEqualsDeclaration | TsExportAssignment | TsNamespaceExportDeclaration;
1981
- interface ExportDefaultExpression extends Node, HasSpan {
1982
- type: "ExportDefaultExpression";
1983
- expression: Expression;
1984
- }
1985
- interface ExportDeclaration extends Node, HasSpan {
1986
- type: "ExportDeclaration";
1987
- declaration: Declaration;
1988
- }
1989
- interface ImportDeclaration extends Node, HasSpan {
1990
- type: "ImportDeclaration";
1991
- specifiers: ImportSpecifier[];
1992
- source: StringLiteral;
1993
- typeOnly: boolean;
1994
- asserts?: ObjectExpression;
1995
- }
1996
- interface ExportAllDeclaration extends Node, HasSpan {
1997
- type: "ExportAllDeclaration";
1998
- source: StringLiteral;
1999
- asserts?: ObjectExpression;
2000
- }
2001
- /**
2002
- * - `export { foo } from 'mod'`
2003
- * - `export { foo as bar } from 'mod'`
2004
- */
2005
- interface ExportNamedDeclaration extends Node, HasSpan {
2006
- type: "ExportNamedDeclaration";
2007
- specifiers: ExportSpecifier[];
2008
- source?: StringLiteral;
2009
- typeOnly: boolean;
2010
- asserts?: ObjectExpression;
2011
- }
2012
- interface ExportDefaultDeclaration extends Node, HasSpan {
2013
- type: "ExportDefaultDeclaration";
2014
- decl: DefaultDecl;
2015
- }
2016
- type DefaultDecl = ClassExpression | FunctionExpression | TsInterfaceDeclaration;
2017
- type ImportSpecifier = NamedImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier;
2018
- /**
2019
- * e.g. `import foo from 'mod.js'`
2020
- */
2021
- interface ImportDefaultSpecifier extends Node, HasSpan {
2022
- type: "ImportDefaultSpecifier";
2023
- local: Identifier;
2024
- }
2025
- /**
2026
- * e.g. `import * as foo from 'mod.js'`.
2027
- */
2028
- interface ImportNamespaceSpecifier extends Node, HasSpan {
2029
- type: "ImportNamespaceSpecifier";
2030
- local: Identifier;
2031
- }
2032
- /**
2033
- * e.g. - `import { foo } from 'mod.js'`
2034
- *
2035
- * local = foo, imported = None
2036
- *
2037
- * e.g. `import { foo as bar } from 'mod.js'`
2038
- *
2039
- * local = bar, imported = Some(foo) for
2040
- */
2041
- interface NamedImportSpecifier extends Node, HasSpan {
2042
- type: "ImportSpecifier";
2043
- local: Identifier;
2044
- imported?: ModuleExportName;
2045
- isTypeOnly: boolean;
2046
- }
2047
- type ModuleExportName = Identifier | StringLiteral;
2048
- type ExportSpecifier = ExportNamespaceSpecifier | ExportDefaultSpecifier | NamedExportSpecifier;
2049
- /**
2050
- * `export * as foo from 'src';`
2051
- */
2052
- interface ExportNamespaceSpecifier extends Node, HasSpan {
2053
- type: "ExportNamespaceSpecifier";
2054
- name: ModuleExportName;
2055
- }
2056
- interface ExportDefaultSpecifier extends Node, HasSpan {
2057
- type: "ExportDefaultSpecifier";
2058
- exported: Identifier;
2059
- }
2060
- interface NamedExportSpecifier extends Node, HasSpan {
2061
- type: "ExportSpecifier";
2062
- orig: ModuleExportName;
2063
- /**
2064
- * `Some(bar)` in `export { foo as bar }`
2065
- */
2066
- exported?: ModuleExportName;
2067
- isTypeOnly: boolean;
2068
- }
2069
- interface HasInterpreter {
2070
- /**
2071
- * e.g. `/usr/bin/node` for `#!/usr/bin/node`
2072
- */
2073
- interpreter: string;
2074
- }
2075
- type Program = Module | Script;
2076
- interface Module extends Node, HasSpan, HasInterpreter {
2077
- type: "Module";
2078
- body: ModuleItem[];
2079
- }
2080
- interface Script extends Node, HasSpan, HasInterpreter {
2081
- type: "Script";
2082
- body: Statement[];
2083
- }
2084
- type ModuleItem = ModuleDeclaration | Statement;
2085
- type BinaryOperator = "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "|" | "^" | "&" | "||" | "&&" | "in" | "instanceof" | "**" | "??";
2086
- type AssignmentOperator = "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "**=" | "&&=" | "||=" | "??=";
2087
- type UpdateOperator = "++" | "--";
2088
- type UnaryOperator = "-" | "+" | "!" | "~" | "typeof" | "void" | "delete";
2089
- type Pattern = BindingIdentifier | ArrayPattern | RestElement | ObjectPattern | AssignmentPattern | Invalid | Expression;
2090
- interface BindingIdentifier extends PatternBase {
2091
- type: "Identifier";
2092
- value: string;
2093
- optional: boolean;
2094
- }
2095
- interface ArrayPattern extends PatternBase {
2096
- type: "ArrayPattern";
2097
- elements: (Pattern | undefined)[];
2098
- optional: boolean;
2099
- }
2100
- interface ObjectPattern extends PatternBase {
2101
- type: "ObjectPattern";
2102
- properties: ObjectPatternProperty[];
2103
- optional: boolean;
2104
- }
2105
- interface AssignmentPattern extends PatternBase {
2106
- type: "AssignmentPattern";
2107
- left: Pattern;
2108
- right: Expression;
2109
- }
2110
- interface RestElement extends PatternBase {
2111
- type: "RestElement";
2112
- rest: Span;
2113
- argument: Pattern;
2114
- }
2115
- type ObjectPatternProperty = KeyValuePatternProperty | AssignmentPatternProperty | RestElement;
2116
- /**
2117
- * `{key: value}`
2118
- */
2119
- interface KeyValuePatternProperty extends Node {
2120
- type: "KeyValuePatternProperty";
2121
- key: PropertyName;
2122
- value: Pattern;
2123
- }
2124
- /**
2125
- * `{key}` or `{key = value}`
2126
- */
2127
- interface AssignmentPatternProperty extends Node, HasSpan {
2128
- type: "AssignmentPatternProperty";
2129
- key: Identifier;
2130
- value?: Expression;
2131
- }
2132
- /** Identifier is `a` in `{ a, }` */
2133
- type Property = Identifier | KeyValueProperty | AssignmentProperty | GetterProperty | SetterProperty | MethodProperty;
2134
- interface PropBase extends Node {
2135
- key: PropertyName;
2136
- }
2137
- interface KeyValueProperty extends PropBase {
2138
- type: "KeyValueProperty";
2139
- value: Expression;
2140
- }
2141
- interface AssignmentProperty extends Node {
2142
- type: "AssignmentProperty";
2143
- key: Identifier;
2144
- value: Expression;
2145
- }
2146
- interface GetterProperty extends PropBase, HasSpan {
2147
- type: "GetterProperty";
2148
- typeAnnotation?: TsTypeAnnotation;
2149
- body?: BlockStatement;
2150
- }
2151
- interface SetterProperty extends PropBase, HasSpan {
2152
- type: "SetterProperty";
2153
- param: Pattern;
2154
- body?: BlockStatement;
2155
- }
2156
- interface MethodProperty extends PropBase, Fn {
2157
- type: "MethodProperty";
2158
- }
2159
- type PropertyName = Identifier | StringLiteral | NumericLiteral | ComputedPropName | BigIntLiteral;
2160
- interface ComputedPropName extends Node, HasSpan {
2161
- type: "Computed";
2162
- expression: Expression;
2163
- }
2164
- interface BlockStatement extends Node, HasSpan {
2165
- type: "BlockStatement";
2166
- stmts: Statement[];
2167
- }
2168
- interface ExpressionStatement extends Node, HasSpan {
2169
- type: "ExpressionStatement";
2170
- expression: Expression;
2171
- }
2172
- type Statement = BlockStatement | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | Declaration | ExpressionStatement;
2173
- interface EmptyStatement extends Node, HasSpan {
2174
- type: "EmptyStatement";
2175
- }
2176
- interface DebuggerStatement extends Node, HasSpan {
2177
- type: "DebuggerStatement";
2178
- }
2179
- interface WithStatement extends Node, HasSpan {
2180
- type: "WithStatement";
2181
- object: Expression;
2182
- body: Statement;
2183
- }
2184
- interface ReturnStatement extends Node, HasSpan {
2185
- type: "ReturnStatement";
2186
- argument?: Expression;
2187
- }
2188
- interface LabeledStatement extends Node, HasSpan {
2189
- type: "LabeledStatement";
2190
- label: Identifier;
2191
- body: Statement;
2192
- }
2193
- interface BreakStatement extends Node, HasSpan {
2194
- type: "BreakStatement";
2195
- label?: Identifier;
2196
- }
2197
- interface ContinueStatement extends Node, HasSpan {
2198
- type: "ContinueStatement";
2199
- label?: Identifier;
2200
- }
2201
- interface IfStatement extends Node, HasSpan {
2202
- type: "IfStatement";
2203
- test: Expression;
2204
- consequent: Statement;
2205
- alternate?: Statement;
2206
- }
2207
- interface SwitchStatement extends Node, HasSpan {
2208
- type: "SwitchStatement";
2209
- discriminant: Expression;
2210
- cases: SwitchCase[];
2211
- }
2212
- interface ThrowStatement extends Node, HasSpan {
2213
- type: "ThrowStatement";
2214
- argument: Expression;
2215
- }
2216
- interface TryStatement extends Node, HasSpan {
2217
- type: "TryStatement";
2218
- block: BlockStatement;
2219
- handler?: CatchClause;
2220
- finalizer?: BlockStatement;
2221
- }
2222
- interface WhileStatement extends Node, HasSpan {
2223
- type: "WhileStatement";
2224
- test: Expression;
2225
- body: Statement;
2226
- }
2227
- interface DoWhileStatement extends Node, HasSpan {
2228
- type: "DoWhileStatement";
2229
- test: Expression;
2230
- body: Statement;
2231
- }
2232
- interface ForStatement extends Node, HasSpan {
2233
- type: "ForStatement";
2234
- init?: VariableDeclaration | Expression;
2235
- test?: Expression;
2236
- update?: Expression;
2237
- body: Statement;
2238
- }
2239
- interface ForInStatement extends Node, HasSpan {
2240
- type: "ForInStatement";
2241
- left: VariableDeclaration | Pattern;
2242
- right: Expression;
2243
- body: Statement;
2244
- }
2245
- interface ForOfStatement extends Node, HasSpan {
2246
- type: "ForOfStatement";
2247
- /**
2248
- * Span of the await token.
2249
- *
2250
- * es2018 for-await-of statements, e.g., `for await (const x of xs) {`
2251
- */
2252
- await?: Span;
2253
- left: VariableDeclaration | Pattern;
2254
- right: Expression;
2255
- body: Statement;
2256
- }
2257
- interface SwitchCase extends Node, HasSpan {
2258
- type: "SwitchCase";
2259
- /**
2260
- * Undefined for default case
2261
- */
2262
- test?: Expression;
2263
- consequent: Statement[];
2264
- }
2265
- interface CatchClause extends Node, HasSpan {
2266
- type: "CatchClause";
2267
- /**
2268
- * The param is `undefined` if the catch binding is omitted. E.g., `try { foo() } catch {}`
2269
- */
2270
- param?: Pattern;
2271
- body: BlockStatement;
2272
- }
2273
- interface TsTypeAnnotation extends Node, HasSpan {
2274
- type: "TsTypeAnnotation";
2275
- typeAnnotation: TsType;
2276
- }
2277
- interface TsTypeParameterDeclaration extends Node, HasSpan {
2278
- type: "TsTypeParameterDeclaration";
2279
- parameters: TsTypeParameter[];
2280
- }
2281
- interface TsTypeParameter extends Node, HasSpan {
2282
- type: "TsTypeParameter";
2283
- name: Identifier;
2284
- in: boolean;
2285
- out: boolean;
2286
- constraint?: TsType;
2287
- default?: TsType;
2288
- }
2289
- interface TsTypeParameterInstantiation extends Node, HasSpan {
2290
- type: "TsTypeParameterInstantiation";
2291
- params: TsType[];
2292
- }
2293
- interface TsParameterProperty extends Node, HasSpan, HasDecorator {
2294
- type: "TsParameterProperty";
2295
- accessibility?: Accessibility;
2296
- override: boolean;
2297
- readonly: boolean;
2298
- param: TsParameterPropertyParameter;
2299
- }
2300
- type TsParameterPropertyParameter = BindingIdentifier | AssignmentPattern;
2301
- interface TsQualifiedName extends Node {
2302
- type: "TsQualifiedName";
2303
- left: TsEntityName;
2304
- right: Identifier;
2305
- }
2306
- type TsEntityName = TsQualifiedName | Identifier;
2307
- type TsTypeElement = TsCallSignatureDeclaration | TsConstructSignatureDeclaration | TsPropertySignature | TsGetterSignature | TsSetterSignature | TsMethodSignature | TsIndexSignature;
2308
- interface TsCallSignatureDeclaration extends Node, HasSpan {
2309
- type: "TsCallSignatureDeclaration";
2310
- params: TsFnParameter[];
2311
- typeAnnotation?: TsTypeAnnotation;
2312
- typeParams?: TsTypeParameterDeclaration;
2313
- }
2314
- interface TsConstructSignatureDeclaration extends Node, HasSpan {
2315
- type: "TsConstructSignatureDeclaration";
2316
- params: TsFnParameter[];
2317
- typeAnnotation?: TsTypeAnnotation;
2318
- typeParams?: TsTypeParameterDeclaration;
2319
- }
2320
- interface TsPropertySignature extends Node, HasSpan {
2321
- type: "TsPropertySignature";
2322
- readonly: boolean;
2323
- key: Expression;
2324
- computed: boolean;
2325
- optional: boolean;
2326
- init?: Expression;
2327
- params: TsFnParameter[];
2328
- typeAnnotation?: TsTypeAnnotation;
2329
- typeParams?: TsTypeParameterDeclaration;
2330
- }
2331
- interface TsGetterSignature extends Node, HasSpan {
2332
- type: "TsGetterSignature";
2333
- readonly: boolean;
2334
- key: Expression;
2335
- computed: boolean;
2336
- optional: boolean;
2337
- typeAnnotation?: TsTypeAnnotation;
2338
- }
2339
- interface TsSetterSignature extends Node, HasSpan {
2340
- type: "TsSetterSignature";
2341
- readonly: boolean;
2342
- key: Expression;
2343
- computed: boolean;
2344
- optional: boolean;
2345
- param: TsFnParameter;
2346
- }
2347
- interface TsMethodSignature extends Node, HasSpan {
2348
- type: "TsMethodSignature";
2349
- readonly: boolean;
2350
- key: Expression;
2351
- computed: boolean;
2352
- optional: boolean;
2353
- params: TsFnParameter[];
2354
- typeAnn?: TsTypeAnnotation;
2355
- typeParams?: TsTypeParameterDeclaration;
2356
- }
2357
- interface TsIndexSignature extends Node, HasSpan {
2358
- type: "TsIndexSignature";
2359
- params: TsFnParameter[];
2360
- typeAnnotation?: TsTypeAnnotation;
2361
- readonly: boolean;
2362
- static: boolean;
2363
- }
2364
- type TsType = TsKeywordType | TsThisType | TsFnOrConstructorType | TsTypeReference | TsTypeQuery | TsTypeLiteral | TsArrayType | TsTupleType | TsOptionalType | TsRestType | TsUnionOrIntersectionType | TsConditionalType | TsInferType | TsParenthesizedType | TsTypeOperator | TsIndexedAccessType | TsMappedType | TsLiteralType | TsTypePredicate | TsImportType;
2365
- type TsFnOrConstructorType = TsFunctionType | TsConstructorType;
2366
- interface TsKeywordType extends Node, HasSpan {
2367
- type: "TsKeywordType";
2368
- kind: TsKeywordTypeKind;
2369
- }
2370
- type TsKeywordTypeKind = "any" | "unknown" | "number" | "object" | "boolean" | "bigint" | "string" | "symbol" | "void" | "undefined" | "null" | "never" | "intrinsic";
2371
- interface TsThisType extends Node, HasSpan {
2372
- type: "TsThisType";
2373
- }
2374
- type TsFnParameter = BindingIdentifier | ArrayPattern | RestElement | ObjectPattern;
2375
- interface TsFunctionType extends Node, HasSpan {
2376
- type: "TsFunctionType";
2377
- params: TsFnParameter[];
2378
- typeParams?: TsTypeParameterDeclaration;
2379
- typeAnnotation: TsTypeAnnotation;
2380
- }
2381
- interface TsConstructorType extends Node, HasSpan {
2382
- type: "TsConstructorType";
2383
- params: TsFnParameter[];
2384
- typeParams?: TsTypeParameterDeclaration;
2385
- typeAnnotation: TsTypeAnnotation;
2386
- isAbstract: boolean;
2387
- }
2388
- interface TsTypeReference extends Node, HasSpan {
2389
- type: "TsTypeReference";
2390
- typeName: TsEntityName;
2391
- typeParams?: TsTypeParameterInstantiation;
2392
- }
2393
- interface TsTypePredicate extends Node, HasSpan {
2394
- type: "TsTypePredicate";
2395
- asserts: boolean;
2396
- paramName: TsThisTypeOrIdent;
2397
- typeAnnotation?: TsTypeAnnotation;
2398
- }
2399
- type TsThisTypeOrIdent = TsThisType | Identifier;
2400
- interface TsImportType extends Node, HasSpan {
2401
- type: "TsImportType";
2402
- argument: StringLiteral;
2403
- qualifier?: TsEntityName;
2404
- typeArguments?: TsTypeParameterInstantiation;
2405
- }
2406
- /**
2407
- * `typeof` operator
2408
- */
2409
- interface TsTypeQuery extends Node, HasSpan {
2410
- type: "TsTypeQuery";
2411
- exprName: TsTypeQueryExpr;
2412
- typeArguments?: TsTypeParameterInstantiation;
2413
- }
2414
- type TsTypeQueryExpr = TsEntityName | TsImportType;
2415
- interface TsTypeLiteral extends Node, HasSpan {
2416
- type: "TsTypeLiteral";
2417
- members: TsTypeElement[];
2418
- }
2419
- interface TsArrayType extends Node, HasSpan {
2420
- type: "TsArrayType";
2421
- elemType: TsType;
2422
- }
2423
- interface TsTupleType extends Node, HasSpan {
2424
- type: "TsTupleType";
2425
- elemTypes: TsTupleElement[];
2426
- }
2427
- interface TsTupleElement extends Node, HasSpan {
2428
- type: "TsTupleElement";
2429
- label?: Pattern;
2430
- ty: TsType;
2431
- }
2432
- interface TsOptionalType extends Node, HasSpan {
2433
- type: "TsOptionalType";
2434
- typeAnnotation: TsType;
2435
- }
2436
- interface TsRestType extends Node, HasSpan {
2437
- type: "TsRestType";
2438
- typeAnnotation: TsType;
2439
- }
2440
- type TsUnionOrIntersectionType = TsUnionType | TsIntersectionType;
2441
- interface TsUnionType extends Node, HasSpan {
2442
- type: "TsUnionType";
2443
- types: TsType[];
2444
- }
2445
- interface TsIntersectionType extends Node, HasSpan {
2446
- type: "TsIntersectionType";
2447
- types: TsType[];
2448
- }
2449
- interface TsConditionalType extends Node, HasSpan {
2450
- type: "TsConditionalType";
2451
- checkType: TsType;
2452
- extendsType: TsType;
2453
- trueType: TsType;
2454
- falseType: TsType;
2455
- }
2456
- interface TsInferType extends Node, HasSpan {
2457
- type: "TsInferType";
2458
- typeParam: TsTypeParameter;
2459
- }
2460
- interface TsParenthesizedType extends Node, HasSpan {
2461
- type: "TsParenthesizedType";
2462
- typeAnnotation: TsType;
2463
- }
2464
- interface TsTypeOperator extends Node, HasSpan {
2465
- type: "TsTypeOperator";
2466
- op: TsTypeOperatorOp;
2467
- typeAnnotation: TsType;
2468
- }
2469
- type TsTypeOperatorOp = "keyof" | "unique" | "readonly";
2470
- interface TsIndexedAccessType extends Node, HasSpan {
2471
- type: "TsIndexedAccessType";
2472
- readonly: boolean;
2473
- objectType: TsType;
2474
- indexType: TsType;
2475
- }
2476
- type TruePlusMinus = true | "+" | "-";
2477
- interface TsMappedType extends Node, HasSpan {
2478
- type: "TsMappedType";
2479
- readonly?: TruePlusMinus;
2480
- typeParam: TsTypeParameter;
2481
- nameType?: TsType;
2482
- optional?: TruePlusMinus;
2483
- typeAnnotation?: TsType;
2484
- }
2485
- interface TsLiteralType extends Node, HasSpan {
2486
- type: "TsLiteralType";
2487
- literal: TsLiteral;
2488
- }
2489
- type TsLiteral = NumericLiteral | StringLiteral | BooleanLiteral | BigIntLiteral | TsTemplateLiteralType;
2490
- interface TsTemplateLiteralType extends Node, HasSpan {
2491
- type: "TemplateLiteral";
2492
- types: TsType[];
2493
- quasis: TemplateElement[];
2494
- }
2495
- interface TsInterfaceDeclaration extends Node, HasSpan {
2496
- type: "TsInterfaceDeclaration";
2497
- id: Identifier;
2498
- declare: boolean;
2499
- typeParams?: TsTypeParameterDeclaration;
2500
- extends: TsExpressionWithTypeArguments[];
2501
- body: TsInterfaceBody;
2502
- }
2503
- interface TsInterfaceBody extends Node, HasSpan {
2504
- type: "TsInterfaceBody";
2505
- body: TsTypeElement[];
2506
- }
2507
- interface TsExpressionWithTypeArguments extends Node, HasSpan {
2508
- type: "TsExpressionWithTypeArguments";
2509
- expression: Expression;
2510
- typeArguments?: TsTypeParameterInstantiation;
2511
- }
2512
- interface TsTypeAliasDeclaration extends Node, HasSpan {
2513
- type: "TsTypeAliasDeclaration";
2514
- declare: boolean;
2515
- id: Identifier;
2516
- typeParams?: TsTypeParameterDeclaration;
2517
- typeAnnotation: TsType;
2518
- }
2519
- interface TsEnumDeclaration extends Node, HasSpan {
2520
- type: "TsEnumDeclaration";
2521
- declare: boolean;
2522
- isConst: boolean;
2523
- id: Identifier;
2524
- members: TsEnumMember[];
2525
- }
2526
- interface TsEnumMember extends Node, HasSpan {
2527
- type: "TsEnumMember";
2528
- id: TsEnumMemberId;
2529
- init?: Expression;
2530
- }
2531
- type TsEnumMemberId = Identifier | StringLiteral;
2532
- interface TsModuleDeclaration extends Node, HasSpan {
2533
- type: "TsModuleDeclaration";
2534
- declare: boolean;
2535
- global: boolean;
2536
- id: TsModuleName;
2537
- body?: TsNamespaceBody;
2538
- }
2539
- /**
2540
- * `namespace A.B { }` is a namespace named `A` with another TsNamespaceDecl as its body.
2541
- */
2542
- type TsNamespaceBody = TsModuleBlock | TsNamespaceDeclaration;
2543
- interface TsModuleBlock extends Node, HasSpan {
2544
- type: "TsModuleBlock";
2545
- body: ModuleItem[];
2546
- }
2547
- interface TsNamespaceDeclaration extends Node, HasSpan {
2548
- type: "TsNamespaceDeclaration";
2549
- declare: boolean;
2550
- global: boolean;
2551
- id: Identifier;
2552
- body: TsNamespaceBody;
2553
- }
2554
- type TsModuleName = Identifier | StringLiteral;
2555
- interface TsImportEqualsDeclaration extends Node, HasSpan {
2556
- type: "TsImportEqualsDeclaration";
2557
- declare: boolean;
2558
- isExport: boolean;
2559
- isTypeOnly: boolean;
2560
- id: Identifier;
2561
- moduleRef: TsModuleReference;
2562
- }
2563
- type TsModuleReference = TsEntityName | TsExternalModuleReference;
2564
- interface TsExternalModuleReference extends Node, HasSpan {
2565
- type: "TsExternalModuleReference";
2566
- expression: StringLiteral;
2567
- }
2568
- interface TsExportAssignment extends Node, HasSpan {
2569
- type: "TsExportAssignment";
2570
- expression: Expression;
2571
- }
2572
- interface TsNamespaceExportDeclaration extends Node, HasSpan {
2573
- type: "TsNamespaceExportDeclaration";
2574
- id: Identifier;
2575
- }
2576
- interface TsAsExpression extends ExpressionBase {
2577
- type: "TsAsExpression";
2578
- expression: Expression;
2579
- typeAnnotation: TsType;
2580
- }
2581
- interface TsSatisfiesExpression extends ExpressionBase {
2582
- type: "TsSatisfiesExpression";
2583
- expression: Expression;
2584
- typeAnnotation: TsType;
2585
- }
2586
- interface TsInstantiation extends Node, HasSpan {
2587
- type: "TsInstantiation";
2588
- expression: Expression;
2589
- typeArguments: TsTypeParameterInstantiation;
2590
- }
2591
- interface TsTypeAssertion extends ExpressionBase {
2592
- type: "TsTypeAssertion";
2593
- expression: Expression;
2594
- typeAnnotation: TsType;
2595
- }
2596
- interface TsConstAssertion extends ExpressionBase {
2597
- type: "TsConstAssertion";
2598
- expression: Expression;
2599
- }
2600
- interface TsNonNullExpression extends ExpressionBase {
2601
- type: "TsNonNullExpression";
2602
- expression: Expression;
2603
- }
2604
- type Accessibility = "public" | "protected" | "private";
2605
- interface Invalid extends Node, HasSpan {
2606
- type: "Invalid";
2607
- }
2608
-
2609
728
  interface Options$1 {
2610
729
  allowRegExp: boolean;
2611
730
  allowFunction: boolean;
@@ -2753,8 +872,8 @@ interface DirectoryMapping {
2753
872
  interface Presets {
2754
873
  apply(extension: 'typescript', config: TypescriptOptions, args?: Options): Promise<TypescriptOptions>;
2755
874
  apply(extension: 'framework', config?: {}, args?: any): Promise<Preset>;
2756
- apply(extension: 'babel', config?: {}, args?: any): Promise<TransformOptions>;
2757
- apply(extension: 'swc', config?: {}, args?: any): Promise<Options$2>;
875
+ apply(extension: 'babel', config?: {}, args?: any): Promise<any>;
876
+ apply(extension: 'swc', config?: {}, args?: any): Promise<any>;
2758
877
  apply(extension: 'entries', config?: [], args?: any): Promise<unknown>;
2759
878
  apply(extension: 'stories', config?: [], args?: any): Promise<StoriesEntry[]>;
2760
879
  apply(extension: 'managerEntries', config: [], args?: any): Promise<string[]>;
@@ -2845,14 +964,7 @@ interface TypescriptOptions {
2845
964
  */
2846
965
  check: boolean;
2847
966
  /**
2848
- * Disable parsing typescript files through babel.
2849
- *
2850
- * @default `false`
2851
- * @deprecated use `skipCompiler` instead
2852
- */
2853
- skipBabel: boolean;
2854
- /**
2855
- * Disable parsing typescript files through compiler.
967
+ * Disable parsing TypeScript files through compiler.
2856
968
  *
2857
969
  * @default `false`
2858
970
  */
@@ -2942,19 +1054,6 @@ interface StorybookConfigRaw {
2942
1054
  staticDirs?: (DirectoryMapping | string)[];
2943
1055
  logLevel?: string;
2944
1056
  features?: {
2945
- /**
2946
- * Build stories.json automatically on start/build
2947
- */
2948
- buildStoriesJson?: boolean;
2949
- /**
2950
- * Activate on demand story store
2951
- */
2952
- storyStoreV7?: boolean;
2953
- /**
2954
- * Do not throw errors if using `.mdx` files in SSv7
2955
- * (for internal use in sandboxes)
2956
- */
2957
- storyStoreV7MdxErrors?: boolean;
2958
1057
  /**
2959
1058
  * Filter args with a "target" on the type from the render function (EXPERIMENTAL)
2960
1059
  */
@@ -2983,10 +1082,10 @@ interface StorybookConfigRaw {
2983
1082
  framework?: Preset;
2984
1083
  typescript?: Partial<TypescriptOptions>;
2985
1084
  refs?: CoreCommon_StorybookRefs;
2986
- babel?: TransformOptions;
2987
- swc?: Options$2;
1085
+ babel?: any;
1086
+ swc?: any;
2988
1087
  env?: Record<string, string>;
2989
- babelDefault?: TransformOptions;
1088
+ babelDefault?: any;
2990
1089
  config?: Entry[];
2991
1090
  previewAnnotations?: Entry[];
2992
1091
  experimental_indexers?: Indexer[];