storybook 9.0.0-alpha.1 → 9.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. package/README.md +31 -29
  2. package/assets/browser/favicon.svg +1 -0
  3. package/assets/browser/nunito-sans-bold-italic.woff2 +0 -0
  4. package/assets/browser/nunito-sans-bold.woff2 +0 -0
  5. package/assets/browser/nunito-sans-italic.woff2 +0 -0
  6. package/assets/browser/nunito-sans-regular.woff2 +0 -0
  7. package/assets/docs/message-reference.png +0 -0
  8. package/assets/server/addon.tsconfig.json +6 -0
  9. package/assets/server/base-preview-body.html +119 -0
  10. package/assets/server/base-preview-head.html +451 -0
  11. package/assets/server/template.ejs +87 -0
  12. package/bin/index.cjs +1 -1
  13. package/dist/babel/index.cjs +54034 -0
  14. package/dist/babel/index.d.ts +7488 -0
  15. package/dist/babel/index.js +54044 -0
  16. package/dist/bin/index.cjs +124 -0
  17. package/dist/bin/index.js +118 -0
  18. package/dist/builder-manager/index.cjs +2167 -0
  19. package/dist/builder-manager/index.d.ts +19 -0
  20. package/dist/builder-manager/index.js +2189 -0
  21. package/dist/channels/index.cjs +1938 -0
  22. package/dist/channels/index.d.ts +108 -0
  23. package/dist/channels/index.js +1885 -0
  24. package/dist/cli/bin/index.cjs +2687 -0
  25. package/dist/cli/bin/index.d.ts +2 -0
  26. package/dist/cli/bin/index.js +2707 -0
  27. package/dist/cli/index.cjs +17327 -0
  28. package/dist/cli/index.d.ts +209 -0
  29. package/dist/cli/index.js +17349 -0
  30. package/dist/client-logger/index.cjs +112 -0
  31. package/dist/client-logger/index.d.ts +29 -0
  32. package/dist/client-logger/index.js +70 -0
  33. package/dist/common/index.cjs +20558 -0
  34. package/dist/common/index.d.ts +955 -0
  35. package/dist/common/index.js +20643 -0
  36. package/dist/components/index.cjs +30056 -0
  37. package/dist/components/index.d.ts +1423 -0
  38. package/dist/components/index.js +25416 -0
  39. package/dist/core-events/index.cjs +167 -0
  40. package/dist/core-events/index.d.ts +313 -0
  41. package/dist/core-events/index.js +149 -0
  42. package/dist/core-server/index.cjs +37872 -0
  43. package/dist/core-server/index.d.ts +462 -0
  44. package/dist/core-server/index.js +37966 -0
  45. package/dist/core-server/presets/common-manager.js +28 -0
  46. package/dist/core-server/presets/common-override-preset.cjs +4824 -0
  47. package/dist/core-server/presets/common-override-preset.js +4829 -0
  48. package/dist/core-server/presets/common-preset.cjs +10228 -0
  49. package/dist/core-server/presets/common-preset.js +10306 -0
  50. package/dist/csf/index.cjs +223 -0
  51. package/dist/csf/index.d.ts +752 -0
  52. package/dist/csf/index.js +216 -0
  53. package/dist/csf-tools/index.cjs +1422 -0
  54. package/dist/csf-tools/index.d.ts +250 -0
  55. package/dist/csf-tools/index.js +1439 -0
  56. package/dist/docs-tools/index.cjs +923 -0
  57. package/dist/docs-tools/index.d.ts +162 -0
  58. package/dist/docs-tools/index.js +909 -0
  59. package/dist/index.cjs +17 -1
  60. package/dist/index.d.ts +1 -1
  61. package/dist/index.js +2 -7
  62. package/dist/instrumenter/index.cjs +3273 -0
  63. package/dist/instrumenter/index.d.ts +104 -0
  64. package/dist/instrumenter/index.js +4800 -0
  65. package/dist/manager/globals-module-info.cjs +666 -0
  66. package/dist/manager/globals-module-info.d.ts +36 -0
  67. package/dist/manager/globals-module-info.js +653 -0
  68. package/dist/manager/globals-runtime.js +41567 -0
  69. package/dist/manager/globals.cjs +43 -0
  70. package/dist/manager/globals.d.ts +21 -0
  71. package/dist/manager/globals.js +30 -0
  72. package/dist/manager/runtime.js +12043 -0
  73. package/dist/manager-api/index.cjs +10772 -0
  74. package/dist/manager-api/index.d.ts +1211 -0
  75. package/dist/manager-api/index.js +4547 -0
  76. package/dist/manager-errors.d.ts +65 -0
  77. package/dist/manager-errors.js +83 -0
  78. package/dist/node-logger/index.cjs +1642 -0
  79. package/dist/node-logger/index.d.ts +117 -0
  80. package/dist/node-logger/index.js +1652 -0
  81. package/dist/preview/globals.cjs +34 -0
  82. package/dist/preview/globals.d.ts +12 -0
  83. package/dist/preview/globals.js +21 -0
  84. package/dist/preview/runtime.js +7723 -0
  85. package/dist/preview-api/index.cjs +5658 -0
  86. package/dist/preview-api/index.d.ts +1356 -0
  87. package/dist/preview-api/index.js +5665 -0
  88. package/dist/preview-errors.cjs +486 -0
  89. package/dist/preview-errors.d.ts +188 -0
  90. package/dist/preview-errors.js +433 -0
  91. package/dist/router/index.cjs +3320 -0
  92. package/dist/router/index.d.ts +385 -0
  93. package/dist/router/index.js +1849 -0
  94. package/dist/server-errors.cjs +710 -0
  95. package/dist/server-errors.d.ts +272 -0
  96. package/dist/server-errors.js +711 -0
  97. package/dist/telemetry/index.cjs +3683 -0
  98. package/dist/telemetry/index.d.ts +112 -0
  99. package/dist/telemetry/index.js +3720 -0
  100. package/dist/theming/create.cjs +2422 -0
  101. package/dist/theming/create.d.ts +50 -0
  102. package/dist/theming/create.js +990 -0
  103. package/dist/theming/index.cjs +4832 -0
  104. package/dist/theming/index.d.ts +11939 -0
  105. package/dist/theming/index.js +3253 -0
  106. package/dist/types/index.cjs +27 -0
  107. package/dist/types/index.d.ts +2541 -0
  108. package/dist/types/index.js +7 -0
  109. package/package.json +308 -212
  110. package/.eslintrc.cjs +0 -31
  111. package/__mocks__/@aw-web-design/x-default-browser.js +0 -2
  112. package/core/babel/index.cjs +0 -1
  113. package/core/babel/index.d.ts +0 -2
  114. package/core/babel/index.js +0 -1
  115. package/core/builder-manager/index.cjs +0 -1
  116. package/core/builder-manager/index.d.ts +0 -2
  117. package/core/builder-manager/index.js +0 -1
  118. package/core/channels/index.cjs +0 -1
  119. package/core/channels/index.d.ts +0 -2
  120. package/core/channels/index.js +0 -1
  121. package/core/cli/bin/index.cjs +0 -1
  122. package/core/cli/bin/index.d.ts +0 -2
  123. package/core/cli/bin/index.js +0 -1
  124. package/core/cli/index.cjs +0 -1
  125. package/core/cli/index.d.ts +0 -2
  126. package/core/cli/index.js +0 -1
  127. package/core/client-logger/index.cjs +0 -1
  128. package/core/client-logger/index.d.ts +0 -2
  129. package/core/client-logger/index.js +0 -1
  130. package/core/common/index.cjs +0 -1
  131. package/core/common/index.d.ts +0 -2
  132. package/core/common/index.js +0 -1
  133. package/core/components/index.cjs +0 -1
  134. package/core/components/index.d.ts +0 -2
  135. package/core/components/index.js +0 -1
  136. package/core/core-events/index.cjs +0 -1
  137. package/core/core-events/index.d.ts +0 -2
  138. package/core/core-events/index.js +0 -1
  139. package/core/core-server/index.cjs +0 -1
  140. package/core/core-server/index.d.ts +0 -2
  141. package/core/core-server/index.js +0 -1
  142. package/core/core-server/presets/common-manager.js +0 -1
  143. package/core/core-server/presets/common-override-preset.cjs +0 -1
  144. package/core/core-server/presets/common-override-preset.js +0 -1
  145. package/core/core-server/presets/common-preset.cjs +0 -1
  146. package/core/core-server/presets/common-preset.js +0 -1
  147. package/core/csf/index.cjs +0 -1
  148. package/core/csf/index.d.ts +0 -2
  149. package/core/csf/index.js +0 -1
  150. package/core/csf-tools/index.cjs +0 -1
  151. package/core/csf-tools/index.d.ts +0 -2
  152. package/core/csf-tools/index.js +0 -1
  153. package/core/docs-tools/index.cjs +0 -1
  154. package/core/docs-tools/index.d.ts +0 -2
  155. package/core/docs-tools/index.js +0 -1
  156. package/core/index.cjs +0 -1
  157. package/core/index.d.ts +0 -2
  158. package/core/index.js +0 -1
  159. package/core/manager/globals-module-info.cjs +0 -1
  160. package/core/manager/globals-module-info.d.ts +0 -2
  161. package/core/manager/globals-module-info.js +0 -1
  162. package/core/manager/globals-runtime.js +0 -1
  163. package/core/manager/globals.cjs +0 -1
  164. package/core/manager/globals.d.ts +0 -2
  165. package/core/manager/globals.js +0 -1
  166. package/core/manager-api/index.cjs +0 -1
  167. package/core/manager-api/index.d.ts +0 -2
  168. package/core/manager-api/index.js +0 -1
  169. package/core/manager-errors.d.ts +0 -2
  170. package/core/manager-errors.js +0 -1
  171. package/core/node-logger/index.cjs +0 -1
  172. package/core/node-logger/index.d.ts +0 -2
  173. package/core/node-logger/index.js +0 -1
  174. package/core/preview/globals.cjs +0 -1
  175. package/core/preview/globals.d.ts +0 -2
  176. package/core/preview/globals.js +0 -1
  177. package/core/preview/runtime.js +0 -1
  178. package/core/preview-api/index.cjs +0 -1
  179. package/core/preview-api/index.d.ts +0 -2
  180. package/core/preview-api/index.js +0 -1
  181. package/core/preview-errors.cjs +0 -1
  182. package/core/preview-errors.d.ts +0 -2
  183. package/core/preview-errors.js +0 -1
  184. package/core/router/index.cjs +0 -1
  185. package/core/router/index.d.ts +0 -2
  186. package/core/router/index.js +0 -1
  187. package/core/server-errors.cjs +0 -1
  188. package/core/server-errors.d.ts +0 -2
  189. package/core/server-errors.js +0 -1
  190. package/core/telemetry/index.cjs +0 -1
  191. package/core/telemetry/index.d.ts +0 -2
  192. package/core/telemetry/index.js +0 -1
  193. package/core/theming/create.cjs +0 -1
  194. package/core/theming/create.d.ts +0 -2
  195. package/core/theming/create.js +0 -1
  196. package/core/theming/index.cjs +0 -1
  197. package/core/theming/index.d.ts +0 -2
  198. package/core/theming/index.js +0 -1
  199. package/core/types/index.cjs +0 -1
  200. package/core/types/index.d.ts +0 -2
  201. package/core/types/index.js +0 -1
  202. package/core.cjs +0 -0
  203. package/core.d.ts +0 -0
  204. package/core.js +0 -1
  205. package/dist/chunk-OWLSIX54.js +0 -8
  206. package/dist/core-path.cjs +0 -1
  207. package/dist/core-path.d.ts +0 -3
  208. package/dist/core-path.js +0 -9
  209. package/dist/proxy.cjs +0 -1
  210. package/dist/proxy.d.ts +0 -2
  211. package/dist/proxy.js +0 -9
@@ -0,0 +1,2541 @@
1
+ import { StoryId, StoryName, ComponentTitle, Tag as Tag$1, Parameters, Args, ArgTypes, ComponentId, StoryKind, Globals, GlobalTypes, InputType, StoryContext, PartialStoryFn, LegacyStoryFn, ArgsStoryFn, StoryFn, DecoratorFunction, LoaderFunction, Renderer as Renderer$1, ViewMode as ViewMode$1, StoryIdentifier, ProjectAnnotations as ProjectAnnotations$2, StrictArgTypes, StrictGlobalTypes, StepRunner, BeforeAll, ComponentAnnotations, StoryAnnotations, StoryContextForEnhancers, CleanupCallback, Canvas, StoryAnnotationsOrFn, AnnotatedStoryFn } from 'storybook/internal/csf';
2
+ export { AfterEach, AnnotatedStoryFn, ArgTypes, ArgTypesEnhancer, Args, ArgsEnhancer, ArgsFromMeta, ArgsStoryFn, BaseAnnotations, ProjectAnnotations as BaseProjectAnnotations, BeforeAll, BeforeEach, Canvas, CleanupCallback, ComponentAnnotations, ComponentId, ComponentTitle, Conditional, DecoratorApplicator, DecoratorFunction, GlobalTypes, Globals, IncludeExcludeOptions, InputType, LegacyAnnotatedStoryFn, LegacyStoryAnnotationsOrFn, LegacyStoryFn, LoaderFunction, Parameters, PartialStoryFn, PlayFunction, PlayFunctionContext, SBArrayType, SBEnumType, SBIntersectionType, SBObjectType, SBOtherType, SBScalarType, SBType, SBUnionType, SeparatorOptions, StepFunction, StepLabel, StepRunner, StoryAnnotations, StoryAnnotationsOrFn, StoryContext, StoryContextForEnhancers, StoryContextForLoaders, StoryContextUpdate, StoryFn, StoryId, StoryIdentifier, StoryKind, StoryName, StrictArgTypes, StrictArgs, StrictGlobalTypes, StrictInputType, Tag } from 'storybook/internal/csf';
3
+ import { ReactElement, FC, ReactNode, PropsWithChildren } from 'react';
4
+ import { Addon_TestProviderType as Addon_TestProviderType$1, NormalizedProjectAnnotations as NormalizedProjectAnnotations$1, ProjectAnnotations as ProjectAnnotations$1, ComposedStoryFn as ComposedStoryFn$1 } from 'storybook/internal/types';
5
+ import { FileSystemCache } from 'storybook/internal/common';
6
+ import { Server, IncomingMessage, ServerResponse } from 'http';
7
+ import { Server as Server$1 } from 'net';
8
+ import { Channel as Channel$1 } from 'storybook/internal/channels';
9
+
10
+ type DateNow = number;
11
+ type TestProviderConfig = Addon_TestProviderType$1;
12
+ type TestingModuleProgressReportProgress = {
13
+ startedAt: DateNow;
14
+ finishedAt?: DateNow;
15
+ numTotalTests?: number;
16
+ numPassedTests?: number;
17
+ numFailedTests?: number;
18
+ numPendingTests?: number;
19
+ percentageCompleted?: number;
20
+ };
21
+
22
+ declare global {
23
+ var globalProjectAnnotations: NormalizedProjectAnnotations$1<any>;
24
+ var defaultProjectAnnotations: ProjectAnnotations$1<any>;
25
+ }
26
+ type WrappedStoryRef = {
27
+ __pw_type: 'jsx' | 'importRef';
28
+ };
29
+ type UnwrappedJSXStoryRef = {
30
+ __pw_type: 'jsx';
31
+ type: UnwrappedImportStoryRef;
32
+ };
33
+ type UnwrappedImportStoryRef = ComposedStoryFn$1;
34
+ declare global {
35
+ function __pwUnwrapObject(storyRef: WrappedStoryRef): Promise<UnwrappedJSXStoryRef | UnwrappedImportStoryRef>;
36
+ }
37
+
38
+ interface Report<T = unknown> {
39
+ type: string;
40
+ version?: number;
41
+ result: T;
42
+ status: 'failed' | 'passed' | 'warning';
43
+ }
44
+ declare class ReporterAPI {
45
+ reports: Report[];
46
+ addReport(report: Report): Promise<void>;
47
+ }
48
+
49
+ /**
50
+ * A URL pathname, beginning with a /.
51
+ *
52
+ * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.pathname
53
+ */
54
+ declare type Pathname = string;
55
+ /**
56
+ * A URL search string, beginning with a ?.
57
+ *
58
+ * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.search
59
+ */
60
+ declare type Search = string;
61
+ /**
62
+ * A URL fragment identifier, beginning with a #.
63
+ *
64
+ * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.hash
65
+ */
66
+ declare type Hash = string;
67
+ /**
68
+ * A unique string associated with a location. May be used to safely store
69
+ * and retrieve data in some other storage API, like `localStorage`.
70
+ *
71
+ * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.key
72
+ */
73
+ declare type Key = string;
74
+ /**
75
+ * The pathname, search, and hash values of a URL.
76
+ */
77
+ interface Path$1 {
78
+ /**
79
+ * A URL pathname, beginning with a /.
80
+ *
81
+ * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.pathname
82
+ */
83
+ pathname: Pathname;
84
+ /**
85
+ * A URL search string, beginning with a ?.
86
+ *
87
+ * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.search
88
+ */
89
+ search: Search;
90
+ /**
91
+ * A URL fragment identifier, beginning with a #.
92
+ *
93
+ * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.hash
94
+ */
95
+ hash: Hash;
96
+ }
97
+ /**
98
+ * An entry in a history stack. A location contains information about the
99
+ * URL path, as well as possibly some arbitrary state and a key.
100
+ *
101
+ * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location
102
+ */
103
+ interface Location extends Path$1 {
104
+ /**
105
+ * A value of arbitrary data associated with this location.
106
+ *
107
+ * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.state
108
+ */
109
+ state: unknown;
110
+ /**
111
+ * A unique string associated with this location. May be used to safely store
112
+ * and retrieve data in some other storage API, like `localStorage`.
113
+ *
114
+ * Note: This value is always "default" on the initial location.
115
+ *
116
+ * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.key
117
+ */
118
+ key: Key;
119
+ }
120
+ /**
121
+ * Describes a location that is the destination of some navigation, either via
122
+ * `history.push` or `history.replace`. May be either a URL or the pieces of a
123
+ * URL path.
124
+ */
125
+ declare type To = string | Partial<Path$1>;
126
+
127
+ interface NavigateOptions$1 {
128
+ replace?: boolean;
129
+ state?: any;
130
+ }
131
+
132
+ interface StoryData {
133
+ viewMode?: string;
134
+ storyId?: string;
135
+ refId?: string;
136
+ }
137
+
138
+ interface Other extends StoryData {
139
+ path: string;
140
+ singleStory?: boolean;
141
+ }
142
+ type NavigateOptions = NavigateOptions$1 & {
143
+ plain?: boolean;
144
+ };
145
+ type NavigateFunction = (to: To | number, options?: NavigateOptions) => void;
146
+ type RouterData = {
147
+ location: Partial<Location>;
148
+ navigate: NavigateFunction;
149
+ } & Other;
150
+ type RenderData = Pick<RouterData, 'location'> & Other;
151
+
152
+ interface ThemeVars extends ThemeVarsBase, ThemeVarsColors {
153
+ }
154
+ interface ThemeVarsBase {
155
+ base: 'light' | 'dark';
156
+ }
157
+ interface ThemeVarsColors {
158
+ colorPrimary: string;
159
+ colorSecondary: string;
160
+ appBg: string;
161
+ appContentBg: string;
162
+ appPreviewBg: string;
163
+ appBorderColor: string;
164
+ appBorderRadius: number;
165
+ fontBase: string;
166
+ fontCode: string;
167
+ textColor: string;
168
+ textInverseColor: string;
169
+ textMutedColor: string;
170
+ barTextColor: string;
171
+ barHoverColor: string;
172
+ barSelectedColor: string;
173
+ barBg: string;
174
+ buttonBg: string;
175
+ buttonBorder: string;
176
+ booleanBg: string;
177
+ booleanSelectedBg: string;
178
+ inputBg: string;
179
+ inputBorder: string;
180
+ inputTextColor: string;
181
+ inputBorderRadius: number;
182
+ brandTitle?: string;
183
+ brandUrl?: string;
184
+ brandImage?: string;
185
+ brandTarget?: string;
186
+ gridCellSize?: number;
187
+ }
188
+
189
+ type ChannelHandler = (event: ChannelEvent) => void;
190
+ interface ChannelTransport {
191
+ send(event: ChannelEvent, options?: any): void;
192
+ setHandler(handler: ChannelHandler): void;
193
+ }
194
+ interface ChannelEvent {
195
+ type: string;
196
+ from: string;
197
+ args: any[];
198
+ }
199
+ interface Listener {
200
+ (...args: any[]): void;
201
+ }
202
+ interface ChannelArgsSingle {
203
+ transport?: ChannelTransport;
204
+ async?: boolean;
205
+ }
206
+ interface ChannelArgsMulti {
207
+ transports: ChannelTransport[];
208
+ async?: boolean;
209
+ }
210
+
211
+ declare class Channel {
212
+ readonly isAsync: boolean;
213
+ private sender;
214
+ private events;
215
+ private data;
216
+ private readonly transports;
217
+ constructor(input: ChannelArgsMulti);
218
+ constructor(input: ChannelArgsSingle);
219
+ get hasTransport(): boolean;
220
+ addListener(eventName: string, listener: Listener): void;
221
+ emit(eventName: string, ...args: any): void;
222
+ last(eventName: string): any;
223
+ eventNames(): string[];
224
+ listenerCount(eventName: string): number;
225
+ listeners(eventName: string): Listener[] | undefined;
226
+ once(eventName: string, listener: Listener): void;
227
+ removeAllListeners(eventName?: string): void;
228
+ removeListener(eventName: string, listener: Listener): void;
229
+ on(eventName: string, listener: Listener): void;
230
+ off(eventName: string, listener: Listener): void;
231
+ private handleEvent;
232
+ private onceListener;
233
+ }
234
+
235
+ interface Options$1 {
236
+ allowRegExp: boolean;
237
+ allowFunction: boolean;
238
+ allowSymbol: boolean;
239
+ allowDate: boolean;
240
+ allowUndefined: boolean;
241
+ allowClass: boolean;
242
+ allowError: boolean;
243
+ maxDepth: number;
244
+ space: number | undefined;
245
+ lazyEval: boolean;
246
+ }
247
+
248
+ /**
249
+ Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
250
+
251
+ @category Type
252
+ */
253
+ type Primitive =
254
+ | null
255
+ | undefined
256
+ | string
257
+ | number
258
+ | boolean
259
+ | symbol
260
+ | bigint;
261
+
262
+ declare global {
263
+ interface SymbolConstructor {
264
+ readonly observable: symbol;
265
+ }
266
+ }
267
+
268
+ /**
269
+ Allows creating a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union.
270
+
271
+ Currently, when a union type of a primitive type is combined with literal types, TypeScript loses all information about the combined literals. Thus, when such type is used in an IDE with autocompletion, no suggestions are made for the declared literals.
272
+
273
+ This type is a workaround for [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729). It will be removed as soon as it's not needed anymore.
274
+
275
+ @example
276
+ ```
277
+ import type {LiteralUnion} from 'type-fest';
278
+
279
+ // Before
280
+
281
+ type Pet = 'dog' | 'cat' | string;
282
+
283
+ const pet: Pet = '';
284
+ // Start typing in your TypeScript-enabled IDE.
285
+ // You **will not** get auto-completion for `dog` and `cat` literals.
286
+
287
+ // After
288
+
289
+ type Pet2 = LiteralUnion<'dog' | 'cat', string>;
290
+
291
+ const pet: Pet2 = '';
292
+ // You **will** get auto-completion for `dog` and `cat` literals.
293
+ ```
294
+
295
+ @category Type
296
+ */
297
+ type LiteralUnion<
298
+ LiteralType,
299
+ BaseType extends Primitive,
300
+ > = LiteralType | (BaseType & Record<never, never>);
301
+
302
+ declare namespace PackageJson$1 {
303
+ /**
304
+ A person who has been involved in creating or maintaining the package.
305
+ */
306
+ export type Person =
307
+ | string
308
+ | {
309
+ name: string;
310
+ url?: string;
311
+ email?: string;
312
+ };
313
+
314
+ export type BugsLocation =
315
+ | string
316
+ | {
317
+ /**
318
+ The URL to the package's issue tracker.
319
+ */
320
+ url?: string;
321
+
322
+ /**
323
+ The email address to which issues should be reported.
324
+ */
325
+ email?: string;
326
+ };
327
+
328
+ export interface DirectoryLocations {
329
+ [directoryType: string]: unknown;
330
+
331
+ /**
332
+ Location for executable scripts. Sugar to generate entries in the `bin` property by walking the folder.
333
+ */
334
+ bin?: string;
335
+
336
+ /**
337
+ Location for Markdown files.
338
+ */
339
+ doc?: string;
340
+
341
+ /**
342
+ Location for example scripts.
343
+ */
344
+ example?: string;
345
+
346
+ /**
347
+ Location for the bulk of the library.
348
+ */
349
+ lib?: string;
350
+
351
+ /**
352
+ Location for man pages. Sugar to generate a `man` array by walking the folder.
353
+ */
354
+ man?: string;
355
+
356
+ /**
357
+ Location for test files.
358
+ */
359
+ test?: string;
360
+ }
361
+
362
+ export type Scripts = {
363
+ /**
364
+ Run **before** the package is published (Also run on local `npm install` without any arguments).
365
+ */
366
+ prepublish?: string;
367
+
368
+ /**
369
+ Run both **before** the package is packed and published, and on local `npm install` without any arguments. This is run **after** `prepublish`, but **before** `prepublishOnly`.
370
+ */
371
+ prepare?: string;
372
+
373
+ /**
374
+ Run **before** the package is prepared and packed, **only** on `npm publish`.
375
+ */
376
+ prepublishOnly?: string;
377
+
378
+ /**
379
+ Run **before** a tarball is packed (on `npm pack`, `npm publish`, and when installing git dependencies).
380
+ */
381
+ prepack?: string;
382
+
383
+ /**
384
+ Run **after** the tarball has been generated and moved to its final destination.
385
+ */
386
+ postpack?: string;
387
+
388
+ /**
389
+ Run **after** the package is published.
390
+ */
391
+ publish?: string;
392
+
393
+ /**
394
+ Run **after** the package is published.
395
+ */
396
+ postpublish?: string;
397
+
398
+ /**
399
+ Run **before** the package is installed.
400
+ */
401
+ preinstall?: string;
402
+
403
+ /**
404
+ Run **after** the package is installed.
405
+ */
406
+ install?: string;
407
+
408
+ /**
409
+ Run **after** the package is installed and after `install`.
410
+ */
411
+ postinstall?: string;
412
+
413
+ /**
414
+ Run **before** the package is uninstalled and before `uninstall`.
415
+ */
416
+ preuninstall?: string;
417
+
418
+ /**
419
+ Run **before** the package is uninstalled.
420
+ */
421
+ uninstall?: string;
422
+
423
+ /**
424
+ Run **after** the package is uninstalled.
425
+ */
426
+ postuninstall?: string;
427
+
428
+ /**
429
+ Run **before** bump the package version and before `version`.
430
+ */
431
+ preversion?: string;
432
+
433
+ /**
434
+ Run **before** bump the package version.
435
+ */
436
+ version?: string;
437
+
438
+ /**
439
+ Run **after** bump the package version.
440
+ */
441
+ postversion?: string;
442
+
443
+ /**
444
+ Run with the `npm test` command, before `test`.
445
+ */
446
+ pretest?: string;
447
+
448
+ /**
449
+ Run with the `npm test` command.
450
+ */
451
+ test?: string;
452
+
453
+ /**
454
+ Run with the `npm test` command, after `test`.
455
+ */
456
+ posttest?: string;
457
+
458
+ /**
459
+ Run with the `npm stop` command, before `stop`.
460
+ */
461
+ prestop?: string;
462
+
463
+ /**
464
+ Run with the `npm stop` command.
465
+ */
466
+ stop?: string;
467
+
468
+ /**
469
+ Run with the `npm stop` command, after `stop`.
470
+ */
471
+ poststop?: string;
472
+
473
+ /**
474
+ Run with the `npm start` command, before `start`.
475
+ */
476
+ prestart?: string;
477
+
478
+ /**
479
+ Run with the `npm start` command.
480
+ */
481
+ start?: string;
482
+
483
+ /**
484
+ Run with the `npm start` command, after `start`.
485
+ */
486
+ poststart?: string;
487
+
488
+ /**
489
+ Run with the `npm restart` command, before `restart`. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided.
490
+ */
491
+ prerestart?: string;
492
+
493
+ /**
494
+ Run with the `npm restart` command. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided.
495
+ */
496
+ restart?: string;
497
+
498
+ /**
499
+ Run with the `npm restart` command, after `restart`. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided.
500
+ */
501
+ postrestart?: string;
502
+ } & Partial<Record<string, string>>;
503
+
504
+ /**
505
+ Dependencies of the package. The version range is a string which has one or more space-separated descriptors. Dependencies can also be identified with a tarball or Git URL.
506
+ */
507
+ export type Dependency = Partial<Record<string, string>>;
508
+
509
+ /**
510
+ Conditions which provide a way to resolve a package entry point based on the environment.
511
+ */
512
+ export type ExportCondition = LiteralUnion<
513
+ | 'import'
514
+ | 'require'
515
+ | 'node'
516
+ | 'node-addons'
517
+ | 'deno'
518
+ | 'browser'
519
+ | 'electron'
520
+ | 'react-native'
521
+ | 'default',
522
+ string
523
+ >;
524
+
525
+ type ExportConditions = {[condition in ExportCondition]: Exports};
526
+
527
+ /**
528
+ Entry points of a module, optionally with conditions and subpath exports.
529
+ */
530
+ export type Exports =
531
+ | null
532
+ | string
533
+ | Array<string | ExportConditions>
534
+ | ExportConditions
535
+ | {[path: string]: Exports}; // eslint-disable-line @typescript-eslint/consistent-indexed-object-style
536
+
537
+ /**
538
+ Import map entries of a module, optionally with conditions.
539
+ */
540
+ export type Imports = { // eslint-disable-line @typescript-eslint/consistent-indexed-object-style
541
+ [key: string]: string | {[key in ExportCondition]: Exports};
542
+ };
543
+
544
+ export interface NonStandardEntryPoints {
545
+ /**
546
+ An ECMAScript module ID that is the primary entry point to the program.
547
+ */
548
+ module?: string;
549
+
550
+ /**
551
+ A module ID with untranspiled code that is the primary entry point to the program.
552
+ */
553
+ esnext?:
554
+ | string
555
+ | {
556
+ [moduleName: string]: string | undefined;
557
+ main?: string;
558
+ browser?: string;
559
+ };
560
+
561
+ /**
562
+ A hint to JavaScript bundlers or component tools when packaging modules for client side use.
563
+ */
564
+ browser?:
565
+ | string
566
+ | Partial<Record<string, string | false>>;
567
+
568
+ /**
569
+ Denote which files in your project are "pure" and therefore safe for Webpack to prune if unused.
570
+
571
+ [Read more.](https://webpack.js.org/guides/tree-shaking/)
572
+ */
573
+ sideEffects?: boolean | string[];
574
+ }
575
+
576
+ export interface TypeScriptConfiguration {
577
+ /**
578
+ Location of the bundled TypeScript declaration file.
579
+ */
580
+ types?: string;
581
+
582
+ /**
583
+ Version selection map of TypeScript.
584
+ */
585
+ typesVersions?: Partial<Record<string, Partial<Record<string, string[]>>>>;
586
+
587
+ /**
588
+ Location of the bundled TypeScript declaration file. Alias of `types`.
589
+ */
590
+ typings?: string;
591
+ }
592
+
593
+ /**
594
+ An alternative configuration for Yarn workspaces.
595
+ */
596
+ export interface WorkspaceConfig {
597
+ /**
598
+ An array of workspace pattern strings which contain the workspace packages.
599
+ */
600
+ packages?: WorkspacePattern[];
601
+
602
+ /**
603
+ Designed to solve the problem of packages which break when their `node_modules` are moved to the root workspace directory - a process known as hoisting. For these packages, both within your workspace, and also some that have been installed via `node_modules`, it is important to have a mechanism for preventing the default Yarn workspace behavior. By adding workspace pattern strings here, Yarn will resume non-workspace behavior for any package which matches the defined patterns.
604
+
605
+ [Read more](https://classic.yarnpkg.com/blog/2018/02/15/nohoist/)
606
+ */
607
+ nohoist?: WorkspacePattern[];
608
+ }
609
+
610
+ /**
611
+ A workspace pattern points to a directory or group of directories which contain packages that should be included in the workspace installation process.
612
+
613
+ The patterns are handled with [minimatch](https://github.com/isaacs/minimatch).
614
+
615
+ @example
616
+ `docs` → Include the docs directory and install its dependencies.
617
+ `packages/*` → Include all nested directories within the packages directory, like `packages/cli` and `packages/core`.
618
+ */
619
+ type WorkspacePattern = string;
620
+
621
+ export interface YarnConfiguration {
622
+ /**
623
+ Used to configure [Yarn workspaces](https://classic.yarnpkg.com/docs/workspaces/).
624
+
625
+ Workspaces allow you to manage multiple packages within the same repository in such a way that you only need to run `yarn install` once to install all of them in a single pass.
626
+
627
+ Please note that the top-level `private` property of `package.json` **must** be set to `true` in order to use workspaces.
628
+ */
629
+ workspaces?: WorkspacePattern[] | WorkspaceConfig;
630
+
631
+ /**
632
+ If your package only allows one version of a given dependency, and you’d like to enforce the same behavior as `yarn install --flat` on the command-line, set this to `true`.
633
+
634
+ Note that if your `package.json` contains `"flat": true` and other packages depend on yours (e.g. you are building a library rather than an app), those other packages will also need `"flat": true` in their `package.json` or be installed with `yarn install --flat` on the command-line.
635
+ */
636
+ flat?: boolean;
637
+
638
+ /**
639
+ Selective version resolutions. Allows the definition of custom package versions inside dependencies without manual edits in the `yarn.lock` file.
640
+ */
641
+ resolutions?: Dependency;
642
+ }
643
+
644
+ export interface JSPMConfiguration {
645
+ /**
646
+ JSPM configuration.
647
+ */
648
+ jspm?: PackageJson$1;
649
+ }
650
+
651
+ /**
652
+ Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). Containing standard npm properties.
653
+ */
654
+ export interface PackageJsonStandard {
655
+ /**
656
+ The name of the package.
657
+ */
658
+ name?: string;
659
+
660
+ /**
661
+ Package version, parseable by [`node-semver`](https://github.com/npm/node-semver).
662
+ */
663
+ version?: string;
664
+
665
+ /**
666
+ Package description, listed in `npm search`.
667
+ */
668
+ description?: string;
669
+
670
+ /**
671
+ Keywords associated with package, listed in `npm search`.
672
+ */
673
+ keywords?: string[];
674
+
675
+ /**
676
+ The URL to the package's homepage.
677
+ */
678
+ homepage?: LiteralUnion<'.', string>;
679
+
680
+ /**
681
+ The URL to the package's issue tracker and/or the email address to which issues should be reported.
682
+ */
683
+ bugs?: BugsLocation;
684
+
685
+ /**
686
+ The license for the package.
687
+ */
688
+ license?: string;
689
+
690
+ /**
691
+ The licenses for the package.
692
+ */
693
+ licenses?: Array<{
694
+ type?: string;
695
+ url?: string;
696
+ }>;
697
+
698
+ author?: Person;
699
+
700
+ /**
701
+ A list of people who contributed to the package.
702
+ */
703
+ contributors?: Person[];
704
+
705
+ /**
706
+ A list of people who maintain the package.
707
+ */
708
+ maintainers?: Person[];
709
+
710
+ /**
711
+ The files included in the package.
712
+ */
713
+ files?: string[];
714
+
715
+ /**
716
+ Resolution algorithm for importing ".js" files from the package's scope.
717
+
718
+ [Read more.](https://nodejs.org/api/esm.html#esm_package_json_type_field)
719
+ */
720
+ type?: 'module' | 'commonjs';
721
+
722
+ /**
723
+ The module ID that is the primary entry point to the program.
724
+ */
725
+ main?: string;
726
+
727
+ /**
728
+ Subpath exports to define entry points of the package.
729
+
730
+ [Read more.](https://nodejs.org/api/packages.html#subpath-exports)
731
+ */
732
+ exports?: Exports;
733
+
734
+ /**
735
+ Subpath imports to define internal package import maps that only apply to import specifiers from within the package itself.
736
+
737
+ [Read more.](https://nodejs.org/api/packages.html#subpath-imports)
738
+ */
739
+ imports?: Imports;
740
+
741
+ /**
742
+ The executable files that should be installed into the `PATH`.
743
+ */
744
+ bin?:
745
+ | string
746
+ | Partial<Record<string, string>>;
747
+
748
+ /**
749
+ Filenames to put in place for the `man` program to find.
750
+ */
751
+ man?: string | string[];
752
+
753
+ /**
754
+ Indicates the structure of the package.
755
+ */
756
+ directories?: DirectoryLocations;
757
+
758
+ /**
759
+ Location for the code repository.
760
+ */
761
+ repository?:
762
+ | string
763
+ | {
764
+ type: string;
765
+ url: string;
766
+
767
+ /**
768
+ Relative path to package.json if it is placed in non-root directory (for example if it is part of a monorepo).
769
+
770
+ [Read more.](https://github.com/npm/rfcs/blob/latest/implemented/0010-monorepo-subdirectory-declaration.md)
771
+ */
772
+ directory?: string;
773
+ };
774
+
775
+ /**
776
+ Script commands that are run at various times in the lifecycle of the package. The key is the lifecycle event, and the value is the command to run at that point.
777
+ */
778
+ scripts?: Scripts;
779
+
780
+ /**
781
+ Is used to set configuration parameters used in package scripts that persist across upgrades.
782
+ */
783
+ config?: Record<string, unknown>;
784
+
785
+ /**
786
+ The dependencies of the package.
787
+ */
788
+ dependencies?: Dependency;
789
+
790
+ /**
791
+ Additional tooling dependencies that are not required for the package to work. Usually test, build, or documentation tooling.
792
+ */
793
+ devDependencies?: Dependency;
794
+
795
+ /**
796
+ Dependencies that are skipped if they fail to install.
797
+ */
798
+ optionalDependencies?: Dependency;
799
+
800
+ /**
801
+ Dependencies that will usually be required by the package user directly or via another dependency.
802
+ */
803
+ peerDependencies?: Dependency;
804
+
805
+ /**
806
+ Indicate peer dependencies that are optional.
807
+ */
808
+ peerDependenciesMeta?: Partial<Record<string, {optional: true}>>;
809
+
810
+ /**
811
+ Package names that are bundled when the package is published.
812
+ */
813
+ bundledDependencies?: string[];
814
+
815
+ /**
816
+ Alias of `bundledDependencies`.
817
+ */
818
+ bundleDependencies?: string[];
819
+
820
+ /**
821
+ Engines that this package runs on.
822
+ */
823
+ engines?: {
824
+ [EngineName in 'npm' | 'node' | string]?: string;
825
+ };
826
+
827
+ /**
828
+ @deprecated
829
+ */
830
+ engineStrict?: boolean;
831
+
832
+ /**
833
+ Operating systems the module runs on.
834
+ */
835
+ os?: Array<LiteralUnion<
836
+ | 'aix'
837
+ | 'darwin'
838
+ | 'freebsd'
839
+ | 'linux'
840
+ | 'openbsd'
841
+ | 'sunos'
842
+ | 'win32'
843
+ | '!aix'
844
+ | '!darwin'
845
+ | '!freebsd'
846
+ | '!linux'
847
+ | '!openbsd'
848
+ | '!sunos'
849
+ | '!win32',
850
+ string
851
+ >>;
852
+
853
+ /**
854
+ CPU architectures the module runs on.
855
+ */
856
+ cpu?: Array<LiteralUnion<
857
+ | 'arm'
858
+ | 'arm64'
859
+ | 'ia32'
860
+ | 'mips'
861
+ | 'mipsel'
862
+ | 'ppc'
863
+ | 'ppc64'
864
+ | 's390'
865
+ | 's390x'
866
+ | 'x32'
867
+ | 'x64'
868
+ | '!arm'
869
+ | '!arm64'
870
+ | '!ia32'
871
+ | '!mips'
872
+ | '!mipsel'
873
+ | '!ppc'
874
+ | '!ppc64'
875
+ | '!s390'
876
+ | '!s390x'
877
+ | '!x32'
878
+ | '!x64',
879
+ string
880
+ >>;
881
+
882
+ /**
883
+ If set to `true`, a warning will be shown if package is installed locally. Useful if the package is primarily a command-line application that should be installed globally.
884
+
885
+ @deprecated
886
+ */
887
+ preferGlobal?: boolean;
888
+
889
+ /**
890
+ If set to `true`, then npm will refuse to publish it.
891
+ */
892
+ private?: boolean;
893
+
894
+ /**
895
+ A set of config values that will be used at publish-time. It's especially handy to set the tag, registry or access, to ensure that a given package is not tagged with 'latest', published to the global public registry or that a scoped module is private by default.
896
+ */
897
+ publishConfig?: PublishConfig;
898
+
899
+ /**
900
+ Describes and notifies consumers of a package's monetary support information.
901
+
902
+ [Read more.](https://github.com/npm/rfcs/blob/latest/accepted/0017-add-funding-support.md)
903
+ */
904
+ funding?: string | {
905
+ /**
906
+ The type of funding.
907
+ */
908
+ type?: LiteralUnion<
909
+ | 'github'
910
+ | 'opencollective'
911
+ | 'patreon'
912
+ | 'individual'
913
+ | 'foundation'
914
+ | 'corporation',
915
+ string
916
+ >;
917
+
918
+ /**
919
+ The URL to the funding page.
920
+ */
921
+ url: string;
922
+ };
923
+ }
924
+
925
+ export interface PublishConfig {
926
+ /**
927
+ Additional, less common properties from the [npm docs on `publishConfig`](https://docs.npmjs.com/cli/v7/configuring-npm/package-json#publishconfig).
928
+ */
929
+ [additionalProperties: string]: unknown;
930
+
931
+ /**
932
+ When publishing scoped packages, the access level defaults to restricted. If you want your scoped package to be publicly viewable (and installable) set `--access=public`. The only valid values for access are public and restricted. Unscoped packages always have an access level of public.
933
+ */
934
+ access?: 'public' | 'restricted';
935
+
936
+ /**
937
+ The base URL of the npm registry.
938
+
939
+ Default: `'https://registry.npmjs.org/'`
940
+ */
941
+ registry?: string;
942
+
943
+ /**
944
+ The tag to publish the package under.
945
+
946
+ Default: `'latest'`
947
+ */
948
+ tag?: string;
949
+ }
950
+ }
951
+
952
+ /**
953
+ Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). Also includes types for fields used by other popular projects, like TypeScript and Yarn.
954
+
955
+ @category File
956
+ */
957
+ type PackageJson$1 =
958
+ PackageJson$1.PackageJsonStandard &
959
+ PackageJson$1.NonStandardEntryPoints &
960
+ PackageJson$1.TypeScriptConfiguration &
961
+ PackageJson$1.YarnConfiguration &
962
+ PackageJson$1.JSPMConfiguration;
963
+
964
+ type ExportName = string;
965
+ type MetaId = string;
966
+ interface StoriesSpecifier {
967
+ /** When auto-titling, what to prefix all generated titles with (default: '') */
968
+ titlePrefix?: string;
969
+ /** Where to start looking for story files */
970
+ directory: string;
971
+ /**
972
+ * What does the filename of a story file look like? (a glob, relative to directory, no leading
973
+ * `./`) If unset, we use `** / *.@(mdx|stories.@(mdx|js|jsx|mjs|ts|tsx))` (no spaces)
974
+ */
975
+ files?: string;
976
+ }
977
+ type StoriesEntry = string | StoriesSpecifier;
978
+ type NormalizedStoriesSpecifier = Required<StoriesSpecifier> & {
979
+ importPathMatcher: RegExp;
980
+ };
981
+ interface IndexerOptions {
982
+ makeTitle: (userTitle?: string) => string;
983
+ }
984
+ interface IndexedStory {
985
+ id: string;
986
+ name: string;
987
+ tags?: Tag$1[];
988
+ parameters?: Parameters;
989
+ }
990
+ interface IndexedCSFFile {
991
+ meta: {
992
+ id?: string;
993
+ title?: string;
994
+ tags?: Tag$1[];
995
+ };
996
+ stories: IndexedStory[];
997
+ }
998
+ /**
999
+ * FIXME: This is a temporary type to allow us to deprecate the old indexer API. We should remove
1000
+ * this type and the deprecated indexer API in 8.0.
1001
+ */
1002
+ type BaseIndexer = {
1003
+ /** A regular expression that should match all files to be handled by this indexer */
1004
+ test: RegExp;
1005
+ };
1006
+ /**
1007
+ * An indexer describes which filenames it handles, and how to index each individual file - turning
1008
+ * it into an entry in the index.
1009
+ */
1010
+ type Indexer = BaseIndexer & {
1011
+ /**
1012
+ * Indexes a file containing stories or docs.
1013
+ *
1014
+ * @param fileName The name of the file to index.
1015
+ * @param options {@link IndexerOptions} for indexing the file.
1016
+ * @returns A promise that resolves to an array of {@link IndexInput} objects.
1017
+ */
1018
+ createIndex: (fileName: string, options: IndexerOptions) => Promise<IndexInput[]>;
1019
+ };
1020
+ interface BaseIndexEntry {
1021
+ id: StoryId;
1022
+ name: StoryName;
1023
+ title: ComponentTitle;
1024
+ tags?: Tag$1[];
1025
+ importPath: Path;
1026
+ }
1027
+ type StoryIndexEntry = BaseIndexEntry & {
1028
+ type: 'story';
1029
+ };
1030
+ type DocsIndexEntry = BaseIndexEntry & {
1031
+ storiesImports: Path[];
1032
+ type: 'docs';
1033
+ };
1034
+ type IndexEntry = StoryIndexEntry | DocsIndexEntry;
1035
+ interface IndexInputStats {
1036
+ loaders?: boolean;
1037
+ play?: boolean;
1038
+ render?: boolean;
1039
+ storyFn?: boolean;
1040
+ mount?: boolean;
1041
+ beforeEach?: boolean;
1042
+ moduleMock?: boolean;
1043
+ globals?: boolean;
1044
+ factory?: boolean;
1045
+ tags?: boolean;
1046
+ }
1047
+ /** The base input for indexing a story or docs entry. */
1048
+ type BaseIndexInput = {
1049
+ /** The file to import from e.g. the story file. */
1050
+ importPath: Path;
1051
+ /** The raw path/package of the file that provides meta.component, if one exists */
1052
+ rawComponentPath?: Path;
1053
+ /** The name of the export to import. */
1054
+ exportName: ExportName;
1055
+ /** The name of the entry, auto-generated from {@link exportName} if unspecified. */
1056
+ name?: StoryName;
1057
+ /** The location in the sidebar, auto-generated from {@link importPath} if unspecified. */
1058
+ title?: ComponentTitle;
1059
+ /**
1060
+ * The custom id optionally set at `meta.id` if it needs to differ from the id generated via
1061
+ * {@link title}. If unspecified, the meta id will be auto-generated from {@link title}. If
1062
+ * specified, the meta in the CSF file _must_ have a matching id set at `meta.id`, to be correctly
1063
+ * matched.
1064
+ */
1065
+ metaId?: MetaId;
1066
+ /** Tags for filtering entries in Storybook and its tools. */
1067
+ tags?: Tag$1[];
1068
+ /**
1069
+ * The id of the entry, auto-generated from {@link title}/{@link metaId} and {@link exportName} if
1070
+ * unspecified. If specified, the story in the CSF file _must_ have a matching id set at
1071
+ * `parameters.__id`, to be correctly matched. Only use this if you need to override the
1072
+ * auto-generated id.
1073
+ */
1074
+ __id?: StoryId;
1075
+ /** Stats about language feature usage that the indexer can optionally report */
1076
+ __stats?: IndexInputStats;
1077
+ };
1078
+ /** The input for indexing a story entry. */
1079
+ type StoryIndexInput = BaseIndexInput & {
1080
+ type: 'story';
1081
+ };
1082
+ /** The input for indexing a docs entry. */
1083
+ type DocsIndexInput = BaseIndexInput & {
1084
+ type: 'docs';
1085
+ /** Paths to story files that must be pre-loaded for this docs entry. */
1086
+ storiesImports?: Path[];
1087
+ };
1088
+ type IndexInput = StoryIndexInput | DocsIndexInput;
1089
+ interface V3CompatIndexEntry extends Omit<StoryIndexEntry, 'type' | 'tags'> {
1090
+ kind: ComponentTitle;
1091
+ story: StoryName;
1092
+ parameters: Parameters;
1093
+ }
1094
+ interface StoryIndexV2 {
1095
+ v: number;
1096
+ stories: Record<StoryId, Omit<V3CompatIndexEntry, 'title' | 'name' | 'importPath'> & {
1097
+ name?: StoryName;
1098
+ }>;
1099
+ }
1100
+ interface StoryIndexV3 {
1101
+ v: number;
1102
+ stories: Record<StoryId, V3CompatIndexEntry>;
1103
+ }
1104
+ interface StoryIndex {
1105
+ v: number;
1106
+ entries: Record<StoryId, IndexEntry>;
1107
+ }
1108
+
1109
+ /** ⚠️ This file contains internal WIP types they MUST NOT be exported outside this package for now! */
1110
+ type BuilderName = 'webpack5' | '@storybook/builder-webpack5' | string;
1111
+ type RendererName = string;
1112
+ interface ServerChannel {
1113
+ emit(type: string, args?: any): void;
1114
+ }
1115
+ interface CoreConfig {
1116
+ builder?: BuilderName | {
1117
+ name: BuilderName;
1118
+ options?: Record<string, any>;
1119
+ };
1120
+ renderer?: RendererName;
1121
+ disableWebpackDefaults?: boolean;
1122
+ channelOptions?: Partial<Options$1>;
1123
+ /** Disables the generation of project.json, a file containing Storybook metadata */
1124
+ disableProjectJson?: boolean;
1125
+ /**
1126
+ * Disables Storybook telemetry
1127
+ *
1128
+ * @see https://storybook.js.org/telemetry
1129
+ */
1130
+ disableTelemetry?: boolean;
1131
+ /** Disables notifications for Storybook updates. */
1132
+ disableWhatsNewNotifications?: boolean;
1133
+ /**
1134
+ * Enable crash reports to be sent to Storybook telemetry
1135
+ *
1136
+ * @see https://storybook.js.org/telemetry
1137
+ */
1138
+ enableCrashReports?: boolean;
1139
+ /**
1140
+ * Enable CORS headings to run document in a "secure context" see:
1141
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer#security_requirements
1142
+ * This enables these headers in development-mode: Cross-Origin-Opener-Policy: same-origin
1143
+ *
1144
+ * ```text
1145
+ * Cross-Origin-Embedder-Policy: require-corp
1146
+ * ```
1147
+ */
1148
+ crossOriginIsolated?: boolean;
1149
+ }
1150
+ interface DirectoryMapping {
1151
+ from: string;
1152
+ to: string;
1153
+ }
1154
+ interface Presets {
1155
+ apply(extension: 'typescript', config: TypescriptOptions, args?: Options): Promise<TypescriptOptions>;
1156
+ apply(extension: 'framework', config?: {}, args?: any): Promise<Preset>;
1157
+ apply(extension: 'babel', config?: {}, args?: any): Promise<any>;
1158
+ apply(extension: 'swc', config?: {}, args?: any): Promise<any>;
1159
+ apply(extension: 'entries', config?: [], args?: any): Promise<unknown>;
1160
+ apply(extension: 'env', config?: {}, args?: any): Promise<any>;
1161
+ apply(extension: 'stories', config?: [], args?: any): Promise<StoriesEntry[]>;
1162
+ apply(extension: 'managerEntries', config: [], args?: any): Promise<string[]>;
1163
+ apply(extension: 'refs', config?: [], args?: any): Promise<StorybookConfigRaw['refs']>;
1164
+ apply(extension: 'core', config?: StorybookConfigRaw['core'], args?: any): Promise<NonNullable<StorybookConfigRaw['core']>>;
1165
+ apply(extension: 'docs', config?: StorybookConfigRaw['docs'], args?: any): Promise<NonNullable<StorybookConfigRaw['docs']>>;
1166
+ apply(extension: 'features', config?: StorybookConfigRaw['features'], args?: any): Promise<NonNullable<StorybookConfigRaw['features']>>;
1167
+ apply(extension: 'typescript', config?: StorybookConfigRaw['typescript'], args?: any): Promise<NonNullable<StorybookConfigRaw['typescript']>>;
1168
+ apply(extension: 'build', config?: StorybookConfigRaw['build'], args?: any): Promise<NonNullable<StorybookConfigRaw['build']>>;
1169
+ apply(extension: 'staticDirs', config?: StorybookConfigRaw['staticDirs'], args?: any): Promise<StorybookConfigRaw['staticDirs']>;
1170
+ apply<T>(extension: string, config?: T, args?: unknown): Promise<T>;
1171
+ }
1172
+ interface LoadedPreset {
1173
+ name: string;
1174
+ preset: any;
1175
+ options: any;
1176
+ }
1177
+ type PresetConfig = string | {
1178
+ name: string;
1179
+ options?: unknown;
1180
+ };
1181
+ interface Ref {
1182
+ id: string;
1183
+ url: string;
1184
+ title: string;
1185
+ version: string;
1186
+ type?: string;
1187
+ disable?: boolean;
1188
+ }
1189
+ interface VersionCheck {
1190
+ success: boolean;
1191
+ cached: boolean;
1192
+ data?: any;
1193
+ error?: any;
1194
+ time: number;
1195
+ }
1196
+ interface Stats {
1197
+ toJson: () => any;
1198
+ }
1199
+ interface BuilderResult {
1200
+ totalTime?: ReturnType<typeof process.hrtime>;
1201
+ stats?: Stats;
1202
+ }
1203
+ type PackageJson = PackageJson$1 & Record<string, any>;
1204
+ interface LoadOptions {
1205
+ packageJson?: PackageJson;
1206
+ outputDir?: string;
1207
+ configDir?: string;
1208
+ cacheKey?: string;
1209
+ ignorePreview?: boolean;
1210
+ extendServer?: (server: Server) => void;
1211
+ }
1212
+ interface CLIBaseOptions {
1213
+ disableTelemetry?: boolean;
1214
+ enableCrashReports?: boolean;
1215
+ configDir?: string;
1216
+ loglevel?: string;
1217
+ quiet?: boolean;
1218
+ }
1219
+ interface CLIOptions extends CLIBaseOptions {
1220
+ port?: number;
1221
+ ignorePreview?: boolean;
1222
+ previewUrl?: string;
1223
+ forceBuildPreview?: boolean;
1224
+ host?: string;
1225
+ initialPath?: string;
1226
+ exactPort?: boolean;
1227
+ https?: boolean;
1228
+ sslCa?: string[];
1229
+ sslCert?: string;
1230
+ sslKey?: string;
1231
+ smokeTest?: boolean;
1232
+ managerCache?: boolean;
1233
+ open?: boolean;
1234
+ ci?: boolean;
1235
+ versionUpdates?: boolean;
1236
+ docs?: boolean;
1237
+ test?: boolean;
1238
+ debugWebpack?: boolean;
1239
+ webpackStatsJson?: string | boolean;
1240
+ statsJson?: string | boolean;
1241
+ outputDir?: string;
1242
+ }
1243
+ interface BuilderOptions {
1244
+ configType?: 'DEVELOPMENT' | 'PRODUCTION';
1245
+ ignorePreview?: boolean;
1246
+ cache?: FileSystemCache;
1247
+ configDir: string;
1248
+ docsMode?: boolean;
1249
+ features?: StorybookConfigRaw['features'];
1250
+ versionCheck?: VersionCheck;
1251
+ disableWebpackDefaults?: boolean;
1252
+ serverChannelUrl?: string;
1253
+ }
1254
+ interface StorybookConfigOptions {
1255
+ presets: Presets;
1256
+ presetsList?: LoadedPreset[];
1257
+ }
1258
+ type Options = LoadOptions & StorybookConfigOptions & CLIOptions & BuilderOptions & {
1259
+ build?: TestBuildConfig;
1260
+ };
1261
+ type Middleware<T extends IncomingMessage = IncomingMessage> = (req: T & IncomingMessage, res: ServerResponse, next: (err?: string | Error) => Promise<void> | void) => Promise<void> | void;
1262
+ interface ServerApp<T extends IncomingMessage = IncomingMessage> {
1263
+ server: Server$1;
1264
+ use(pattern: RegExp | string, ...handlers: Middleware<T>[]): this;
1265
+ use(...handlers: Middleware<T>[]): this;
1266
+ get(pattern: RegExp | string, ...handlers: Middleware<T>[]): this;
1267
+ post(pattern: RegExp | string, ...handlers: Middleware<T>[]): this;
1268
+ put(pattern: RegExp | string, ...handlers: Middleware<T>[]): this;
1269
+ patch(pattern: RegExp | string, ...handlers: Middleware<T>[]): this;
1270
+ delete(pattern: RegExp | string, ...handlers: Middleware<T>[]): this;
1271
+ head(pattern: RegExp | string, ...handlers: Middleware<T>[]): this;
1272
+ options(pattern: RegExp | string, ...handlers: Middleware<T>[]): this;
1273
+ connect(pattern: RegExp | string, ...handlers: Middleware<T>[]): this;
1274
+ trace(pattern: RegExp | string, ...handlers: Middleware<T>[]): this;
1275
+ }
1276
+ interface Builder<Config, BuilderStats extends Stats = Stats> {
1277
+ getConfig: (options: Options) => Promise<Config>;
1278
+ start: (args: {
1279
+ options: Options;
1280
+ startTime: ReturnType<typeof process.hrtime>;
1281
+ router: ServerApp;
1282
+ server: Server;
1283
+ channel: ServerChannel;
1284
+ }) => Promise<void | {
1285
+ stats?: BuilderStats;
1286
+ totalTime: ReturnType<typeof process.hrtime>;
1287
+ bail: (e?: Error) => Promise<void>;
1288
+ }>;
1289
+ build: (arg: {
1290
+ options: Options;
1291
+ startTime: ReturnType<typeof process.hrtime>;
1292
+ }) => Promise<void | BuilderStats>;
1293
+ bail: (e?: Error) => Promise<void>;
1294
+ corePresets?: string[];
1295
+ overridePresets?: string[];
1296
+ }
1297
+ /** Options for TypeScript usage within Storybook. */
1298
+ interface TypescriptOptions {
1299
+ /**
1300
+ * Enables type checking within Storybook.
1301
+ *
1302
+ * @default `false`
1303
+ */
1304
+ check: boolean;
1305
+ /**
1306
+ * Disable parsing TypeScript files through compiler.
1307
+ *
1308
+ * @default `false`
1309
+ */
1310
+ skipCompiler: boolean;
1311
+ }
1312
+ type Preset = string | {
1313
+ name: string;
1314
+ options?: any;
1315
+ };
1316
+ /** An additional script that gets injected into the preview or the manager, */
1317
+ type Entry = string;
1318
+ type CoreCommon_StorybookRefs = Record<string, {
1319
+ title: string;
1320
+ url: string;
1321
+ } | {
1322
+ disable: boolean;
1323
+ expanded?: boolean;
1324
+ }>;
1325
+ type DocsOptions = {
1326
+ /** What should we call the generated docs entries? */
1327
+ defaultName?: string;
1328
+ /**
1329
+ * Should we generate a docs entry per CSF file? Set to 'tag' (the default) to generate an entry
1330
+ * for every CSF file with the 'autodocs' tag.
1331
+ *
1332
+ * @deprecated Use `tags: ['autodocs']` in `.storybook/preview.js` instead
1333
+ */
1334
+ autodocs?: boolean | 'tag';
1335
+ /** Only show doc entries in the side bar (usually set with the `--docs` CLI flag) */
1336
+ docsMode?: boolean;
1337
+ };
1338
+ interface TestBuildFlags {
1339
+ /**
1340
+ * The package @storybook/blocks will be excluded from the bundle, even when imported in e.g. the
1341
+ * preview.
1342
+ */
1343
+ disableBlocks?: boolean;
1344
+ /** Disable specific addons */
1345
+ disabledAddons?: string[];
1346
+ /** Filter out .mdx stories entries */
1347
+ disableMDXEntries?: boolean;
1348
+ /** Override autodocs to be disabled */
1349
+ disableAutoDocs?: boolean;
1350
+ /** Override docgen to be disabled. */
1351
+ disableDocgen?: boolean;
1352
+ /** Override sourcemaps generation to be disabled. */
1353
+ disableSourcemaps?: boolean;
1354
+ /** Override tree-shaking (dead code elimination) to be disabled. */
1355
+ disableTreeShaking?: boolean;
1356
+ /** Minify with ESBuild when using webpack. */
1357
+ esbuildMinify?: boolean;
1358
+ }
1359
+ interface TestBuildConfig {
1360
+ test?: TestBuildFlags;
1361
+ }
1362
+ type Tag = string;
1363
+ interface TagOptions {
1364
+ excludeFromSidebar: boolean;
1365
+ excludeFromDocsStories: boolean;
1366
+ }
1367
+ type TagsOptions = Record<Tag, Partial<TagOptions>>;
1368
+ /**
1369
+ * The interface for Storybook configuration used internally in presets The difference is that these
1370
+ * values are the raw values, AKA, not wrapped with `PresetValue<>`
1371
+ */
1372
+ interface StorybookConfigRaw {
1373
+ /**
1374
+ * Sets the addons you want to use with Storybook.
1375
+ *
1376
+ * @example
1377
+ *
1378
+ * ```ts
1379
+ * addons = ['@storybook/addon-essentials'];
1380
+ * addons = [{ name: '@storybook/addon-essentials', options: { backgrounds: false } }];
1381
+ * ```
1382
+ */
1383
+ addons?: Preset[];
1384
+ core?: CoreConfig;
1385
+ staticDirs?: (DirectoryMapping | string)[];
1386
+ logLevel?: string;
1387
+ features?: {
1388
+ /** Filter args with a "target" on the type from the render function (EXPERIMENTAL) */
1389
+ argTypeTargetsV7?: boolean;
1390
+ /** Apply decorators from preview.js before decorators from addons or frameworks */
1391
+ legacyDecoratorFileOrder?: boolean;
1392
+ /**
1393
+ * Disallow implicit actions during rendering. This will be the default in Storybook 8.
1394
+ *
1395
+ * This will make sure that your story renders the same no matter if docgen is enabled or not.
1396
+ */
1397
+ disallowImplicitActionsInRenderV8?: boolean;
1398
+ /** Enable asynchronous component rendering in React renderer */
1399
+ experimentalRSC?: boolean;
1400
+ /** Use globals & globalTypes for configuring the viewport addon */
1401
+ viewportStoryGlobals?: boolean;
1402
+ /** Use globals & globalTypes for configuring the backgrounds addon */
1403
+ backgroundsStoryGlobals?: boolean;
1404
+ /** Set NODE_ENV to development in built Storybooks for better testability and debuggability */
1405
+ developmentModeForBuild?: boolean;
1406
+ };
1407
+ build?: TestBuildConfig;
1408
+ stories: StoriesEntry[];
1409
+ framework?: Preset;
1410
+ typescript?: Partial<TypescriptOptions>;
1411
+ refs?: CoreCommon_StorybookRefs;
1412
+ babel?: any;
1413
+ swc?: any;
1414
+ env?: Record<string, string>;
1415
+ babelDefault?: any;
1416
+ previewAnnotations?: Entry[];
1417
+ experimental_indexers?: Indexer[];
1418
+ docs?: DocsOptions;
1419
+ previewHead?: string;
1420
+ previewBody?: string;
1421
+ previewMainTemplate?: string;
1422
+ managerHead?: string;
1423
+ tags?: TagsOptions;
1424
+ }
1425
+ /**
1426
+ * The interface for Storybook configuration in `main.ts` files. This interface is public All values
1427
+ * should be wrapped with `PresetValue<>`, though there are a few exceptions: `addons`, `framework`
1428
+ */
1429
+ interface StorybookConfig {
1430
+ /**
1431
+ * Sets the addons you want to use with Storybook.
1432
+ *
1433
+ * @example
1434
+ *
1435
+ * ```
1436
+ * addons = ['@storybook/addon-essentials'];
1437
+ * addons = [{ name: '@storybook/addon-essentials', options: { backgrounds: false } }];
1438
+ * ```
1439
+ */
1440
+ addons?: StorybookConfigRaw['addons'];
1441
+ core?: PresetValue<StorybookConfigRaw['core']>;
1442
+ /**
1443
+ * Sets a list of directories of static files to be loaded by Storybook server
1444
+ *
1445
+ * @example
1446
+ *
1447
+ * ```ts
1448
+ * staticDirs = ['./public'];
1449
+ * staticDirs = [{ from: './public', to: '/assets' }];
1450
+ * ```
1451
+ */
1452
+ staticDirs?: PresetValue<StorybookConfigRaw['staticDirs']>;
1453
+ logLevel?: PresetValue<StorybookConfigRaw['logLevel']>;
1454
+ features?: PresetValue<StorybookConfigRaw['features']>;
1455
+ build?: PresetValue<StorybookConfigRaw['build']>;
1456
+ /**
1457
+ * Tells Storybook where to find stories.
1458
+ *
1459
+ * @example
1460
+ *
1461
+ * ```ts
1462
+ * stories = ['./src/*.stories.@(j|t)sx?'];
1463
+ * stories = async () => [...(await myCustomStoriesEntryBuilderFunc())];
1464
+ * ```
1465
+ */
1466
+ stories: PresetValue<StorybookConfigRaw['stories']>;
1467
+ /** Framework, e.g. '@storybook/react-vite', required in v7 */
1468
+ framework?: StorybookConfigRaw['framework'];
1469
+ /** Controls how Storybook handles TypeScript files. */
1470
+ typescript?: PresetValue<StorybookConfigRaw['typescript']>;
1471
+ /** References external Storybooks */
1472
+ refs?: PresetValue<StorybookConfigRaw['refs']>;
1473
+ /** Modify or return babel config. */
1474
+ babel?: PresetValue<StorybookConfigRaw['babel']>;
1475
+ /** Modify or return swc config. */
1476
+ swc?: PresetValue<StorybookConfigRaw['swc']>;
1477
+ /** Modify or return env config. */
1478
+ env?: PresetValue<StorybookConfigRaw['env']>;
1479
+ /** Modify or return babel config. */
1480
+ babelDefault?: PresetValue<StorybookConfigRaw['babelDefault']>;
1481
+ /** Add additional scripts to run in the preview a la `.storybook/preview.js` */
1482
+ previewAnnotations?: PresetValue<StorybookConfigRaw['previewAnnotations']>;
1483
+ /** Process CSF files for the story index. */
1484
+ experimental_indexers?: PresetValue<StorybookConfigRaw['experimental_indexers']>;
1485
+ /** Docs related features in index generation */
1486
+ docs?: PresetValue<StorybookConfigRaw['docs']>;
1487
+ /**
1488
+ * Programmatically modify the preview head/body HTML. The previewHead and previewBody functions
1489
+ * accept a string, which is the existing head/body, and return a modified string.
1490
+ */
1491
+ previewHead?: PresetValue<StorybookConfigRaw['previewHead']>;
1492
+ previewBody?: PresetValue<StorybookConfigRaw['previewBody']>;
1493
+ /**
1494
+ * Programmatically override the preview's main page template. This should return a reference to a
1495
+ * file containing an `.ejs` template that will be interpolated with environment variables.
1496
+ *
1497
+ * @example
1498
+ *
1499
+ * ```ts
1500
+ * previewMainTemplate = '.storybook/index.ejs';
1501
+ * ```
1502
+ */
1503
+ previewMainTemplate?: PresetValue<StorybookConfigRaw['previewMainTemplate']>;
1504
+ /**
1505
+ * Programmatically modify the preview head/body HTML. The managerHead function accept a string,
1506
+ * which is the existing head content, and return a modified string.
1507
+ */
1508
+ managerHead?: PresetValue<StorybookConfigRaw['managerHead']>;
1509
+ /** Configure non-standard tag behaviors */
1510
+ tags?: PresetValue<StorybookConfigRaw['tags']>;
1511
+ }
1512
+ type PresetValue<T> = T | ((config: T, options: Options) => T | Promise<T>);
1513
+ type PresetProperty<K, TStorybookConfig = StorybookConfigRaw> = TStorybookConfig[K extends keyof TStorybookConfig ? K : never] | PresetPropertyFn<K, TStorybookConfig>;
1514
+ 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]>;
1515
+ interface CoreCommon_ResolvedAddonPreset {
1516
+ type: 'presets';
1517
+ name: string;
1518
+ }
1519
+ type PreviewAnnotation = string | {
1520
+ bare: string;
1521
+ absolute: string;
1522
+ };
1523
+ interface CoreCommon_ResolvedAddonVirtual {
1524
+ type: 'virtual';
1525
+ name: string;
1526
+ managerEntries?: string[];
1527
+ previewAnnotations?: PreviewAnnotation[];
1528
+ presets?: (string | {
1529
+ name: string;
1530
+ options?: any;
1531
+ })[];
1532
+ }
1533
+ type CoreCommon_OptionsEntry = {
1534
+ name: string;
1535
+ };
1536
+ type CoreCommon_AddonEntry = string | CoreCommon_OptionsEntry;
1537
+ type CoreCommon_AddonInfo = {
1538
+ name: string;
1539
+ inEssentials: boolean;
1540
+ };
1541
+ interface CoreCommon_StorybookInfo {
1542
+ version: string;
1543
+ framework: string;
1544
+ frameworkPackage: string;
1545
+ renderer: string;
1546
+ rendererPackage: string;
1547
+ configDir?: string;
1548
+ mainConfig?: string;
1549
+ previewConfig?: string;
1550
+ managerConfig?: string;
1551
+ }
1552
+ /**
1553
+ * Given a generic string type, returns that type but ensures that a string in general is compatible
1554
+ * with it. We use this construct to ensure that IDEs can provide better autocompletion for string
1555
+ * types. This is, for example, needed for main config fields, where we want to ensure that the user
1556
+ * can provide a custom string, but also a string that is compatible with the type.
1557
+ *
1558
+ * @example
1559
+ *
1560
+ * ```ts
1561
+ * type Framework = CompatibleString<'@storybook/nextjs'>;
1562
+ * const framework: Framework = '@storybook/nextjs'; // valid and will be autocompleted const framework: Framework =
1563
+ * path.dirname(require.resolve(path.join('@storybook/nextjs', 'package.json'))); // valid
1564
+ * ```
1565
+ */
1566
+ type CompatibleString<T extends string> = T | (string & {});
1567
+
1568
+ interface API_BaseEntry {
1569
+ id: StoryId;
1570
+ depth: number;
1571
+ name: string;
1572
+ tags: Tag$1[];
1573
+ refId?: string;
1574
+ renderLabel?: (item: API_BaseEntry, api: any) => any;
1575
+ }
1576
+ interface API_RootEntry extends API_BaseEntry {
1577
+ type: 'root';
1578
+ startCollapsed?: boolean;
1579
+ children: StoryId[];
1580
+ }
1581
+ interface API_GroupEntry extends API_BaseEntry {
1582
+ type: 'group';
1583
+ parent?: StoryId;
1584
+ children: StoryId[];
1585
+ }
1586
+ interface API_ComponentEntry extends API_BaseEntry {
1587
+ type: 'component';
1588
+ parent?: StoryId;
1589
+ children: StoryId[];
1590
+ }
1591
+ interface API_DocsEntry extends API_BaseEntry {
1592
+ type: 'docs';
1593
+ parent: StoryId;
1594
+ title: ComponentTitle;
1595
+ importPath: Path;
1596
+ prepared: boolean;
1597
+ parameters?: {
1598
+ [parameterName: string]: any;
1599
+ };
1600
+ }
1601
+ interface API_StoryEntry extends API_BaseEntry {
1602
+ type: 'story';
1603
+ parent: StoryId;
1604
+ title: ComponentTitle;
1605
+ importPath: Path;
1606
+ prepared: boolean;
1607
+ parameters?: {
1608
+ [parameterName: string]: any;
1609
+ };
1610
+ args?: Args;
1611
+ argTypes?: ArgTypes;
1612
+ initialArgs?: Args;
1613
+ }
1614
+ type API_LeafEntry = API_DocsEntry | API_StoryEntry;
1615
+ type API_HashEntry = API_RootEntry | API_GroupEntry | API_ComponentEntry | API_DocsEntry | API_StoryEntry;
1616
+ /**
1617
+ * The `IndexHash` is our manager-side representation of the `StoryIndex`. We create entries in the
1618
+ * hash not only for each story or docs entry, but also for each "group" of the component (split on
1619
+ * '/'), as that's how things are manipulated in the manager (i.e. in the sidebar)
1620
+ */
1621
+ interface API_IndexHash {
1622
+ [id: string]: API_HashEntry;
1623
+ }
1624
+ type API_PreparedIndexEntry = IndexEntry & {
1625
+ parameters?: Parameters;
1626
+ argTypes?: ArgTypes;
1627
+ args?: Args;
1628
+ initialArgs?: Args;
1629
+ };
1630
+ interface API_PreparedStoryIndex {
1631
+ v: number;
1632
+ entries: Record<StoryId, API_PreparedIndexEntry>;
1633
+ }
1634
+ type API_OptionsData = {
1635
+ docsOptions: DocsOptions;
1636
+ };
1637
+ interface API_ReleaseNotes {
1638
+ success?: boolean;
1639
+ currentVersion?: string;
1640
+ showOnFirstLaunch?: boolean;
1641
+ }
1642
+ interface API_Settings {
1643
+ lastTrackedStoryId: string;
1644
+ }
1645
+ interface API_Version {
1646
+ version: string;
1647
+ info?: {
1648
+ plain: string;
1649
+ };
1650
+ [key: string]: any;
1651
+ }
1652
+ interface API_UnknownEntries {
1653
+ [key: string]: {
1654
+ [key: string]: any;
1655
+ };
1656
+ }
1657
+ interface API_Versions$1 {
1658
+ latest?: API_Version;
1659
+ next?: API_Version;
1660
+ current?: API_Version;
1661
+ }
1662
+ type API_StatusValue = 'pending' | 'success' | 'error' | 'warn' | 'unknown';
1663
+ interface API_StatusObject {
1664
+ status: API_StatusValue;
1665
+ title: string;
1666
+ description: string;
1667
+ data?: any;
1668
+ onClick?: () => void;
1669
+ sidebarContextMenu?: boolean;
1670
+ }
1671
+ type API_StatusState = Record<StoryId, Record<string, API_StatusObject>>;
1672
+ type API_StatusUpdate = Record<StoryId, API_StatusObject | null>;
1673
+ type API_FilterFunction = (item: API_PreparedIndexEntry & {
1674
+ status: Record<string, API_StatusObject | null>;
1675
+ }) => boolean;
1676
+
1677
+ interface SetStoriesStory {
1678
+ id: StoryId;
1679
+ name: string;
1680
+ refId?: string;
1681
+ componentId?: ComponentId;
1682
+ kind: StoryKind;
1683
+ parameters: {
1684
+ fileName: string;
1685
+ options: {
1686
+ [optionName: string]: any;
1687
+ };
1688
+ docsOnly?: boolean;
1689
+ viewMode?: API_ViewMode;
1690
+ [parameterName: string]: any;
1691
+ };
1692
+ argTypes?: ArgTypes;
1693
+ args?: Args;
1694
+ initialArgs?: Args;
1695
+ }
1696
+ interface SetStoriesStoryData {
1697
+ [id: string]: SetStoriesStory;
1698
+ }
1699
+ type SetStoriesPayload = {
1700
+ v: 2;
1701
+ error?: Error;
1702
+ globals: Args;
1703
+ globalParameters: Parameters;
1704
+ stories: SetStoriesStoryData;
1705
+ kindParameters: {
1706
+ [kind: string]: Parameters;
1707
+ };
1708
+ } | ({
1709
+ v?: number;
1710
+ stories: SetStoriesStoryData;
1711
+ } & Record<string, never>);
1712
+ interface SetGlobalsPayload {
1713
+ globals: Globals;
1714
+ globalTypes: GlobalTypes;
1715
+ }
1716
+ interface GlobalsUpdatedPayload {
1717
+ initialGlobals: Globals;
1718
+ userGlobals: Globals;
1719
+ storyGlobals: Globals;
1720
+ globals: Globals;
1721
+ }
1722
+ interface StoryPreparedPayload {
1723
+ id: StoryId;
1724
+ parameters: Parameters;
1725
+ argTypes: ArgTypes;
1726
+ initialArgs: Args;
1727
+ args: Args;
1728
+ }
1729
+ interface DocsPreparedPayload {
1730
+ id: StoryId;
1731
+ parameters: Parameters;
1732
+ }
1733
+
1734
+ type OrString$1<T extends string> = T | (string & {});
1735
+ type API_ViewMode = OrString$1<'story' | 'docs' | 'settings'> | undefined;
1736
+ type API_RenderOptions = Addon_RenderOptions;
1737
+ interface API_RouteOptions {
1738
+ storyId: string;
1739
+ viewMode: API_ViewMode;
1740
+ location: RenderData['location'];
1741
+ path: string;
1742
+ }
1743
+ interface API_MatchOptions {
1744
+ storyId: string;
1745
+ viewMode: API_ViewMode;
1746
+ location: RenderData['location'];
1747
+ path: string;
1748
+ }
1749
+ type API_StateMerger<S> = (input: S) => S;
1750
+ interface API_ProviderData<API> {
1751
+ provider: API_Provider<API>;
1752
+ docsOptions: DocsOptions;
1753
+ }
1754
+ interface API_Provider<API> {
1755
+ channel?: Channel;
1756
+ /** @deprecated Will be removed in 8.0, please use channel instead */
1757
+ serverChannel?: Channel;
1758
+ renderPreview?: API_IframeRenderer;
1759
+ handleAPI(api: API): void;
1760
+ getConfig(): {
1761
+ sidebar?: API_SidebarOptions<API>;
1762
+ theme?: ThemeVars;
1763
+ StoryMapper?: API_StoryMapper;
1764
+ [k: string]: any;
1765
+ } & Partial<API_UIOptions>;
1766
+ [key: string]: any;
1767
+ }
1768
+ type API_IframeRenderer = (storyId: string, viewMode: API_ViewMode, id: string, baseUrl: string, scale: number, queryParams: Record<string, any>) => ReactElement<any, any> | null;
1769
+ interface API_UIOptions {
1770
+ name?: string;
1771
+ url?: string;
1772
+ goFullScreen: boolean;
1773
+ showStoriesPanel: boolean;
1774
+ showAddonPanel: boolean;
1775
+ addonPanelInRight: boolean;
1776
+ theme?: ThemeVars;
1777
+ selectedPanel?: string;
1778
+ }
1779
+ interface API_Layout {
1780
+ initialActive: API_ActiveTabsType;
1781
+ navSize: number;
1782
+ bottomPanelHeight: number;
1783
+ rightPanelWidth: number;
1784
+ /**
1785
+ * The sizes of the panels when they were last visible used to restore the sizes when the panels
1786
+ * are shown again eg. when toggling fullscreen, panels, etc.
1787
+ */
1788
+ recentVisibleSizes: {
1789
+ navSize: number;
1790
+ bottomPanelHeight: number;
1791
+ rightPanelWidth: number;
1792
+ };
1793
+ panelPosition: API_PanelPositions;
1794
+ showTabs: boolean;
1795
+ showToolbar: boolean;
1796
+ /** @deprecated, will be removed in 8.0 - this API no longer works */
1797
+ isToolshown?: boolean;
1798
+ }
1799
+ interface API_UI {
1800
+ name?: string;
1801
+ url?: string;
1802
+ enableShortcuts: boolean;
1803
+ }
1804
+ type API_PanelPositions = 'bottom' | 'right';
1805
+ type API_ActiveTabsType = 'sidebar' | 'canvas' | 'addons';
1806
+ interface API_SidebarOptions<API = any> {
1807
+ showRoots?: boolean;
1808
+ filters?: Record<string, API_FilterFunction>;
1809
+ collapsedRoots?: string[];
1810
+ renderLabel?: (item: API_HashEntry, api: API) => any;
1811
+ }
1812
+ interface OnClearOptions {
1813
+ /** `true` when the user manually dismissed the notification. */
1814
+ dismissed: boolean;
1815
+ /** `true` when the notification timed out after the set duration. */
1816
+ timeout: boolean;
1817
+ }
1818
+ interface OnClickOptions {
1819
+ /** Function to dismiss the notification. */
1820
+ onDismiss: () => void;
1821
+ }
1822
+ /**
1823
+ * @deprecated Use ReactNode for the icon instead.
1824
+ * @see https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#icons-is-deprecated
1825
+ */
1826
+ interface DeprecatedIconType {
1827
+ name: string;
1828
+ color?: string;
1829
+ }
1830
+ interface API_Notification {
1831
+ id: string;
1832
+ content: {
1833
+ headline: string;
1834
+ subHeadline?: string | any;
1835
+ };
1836
+ duration?: number;
1837
+ link?: string;
1838
+ icon?: React.ReactNode | DeprecatedIconType;
1839
+ onClear?: (options: OnClearOptions) => void;
1840
+ onClick?: (options: OnClickOptions) => void;
1841
+ }
1842
+ type API_Versions = Record<string, string>;
1843
+ type API_SetRefData = Partial<API_ComposedRef & {
1844
+ setStoriesData: SetStoriesStoryData;
1845
+ storyIndex: StoryIndex;
1846
+ }>;
1847
+ type API_StoryMapper = (ref: API_ComposedRef, story: SetStoriesStory) => SetStoriesStory;
1848
+ interface API_LoadedRefData {
1849
+ index?: API_IndexHash;
1850
+ filteredIndex?: API_IndexHash;
1851
+ indexError?: Error;
1852
+ previewInitialized: boolean;
1853
+ }
1854
+ interface API_ComposedRef extends API_LoadedRefData {
1855
+ id: string;
1856
+ title?: string;
1857
+ url: string;
1858
+ type?: 'auto-inject' | 'unknown' | 'lazy' | 'server-checked';
1859
+ expanded?: boolean;
1860
+ versions?: API_Versions;
1861
+ loginUrl?: string;
1862
+ version?: string;
1863
+ sourceUrl?: string;
1864
+ /** DO NOT USE THIS */
1865
+ internal_index?: StoryIndex;
1866
+ }
1867
+ type API_ComposedRefUpdate = Partial<Pick<API_ComposedRef, 'title' | 'type' | 'expanded' | 'index' | 'filteredIndex' | 'versions' | 'loginUrl' | 'version' | 'indexError' | 'previewInitialized' | 'sourceUrl' | 'internal_index'>>;
1868
+ type API_Refs = Record<string, API_ComposedRef>;
1869
+ type API_RefId = string;
1870
+ type API_RefUrl = string;
1871
+
1872
+ type Addon_Types = Exclude<Addon_TypesEnum, Addon_TypesEnum.experimental_PAGE | Addon_TypesEnum.experimental_SIDEBAR_BOTTOM | Addon_TypesEnum.experimental_TEST_PROVIDER | Addon_TypesEnum.experimental_SIDEBAR_TOP>;
1873
+ interface Addon_ArgType<TArg = unknown> extends InputType {
1874
+ defaultValue?: TArg;
1875
+ }
1876
+ type Addons_ArgTypes<TArgs = Args> = {
1877
+ [key in keyof Partial<TArgs>]: Addon_ArgType<TArgs[key]>;
1878
+ } & {
1879
+ [key in string]: Addon_ArgType<unknown>;
1880
+ };
1881
+ type Addon_Comparator<T> = ((a: T, b: T) => boolean) | ((a: T, b: T) => number);
1882
+ type Addon_StorySortMethod = 'configure' | 'alphabetical';
1883
+ interface Addon_StorySortObjectParameter {
1884
+ method?: Addon_StorySortMethod;
1885
+ order?: any[];
1886
+ locales?: string;
1887
+ includeNames?: boolean;
1888
+ }
1889
+ type IndexEntryLegacy = [StoryId, any, Parameters, Parameters];
1890
+ type Addon_StorySortComparator = Addon_Comparator<IndexEntryLegacy>;
1891
+ type Addon_StorySortParameter = Addon_StorySortComparator | Addon_StorySortObjectParameter;
1892
+ type Addon_StorySortComparatorV7 = Addon_Comparator<IndexEntry>;
1893
+ type Addon_StorySortParameterV7 = Addon_StorySortComparatorV7 | Addon_StorySortObjectParameter;
1894
+ interface Addon_OptionsParameter extends Object {
1895
+ storySort?: Addon_StorySortParameter;
1896
+ theme?: {
1897
+ base: string;
1898
+ brandTitle?: string;
1899
+ };
1900
+ [key: string]: any;
1901
+ }
1902
+ interface Addon_OptionsParameterV7 extends Object {
1903
+ storySort?: Addon_StorySortParameterV7;
1904
+ theme?: {
1905
+ base: string;
1906
+ brandTitle?: string;
1907
+ };
1908
+ [key: string]: any;
1909
+ }
1910
+ type Addon_StoryContext<TRenderer extends Renderer = Renderer> = StoryContext<TRenderer>;
1911
+ type Addon_StoryContextUpdate = Partial<Addon_StoryContext>;
1912
+ interface Addon_ReturnTypeFramework<ReturnType> extends Renderer {
1913
+ component: any;
1914
+ storyResult: ReturnType;
1915
+ canvasElement: any;
1916
+ }
1917
+ type Addon_PartialStoryFn<ReturnType = unknown> = PartialStoryFn<Addon_ReturnTypeFramework<ReturnType>>;
1918
+ type Addon_LegacyStoryFn<ReturnType = unknown> = LegacyStoryFn<Addon_ReturnTypeFramework<ReturnType>>;
1919
+ type Addon_ArgsStoryFn<ReturnType = unknown> = ArgsStoryFn<Addon_ReturnTypeFramework<ReturnType>>;
1920
+ type Addon_StoryFn<ReturnType = unknown> = StoryFn<Addon_ReturnTypeFramework<ReturnType>>;
1921
+ type Addon_DecoratorFunction<StoryFnReturnType = unknown> = DecoratorFunction<Addon_ReturnTypeFramework<StoryFnReturnType>>;
1922
+ type Addon_LoaderFunction = LoaderFunction<Addon_ReturnTypeFramework<unknown>>;
1923
+ interface Addon_WrapperSettings {
1924
+ options: object;
1925
+ parameters: {
1926
+ [key: string]: any;
1927
+ };
1928
+ }
1929
+ type Addon_StoryWrapper = (storyFn: Addon_LegacyStoryFn, context: Addon_StoryContext, settings: Addon_WrapperSettings) => any;
1930
+ type Addon_MakeDecoratorResult = (...args: any) => any;
1931
+ interface Addon_AddStoryArgs<StoryFnReturnType = unknown> {
1932
+ id: StoryId;
1933
+ kind: StoryKind;
1934
+ name: StoryName;
1935
+ storyFn: Addon_StoryFn<StoryFnReturnType>;
1936
+ parameters: Parameters;
1937
+ }
1938
+ type Addon_ClientApiAddon<StoryFnReturnType = unknown> = Addon_Type & {
1939
+ apply: (a: Addon_StoryApi<StoryFnReturnType>, b: any[]) => any;
1940
+ };
1941
+ interface Addon_ClientApiAddons<StoryFnReturnType> {
1942
+ [key: string]: Addon_ClientApiAddon<StoryFnReturnType>;
1943
+ }
1944
+ type Addon_ClientApiReturnFn<StoryFnReturnType = unknown> = (...args: any[]) => Addon_StoryApi<StoryFnReturnType>;
1945
+ interface Addon_StoryApi<StoryFnReturnType = unknown> {
1946
+ kind: StoryKind;
1947
+ add: (storyName: StoryName, storyFn: Addon_StoryFn<StoryFnReturnType>, parameters?: Parameters) => Addon_StoryApi<StoryFnReturnType>;
1948
+ addDecorator: (decorator: Addon_DecoratorFunction<StoryFnReturnType>) => Addon_StoryApi<StoryFnReturnType>;
1949
+ addLoader: (decorator: Addon_LoaderFunction) => Addon_StoryApi<StoryFnReturnType>;
1950
+ addParameters: (parameters: Parameters) => Addon_StoryApi<StoryFnReturnType>;
1951
+ [k: string]: string | Addon_ClientApiReturnFn<StoryFnReturnType>;
1952
+ }
1953
+ interface Addon_ClientStoryApi<StoryFnReturnType = unknown> {
1954
+ }
1955
+ type Addon_LoadFn = () => any;
1956
+ type Addon_RequireContext = any;
1957
+ type Addon_Loadable = Addon_RequireContext | [Addon_RequireContext] | Addon_LoadFn;
1958
+ type Addon_BaseDecorators<StoryFnReturnType> = Array<(story: () => StoryFnReturnType, context: Addon_StoryContext) => StoryFnReturnType>;
1959
+ interface Addon_BaseAnnotations<TArgs, StoryFnReturnType, TRenderer extends Renderer = Renderer> {
1960
+ /**
1961
+ * Dynamic data that are provided (and possibly updated by) Storybook and its addons.
1962
+ *
1963
+ * @see [Arg story inputs](https://storybook.js.org/docs/api/csf#args-story-inputs)
1964
+ */
1965
+ args?: Partial<TArgs>;
1966
+ /**
1967
+ * ArgTypes encode basic metadata for args, such as `name`, `description`, `defaultValue` for an
1968
+ * arg. These get automatically filled in by Storybook Docs.
1969
+ *
1970
+ * @see [Arg types](https://storybook.js.org/docs/api/arg-types)
1971
+ */
1972
+ argTypes?: Addons_ArgTypes<TArgs>;
1973
+ /**
1974
+ * Custom metadata for a story.
1975
+ *
1976
+ * @see [Parameters](https://storybook.js.org/docs/writing-stories/parameters)
1977
+ */
1978
+ parameters?: Parameters;
1979
+ /**
1980
+ * Wrapper components or Storybook decorators that wrap a story.
1981
+ *
1982
+ * Decorators defined in Meta will be applied to every story variation.
1983
+ *
1984
+ * @see [Decorators](https://storybook.js.org/docs/writing-stories/decorators)
1985
+ */
1986
+ decorators?: Addon_BaseDecorators<StoryFnReturnType>;
1987
+ /**
1988
+ * Define a custom render function for the story(ies). If not passed, a default render function by
1989
+ * the framework will be used.
1990
+ */
1991
+ render?: (args: TArgs, context: Addon_StoryContext<TRenderer>) => StoryFnReturnType;
1992
+ /** Function that is executed after the story is rendered. */
1993
+ play?: (context: Addon_StoryContext<TRenderer>) => Promise<void> | void;
1994
+ }
1995
+ interface Addon_Annotations<TArgs, StoryFnReturnType> extends Addon_BaseAnnotations<TArgs, StoryFnReturnType> {
1996
+ /**
1997
+ * Used to only include certain named exports as stories. Useful when you want to have non-story
1998
+ * exports such as mock data or ignore a few stories.
1999
+ *
2000
+ * @example
2001
+ *
2002
+ * ```ts
2003
+ * includeStories: ['SimpleStory', 'ComplexStory'];
2004
+ * includeStories: /.*Story$/;
2005
+ * ```
2006
+ *
2007
+ * @see [Non-story exports](https://storybook.js.org/docs/api/csf#non-story-exports)
2008
+ */
2009
+ includeStories?: string[] | RegExp;
2010
+ /**
2011
+ * Used to exclude certain named exports. Useful when you want to have non-story exports such as
2012
+ * mock data or ignore a few stories.
2013
+ *
2014
+ * @example
2015
+ *
2016
+ * ```ts
2017
+ * excludeStories: ['simpleData', 'complexData'];
2018
+ * excludeStories: /.*Data$/;
2019
+ * ```
2020
+ *
2021
+ * @see [Non-story exports](https://storybook.js.org/docs/api/csf#non-story-exports)
2022
+ */
2023
+ excludeStories?: string[] | RegExp;
2024
+ }
2025
+ interface Addon_BaseMeta<ComponentType> {
2026
+ /**
2027
+ * Title of the story which will be presented in the navigation. **Should be unique.**
2028
+ *
2029
+ * Stories can be organized in a nested structure using "/" as a separator.
2030
+ *
2031
+ * Since CSF 3.0 this property is optional.
2032
+ *
2033
+ * @example
2034
+ *
2035
+ * ```ts
2036
+ * export default { title: 'Design System/Atoms/Button' };
2037
+ * ```
2038
+ *
2039
+ * @see [Story Hierarchy](https://storybook.js.org/docs/writing-stories/naming-components-and-hierarchy)
2040
+ */
2041
+ title?: string;
2042
+ /**
2043
+ * Manually set the id of a story, which in particular is useful if you want to rename stories
2044
+ * without breaking permalinks.
2045
+ *
2046
+ * Storybook will prioritize the id over the title for ID generation, if provided, and will
2047
+ * prioritize the story.storyName over the export key for display.
2048
+ *
2049
+ * @see [Sidebar and URLs](https://storybook.js.org/docs/configure/user-interface/sidebar-and-urls#permalink-to-stories)
2050
+ */
2051
+ id?: string;
2052
+ /**
2053
+ * The primary component for your story.
2054
+ *
2055
+ * Used by addons for automatic prop table generation and display of other component metadata.
2056
+ */
2057
+ component?: ComponentType;
2058
+ /**
2059
+ * Auxiliary sub-components that are part of the stories.
2060
+ *
2061
+ * Used by addons for automatic prop table generation and display of other component metadata.
2062
+ *
2063
+ * @deprecated
2064
+ * @example
2065
+ *
2066
+ * ```ts
2067
+ * import { Button, ButtonGroup } from './components';
2068
+ *
2069
+ * export default {
2070
+ * subcomponents: { Button, ButtonGroup },
2071
+ * };
2072
+ * ```
2073
+ *
2074
+ * By defining them each component will have its tab in the args table.
2075
+ */
2076
+ subcomponents?: Record<string, ComponentType>;
2077
+ }
2078
+ type Addon_BaseStoryObject<TArgs, StoryFnReturnType> = {
2079
+ /** Override the display name in the UI */
2080
+ storyName?: string;
2081
+ };
2082
+ type Addon_BaseStoryFn<TArgs, StoryFnReturnType> = {
2083
+ (args: TArgs, context: Addon_StoryContext): StoryFnReturnType;
2084
+ } & Addon_BaseStoryObject<TArgs, StoryFnReturnType>;
2085
+ type BaseStory<TArgs, StoryFnReturnType> = Addon_BaseStoryFn<TArgs, StoryFnReturnType> | Addon_BaseStoryObject<TArgs, StoryFnReturnType>;
2086
+ interface Addon_RenderOptions {
2087
+ active: boolean;
2088
+ }
2089
+ type Addon_Type = Addon_BaseType | Addon_PageType | Addon_WrapperType | Addon_SidebarBottomType | Addon_SidebarTopType | Addon_TestProviderType<Addon_TestProviderState>;
2090
+ interface Addon_BaseType {
2091
+ /**
2092
+ * The title of the addon. This can be a simple string, but it can also be a
2093
+ * React.FunctionComponent or a React.ReactElement.
2094
+ */
2095
+ title: FC | ReactNode | (() => string);
2096
+ /**
2097
+ * The type of the addon.
2098
+ *
2099
+ * @example
2100
+ *
2101
+ * ```ts
2102
+ * Addon_TypesEnum.PANEL;
2103
+ * ```
2104
+ */
2105
+ type: Exclude<Addon_Types, Addon_TypesEnum.PREVIEW | Addon_TypesEnum.experimental_PAGE | Addon_TypesEnum.experimental_SIDEBAR_BOTTOM | Addon_TypesEnum.experimental_SIDEBAR_TOP | Addon_TypesEnum.experimental_TEST_PROVIDER>;
2106
+ /**
2107
+ * The unique id of the addon.
2108
+ *
2109
+ * @example 'my-org-name/my-addon-name';
2110
+ *
2111
+ * @warn This will become non-optional in 8.0
2112
+ *
2113
+ * This needs to be globally unique, so we recommend prefixing it with your org name or npm package name.
2114
+ *
2115
+ * Do not prefix with `storybook`, this is reserved for core storybook feature and core addons.
2116
+ */
2117
+ id?: string;
2118
+ /**
2119
+ * This component will wrap your `render` function.
2120
+ *
2121
+ * With it you can determine if you want your addon to be rendered or not.
2122
+ *
2123
+ * This is to facilitate addons keeping state, and keep listening for events even when they are
2124
+ * not currently on screen/rendered.
2125
+ */
2126
+ route?: (routeOptions: RenderData) => string;
2127
+ /** This will determine the value of `active` prop of your render function. */
2128
+ match?: (matchOptions: RenderData & {
2129
+ tabId?: string;
2130
+ }) => boolean;
2131
+ /**
2132
+ * The actual contents of your addon.
2133
+ *
2134
+ * This is called as a function, so if you want to use hooks, your function needs to return a
2135
+ * JSX.Element within which components are rendered
2136
+ */
2137
+ render: (props: Partial<Addon_RenderOptions>) => ReturnType<FC<Partial<Addon_RenderOptions>>>;
2138
+ /** @unstable */
2139
+ paramKey?: string;
2140
+ /** @unstable */
2141
+ disabled?: boolean | ((parameters: API_StoryEntry['parameters']) => boolean);
2142
+ /** @unstable */
2143
+ hidden?: boolean;
2144
+ }
2145
+ interface Addon_PageType {
2146
+ type: Addon_TypesEnum.experimental_PAGE;
2147
+ /** The unique id of the page. */
2148
+ id: string;
2149
+ /** The URL to navigate to when Storybook needs to navigate to this page. */
2150
+ url: string;
2151
+ /** The title is used in mobile mode to represent the page in the navigation. */
2152
+ title: FC | string | ReactElement | ReactNode;
2153
+ /**
2154
+ * The main content of the addon, a function component without any props. Storybook will render
2155
+ * your component always.
2156
+ *
2157
+ * If you want to render your component only when the URL matches, use the `Route` component.
2158
+ *
2159
+ * @example
2160
+ *
2161
+ * ```jsx
2162
+ * import { Route } from 'storybook/internal/router';
2163
+ *
2164
+ * Render: () => {
2165
+ * return (
2166
+ * <Route path="/my-addon">
2167
+ * {' '}
2168
+ * <MyAddonContent />{' '}
2169
+ * </Route>
2170
+ * );
2171
+ * };
2172
+ * ```
2173
+ */
2174
+ render: FC;
2175
+ }
2176
+ interface Addon_WrapperType {
2177
+ type: Addon_TypesEnum.PREVIEW;
2178
+ /** The unique id of the page. */
2179
+ id: string;
2180
+ /**
2181
+ * A React.FunctionComponent that wraps the story.
2182
+ *
2183
+ * This component must accept a children prop, and render it.
2184
+ */
2185
+ render: FC<PropsWithChildren<{
2186
+ index: number;
2187
+ children: ReactNode;
2188
+ id: string;
2189
+ storyId: StoryId;
2190
+ }>>;
2191
+ }
2192
+ /** @deprecated This doesn't do anything anymore and will be removed in Storybook 9.0. */
2193
+ interface Addon_SidebarBottomType {
2194
+ type: Addon_TypesEnum.experimental_SIDEBAR_BOTTOM;
2195
+ /** The unique id of the tool. */
2196
+ id: string;
2197
+ /** A React.FunctionComponent. */
2198
+ render: FC;
2199
+ }
2200
+ /** @deprecated This will be removed in Storybook 9.0. */
2201
+ interface Addon_SidebarTopType {
2202
+ type: Addon_TypesEnum.experimental_SIDEBAR_TOP;
2203
+ /** The unique id of the tool. */
2204
+ id: string;
2205
+ /** A React.FunctionComponent. */
2206
+ render: FC;
2207
+ }
2208
+ interface Addon_TestProviderType<Details extends {
2209
+ [key: string]: any;
2210
+ } = NonNullable<unknown>> {
2211
+ type: Addon_TypesEnum.experimental_TEST_PROVIDER;
2212
+ /** The unique id of the test provider. */
2213
+ id: string;
2214
+ name: string;
2215
+ /** @deprecated Use render instead */
2216
+ title?: (state: TestProviderConfig & Addon_TestProviderState<Details>) => ReactNode;
2217
+ /** @deprecated Use render instead */
2218
+ description?: (state: TestProviderConfig & Addon_TestProviderState<Details>) => ReactNode;
2219
+ render?: (state: TestProviderConfig & Addon_TestProviderState<Details>) => ReactNode;
2220
+ sidebarContextMenu?: (options: {
2221
+ context: API_HashEntry;
2222
+ state: TestProviderConfig & Addon_TestProviderState<Details>;
2223
+ }) => ReactNode;
2224
+ stateUpdater?: (state: TestProviderConfig & Addon_TestProviderState<Details>, update: Partial<Addon_TestProviderState<Details>>) => void | Partial<TestProviderConfig & Addon_TestProviderState<Details>>;
2225
+ runnable?: boolean;
2226
+ }
2227
+ type Addon_TestProviderState<Details extends {
2228
+ [key: string]: any;
2229
+ } = NonNullable<unknown>> = Pick<Addon_TestProviderType, 'runnable'> & {
2230
+ progress?: TestingModuleProgressReportProgress;
2231
+ details: Details;
2232
+ cancellable: boolean;
2233
+ cancelling: boolean;
2234
+ running: boolean;
2235
+ failed: boolean;
2236
+ crashed: boolean;
2237
+ error?: {
2238
+ name: string;
2239
+ message?: string;
2240
+ };
2241
+ };
2242
+ type Addon_TypeBaseNames = Exclude<Addon_TypesEnum, Addon_TypesEnum.PREVIEW | Addon_TypesEnum.experimental_PAGE | Addon_TypesEnum.experimental_SIDEBAR_BOTTOM | Addon_TypesEnum.experimental_SIDEBAR_TOP | Addon_TypesEnum.experimental_TEST_PROVIDER>;
2243
+ interface Addon_TypesMapping extends Record<Addon_TypeBaseNames, Addon_BaseType> {
2244
+ [Addon_TypesEnum.PREVIEW]: Addon_WrapperType;
2245
+ [Addon_TypesEnum.experimental_PAGE]: Addon_PageType;
2246
+ [Addon_TypesEnum.experimental_SIDEBAR_BOTTOM]: Addon_SidebarBottomType;
2247
+ [Addon_TypesEnum.experimental_SIDEBAR_TOP]: Addon_SidebarTopType;
2248
+ [Addon_TypesEnum.experimental_TEST_PROVIDER]: Addon_TestProviderType<Addon_TestProviderState>;
2249
+ }
2250
+ type Addon_Loader<API> = (api: API) => void;
2251
+ interface Addon_Loaders<API> {
2252
+ [key: string]: Addon_Loader<API>;
2253
+ }
2254
+ interface Addon_Collection<T = Addon_Type> {
2255
+ [key: string]: T;
2256
+ }
2257
+ interface Addon_Elements {
2258
+ [key: string]: Addon_Collection;
2259
+ }
2260
+ interface Addon_ToolbarConfig {
2261
+ hidden?: boolean;
2262
+ }
2263
+ interface Addon_Config {
2264
+ theme?: ThemeVars;
2265
+ toolbar?: {
2266
+ [id: string]: Addon_ToolbarConfig;
2267
+ };
2268
+ sidebar?: API_SidebarOptions;
2269
+ [key: string]: any;
2270
+ }
2271
+ declare enum Addon_TypesEnum {
2272
+ /**
2273
+ * This API is used to create a tab the toolbar above the canvas, This API might be removed in the
2274
+ * future.
2275
+ *
2276
+ * @unstable
2277
+ */
2278
+ TAB = "tab",
2279
+ /** This adds panels to the addons side panel. */
2280
+ PANEL = "panel",
2281
+ /** This adds items in the toolbar above the canvas - on the left side. */
2282
+ TOOL = "tool",
2283
+ /** This adds items in the toolbar above the canvas - on the right side. */
2284
+ TOOLEXTRA = "toolextra",
2285
+ /**
2286
+ * This adds wrapper components around the canvas/iframe component storybook renders.
2287
+ *
2288
+ * @unstable this API is not stable yet, and is likely to change in 8.0.
2289
+ */
2290
+ PREVIEW = "preview",
2291
+ /**
2292
+ * This adds pages that render instead of the canvas.
2293
+ *
2294
+ * @unstable
2295
+ */
2296
+ experimental_PAGE = "page",
2297
+ /**
2298
+ * This adds items in the bottom of the sidebar.
2299
+ *
2300
+ * @deprecated This doesn't do anything anymore and will be removed in Storybook 9.0.
2301
+ */
2302
+ experimental_SIDEBAR_BOTTOM = "sidebar-bottom",
2303
+ /**
2304
+ * This adds items in the top of the sidebar.
2305
+ *
2306
+ * @deprecated This will be removed in Storybook 9.0.
2307
+ */
2308
+ experimental_SIDEBAR_TOP = "sidebar-top",
2309
+ /** This adds items to the Testing Module in the sidebar. */
2310
+ experimental_TEST_PROVIDER = "test-provider"
2311
+ }
2312
+
2313
+ interface Renderer extends Renderer$1 {
2314
+ }
2315
+
2316
+ type OrString<T extends string> = T | (string & {});
2317
+ type ViewMode = OrString<ViewMode$1 | 'settings'> | undefined;
2318
+ type Layout = 'centered' | 'fullscreen' | 'padded' | 'none';
2319
+ interface StorybookParameters {
2320
+ options?: Addon_OptionsParameter;
2321
+ /**
2322
+ * The layout property defines basic styles added to the preview body where the story is rendered.
2323
+ *
2324
+ * If you pass `none`, no styles are applied.
2325
+ */
2326
+ layout?: Layout;
2327
+ }
2328
+ interface StorybookInternalParameters extends StorybookParameters {
2329
+ fileName?: string;
2330
+ docsOnly?: true;
2331
+ }
2332
+ type Path = string;
2333
+
2334
+ interface WebRenderer extends Renderer {
2335
+ canvasElement: HTMLElement;
2336
+ }
2337
+ type ModuleExport = any;
2338
+ type ModuleExports = Record<string, ModuleExport>;
2339
+ type ModuleImportFn = (path: Path) => Promise<ModuleExports>;
2340
+ type MaybePromise<T> = Promise<T> | T;
2341
+ type TeardownRenderToCanvas = () => MaybePromise<void>;
2342
+ type RenderToCanvas<TRenderer extends Renderer> = (context: RenderContext<TRenderer>, element: TRenderer['canvasElement']) => MaybePromise<void | TeardownRenderToCanvas>;
2343
+ interface ProjectAnnotations<TRenderer extends Renderer> extends ProjectAnnotations$2<TRenderer> {
2344
+ addons?: ProjectAnnotations<TRenderer>[];
2345
+ testingLibraryRender?: (...args: never[]) => {
2346
+ unmount: () => void;
2347
+ };
2348
+ renderToCanvas?: RenderToCanvas<TRenderer>;
2349
+ renderToDOM?: RenderToCanvas<TRenderer>;
2350
+ }
2351
+ type NamedExportsOrDefault<TExport> = TExport | {
2352
+ default: TExport;
2353
+ };
2354
+ type NamedOrDefaultProjectAnnotations<TRenderer extends Renderer = Renderer> = NamedExportsOrDefault<ProjectAnnotations<TRenderer>>;
2355
+ type NormalizedProjectAnnotations<TRenderer extends Renderer = Renderer> = Omit<ProjectAnnotations<TRenderer>, 'decorators' | 'loaders' | 'runStep' | 'beforeAll'> & {
2356
+ argTypes?: StrictArgTypes;
2357
+ globalTypes?: StrictGlobalTypes;
2358
+ decorators?: DecoratorFunction<TRenderer>[];
2359
+ loaders?: LoaderFunction<TRenderer>[];
2360
+ runStep: StepRunner<TRenderer>;
2361
+ beforeAll: BeforeAll;
2362
+ };
2363
+ type NormalizedComponentAnnotations<TRenderer extends Renderer = Renderer> = Omit<ComponentAnnotations<TRenderer>, 'decorators' | 'loaders'> & {
2364
+ id: ComponentId;
2365
+ title: ComponentTitle;
2366
+ argTypes?: StrictArgTypes;
2367
+ decorators?: DecoratorFunction<TRenderer>[];
2368
+ loaders?: LoaderFunction<TRenderer>[];
2369
+ };
2370
+ type NormalizedStoryAnnotations<TRenderer extends Renderer = Renderer> = Omit<StoryAnnotations<TRenderer>, 'storyName' | 'story' | 'decorators' | 'loaders'> & {
2371
+ moduleExport: ModuleExport;
2372
+ id: StoryId;
2373
+ argTypes?: StrictArgTypes;
2374
+ name: StoryName;
2375
+ userStoryFn?: StoryFn<TRenderer>;
2376
+ decorators?: DecoratorFunction<TRenderer>[];
2377
+ loaders?: LoaderFunction<TRenderer>[];
2378
+ };
2379
+ type CSFFile<TRenderer extends Renderer = Renderer> = {
2380
+ meta: NormalizedComponentAnnotations<TRenderer>;
2381
+ stories: Record<StoryId, NormalizedStoryAnnotations<TRenderer>>;
2382
+ projectAnnotations?: NormalizedProjectAnnotations<TRenderer>;
2383
+ moduleExports: ModuleExports;
2384
+ };
2385
+ type PreparedStory<TRenderer extends Renderer = Renderer> = StoryContextForEnhancers<TRenderer> & {
2386
+ moduleExport: ModuleExport;
2387
+ originalStoryFn: StoryFn<TRenderer>;
2388
+ undecoratedStoryFn: LegacyStoryFn<TRenderer>;
2389
+ unboundStoryFn: LegacyStoryFn<TRenderer>;
2390
+ applyLoaders: (context: StoryContext<TRenderer>) => Promise<StoryContext<TRenderer>['loaded']>;
2391
+ applyBeforeEach: (context: StoryContext<TRenderer>) => Promise<CleanupCallback[]>;
2392
+ applyAfterEach: (context: StoryContext<TRenderer>) => Promise<void>;
2393
+ playFunction?: (context: StoryContext<TRenderer>) => Promise<void> | void;
2394
+ runStep: StepRunner<TRenderer>;
2395
+ mount: (context: StoryContext<TRenderer>) => () => Promise<Canvas>;
2396
+ testingLibraryRender?: (...args: never[]) => unknown;
2397
+ renderToCanvas?: ProjectAnnotations<TRenderer>['renderToCanvas'];
2398
+ usesMount: boolean;
2399
+ storyGlobals: Globals;
2400
+ };
2401
+ type PreparedMeta<TRenderer extends Renderer = Renderer> = Omit<StoryContextForEnhancers<TRenderer>, 'name' | 'story'> & {
2402
+ moduleExport: ModuleExport;
2403
+ };
2404
+ type BoundStory<TRenderer extends Renderer = Renderer> = PreparedStory<TRenderer> & {
2405
+ storyFn: PartialStoryFn<TRenderer>;
2406
+ };
2407
+ declare type RenderContext<TRenderer extends Renderer = Renderer> = StoryIdentifier & {
2408
+ showMain: () => void;
2409
+ showError: (error: {
2410
+ title: string;
2411
+ description: string;
2412
+ }) => void;
2413
+ showException: (err: Error) => void;
2414
+ forceRemount: boolean;
2415
+ storyContext: StoryContext<TRenderer>;
2416
+ storyFn: PartialStoryFn<TRenderer>;
2417
+ unboundStoryFn: LegacyStoryFn<TRenderer>;
2418
+ };
2419
+
2420
+ interface BuilderStats {
2421
+ toJson: () => any;
2422
+ }
2423
+ type Builder_WithRequiredProperty<Type, Key extends keyof Type> = Type & {
2424
+ [Property in Key]-?: Type[Property];
2425
+ };
2426
+ type Builder_Unpromise<T extends Promise<any>> = T extends Promise<infer U> ? U : never;
2427
+ type Builder_EnvsRaw = Record<string, string>;
2428
+
2429
+ type RenderContextCallbacks<TRenderer extends Renderer> = Pick<RenderContext<TRenderer>, 'showMain' | 'showError' | 'showException'>;
2430
+ type StoryRenderOptions = {
2431
+ autoplay?: boolean;
2432
+ forceInitialArgs?: boolean;
2433
+ };
2434
+ type ResolvedModuleExportType = 'component' | 'meta' | 'story';
2435
+ /**
2436
+ * What do we know about an of={} call?
2437
+ *
2438
+ * Technically, the type names aren't super accurate:
2439
+ *
2440
+ * - Meta === `CSFFile`
2441
+ * - Story === `PreparedStory` But these shorthands capture the idea of what is being talked about
2442
+ */
2443
+ type ResolvedModuleExportFromType<TType extends ResolvedModuleExportType, TRenderer extends Renderer = Renderer> = TType extends 'component' ? {
2444
+ type: 'component';
2445
+ component: TRenderer['component'];
2446
+ projectAnnotations: NormalizedProjectAnnotations<Renderer>;
2447
+ } : TType extends 'meta' ? {
2448
+ type: 'meta';
2449
+ csfFile: CSFFile<TRenderer>;
2450
+ preparedMeta: PreparedMeta;
2451
+ } : {
2452
+ type: 'story';
2453
+ story: PreparedStory<TRenderer>;
2454
+ };
2455
+ type ResolvedModuleExport<TRenderer extends Renderer = Renderer> = {
2456
+ type: ResolvedModuleExportType;
2457
+ } & (ResolvedModuleExportFromType<'component', TRenderer> | ResolvedModuleExportFromType<'meta', TRenderer> | ResolvedModuleExportFromType<'story', TRenderer>);
2458
+ interface DocsContextProps<TRenderer extends Renderer = Renderer> {
2459
+ /**
2460
+ * Register a CSF file that this docs entry uses. Used by the `<Meta of={} />` block to attach,
2461
+ * and the `<Story meta={} />` bloc to reference
2462
+ */
2463
+ referenceMeta: (metaExports: ModuleExports, attach: boolean) => void;
2464
+ /**
2465
+ * Find a component, meta or story object from the direct export(s) from the CSF file. This is the
2466
+ * API that drives the `of={}` syntax.
2467
+ */
2468
+ resolveOf<TType extends ResolvedModuleExportType>(moduleExportOrType: ModuleExport | TType, validTypes?: TType[]): ResolvedModuleExportFromType<TType, TRenderer>;
2469
+ /**
2470
+ * Find a story's id from the name of the story. This is primarily used by the `<Story name={} />
2471
+ * block. Note that the story must be part of the primary CSF file of the docs entry.
2472
+ */
2473
+ storyIdByName: (storyName: StoryName) => StoryId;
2474
+ /**
2475
+ * Syncronously find a story by id (if the id is not provided, this will look up the primary story
2476
+ * in the CSF file, if such a file exists).
2477
+ */
2478
+ storyById: (id?: StoryId) => PreparedStory<TRenderer>;
2479
+ /** Syncronously find all stories of the component referenced by the CSF file. */
2480
+ componentStories: () => PreparedStory<TRenderer>[];
2481
+ /** Syncronously find all stories by CSF file. */
2482
+ componentStoriesFromCSFFile: (csfFile: CSFFile<TRenderer>) => PreparedStory<TRenderer>[];
2483
+ /** Get the story context of the referenced story. */
2484
+ getStoryContext: (story: PreparedStory<TRenderer>) => Omit<StoryContext<TRenderer>, 'abortSignal' | 'canvasElement' | 'step' | 'context'>;
2485
+ /** Asyncronously load an arbitrary story by id. */
2486
+ loadStory: (id: StoryId) => Promise<PreparedStory<TRenderer>>;
2487
+ /** Render a story to a given HTML element and keep it up to date across context changes */
2488
+ renderStoryToElement: (story: PreparedStory<TRenderer>, element: HTMLElement, callbacks: RenderContextCallbacks<TRenderer>, options: StoryRenderOptions) => () => Promise<void>;
2489
+ /** Storybook channel -- use for low level event watching/emitting */
2490
+ channel: Channel$1;
2491
+ /** Project annotations -- can be read to get the project's global annotations */
2492
+ projectAnnotations: NormalizedProjectAnnotations<TRenderer>;
2493
+ }
2494
+ type DocsRenderFunction<TRenderer extends Renderer> = (docsContext: DocsContextProps<TRenderer>, docsParameters: Parameters, element: HTMLElement) => Promise<void>;
2495
+
2496
+ type Store_CSFExports<TRenderer extends Renderer$1 = Renderer$1, TArgs extends Args = Args> = {
2497
+ default: ComponentAnnotations<TRenderer, TArgs>;
2498
+ __esModule?: boolean;
2499
+ __namedExportsOrder?: string[];
2500
+ };
2501
+ /** A story function with partial args, used internally by composeStory */
2502
+ type PartialArgsStoryFn<TRenderer extends Renderer$1 = Renderer$1, TArgs = Args> = (args?: TArgs) => (TRenderer & {
2503
+ T: TArgs;
2504
+ })['storyResult'];
2505
+ /**
2506
+ * A story that got recomposed for portable stories, containing all the necessary data to be
2507
+ * rendered in external environments
2508
+ */
2509
+ type ComposedStoryFn<TRenderer extends Renderer$1 = Renderer$1, TArgs = Args> = PartialArgsStoryFn<TRenderer, TArgs> & {
2510
+ args: TArgs;
2511
+ id: StoryId;
2512
+ play?: (context?: Partial<StoryContext<TRenderer, Partial<TArgs>>>) => Promise<void>;
2513
+ run: (context?: Partial<StoryContext<TRenderer, Partial<TArgs>>>) => Promise<void>;
2514
+ load: () => Promise<void>;
2515
+ storyName: string;
2516
+ parameters: Parameters;
2517
+ argTypes: StrictArgTypes<TArgs>;
2518
+ reporting: ReporterAPI;
2519
+ tags: Tag$1[];
2520
+ globals: Globals;
2521
+ };
2522
+ /**
2523
+ * Based on a module of stories, it returns all stories within it, filtering non-stories Each story
2524
+ * will have partial props, as their props should be handled when composing stories
2525
+ */
2526
+ type StoriesWithPartialProps<TRenderer extends Renderer$1, TModule> = {
2527
+ [K in keyof TModule as TModule[K] extends StoryAnnotationsOrFn<infer _, infer _TProps> ? K : never]: TModule[K] extends StoryAnnotationsOrFn<infer _, infer TProps> ? ComposedStoryFn<TRenderer, Partial<TProps>> : unknown;
2528
+ };
2529
+ /**
2530
+ * Type used for integrators of portable stories, as reference when creating their own composeStory
2531
+ * function
2532
+ */
2533
+ interface ComposeStoryFn<TRenderer extends Renderer$1 = Renderer$1, TArgs extends Args = Args> {
2534
+ (storyAnnotations: AnnotatedStoryFn<TRenderer, TArgs> | StoryAnnotations<TRenderer, TArgs>, componentAnnotations: ComponentAnnotations<TRenderer, TArgs>, projectAnnotations: ProjectAnnotations$2<TRenderer>, exportsName?: string): ComposedStoryFn;
2535
+ }
2536
+
2537
+ type SupportedFrameworks = 'angular' | 'ember' | 'experimental-nextjs-vite' | 'html-vite' | 'html-webpack5' | 'nextjs' | 'preact-vite' | 'preact-webpack5' | 'react-native-web-vite' | 'react-vite' | 'react-webpack5' | 'server-webpack5' | 'svelte-vite' | 'svelte-webpack5' | 'sveltekit' | 'vue3-vite' | 'vue3-webpack5' | 'web-components-vite' | 'web-components-webpack5' | 'qwik' | 'solid' | 'nuxt' | 'react-rsbuild' | 'vue3-rsbuild';
2538
+
2539
+ type SupportedRenderers = 'react' | 'react-native' | 'vue3' | 'angular' | 'ember' | 'preact' | 'svelte' | 'qwik' | 'html' | 'web-components' | 'server' | 'solid' | 'nuxt';
2540
+
2541
+ export { type API_ActiveTabsType, type API_BaseEntry, type API_ComponentEntry, type API_ComposedRef, type API_ComposedRefUpdate, type API_DocsEntry, type API_FilterFunction, type API_GroupEntry, type API_HashEntry, type API_IframeRenderer, type API_IndexHash, type API_Layout, type API_LeafEntry, type API_LoadedRefData, type API_MatchOptions, type API_Notification, type API_OptionsData, type API_PanelPositions, type API_PreparedIndexEntry, type API_PreparedStoryIndex, type API_Provider, type API_ProviderData, type API_RefId, type API_RefUrl, type API_Refs, type API_ReleaseNotes, type API_RenderOptions, type API_RootEntry, type API_RouteOptions, type API_SetRefData, type API_Settings, type API_SidebarOptions, type API_StateMerger, type API_StatusObject, type API_StatusState, type API_StatusUpdate, type API_StatusValue, type API_StoryEntry, type API_StoryMapper, type API_UI, type API_UIOptions, type API_UnknownEntries, type API_Version, type API_Versions$1 as API_Versions, type API_ViewMode, type Addon_AddStoryArgs, type Addon_Annotations, type Addon_ArgType, type Addon_ArgsStoryFn, type Addon_BaseAnnotations, type Addon_BaseDecorators, type Addon_BaseMeta, type Addon_BaseStoryFn, type Addon_BaseStoryObject, type Addon_BaseType, type Addon_ClientApiAddon, type Addon_ClientApiAddons, type Addon_ClientApiReturnFn, type Addon_ClientStoryApi, type Addon_Collection, type Addon_Comparator, type Addon_Config, type Addon_DecoratorFunction, type Addon_Elements, type Addon_LegacyStoryFn, type Addon_LoadFn, type Addon_Loadable, type Addon_Loader, type Addon_LoaderFunction, type Addon_Loaders, type Addon_MakeDecoratorResult, type Addon_OptionsParameter, type Addon_OptionsParameterV7, type Addon_PageType, type Addon_PartialStoryFn, type Addon_RenderOptions, type Addon_RequireContext, type Addon_SidebarBottomType, type Addon_SidebarTopType, type Addon_StoryApi, type Addon_StoryContext, type Addon_StoryContextUpdate, type Addon_StoryFn, type Addon_StorySortComparator, type Addon_StorySortComparatorV7, type Addon_StorySortMethod, type Addon_StorySortObjectParameter, type Addon_StorySortParameter, type Addon_StorySortParameterV7, type Addon_StoryWrapper, type Addon_TestProviderState, type Addon_TestProviderType, type Addon_ToolbarConfig, type Addon_Type, type Addon_Types, Addon_TypesEnum, type Addon_TypesMapping, type Addon_WrapperSettings, type Addon_WrapperType, type Addons_ArgTypes, type BaseIndexEntry, type BaseIndexInput, type BaseStory, type BoundStory, type Builder, type BuilderName, type BuilderOptions, type BuilderResult, type BuilderStats, type Builder_EnvsRaw, type Builder_Unpromise, type Builder_WithRequiredProperty, type CLIBaseOptions, type CLIOptions, type CSFFile, type CompatibleString, type ComposeStoryFn, type ComposedStoryFn, type CoreCommon_AddonEntry, type CoreCommon_AddonInfo, type CoreCommon_OptionsEntry, type CoreCommon_ResolvedAddonPreset, type CoreCommon_ResolvedAddonVirtual, type CoreCommon_StorybookInfo, type CoreConfig, type DocsContextProps, type DocsIndexEntry, type DocsIndexInput, type DocsOptions, type DocsPreparedPayload, type DocsRenderFunction, type Entry, type GlobalsUpdatedPayload, type IndexEntry, type IndexEntryLegacy, type IndexInput, type IndexInputStats, type IndexedCSFFile, type IndexedStory, type Indexer, type IndexerOptions, type LoadOptions, type LoadedPreset, type Middleware, type ModuleExport, type ModuleExports, type ModuleImportFn, type NamedOrDefaultProjectAnnotations, type NormalizedComponentAnnotations, type NormalizedProjectAnnotations, type NormalizedStoriesSpecifier, type NormalizedStoryAnnotations, type Options, type PackageJson, type PartialArgsStoryFn, type Path, type PreparedMeta, type PreparedStory, type Preset, type PresetConfig, type PresetProperty, type PresetPropertyFn, type PresetValue, type Presets, type PreviewAnnotation, type ProjectAnnotations, type Ref, type RenderContext, type RenderContextCallbacks, type RenderToCanvas, type Renderer, type RendererName, type ResolvedModuleExport, type ResolvedModuleExportFromType, type ResolvedModuleExportType, type SetGlobalsPayload, type SetStoriesPayload, type SetStoriesStory, type SetStoriesStoryData, type Stats, type Store_CSFExports, type StoriesEntry, type StoriesSpecifier, type StoriesWithPartialProps, type StoryIndex, type StoryIndexEntry, type StoryIndexInput, type StoryIndexV2, type StoryIndexV3, type StoryPreparedPayload, type StoryRenderOptions, type StorybookConfig, type StorybookConfigOptions, type StorybookConfigRaw, type StorybookInternalParameters, type StorybookParameters, type SupportedFrameworks, type SupportedRenderers, type TagOptions, type TagsOptions, type TeardownRenderToCanvas, type TestBuildConfig, type TestBuildFlags, type TypescriptOptions, type V3CompatIndexEntry, type VersionCheck, type ViewMode, type WebRenderer };