@storybook/preset-vue3-webpack 8.0.0-alpha.8 → 8.0.0-beta.0

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