@storybook/types 8.0.0-alpha.9 → 8.0.0-beta.0
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 +33 -80
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1009,7 +1009,7 @@ type ComponentTitle = string;
|
|
|
1009
1009
|
type StoryName = string;
|
|
1010
1010
|
/** @deprecated */
|
|
1011
1011
|
type StoryKind = ComponentTitle;
|
|
1012
|
-
type Tag = string;
|
|
1012
|
+
type Tag$1 = string;
|
|
1013
1013
|
interface StoryIdentifier {
|
|
1014
1014
|
componentId: ComponentId;
|
|
1015
1015
|
title: ComponentTitle;
|
|
@@ -1019,7 +1019,7 @@ interface StoryIdentifier {
|
|
|
1019
1019
|
name: StoryName;
|
|
1020
1020
|
/** @deprecated */
|
|
1021
1021
|
story: StoryName;
|
|
1022
|
-
tags: Tag[];
|
|
1022
|
+
tags: Tag$1[];
|
|
1023
1023
|
}
|
|
1024
1024
|
interface Parameters {
|
|
1025
1025
|
[name: string]: any;
|
|
@@ -1244,7 +1244,7 @@ interface ComponentAnnotations<TRenderer extends Renderer = Renderer, TArgs = Ar
|
|
|
1244
1244
|
/**
|
|
1245
1245
|
* Named tags for a story, used to filter stories in different contexts.
|
|
1246
1246
|
*/
|
|
1247
|
-
tags?: Tag[];
|
|
1247
|
+
tags?: Tag$1[];
|
|
1248
1248
|
}
|
|
1249
1249
|
type StoryAnnotations<TRenderer extends Renderer = Renderer, TArgs = Args, TRequiredArgs = Partial<TArgs>> = BaseAnnotations<TRenderer, TArgs> & {
|
|
1250
1250
|
/**
|
|
@@ -1262,7 +1262,7 @@ type StoryAnnotations<TRenderer extends Renderer = Renderer, TArgs = Args, TRequ
|
|
|
1262
1262
|
/**
|
|
1263
1263
|
* Named tags for a story, used to filter stories in different contexts.
|
|
1264
1264
|
*/
|
|
1265
|
-
tags?: Tag[];
|
|
1265
|
+
tags?: Tag$1[];
|
|
1266
1266
|
/** @deprecated */
|
|
1267
1267
|
story?: Omit<StoryAnnotations<TRenderer, TArgs>, 'story'>;
|
|
1268
1268
|
} & ({} extends TRequiredArgs ? {
|
|
@@ -1518,14 +1518,14 @@ interface IndexerOptions {
|
|
|
1518
1518
|
interface IndexedStory {
|
|
1519
1519
|
id: string;
|
|
1520
1520
|
name: string;
|
|
1521
|
-
tags?: Tag[];
|
|
1521
|
+
tags?: Tag$1[];
|
|
1522
1522
|
parameters?: Parameters;
|
|
1523
1523
|
}
|
|
1524
1524
|
interface IndexedCSFFile {
|
|
1525
1525
|
meta: {
|
|
1526
1526
|
id?: string;
|
|
1527
1527
|
title?: string;
|
|
1528
|
-
tags?: Tag[];
|
|
1528
|
+
tags?: Tag$1[];
|
|
1529
1529
|
};
|
|
1530
1530
|
stories: IndexedStory[];
|
|
1531
1531
|
}
|
|
@@ -1555,7 +1555,7 @@ interface BaseIndexEntry {
|
|
|
1555
1555
|
id: StoryId;
|
|
1556
1556
|
name: StoryName;
|
|
1557
1557
|
title: ComponentTitle;
|
|
1558
|
-
tags?: Tag[];
|
|
1558
|
+
tags?: Tag$1[];
|
|
1559
1559
|
importPath: Path;
|
|
1560
1560
|
}
|
|
1561
1561
|
type StoryIndexEntry = BaseIndexEntry & {
|
|
@@ -1585,7 +1585,9 @@ type BaseIndexInput = {
|
|
|
1585
1585
|
*/
|
|
1586
1586
|
metaId?: MetaId;
|
|
1587
1587
|
/** Tags for filtering entries in Storybook and its tools. */
|
|
1588
|
-
tags?: Tag[];
|
|
1588
|
+
tags?: Tag$1[];
|
|
1589
|
+
/** Tags from the meta for filtering entries in Storybook and its tools. */
|
|
1590
|
+
metaTags?: Tag$1[];
|
|
1589
1591
|
/**
|
|
1590
1592
|
* The id of the entry, auto-generated from {@link title}/{@link metaId} and {@link exportName} if unspecified.
|
|
1591
1593
|
* If specified, the story in the CSF file _must_ have a matching id set at `parameters.__id`, to be correctly matched.
|
|
@@ -1885,6 +1887,12 @@ interface TestBuildFlags {
|
|
|
1885
1887
|
interface TestBuildConfig {
|
|
1886
1888
|
test?: TestBuildFlags;
|
|
1887
1889
|
}
|
|
1890
|
+
type Tag = string;
|
|
1891
|
+
interface TagOptions {
|
|
1892
|
+
excludeFromSidebar: boolean;
|
|
1893
|
+
excludeFromDocsStories: boolean;
|
|
1894
|
+
}
|
|
1895
|
+
type TagsOptions = Record<Tag, Partial<TagOptions>>;
|
|
1888
1896
|
/**
|
|
1889
1897
|
* The interface for Storybook configuration used internally in presets
|
|
1890
1898
|
* The difference is that these values are the raw values, AKA, not wrapped with `PresetValue<>`
|
|
@@ -1919,9 +1927,9 @@ interface StorybookConfigRaw {
|
|
|
1919
1927
|
*/
|
|
1920
1928
|
disallowImplicitActionsInRenderV8?: boolean;
|
|
1921
1929
|
/**
|
|
1922
|
-
* Enable asynchronous component rendering in
|
|
1930
|
+
* Enable asynchronous component rendering in React renderer
|
|
1923
1931
|
*/
|
|
1924
|
-
|
|
1932
|
+
experimentalRSC?: boolean;
|
|
1925
1933
|
};
|
|
1926
1934
|
build?: TestBuildConfig;
|
|
1927
1935
|
stories: StoriesEntry[];
|
|
@@ -1932,7 +1940,6 @@ interface StorybookConfigRaw {
|
|
|
1932
1940
|
swc?: any;
|
|
1933
1941
|
env?: Record<string, string>;
|
|
1934
1942
|
babelDefault?: any;
|
|
1935
|
-
config?: Entry[];
|
|
1936
1943
|
previewAnnotations?: Entry[];
|
|
1937
1944
|
experimental_indexers?: Indexer[];
|
|
1938
1945
|
docs?: DocsOptions;
|
|
@@ -1940,6 +1947,7 @@ interface StorybookConfigRaw {
|
|
|
1940
1947
|
previewBody?: string;
|
|
1941
1948
|
previewMainTemplate?: string;
|
|
1942
1949
|
managerHead?: string;
|
|
1950
|
+
tags?: TagsOptions;
|
|
1943
1951
|
}
|
|
1944
1952
|
/**
|
|
1945
1953
|
* The interface for Storybook configuration in `main.ts` files.
|
|
@@ -1997,12 +2005,6 @@ interface StorybookConfig {
|
|
|
1997
2005
|
* Modify or return babel config.
|
|
1998
2006
|
*/
|
|
1999
2007
|
babelDefault?: PresetValue<StorybookConfigRaw['babelDefault']>;
|
|
2000
|
-
/**
|
|
2001
|
-
* Add additional scripts to run in the preview a la `.storybook/preview.js`
|
|
2002
|
-
*
|
|
2003
|
-
* @deprecated use `previewAnnotations` or `/preview.js` file instead
|
|
2004
|
-
*/
|
|
2005
|
-
config?: PresetValue<StorybookConfigRaw['config']>;
|
|
2006
2008
|
/**
|
|
2007
2009
|
* Add additional scripts to run in the preview a la `.storybook/preview.js`
|
|
2008
2010
|
*/
|
|
@@ -2036,6 +2038,10 @@ interface StorybookConfig {
|
|
|
2036
2038
|
* which is the existing head content, and return a modified string.
|
|
2037
2039
|
*/
|
|
2038
2040
|
managerHead?: PresetValue<StorybookConfigRaw['managerHead']>;
|
|
2041
|
+
/**
|
|
2042
|
+
* Configure non-standard tag behaviors
|
|
2043
|
+
*/
|
|
2044
|
+
tags?: PresetValue<StorybookConfigRaw['tags']>;
|
|
2039
2045
|
}
|
|
2040
2046
|
type PresetValue<T> = T | ((config: T, options: Options) => T | Promise<T>);
|
|
2041
2047
|
type PresetProperty<K, TStorybookConfig = StorybookConfigRaw> = TStorybookConfig[K extends keyof TStorybookConfig ? K : never] | PresetPropertyFn<K, TStorybookConfig>;
|
|
@@ -2084,73 +2090,39 @@ interface API_BaseEntry {
|
|
|
2084
2090
|
name: string;
|
|
2085
2091
|
refId?: string;
|
|
2086
2092
|
renderLabel?: (item: API_BaseEntry) => any;
|
|
2087
|
-
/** @deprecated */
|
|
2088
|
-
isRoot: boolean;
|
|
2089
|
-
/** @deprecated */
|
|
2090
|
-
isComponent: boolean;
|
|
2091
|
-
/** @deprecated */
|
|
2092
|
-
isLeaf: boolean;
|
|
2093
2093
|
}
|
|
2094
2094
|
interface API_RootEntry extends API_BaseEntry {
|
|
2095
2095
|
type: 'root';
|
|
2096
2096
|
startCollapsed?: boolean;
|
|
2097
2097
|
children: StoryId[];
|
|
2098
|
-
/** @deprecated */
|
|
2099
|
-
isRoot: true;
|
|
2100
|
-
/** @deprecated */
|
|
2101
|
-
isComponent: false;
|
|
2102
|
-
/** @deprecated */
|
|
2103
|
-
isLeaf: false;
|
|
2104
2098
|
}
|
|
2105
2099
|
interface API_GroupEntry extends API_BaseEntry {
|
|
2106
2100
|
type: 'group';
|
|
2107
2101
|
parent?: StoryId;
|
|
2108
2102
|
children: StoryId[];
|
|
2109
|
-
/** @deprecated */
|
|
2110
|
-
isRoot: false;
|
|
2111
|
-
/** @deprecated */
|
|
2112
|
-
isComponent: false;
|
|
2113
|
-
/** @deprecated */
|
|
2114
|
-
isLeaf: false;
|
|
2115
2103
|
}
|
|
2116
2104
|
interface API_ComponentEntry extends API_BaseEntry {
|
|
2117
2105
|
type: 'component';
|
|
2118
2106
|
parent?: StoryId;
|
|
2119
2107
|
children: StoryId[];
|
|
2120
|
-
/** @deprecated */
|
|
2121
|
-
isRoot: false;
|
|
2122
|
-
/** @deprecated */
|
|
2123
|
-
isComponent: true;
|
|
2124
|
-
/** @deprecated */
|
|
2125
|
-
isLeaf: false;
|
|
2126
2108
|
}
|
|
2127
2109
|
interface API_DocsEntry extends API_BaseEntry {
|
|
2128
2110
|
type: 'docs';
|
|
2129
2111
|
parent: StoryId;
|
|
2130
2112
|
title: ComponentTitle;
|
|
2131
|
-
/** @deprecated */
|
|
2132
|
-
kind: ComponentTitle;
|
|
2133
2113
|
importPath: Path;
|
|
2134
|
-
tags: Tag[];
|
|
2114
|
+
tags: Tag$1[];
|
|
2135
2115
|
prepared: boolean;
|
|
2136
2116
|
parameters?: {
|
|
2137
2117
|
[parameterName: string]: any;
|
|
2138
2118
|
};
|
|
2139
|
-
/** @deprecated */
|
|
2140
|
-
isRoot: false;
|
|
2141
|
-
/** @deprecated */
|
|
2142
|
-
isComponent: false;
|
|
2143
|
-
/** @deprecated */
|
|
2144
|
-
isLeaf: true;
|
|
2145
2119
|
}
|
|
2146
2120
|
interface API_StoryEntry extends API_BaseEntry {
|
|
2147
2121
|
type: 'story';
|
|
2148
2122
|
parent: StoryId;
|
|
2149
2123
|
title: ComponentTitle;
|
|
2150
|
-
/** @deprecated */
|
|
2151
|
-
kind: ComponentTitle;
|
|
2152
2124
|
importPath: Path;
|
|
2153
|
-
tags: Tag[];
|
|
2125
|
+
tags: Tag$1[];
|
|
2154
2126
|
prepared: boolean;
|
|
2155
2127
|
parameters?: {
|
|
2156
2128
|
[parameterName: string]: any;
|
|
@@ -2158,21 +2130,9 @@ interface API_StoryEntry extends API_BaseEntry {
|
|
|
2158
2130
|
args?: Args;
|
|
2159
2131
|
argTypes?: ArgTypes;
|
|
2160
2132
|
initialArgs?: Args;
|
|
2161
|
-
/** @deprecated */
|
|
2162
|
-
isRoot: false;
|
|
2163
|
-
/** @deprecated */
|
|
2164
|
-
isComponent: false;
|
|
2165
|
-
/** @deprecated */
|
|
2166
|
-
isLeaf: true;
|
|
2167
2133
|
}
|
|
2168
2134
|
type API_LeafEntry = API_DocsEntry | API_StoryEntry;
|
|
2169
2135
|
type API_HashEntry = API_RootEntry | API_GroupEntry | API_ComponentEntry | API_DocsEntry | API_StoryEntry;
|
|
2170
|
-
/** @deprecated */
|
|
2171
|
-
type API_Root = API_RootEntry;
|
|
2172
|
-
/** @deprecated */
|
|
2173
|
-
type API_Group = API_GroupEntry | API_ComponentEntry;
|
|
2174
|
-
/** @deprecated */
|
|
2175
|
-
type API_Story = API_LeafEntry;
|
|
2176
2136
|
/**
|
|
2177
2137
|
* The `IndexHash` is our manager-side representation of the `StoryIndex`.
|
|
2178
2138
|
* We create entries in the hash not only for each story or docs entry, but
|
|
@@ -2299,18 +2259,6 @@ interface API_MatchOptions {
|
|
|
2299
2259
|
location: RenderData['location'];
|
|
2300
2260
|
path: string;
|
|
2301
2261
|
}
|
|
2302
|
-
/**
|
|
2303
|
-
* @deprecated this is synonymous with `Addon_Type`. This interface will be removed in 8.0
|
|
2304
|
-
*/
|
|
2305
|
-
type API_Addon = Addon_Type;
|
|
2306
|
-
/**
|
|
2307
|
-
* @deprecated this is synonymous with `Addon_Collection`. This interface will be removed in 8.0
|
|
2308
|
-
*/
|
|
2309
|
-
type API_Collection<T = Addon_Type> = Addon_Collection<T>;
|
|
2310
|
-
/**
|
|
2311
|
-
* @deprecated This interface will be removed in 8.0
|
|
2312
|
-
*/
|
|
2313
|
-
type API_Panels = Addon_Collection<Addon_BaseType>;
|
|
2314
2262
|
type API_StateMerger<S> = (input: S) => S;
|
|
2315
2263
|
interface API_ProviderData<API> {
|
|
2316
2264
|
provider: API_Provider<API>;
|
|
@@ -2662,7 +2610,9 @@ interface Addon_BaseType {
|
|
|
2662
2610
|
/**
|
|
2663
2611
|
* This will determine the value of `active` prop of your render function.
|
|
2664
2612
|
*/
|
|
2665
|
-
match?: (matchOptions: RenderData
|
|
2613
|
+
match?: (matchOptions: RenderData & {
|
|
2614
|
+
tabId?: string;
|
|
2615
|
+
}) => boolean;
|
|
2666
2616
|
/**
|
|
2667
2617
|
* The actual contents of your addon.
|
|
2668
2618
|
*
|
|
@@ -2731,7 +2681,6 @@ interface Addon_WrapperType {
|
|
|
2731
2681
|
children: ReactNode;
|
|
2732
2682
|
id: string;
|
|
2733
2683
|
storyId: StoryId;
|
|
2734
|
-
active: boolean;
|
|
2735
2684
|
}>>;
|
|
2736
2685
|
}
|
|
2737
2686
|
interface Addon_SidebarBottomType {
|
|
@@ -2975,6 +2924,10 @@ interface DocsContextProps<TRenderer extends Renderer = Renderer> {
|
|
|
2975
2924
|
* Syncronously find all stories of the component referenced by the CSF file.
|
|
2976
2925
|
*/
|
|
2977
2926
|
componentStories: () => PreparedStory<TRenderer>[];
|
|
2927
|
+
/**
|
|
2928
|
+
* Syncronously find all stories by CSF file.
|
|
2929
|
+
*/
|
|
2930
|
+
componentStoriesFromCSFFile: (csfFile: CSFFile<TRenderer>) => PreparedStory<TRenderer>[];
|
|
2978
2931
|
/**
|
|
2979
2932
|
* Get the story context of the referenced story.
|
|
2980
2933
|
*/
|
|
@@ -3045,4 +2998,4 @@ interface ComposeStoryFn<TRenderer extends Renderer = Renderer, TArgs extends Ar
|
|
|
3045
2998
|
(storyAnnotations: AnnotatedStoryFn<TRenderer, TArgs> | StoryAnnotations<TRenderer, TArgs>, componentAnnotations: ComponentAnnotations<TRenderer, TArgs>, projectAnnotations: ProjectAnnotations<TRenderer>, exportsName?: string): ComposedStoryFn;
|
|
3046
2999
|
}
|
|
3047
3000
|
|
|
3048
|
-
export { API_ActiveTabsType,
|
|
3001
|
+
export { API_ActiveTabsType, API_BaseEntry, API_ComponentEntry, API_ComposedRef, API_ComposedRefUpdate, API_DocsEntry, API_FilterFunction, API_GroupEntry, API_HashEntry, API_IframeRenderer, API_IndexHash, API_Layout, API_LeafEntry, API_LoadedRefData, API_MatchOptions, API_Notification, API_OptionsData, API_PanelPositions, API_PreparedIndexEntry, API_PreparedStoryIndex, API_Provider, API_ProviderData, API_RefId, API_RefUrl, API_Refs, API_ReleaseNotes, API_RenderOptions, API_RootEntry, API_RouteOptions, API_SetRefData, API_Settings, API_SidebarOptions, API_StateMerger, API_StatusObject, API_StatusState, API_StatusUpdate, API_StatusValue, API_StoryEntry, API_StoryMapper, API_UI, API_UIOptions, API_UnknownEntries, API_Version, API_Versions$1 as API_Versions, API_ViewMode, Addon_AddStoryArgs, Addon_Annotations, Addon_ArgType, Addon_ArgsStoryFn, Addon_BaseAnnotations, Addon_BaseDecorators, Addon_BaseMeta, Addon_BaseStoryFn, Addon_BaseStoryObject, Addon_BaseType, Addon_ClientApiAddon, Addon_ClientApiAddons, Addon_ClientApiReturnFn, Addon_ClientStoryApi, Addon_Collection, Addon_Comparator, Addon_Config, Addon_DecoratorFunction, Addon_Elements, Addon_LegacyStoryFn, Addon_LoadFn, Addon_Loadable, Addon_Loader, Addon_LoaderFunction, Addon_Loaders, Addon_MakeDecoratorResult, Addon_OptionsParameter, Addon_OptionsParameterV7, Addon_PageType, Addon_PartialStoryFn, Addon_RenderOptions, Addon_RequireContext, Addon_SidebarBottomType, Addon_SidebarTopType, Addon_StoryApi, Addon_StoryContext, Addon_StoryContextUpdate, Addon_StoryFn, Addon_StorySortComparator, Addon_StorySortComparatorV7, Addon_StorySortMethod, Addon_StorySortObjectParameter, Addon_StorySortParameter, Addon_StorySortParameterV7, Addon_StoryWrapper, Addon_ToolbarConfig, Addon_Type, Addon_Types, Addon_TypesEnum, Addon_TypesMapping, Addon_WrapperSettings, Addon_WrapperType, Addons_ArgTypes, AnnotatedStoryFn, ArgTypes, ArgTypesEnhancer, Args, ArgsEnhancer, ArgsFromMeta, ArgsStoryFn, BaseAnnotations, BaseIndexEntry, BaseIndexInput, BaseStory, BoundStory, Builder, BuilderName, BuilderOptions, BuilderResult, BuilderStats, Builder_EnvsRaw, Builder_Unpromise, Builder_WithRequiredProperty, CLIOptions, CSFFile, ComponentAnnotations, ComponentId, ComponentTitle, ComposeStoryFn, ComposedStoryFn, ComposedStoryPlayContext, ComposedStoryPlayFn, Conditional, CoreCommon_AddonEntry, CoreCommon_AddonInfo, CoreCommon_OptionsEntry, CoreCommon_ResolvedAddonPreset, CoreCommon_ResolvedAddonVirtual, CoreCommon_StorybookInfo, CoreConfig, DecoratorApplicator, DecoratorFunction, DocsContextProps, DocsIndexEntry, DocsIndexInput, DocsOptions, DocsPreparedPayload, DocsRenderFunction, Entry, GlobalTypes, Globals, IncludeExcludeOptions, IndexEntry, IndexEntryLegacy, IndexInput, IndexedCSFFile, IndexedStory, Indexer, IndexerOptions, InputType, LegacyAnnotatedStoryFn, LegacyStoryAnnotationsOrFn, LegacyStoryFn, LoadOptions, LoadedPreset, LoaderFunction, ModuleExport, ModuleExports, ModuleImportFn, NormalizedComponentAnnotations, NormalizedProjectAnnotations, NormalizedStoriesSpecifier, NormalizedStoryAnnotations, Options, PackageJson, Parameters, PartialArgsStoryFn, PartialStoryFn, Path, PlayFunction, PlayFunctionContext, PreparedMeta, PreparedStory, Preset, PresetConfig, PresetProperty, PresetPropertyFn, PresetValue, Presets, PreviewAnnotation, ProjectAnnotations, Ref, RenderContext, RenderContextCallbacks, RenderToCanvas, Renderer, RendererName, ResolvedModuleExport, ResolvedModuleExportFromType, ResolvedModuleExportType, SBArrayType, SBEnumType, SBIntersectionType, SBObjectType, SBOtherType, SBScalarType, SBType, SBUnionType, SeparatorOptions, SetGlobalsPayload, SetStoriesPayload, SetStoriesStory, SetStoriesStoryData, Stats, StepFunction, StepLabel, StepRunner, Store_CSFExports, StoriesEntry, StoriesWithPartialProps, StoryAnnotations, StoryAnnotationsOrFn, StoryContext, StoryContextForEnhancers, StoryContextForLoaders, StoryContextUpdate, StoryFn, StoryId, StoryIdentifier, StoryIndex, StoryIndexEntry, StoryIndexInput, StoryIndexV2, StoryIndexV3, StoryKind, StoryName, StoryPreparedPayload, StoryRenderOptions, StorybookConfig, StorybookConfigOptions, StorybookConfigRaw, StorybookInternalParameters, StorybookParameters, StrictArgTypes, StrictArgs, StrictGlobalTypes, StrictInputType, Tag$1 as Tag, TagOptions, TagsOptions, TeardownRenderToCanvas, TestBuildConfig, TestBuildFlags, TypescriptOptions, V3CompatIndexEntry, VersionCheck, ViewMode, WebRenderer };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/types",
|
|
3
|
-
"version": "8.0.0-
|
|
3
|
+
"version": "8.0.0-beta.0",
|
|
4
4
|
"description": "Core Storybook TS Types",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@storybook/channels": "8.0.0-
|
|
47
|
+
"@storybook/channels": "8.0.0-beta.0",
|
|
48
48
|
"@types/express": "^4.7.0",
|
|
49
49
|
"file-system-cache": "2.3.0"
|
|
50
50
|
},
|