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