@storybook/manager-api 8.0.0-alpha.9 → 8.0.0-beta.1
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/dist/index.d.ts +19 -55
- package/dist/index.js +3 -3
- package/dist/index.mjs +3 -3
- package/package.json +8 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ReactNode, FC, Component, ReactElement } from 'react';
|
|
2
|
-
import { API_ProviderData, API_IframeRenderer, Addon_Types, Addon_TypesEnum, Addon_Collection, Addon_TypesMapping,
|
|
2
|
+
import { API_ProviderData, API_IframeRenderer, Addon_Types, Addon_TypesEnum, Addon_Collection, Addon_TypesMapping, API_StateMerger, API_Provider, API_Notification, StoryId, API_Settings, API_LoadedRefData, API_PreparedStoryIndex, API_ViewMode, API_StatusState, API_FilterFunction, API_HashEntry, API_LeafEntry, API_StoryEntry, Args, API_IndexHash, API_ComposedRef, API_StatusUpdate, API_DocsEntry, API_Refs, API_SetRefData, API_ComposedRefUpdate, API_Layout, API_UI, API_PanelPositions, API_Versions, API_UnknownEntries, API_Version, Globals, GlobalTypes, Addon_BaseType, Addon_SidebarTopType, Addon_SidebarBottomType, Addon_PageType, Addon_WrapperType, Addon_Config, API_OptionsData, Parameters, ArgTypes } from '@storybook/types';
|
|
3
3
|
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/types';
|
|
4
4
|
import { RouterData, NavigateOptions } from '@storybook/router';
|
|
5
5
|
import { Listener, Channel } from '@storybook/channels';
|
|
@@ -53,24 +53,9 @@ interface SubAPI$b {
|
|
|
53
53
|
* @protected This is used internally in storybook's manager.
|
|
54
54
|
* @template T - The type of the elements in the collection.
|
|
55
55
|
* @param {Addon_Types | Addon_TypesEnum.experimental_PAGE} type - The type of the elements to retrieve.
|
|
56
|
-
* @returns {
|
|
56
|
+
* @returns {Addon_Collection<T>} - A collection of elements of the specified type.
|
|
57
57
|
*/
|
|
58
58
|
getElements: <T extends Addon_Types | Addon_TypesEnum.experimental_PAGE | Addon_TypesEnum.experimental_SIDEBAR_BOTTOM | Addon_TypesEnum.experimental_SIDEBAR_TOP = Addon_Types>(type: T) => Addon_Collection<Addon_TypesMapping[T]>;
|
|
59
|
-
/**
|
|
60
|
-
* Returns a collection of all panels.
|
|
61
|
-
* This is the same as calling getElements('panel')
|
|
62
|
-
* @protected This is used internally in storybook's manager.
|
|
63
|
-
* @deprecated please use getElements('panel') instead. This API will be removed in storybook 8.0.
|
|
64
|
-
* @returns {API_Panels} - A collection of all panels.
|
|
65
|
-
*/
|
|
66
|
-
getPanels: () => API_Panels;
|
|
67
|
-
/**
|
|
68
|
-
* Returns a collection of panels currently enabled for the selected story.
|
|
69
|
-
* @protected This is used internally in storybook's manager.
|
|
70
|
-
* @deprecated please use getElements('panel') instead, and do the filtering manually. This API will be removed in storybook 8.0.
|
|
71
|
-
* @returns {API_Panels} - A collection of all panels.
|
|
72
|
-
*/
|
|
73
|
-
getStoryPanels: () => API_Panels;
|
|
74
59
|
/**
|
|
75
60
|
* Returns the id of the currently selected panel.
|
|
76
61
|
* @returns {string} - The ID of the currently selected panel.
|
|
@@ -641,6 +626,12 @@ interface SubAPI$3 {
|
|
|
641
626
|
* @returns {void}
|
|
642
627
|
*/
|
|
643
628
|
setQueryParams: (input: QueryParams) => void;
|
|
629
|
+
/**
|
|
630
|
+
* Set the query parameters for the current URL & navigates.
|
|
631
|
+
* @param {QueryParams} input - An object containing the query parameters to set.
|
|
632
|
+
* @returns {void}
|
|
633
|
+
*/
|
|
634
|
+
applyQueryParams: (input: QueryParams) => void;
|
|
644
635
|
}
|
|
645
636
|
|
|
646
637
|
interface SubState$2 {
|
|
@@ -661,6 +652,16 @@ interface SubAPI$2 {
|
|
|
661
652
|
* @returns {API_Version} The latest version of the Storybook Manager.
|
|
662
653
|
*/
|
|
663
654
|
getLatestVersion: () => API_Version;
|
|
655
|
+
/**
|
|
656
|
+
* Returns the URL of the Storybook documentation for the current version.
|
|
657
|
+
*
|
|
658
|
+
* @returns {string} The URL of the Storybook Manager documentation.
|
|
659
|
+
*/
|
|
660
|
+
getDocsUrl: (options: {
|
|
661
|
+
subpath?: string;
|
|
662
|
+
versioned?: boolean;
|
|
663
|
+
renderer?: boolean;
|
|
664
|
+
}) => string;
|
|
664
665
|
/**
|
|
665
666
|
* Checks if an update is available for the Storybook Manager.
|
|
666
667
|
*
|
|
@@ -703,63 +704,26 @@ interface SubAPI {
|
|
|
703
704
|
|
|
704
705
|
declare function mockChannel(): Channel;
|
|
705
706
|
|
|
706
|
-
interface DeprecatedAddonWithId {
|
|
707
|
-
/**
|
|
708
|
-
* @deprecated will be removed in 8.0, when registering addons, please use the addon id as the first argument
|
|
709
|
-
*/
|
|
710
|
-
id?: string;
|
|
711
|
-
}
|
|
712
707
|
declare class AddonStore {
|
|
713
708
|
constructor();
|
|
714
709
|
private loaders;
|
|
715
710
|
private elements;
|
|
716
711
|
private config;
|
|
717
712
|
private channel;
|
|
718
|
-
/**
|
|
719
|
-
* @deprecated will be removed in 8.0
|
|
720
|
-
*/
|
|
721
|
-
private serverChannel;
|
|
722
713
|
private promise;
|
|
723
714
|
private resolve;
|
|
724
715
|
getChannel: () => Channel;
|
|
725
|
-
/**
|
|
726
|
-
* @deprecated will be removed in 8.0, use getChannel instead
|
|
727
|
-
*/
|
|
728
|
-
getServerChannel: () => Channel;
|
|
729
716
|
ready: () => Promise<Channel>;
|
|
730
717
|
hasChannel: () => boolean;
|
|
731
|
-
/**
|
|
732
|
-
* @deprecated will be removed in 8.0, please use the normal channel instead
|
|
733
|
-
*/
|
|
734
|
-
hasServerChannel: () => boolean;
|
|
735
718
|
setChannel: (channel: Channel) => void;
|
|
736
|
-
/**
|
|
737
|
-
* @deprecated will be removed in 8.0, please use the normal channel instead
|
|
738
|
-
*/
|
|
739
|
-
setServerChannel: (channel: Channel) => void;
|
|
740
719
|
getElements<T extends Addon_Types | Addon_TypesEnum.experimental_PAGE | Addon_TypesEnum.experimental_SIDEBAR_BOTTOM | Addon_TypesEnum.experimental_SIDEBAR_TOP>(type: T): Addon_Collection<Addon_TypesMapping[T]> | any;
|
|
741
|
-
/**
|
|
742
|
-
* Adds a panel to the addon store.
|
|
743
|
-
* @param {string} id - The id of the panel.
|
|
744
|
-
* @param {Addon_Type} options - The options for the panel.
|
|
745
|
-
* @returns {void}
|
|
746
|
-
*
|
|
747
|
-
* @deprecated Use the 'add' method instead.
|
|
748
|
-
* @example
|
|
749
|
-
* addons.add('My Panel', {
|
|
750
|
-
* title: 'My Title',
|
|
751
|
-
* type: types.PANEL,
|
|
752
|
-
* render: () => <div>My Content</div>,
|
|
753
|
-
* });
|
|
754
|
-
*/
|
|
755
|
-
addPanel: (id: string, options: Omit<Addon_BaseType, 'type' | 'id'> & DeprecatedAddonWithId) => void;
|
|
756
720
|
/**
|
|
757
721
|
* Adds an addon to the addon store.
|
|
758
722
|
* @param {string} id - The id of the addon.
|
|
759
723
|
* @param {Addon_Type} addon - The addon to add.
|
|
760
724
|
* @returns {void}
|
|
761
725
|
*/
|
|
762
|
-
add(id: string, addon: Addon_BaseType |
|
|
726
|
+
add(id: string, addon: Addon_BaseType | Omit<Addon_SidebarTopType, 'id'> | Omit<Addon_SidebarBottomType, 'id'> | Omit<Addon_PageType, 'id'> | Omit<Addon_WrapperType, 'id'>): void;
|
|
763
727
|
setConfig: (value: Addon_Config) => void;
|
|
764
728
|
getConfig: () => Addon_Config;
|
|
765
729
|
/**
|