storybook 9.0.0-alpha.11 → 9.0.0-alpha.13
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.
- package/assets/docs/addon-backgrounds.gif +0 -0
- package/assets/docs/highlight.png +0 -0
- package/bin/index.cjs +2 -2
- package/dist/actions/preview.d.ts +0 -1
- package/dist/backgrounds/index.cjs +148 -0
- package/dist/backgrounds/index.d.ts +91 -0
- package/dist/backgrounds/index.js +130 -0
- package/dist/backgrounds/preview.cjs +143 -0
- package/dist/backgrounds/preview.d.ts +54 -0
- package/dist/backgrounds/preview.js +127 -0
- package/dist/bin/index.cjs +49 -61
- package/dist/bin/index.js +49 -61
- package/dist/builder-manager/index.cjs +390 -380
- package/dist/builder-manager/index.js +489 -479
- package/dist/channels/index.cjs +17 -17
- package/dist/channels/index.js +3 -3
- package/dist/cli/bin/index.cjs +225 -225
- package/dist/cli/bin/index.js +234 -234
- package/dist/cli/index.cjs +1904 -1909
- package/dist/cli/index.d.ts +3 -7
- package/dist/cli/index.js +734 -739
- package/dist/common/index.cjs +2401 -2388
- package/dist/common/index.d.ts +1 -13
- package/dist/common/index.js +2609 -2596
- package/dist/components/index.cjs +5701 -5946
- package/dist/components/index.d.ts +3 -254
- package/dist/components/index.js +7271 -13724
- package/dist/controls/preview.d.ts +0 -1
- package/dist/core-events/index.cjs +91 -106
- package/dist/core-events/index.d.ts +2 -80
- package/dist/core-events/index.js +79 -94
- package/dist/core-server/index.cjs +5221 -5122
- package/dist/core-server/index.d.ts +32 -23
- package/dist/core-server/index.js +6511 -6412
- package/dist/core-server/presets/common-manager.js +9815 -12
- package/dist/core-server/presets/common-preset.cjs +2817 -2989
- package/dist/core-server/presets/common-preset.js +2896 -3068
- package/dist/csf/index.d.ts +0 -2
- package/dist/csf-tools/index.cjs +0 -8
- package/dist/csf-tools/index.d.ts +0 -4
- package/dist/csf-tools/index.js +0 -8
- package/dist/docs-tools/index.cjs +626 -600
- package/dist/docs-tools/index.js +613 -587
- package/dist/highlight/index.cjs +27 -0
- package/dist/highlight/index.d.ts +17 -0
- package/dist/highlight/index.js +7 -0
- package/dist/highlight/preview.cjs +81 -0
- package/dist/highlight/preview.d.ts +54 -0
- package/dist/highlight/preview.js +67 -0
- package/dist/instrumenter/index.cjs +70 -60
- package/dist/instrumenter/index.d.ts +8 -7
- package/dist/instrumenter/index.js +98 -88
- package/dist/manager/globals-module-info.cjs +21 -33
- package/dist/manager/globals-module-info.js +6 -18
- package/dist/manager/globals-runtime.js +22671 -22006
- package/dist/manager/runtime.js +4996 -4581
- package/dist/manager-api/index.cjs +1289 -1384
- package/dist/manager-api/index.d.ts +109 -114
- package/dist/manager-api/index.js +920 -1021
- package/dist/measure/index.cjs +474 -0
- package/dist/measure/index.d.ts +66 -0
- package/dist/measure/index.js +462 -0
- package/dist/measure/preview.cjs +464 -0
- package/dist/measure/preview.d.ts +59 -0
- package/dist/measure/preview.js +448 -0
- package/dist/outline/index.cjs +528 -0
- package/dist/outline/index.d.ts +66 -0
- package/dist/outline/index.js +500 -0
- package/dist/outline/preview.cjs +518 -0
- package/dist/outline/preview.d.ts +59 -0
- package/dist/outline/preview.js +486 -0
- package/dist/preview/runtime.js +14340 -13357
- package/dist/preview-api/index.cjs +1201 -1321
- package/dist/preview-api/index.d.ts +66 -120
- package/dist/preview-api/index.js +1546 -1665
- package/dist/telemetry/index.d.ts +1 -1
- package/dist/test/index.cjs +1547 -1546
- package/dist/test/index.js +2308 -2307
- package/dist/test/preview.cjs +1906 -1905
- package/dist/test/preview.d.ts +0 -6
- package/dist/test/preview.js +1439 -1438
- package/dist/test/spy.cjs +65 -64
- package/dist/test/spy.js +59 -58
- package/dist/types/index.cjs +11 -12
- package/dist/types/index.d.ts +502 -298
- package/dist/types/index.js +1 -2
- package/dist/viewport/preview.d.ts +0 -1
- package/package.json +124 -19
- package/dist/actions/manager.js +0 -1196
- package/dist/component-testing/manager.js +0 -3099
- package/dist/controls/manager.js +0 -5545
- package/dist/viewport/manager.js +0 -400
- /package/dist/{component-testing/manager.css → core-server/presets/common-manager.css} +0 -0
|
@@ -2,11 +2,11 @@ import React, { FC, ReactNode, ReactElement, Component } from 'react';
|
|
|
2
2
|
import { Channel, Listener as Listener$1 } from 'storybook/internal/channels';
|
|
3
3
|
export { Listener as ChannelListener } from 'storybook/internal/channels';
|
|
4
4
|
import { RouterData, NavigateOptions } from 'storybook/internal/router';
|
|
5
|
-
import { Addon_Types, Addon_TypesEnum, Addon_Collection, Addon_TypesMapping, Addon_BaseType,
|
|
5
|
+
import { Addon_Types, Addon_TypesEnum, Addon_Collection, Addon_TypesMapping, Addon_BaseType, Addon_TestProviderType, Addon_PageType, Addon_WrapperType, Addon_Config, API_ProviderData, API_StateMerger, API_Provider, Globals, GlobalTypes, API_PanelPositions, API_Layout, API_UI, API_Notification, API_IframeRenderer, API_ComposedRef, API_SetRefData, API_ComposedRefUpdate, API_Refs, StoryId, API_Settings, API_HashEntry, API_ViewMode, API_LeafEntry, API_PreparedStoryIndex, API_StoryEntry, Args, API_IndexHash, API_DocsEntry, API_FilterFunction, API_LoadedRefData, API_Version, API_Versions, API_UnknownEntries, API_OptionsData, Parameters, ArgTypes, NormalizedProjectAnnotations, ProjectAnnotations, ComposedStoryFn } from 'storybook/internal/types';
|
|
6
6
|
export { Addon_Type as Addon, API_ComponentEntry as ComponentEntry, API_ComposedRef as ComposedRef, API_DocsEntry as DocsEntry, API_GroupEntry as GroupEntry, API_HashEntry as HashEntry, API_IndexHash as IndexHash, API_LeafEntry as LeafEntry, API_Refs as Refs, API_RootEntry as RootEntry, API_IndexHash as StoriesHash, API_StoryEntry as StoryEntry } from 'storybook/internal/types';
|
|
7
|
-
import { TestProviderState as TestProviderState$1, TestProviderId as TestProviderId$1, TestProviders, WhatsNewData } from 'storybook/internal/core-events';
|
|
8
7
|
import { ThemeVars } from 'storybook/theming';
|
|
9
8
|
import { toId, StoryId as StoryId$1 } from 'storybook/internal/csf';
|
|
9
|
+
import { WhatsNewData } from 'storybook/internal/core-events';
|
|
10
10
|
|
|
11
11
|
declare function mockChannel(): Channel;
|
|
12
12
|
|
|
@@ -22,7 +22,7 @@ declare class AddonStore {
|
|
|
22
22
|
ready: () => Promise<Channel>;
|
|
23
23
|
hasChannel: () => boolean;
|
|
24
24
|
setChannel: (channel: Channel) => void;
|
|
25
|
-
getElements<T extends Addon_Types | Addon_TypesEnum.experimental_PAGE | Addon_TypesEnum.
|
|
25
|
+
getElements<T extends Addon_Types | Addon_TypesEnum.experimental_PAGE | Addon_TypesEnum.experimental_TEST_PROVIDER>(type: T): Addon_Collection<Addon_TypesMapping[T]> | any;
|
|
26
26
|
/**
|
|
27
27
|
* Adds an addon to the addon store.
|
|
28
28
|
*
|
|
@@ -30,7 +30,7 @@ declare class AddonStore {
|
|
|
30
30
|
* @param {Addon_Type} addon - The addon to add.
|
|
31
31
|
* @returns {void}
|
|
32
32
|
*/
|
|
33
|
-
add(id: string, addon: Addon_BaseType | Omit<
|
|
33
|
+
add(id: string, addon: Addon_BaseType | Omit<Addon_TestProviderType, 'id'> | Omit<Addon_PageType, 'id'> | Omit<Addon_WrapperType, 'id'>): void;
|
|
34
34
|
setConfig: (value: Addon_Config) => void;
|
|
35
35
|
getConfig: () => Addon_Config;
|
|
36
36
|
/**
|
|
@@ -81,7 +81,7 @@ type ModuleArgs = RouterData & API_ProviderData<API> & {
|
|
|
81
81
|
store: Store;
|
|
82
82
|
};
|
|
83
83
|
|
|
84
|
-
interface SubAPI$
|
|
84
|
+
interface SubAPI$c {
|
|
85
85
|
/**
|
|
86
86
|
* Returns a collection of elements of a specific type.
|
|
87
87
|
*
|
|
@@ -91,7 +91,7 @@ interface SubAPI$d {
|
|
|
91
91
|
* @returns {Addon_Collection<T>} - A collection of elements of the specified type.
|
|
92
92
|
* @protected This is used internally in storybook's manager.
|
|
93
93
|
*/
|
|
94
|
-
getElements: <T extends Addon_Types | Addon_TypesEnum.experimental_PAGE | Addon_TypesEnum.
|
|
94
|
+
getElements: <T extends Addon_Types | Addon_TypesEnum.experimental_PAGE | Addon_TypesEnum.experimental_TEST_PROVIDER>(type: T) => Addon_Collection<Addon_TypesMapping[T]>;
|
|
95
95
|
/**
|
|
96
96
|
* Returns the id of the currently selected panel.
|
|
97
97
|
*
|
|
@@ -128,7 +128,7 @@ interface SubAPI$d {
|
|
|
128
128
|
getAddonState<S>(addonId: string): S;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
interface SubAPI$
|
|
131
|
+
interface SubAPI$b {
|
|
132
132
|
/**
|
|
133
133
|
* Returns the channel object.
|
|
134
134
|
*
|
|
@@ -171,20 +171,6 @@ interface SubAPI$c {
|
|
|
171
171
|
once: (type: string, handler: Listener$1) => void;
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
type SubState$a = {
|
|
175
|
-
testProviders: TestProviders;
|
|
176
|
-
};
|
|
177
|
-
interface RunOptions {
|
|
178
|
-
entryId?: StoryId;
|
|
179
|
-
}
|
|
180
|
-
type SubAPI$b = {
|
|
181
|
-
getTestProviderState(id: string): TestProviderState$1 | undefined;
|
|
182
|
-
updateTestProviderState(id: TestProviderId$1, update: Partial<TestProviderState$1>): void;
|
|
183
|
-
clearTestProviderState(id: TestProviderId$1): void;
|
|
184
|
-
runTestProvider(id: TestProviderId$1, options?: RunOptions): () => void;
|
|
185
|
-
cancelTestProvider(id: TestProviderId$1): void;
|
|
186
|
-
};
|
|
187
|
-
|
|
188
174
|
interface SubState$9 {
|
|
189
175
|
globals?: Globals;
|
|
190
176
|
userGlobals?: Globals;
|
|
@@ -391,7 +377,7 @@ interface SubState$5 {
|
|
|
391
377
|
|
|
392
378
|
declare const isMacLike: () => boolean;
|
|
393
379
|
declare const controlOrMetaSymbol: () => "⌘" | "ctrl";
|
|
394
|
-
declare const controlOrMetaKey: () => "
|
|
380
|
+
declare const controlOrMetaKey: () => "meta" | "control";
|
|
395
381
|
declare const optionOrAltSymbol: () => "⌥" | "alt";
|
|
396
382
|
declare const isShortcutTaken: (arr1: string[], arr2: string[]) => boolean;
|
|
397
383
|
type KeyboardEventLike = Pick<KeyboardEvent, 'altKey' | 'ctrlKey' | 'metaKey' | 'shiftKey' | 'key' | 'code' | 'keyCode' | 'preventDefault'>;
|
|
@@ -651,6 +637,14 @@ interface SubAPI$3 {
|
|
|
651
637
|
* @returns {StoryId} The ID of the leaf story, or null if no leaf story was found.
|
|
652
638
|
*/
|
|
653
639
|
findLeafStoryId(index: API_IndexHash, storyId: StoryId): StoryId;
|
|
640
|
+
/**
|
|
641
|
+
* Finds all the leaf story IDs for the given entry ID in the given index.
|
|
642
|
+
*
|
|
643
|
+
* @param {StoryId} entryId - The ID of the entry to find the leaf story IDs for.
|
|
644
|
+
* @returns {StoryId[]} The IDs of all the leaf stories, or an empty array if no leaf stories were
|
|
645
|
+
* found.
|
|
646
|
+
*/
|
|
647
|
+
findAllLeafStoryIds(entryId: string): StoryId[];
|
|
654
648
|
/**
|
|
655
649
|
* Finds the ID of the sibling story in the given direction for the given story ID in the given
|
|
656
650
|
* story index.
|
|
@@ -818,6 +812,67 @@ declare const experimental_requestResponse: <RequestPayload, ResponsePayload = v
|
|
|
818
812
|
|
|
819
813
|
declare const _default: <TObj = any>(a: TObj, ...b: Partial<TObj>[]) => TObj;
|
|
820
814
|
|
|
815
|
+
declare const ActiveTabs: {
|
|
816
|
+
SIDEBAR: "sidebar";
|
|
817
|
+
CANVAS: "canvas";
|
|
818
|
+
ADDONS: "addons";
|
|
819
|
+
};
|
|
820
|
+
|
|
821
|
+
declare const ManagerContext: React.Context<{
|
|
822
|
+
api: API;
|
|
823
|
+
state: State;
|
|
824
|
+
}>;
|
|
825
|
+
type State = SubState$8 & SubState$3 & SubState$6 & SubState$7 & SubState$1 & SubState$2 & SubState$4 & SubState$5 & SubState$9 & SubState & RouterData & API_OptionsData & Other;
|
|
826
|
+
type API = SubAPI$c & SubAPI$b & SubAPI$7 & SubAPI$3 & SubAPI$6 & SubAPI$a & SubAPI$9 & SubAPI$8 & SubAPI$4 & SubAPI$5 & SubAPI$1 & SubAPI$2 & SubAPI & Other;
|
|
827
|
+
interface Other {
|
|
828
|
+
[key: string]: any;
|
|
829
|
+
}
|
|
830
|
+
interface Combo {
|
|
831
|
+
api: API;
|
|
832
|
+
state: State;
|
|
833
|
+
}
|
|
834
|
+
type ManagerProviderProps = RouterData & API_ProviderData<API> & {
|
|
835
|
+
children: ReactNode | FC<Combo>;
|
|
836
|
+
};
|
|
837
|
+
declare const combineParameters: (...parameterSets: Parameters[]) => {};
|
|
838
|
+
declare class ManagerProvider extends Component<ManagerProviderProps, State> {
|
|
839
|
+
api: API;
|
|
840
|
+
modules: ReturnType<ModuleFn>[];
|
|
841
|
+
static displayName: string;
|
|
842
|
+
constructor(props: ManagerProviderProps);
|
|
843
|
+
static getDerivedStateFromProps(props: ManagerProviderProps, state: State): State;
|
|
844
|
+
shouldComponentUpdate(nextProps: ManagerProviderProps, nextState: State): boolean;
|
|
845
|
+
initModules: () => void;
|
|
846
|
+
render(): React.JSX.Element;
|
|
847
|
+
}
|
|
848
|
+
interface ManagerConsumerProps<P = unknown> {
|
|
849
|
+
filter?: (combo: Combo) => P;
|
|
850
|
+
children: FC<P> | ReactNode;
|
|
851
|
+
}
|
|
852
|
+
declare function ManagerConsumer<P = Combo>({ filter, children, }: ManagerConsumerProps<P>): ReactElement;
|
|
853
|
+
declare function useStorybookState(): State;
|
|
854
|
+
declare function useStorybookApi(): API;
|
|
855
|
+
|
|
856
|
+
interface API_EventMap {
|
|
857
|
+
[eventId: string]: Listener$1;
|
|
858
|
+
}
|
|
859
|
+
declare const useChannel: (eventMap: API_EventMap, deps?: any[]) => (type: string, ...args: any[]) => void;
|
|
860
|
+
declare function useStoryPrepared(storyId?: StoryId): boolean;
|
|
861
|
+
declare function useParameter<S>(parameterKey: string, defaultValue?: S): S;
|
|
862
|
+
declare function useSharedState<S>(stateId: string, defaultState?: S): [S, (newStateOrMerger: S | API_StateMerger<S>, options?: Options) => void];
|
|
863
|
+
declare function useAddonState<S>(addonId: string, defaultState?: S): [S, (newStateOrMerger: S | API_StateMerger<S>, options?: Options) => void];
|
|
864
|
+
declare function useArgs(): [Args, (newArgs: Args) => void, (argNames?: string[]) => void, Args];
|
|
865
|
+
declare function useGlobals(): [
|
|
866
|
+
globals: Globals,
|
|
867
|
+
updateGlobals: (newGlobals: Globals) => void,
|
|
868
|
+
storyGlobals: Globals,
|
|
869
|
+
userGlobals: Globals
|
|
870
|
+
];
|
|
871
|
+
declare function useGlobalTypes(): ArgTypes;
|
|
872
|
+
declare function useArgTypes(): ArgTypes;
|
|
873
|
+
|
|
874
|
+
declare const typesX: typeof Addon_TypesEnum;
|
|
875
|
+
|
|
821
876
|
type EnvironmentType = (typeof UniversalStore.Environment)[keyof typeof UniversalStore.Environment];
|
|
822
877
|
type StatusType = (typeof UniversalStore.Status)[keyof typeof UniversalStore.Status];
|
|
823
878
|
type StateUpdater<TState> = (prevState: TState) => TState;
|
|
@@ -1124,28 +1179,6 @@ declare class MockUniversalStore<State, CustomEvent extends {
|
|
|
1124
1179
|
unsubscribeAll(): void;
|
|
1125
1180
|
}
|
|
1126
1181
|
|
|
1127
|
-
declare global {
|
|
1128
|
-
interface SymbolConstructor {
|
|
1129
|
-
readonly observable: symbol;
|
|
1130
|
-
}
|
|
1131
|
-
}
|
|
1132
|
-
|
|
1133
|
-
declare global {
|
|
1134
|
-
var globalProjectAnnotations: NormalizedProjectAnnotations<any>;
|
|
1135
|
-
var defaultProjectAnnotations: ProjectAnnotations<any>;
|
|
1136
|
-
}
|
|
1137
|
-
type WrappedStoryRef = {
|
|
1138
|
-
__pw_type: 'jsx' | 'importRef';
|
|
1139
|
-
};
|
|
1140
|
-
type UnwrappedJSXStoryRef = {
|
|
1141
|
-
__pw_type: 'jsx';
|
|
1142
|
-
type: UnwrappedImportStoryRef;
|
|
1143
|
-
};
|
|
1144
|
-
type UnwrappedImportStoryRef = ComposedStoryFn;
|
|
1145
|
-
declare global {
|
|
1146
|
-
function __pwUnwrapObject(storyRef: WrappedStoryRef): Promise<UnwrappedJSXStoryRef | UnwrappedImportStoryRef>;
|
|
1147
|
-
}
|
|
1148
|
-
|
|
1149
1182
|
type StatusValue = 'status-value:pending' | 'status-value:success' | 'status-value:error' | 'status-value:warning' | 'status-value:unknown';
|
|
1150
1183
|
type StatusTypeId = string;
|
|
1151
1184
|
type StatusByTypeId = Record<StatusTypeId, Status>;
|
|
@@ -1159,6 +1192,13 @@ interface Status {
|
|
|
1159
1192
|
data?: any;
|
|
1160
1193
|
sidebarContextMenu?: boolean;
|
|
1161
1194
|
}
|
|
1195
|
+
declare const StatusStoreEventType: {
|
|
1196
|
+
readonly SELECT: "select";
|
|
1197
|
+
};
|
|
1198
|
+
type StatusStoreEvent = {
|
|
1199
|
+
type: typeof StatusStoreEventType.SELECT;
|
|
1200
|
+
payload: Status[];
|
|
1201
|
+
};
|
|
1162
1202
|
type StatusStore = {
|
|
1163
1203
|
getAll: () => StatusesByStoryIdAndTypeId;
|
|
1164
1204
|
set: (statuses: Status[]) => void;
|
|
@@ -1171,6 +1211,28 @@ type StatusStoreByTypeId = StatusStore & {
|
|
|
1171
1211
|
};
|
|
1172
1212
|
type UseStatusStore = <T = StatusesByStoryIdAndTypeId>(selector?: (statuses: StatusesByStoryIdAndTypeId) => T) => T;
|
|
1173
1213
|
|
|
1214
|
+
declare global {
|
|
1215
|
+
interface SymbolConstructor {
|
|
1216
|
+
readonly observable: symbol;
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
declare global {
|
|
1221
|
+
var globalProjectAnnotations: NormalizedProjectAnnotations<any>;
|
|
1222
|
+
var defaultProjectAnnotations: ProjectAnnotations<any>;
|
|
1223
|
+
}
|
|
1224
|
+
type WrappedStoryRef = {
|
|
1225
|
+
__pw_type: 'jsx' | 'importRef';
|
|
1226
|
+
};
|
|
1227
|
+
type UnwrappedJSXStoryRef = {
|
|
1228
|
+
__pw_type: 'jsx';
|
|
1229
|
+
type: UnwrappedImportStoryRef;
|
|
1230
|
+
};
|
|
1231
|
+
type UnwrappedImportStoryRef = ComposedStoryFn;
|
|
1232
|
+
declare global {
|
|
1233
|
+
function __pwUnwrapObject(storyRef: WrappedStoryRef): Promise<UnwrappedJSXStoryRef | UnwrappedImportStoryRef>;
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1174
1236
|
type TestProviderState = 'test-provider-state:pending' | 'test-provider-state:running' | 'test-provider-state:succeeded' | 'test-provider-state:crashed';
|
|
1175
1237
|
type TestProviderId = string;
|
|
1176
1238
|
type TestProviderStateByProviderId = Record<TestProviderId, TestProviderState>;
|
|
@@ -1425,6 +1487,7 @@ declare const fullStatusStore: StatusStore & {
|
|
|
1425
1487
|
};
|
|
1426
1488
|
declare const getStatusStoreByTypeId: (typeId: StatusTypeId) => StatusStoreByTypeId;
|
|
1427
1489
|
declare const useStatusStore: UseStatusStore;
|
|
1490
|
+
declare const universalStatusStore: UniversalStore<StatusesByStoryIdAndTypeId, StatusStoreEvent>;
|
|
1428
1491
|
|
|
1429
1492
|
declare const fullTestProviderStore: {
|
|
1430
1493
|
settingsChanged: () => void;
|
|
@@ -1439,74 +1502,6 @@ declare const fullTestProviderStore: {
|
|
|
1439
1502
|
};
|
|
1440
1503
|
declare const getTestProviderStoreById: (testProviderId: TestProviderId) => TestProviderStoreById;
|
|
1441
1504
|
declare const useTestProviderStore: UseTestProviderStore;
|
|
1505
|
+
declare const universalTestProviderStore: UniversalStore<TestProviderStateByProviderId, TestProviderStoreEvent>;
|
|
1442
1506
|
|
|
1443
|
-
|
|
1444
|
-
SIDEBAR: "sidebar";
|
|
1445
|
-
CANVAS: "canvas";
|
|
1446
|
-
ADDONS: "addons";
|
|
1447
|
-
};
|
|
1448
|
-
|
|
1449
|
-
declare const ManagerContext: React.Context<{
|
|
1450
|
-
api: API;
|
|
1451
|
-
state: State;
|
|
1452
|
-
}>;
|
|
1453
|
-
type State = SubState$8 & SubState$3 & SubState$6 & SubState$7 & SubState$a & SubState$1 & SubState$2 & SubState$4 & SubState$5 & SubState$9 & SubState & RouterData & API_OptionsData & DeprecatedState & Other;
|
|
1454
|
-
type API = SubAPI$d & SubAPI$c & SubAPI$7 & SubAPI$3 & SubAPI$6 & SubAPI$a & SubAPI$9 & SubAPI$8 & SubAPI$b & SubAPI$4 & SubAPI$5 & SubAPI$1 & SubAPI$2 & SubAPI & Other;
|
|
1455
|
-
interface DeprecatedState {
|
|
1456
|
-
/** @deprecated Use index */
|
|
1457
|
-
storiesHash: API_IndexHash;
|
|
1458
|
-
/** @deprecated Use previewInitialized */
|
|
1459
|
-
storiesConfigured: boolean;
|
|
1460
|
-
/** @deprecated Use indexError */
|
|
1461
|
-
storiesFailed?: Error;
|
|
1462
|
-
}
|
|
1463
|
-
interface Other {
|
|
1464
|
-
[key: string]: any;
|
|
1465
|
-
}
|
|
1466
|
-
interface Combo {
|
|
1467
|
-
api: API;
|
|
1468
|
-
state: State;
|
|
1469
|
-
}
|
|
1470
|
-
type ManagerProviderProps = RouterData & API_ProviderData<API> & {
|
|
1471
|
-
children: ReactNode | FC<Combo>;
|
|
1472
|
-
};
|
|
1473
|
-
declare const combineParameters: (...parameterSets: Parameters[]) => {};
|
|
1474
|
-
declare class ManagerProvider extends Component<ManagerProviderProps, State> {
|
|
1475
|
-
api: API;
|
|
1476
|
-
modules: ReturnType<ModuleFn>[];
|
|
1477
|
-
static displayName: string;
|
|
1478
|
-
constructor(props: ManagerProviderProps);
|
|
1479
|
-
static getDerivedStateFromProps(props: ManagerProviderProps, state: State): State;
|
|
1480
|
-
shouldComponentUpdate(nextProps: ManagerProviderProps, nextState: State): boolean;
|
|
1481
|
-
initModules: () => void;
|
|
1482
|
-
render(): React.JSX.Element;
|
|
1483
|
-
}
|
|
1484
|
-
interface ManagerConsumerProps<P = unknown> {
|
|
1485
|
-
filter?: (combo: Combo) => P;
|
|
1486
|
-
children: FC<P> | ReactNode;
|
|
1487
|
-
}
|
|
1488
|
-
declare function ManagerConsumer<P = Combo>({ filter, children, }: ManagerConsumerProps<P>): ReactElement;
|
|
1489
|
-
declare function useStorybookState(): State;
|
|
1490
|
-
declare function useStorybookApi(): API;
|
|
1491
|
-
|
|
1492
|
-
interface API_EventMap {
|
|
1493
|
-
[eventId: string]: Listener$1;
|
|
1494
|
-
}
|
|
1495
|
-
declare const useChannel: (eventMap: API_EventMap, deps?: any[]) => (type: string, ...args: any[]) => void;
|
|
1496
|
-
declare function useStoryPrepared(storyId?: StoryId): boolean;
|
|
1497
|
-
declare function useParameter<S>(parameterKey: string, defaultValue?: S): S;
|
|
1498
|
-
declare function useSharedState<S>(stateId: string, defaultState?: S): [S, (newStateOrMerger: S | API_StateMerger<S>, options?: Options) => void];
|
|
1499
|
-
declare function useAddonState<S>(addonId: string, defaultState?: S): [S, (newStateOrMerger: S | API_StateMerger<S>, options?: Options) => void];
|
|
1500
|
-
declare function useArgs(): [Args, (newArgs: Args) => void, (argNames?: string[]) => void, Args];
|
|
1501
|
-
declare function useGlobals(): [
|
|
1502
|
-
globals: Globals,
|
|
1503
|
-
updateGlobals: (newGlobals: Globals) => void,
|
|
1504
|
-
storyGlobals: Globals,
|
|
1505
|
-
userGlobals: Globals
|
|
1506
|
-
];
|
|
1507
|
-
declare function useGlobalTypes(): ArgTypes;
|
|
1508
|
-
declare function useArgTypes(): ArgTypes;
|
|
1509
|
-
|
|
1510
|
-
declare const typesX: typeof Addon_TypesEnum;
|
|
1511
|
-
|
|
1512
|
-
export { type API, type API_EventMap, ActiveTabs, AddonStore, type Combo, ManagerConsumer as Consumer, type KeyboardEventLike, ManagerContext, type ManagerProviderProps, ManagerProvider as Provider, RequestResponseError, type State, type Options as StoreOptions, addons, combineParameters, controlOrMetaKey, controlOrMetaSymbol, eventMatchesShortcut, eventToShortcut, MockUniversalStore as experimental_MockUniversalStore, UniversalStore as experimental_UniversalStore, getStatusStoreByTypeId as experimental_getStatusStore, getTestProviderStoreById as experimental_getTestProviderStore, experimental_requestResponse, useStatusStore as experimental_useStatusStore, useTestProviderStore as experimental_useTestProviderStore, useUniversalStore as experimental_useUniversalStore, fullStatusStore as internal_fullStatusStore, fullTestProviderStore as internal_fullTestProviderStore, isMacLike, isShortcutTaken, keyToSymbol, _default as merge, mockChannel, optionOrAltSymbol, shortcutMatchesShortcut, shortcutToHumanString, typesX as types, useAddonState, useArgTypes, useArgs, useChannel, useGlobalTypes, useGlobals, useParameter, useSharedState, useStoryPrepared, useStorybookApi, useStorybookState };
|
|
1507
|
+
export { type API, type API_EventMap, ActiveTabs, AddonStore, type Combo, ManagerConsumer as Consumer, type KeyboardEventLike, ManagerContext, type ManagerProviderProps, ManagerProvider as Provider, RequestResponseError, type State, type Options as StoreOptions, addons, combineParameters, controlOrMetaKey, controlOrMetaSymbol, eventMatchesShortcut, eventToShortcut, MockUniversalStore as experimental_MockUniversalStore, UniversalStore as experimental_UniversalStore, getStatusStoreByTypeId as experimental_getStatusStore, getTestProviderStoreById as experimental_getTestProviderStore, experimental_requestResponse, useStatusStore as experimental_useStatusStore, useTestProviderStore as experimental_useTestProviderStore, useUniversalStore as experimental_useUniversalStore, fullStatusStore as internal_fullStatusStore, fullTestProviderStore as internal_fullTestProviderStore, universalStatusStore as internal_universalStatusStore, universalTestProviderStore as internal_universalTestProviderStore, isMacLike, isShortcutTaken, keyToSymbol, _default as merge, mockChannel, optionOrAltSymbol, shortcutMatchesShortcut, shortcutToHumanString, typesX as types, useAddonState, useArgTypes, useArgs, useChannel, useGlobalTypes, useGlobals, useParameter, useSharedState, useStoryPrepared, useStorybookApi, useStorybookState };
|