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