@storybook/types 7.0.0-alpha.53 → 7.0.0-alpha.54
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 +66 -3
- package/dist/index.mjs +1 -1
- package/package.json +5 -4
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { FileSystemCache } from 'file-system-cache';
|
|
|
2
2
|
import { TransformOptions } from '@babel/core';
|
|
3
3
|
import { Router } from 'express';
|
|
4
4
|
import { Server } from 'http';
|
|
5
|
+
import { Channel as Channel$1 } from '@storybook/channels';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
|
|
@@ -1360,6 +1361,17 @@ interface Location extends Path$1 {
|
|
|
1360
1361
|
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.key
|
|
1361
1362
|
*/
|
|
1362
1363
|
key: Key;
|
|
1364
|
+
}
|
|
1365
|
+
/**
|
|
1366
|
+
* Describes a location that is the destination of some navigation, either via
|
|
1367
|
+
* `history.push` or `history.replace`. May be either a URL or the pieces of a
|
|
1368
|
+
* URL path.
|
|
1369
|
+
*/
|
|
1370
|
+
declare type To = string | Partial<Path$1>;
|
|
1371
|
+
|
|
1372
|
+
interface NavigateOptions$1 {
|
|
1373
|
+
replace?: boolean;
|
|
1374
|
+
state?: any;
|
|
1363
1375
|
}
|
|
1364
1376
|
|
|
1365
1377
|
interface StoryData {
|
|
@@ -1372,12 +1384,15 @@ interface Other extends StoryData {
|
|
|
1372
1384
|
path: string;
|
|
1373
1385
|
singleStory?: boolean;
|
|
1374
1386
|
}
|
|
1387
|
+
type NavigateOptions = NavigateOptions$1 & {
|
|
1388
|
+
plain?: boolean;
|
|
1389
|
+
};
|
|
1390
|
+
type NavigateFunction = (to: To | number, options?: NavigateOptions) => void;
|
|
1375
1391
|
type RouterData = {
|
|
1376
1392
|
location: Partial<Location>;
|
|
1377
|
-
navigate:
|
|
1393
|
+
navigate: NavigateFunction;
|
|
1378
1394
|
} & Other;
|
|
1379
1395
|
type RenderData = Pick<RouterData, 'location'> & Other;
|
|
1380
|
-
declare const useNavigate: () => (to: string | number, { plain, ...options }?: any) => void;
|
|
1381
1396
|
|
|
1382
1397
|
interface ThemeVars {
|
|
1383
1398
|
base: 'light' | 'dark';
|
|
@@ -2867,4 +2882,52 @@ type API_Refs = Record<string, API_ComposedRef>;
|
|
|
2867
2882
|
type API_RefId = string;
|
|
2868
2883
|
type API_RefUrl = string;
|
|
2869
2884
|
|
|
2870
|
-
|
|
2885
|
+
type StoryRenderOptions = {
|
|
2886
|
+
autoplay?: boolean;
|
|
2887
|
+
};
|
|
2888
|
+
interface DocsContextProps<TRenderer extends Renderer = Renderer> {
|
|
2889
|
+
/**
|
|
2890
|
+
* Register the CSF file that this docs entry represents.
|
|
2891
|
+
* Used by the `<Meta of={} />` block.
|
|
2892
|
+
*/
|
|
2893
|
+
setMeta: (metaExports: Store_ModuleExports) => void;
|
|
2894
|
+
/**
|
|
2895
|
+
* Find a story's id from the direct export from the CSF file.
|
|
2896
|
+
* This is primarily used by the `<Story of={} /> block.
|
|
2897
|
+
*/
|
|
2898
|
+
storyIdByModuleExport: (storyExport: Store_ModuleExport, metaExports?: Store_ModuleExports) => StoryId;
|
|
2899
|
+
/**
|
|
2900
|
+
* Find a story's id from the name of the story.
|
|
2901
|
+
* This is primarily used by the `<Story name={} /> block.
|
|
2902
|
+
* Note that the story must be part of the primary CSF file of the docs entry.
|
|
2903
|
+
*/
|
|
2904
|
+
storyIdByName: (storyName: StoryName) => StoryId;
|
|
2905
|
+
/**
|
|
2906
|
+
* Syncronously find a story by id (if the id is not provided, this will look up the primary
|
|
2907
|
+
* story in the CSF file, if such a file exists).
|
|
2908
|
+
*/
|
|
2909
|
+
storyById: (id?: StoryId) => Store_Story<TRenderer>;
|
|
2910
|
+
/**
|
|
2911
|
+
* Syncronously find all stories of the component referenced by the CSF file.
|
|
2912
|
+
*/
|
|
2913
|
+
componentStories: () => Store_Story<TRenderer>[];
|
|
2914
|
+
/**
|
|
2915
|
+
* Get the story context of the referenced story.
|
|
2916
|
+
*/
|
|
2917
|
+
getStoryContext: (story: Store_Story<TRenderer>) => StoryContextForLoaders<TRenderer>;
|
|
2918
|
+
/**
|
|
2919
|
+
* Asyncronously load an arbitrary story by id.
|
|
2920
|
+
*/
|
|
2921
|
+
loadStory: (id: StoryId) => Promise<Store_Story<TRenderer>>;
|
|
2922
|
+
/**
|
|
2923
|
+
* Render a story to a given HTML element and keep it up to date across context changes
|
|
2924
|
+
*/
|
|
2925
|
+
renderStoryToElement: (story: Store_Story<TRenderer>, element: HTMLElement, options: StoryRenderOptions) => () => Promise<void>;
|
|
2926
|
+
/**
|
|
2927
|
+
* Storybook channel -- use for low level event watching/emitting
|
|
2928
|
+
*/
|
|
2929
|
+
channel: Channel$1;
|
|
2930
|
+
}
|
|
2931
|
+
type DocsRenderFunction<TRenderer extends Renderer> = (docsContext: DocsContextProps<TRenderer>, docsParameters: Parameters, element: HTMLElement, callback: () => void) => void;
|
|
2932
|
+
|
|
2933
|
+
export { API_ActiveTabsType, API_Addon, API_ArgType, API_ArgTypes, API_Args, API_BaseEntry, API_Collection, API_ComponentEntry, API_ComposedRef, API_ComposedRefUpdate, API_DocsEntry, API_DocsIndexEntry, API_Group, API_GroupEntry, API_HashEntry, API_IframeRenderer, API_IndexEntry, API_Layout, API_LeafEntry, API_MatchOptions, API_Notification, API_OptionsData, API_PanelPositions, API_Panels, API_PreparedStoryIndex, API_Provider, API_ProviderData, API_RefId, API_RefUrl, API_Refs, API_ReleaseNotes, API_RenderOptions, API_Root, API_RootEntry, API_RouteOptions, API_SetGlobalsPayload, API_SetRefData, API_SetStoriesPayload, API_SetStoriesStory, API_SetStoriesStoryData, API_Settings, API_SidebarOptions, API_StateMerger, API_StoriesHash, API_Story, API_StoryEntry, API_StoryIndex, API_StoryIndexEntry, API_StoryIndexV3, API_StoryKey, 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_BaseIndexEntry, Addon_BaseMeta, Addon_BaseStoryFn, Addon_BaseStoryObject, Addon_ClientApiAddon, Addon_ClientApiAddons, Addon_ClientApiReturnFn, Addon_ClientStoryApi, Addon_Collection, Addon_Comparator, Addon_Config, Addon_DecoratorFunction, Addon_DocsIndexEntry, Addon_Elements, Addon_IndexEntry, Addon_IndexEntryLegacy, Addon_LegacyStoryFn, Addon_LoadFn, Addon_Loadable, Addon_Loader, Addon_LoaderFunction, Addon_Loaders, Addon_MakeDecoratorResult, Addon_OptionsParameter, Addon_PartialStoryFn, Addon_RenderOptions, Addon_RequireContext, Addon_StandaloneDocsIndexEntry, Addon_StoryApi, Addon_StoryContext, Addon_StoryContextUpdate, Addon_StoryFn, Addon_StoryIndexEntry, Addon_StorySortComparator, Addon_StorySortComparatorV7, Addon_StorySortMethod, Addon_StorySortObjectParameter, Addon_StorySortParameter, Addon_StorySortParameterV7, Addon_StoryWrapper, Addon_TemplateDocsIndexEntry, Addon_ToolbarConfig, Addon_Type, Addon_Types, Addon_TypesEnum, Addon_WrapperSettings, Addons_ArgTypes, AnnotatedStoryFn, ArgTypes, ArgTypesEnhancer, Args, ArgsEnhancer, ArgsFromMeta, ArgsStoryFn, BaseAnnotations, BaseStory, Builder, BuilderName, BuilderOptions, BuilderResult, BuilderStats, Builder_EnvsRaw, Builder_Unpromise, Builder_WithRequiredProperty, CLIOptions, CSF_Meta, CSF_Story, ClientAPI_AddStoryArgs, ClientAPI_ArgTypesEnhancer, ClientAPI_ArgsEnhancer, ClientAPI_ClientApiAddon, ClientAPI_ClientApiAddons, ClientAPI_ClientApiReturnFn, ClientAPI_ErrorLike, ClientAPI_GetStorybookKind, ClientAPI_GetStorybookStory, ClientAPI_RenderContextWithoutStoryContext, ClientAPI_StoreSelection, ClientAPI_StoreSelectionSpecifier, ClientAPI_StoryMetadata, ComponentAnnotations, ComponentId, ComponentTitle, Conditional, CoreClient_LoaderFunction, CoreClient_PreviewError, CoreClient_RenderStoryFunction, CoreClient_RequireContext, CoreCommon_AddonEntry, CoreCommon_AddonInfo, CoreCommon_IndexedStory, CoreCommon_IndexerOptions, CoreCommon_NormalizedStoriesSpecifier, CoreCommon_OptionsEntry, CoreCommon_ResolvedAddonPreset, CoreCommon_ResolvedAddonVirtual, CoreCommon_StoriesEntry, CoreCommon_StoryIndex, CoreCommon_StoryIndexer, CoreCommon_StorybookInfo, CoreConfig, DecoratorApplicator, DecoratorFunction, DocsContextProps, DocsOptions, DocsRenderFunction, Entry, GlobalTypes, Globals, IncludeExcludeOptions, InputType, LegacyAnnotatedStoryFn, LegacyStoryAnnotationsOrFn, LegacyStoryFn, LoadOptions, Loadable, LoadedPreset, LoaderFunction, Options, PackageJson, Parameters, PartialStoryFn, Path, PlayFunction, PlayFunctionContext, Preset, PresetConfig, PresetProperty, PresetPropertyFn, Presets, PreviewAnnotation, ProjectAnnotations, Ref, ReleaseNotesData, Store_RenderContext as RenderContext, RenderToCanvas, Renderer, RendererName, SBArrayType, SBEnumType, SBIntersectionType, SBObjectType, SBOtherType, SBScalarType, SBType, SBUnionType, SeparatorOptions, Stats, StepFunction, StepLabel, StepRunner, Store_BoundStory, Store_CSFExports, Store_CSFFile, Store_ComposeStory, Store_ComposedStory, Store_ComposedStoryPlayContext, Store_ComposedStoryPlayFn, Store_ContextStore, Store_ControlsMatchers, Store_DecoratorApplicator, Store_ExtractOptions, Store_ModuleExport, Store_ModuleExports, Store_ModuleImportFn, Store_NormalizedComponentAnnotations, Store_NormalizedProjectAnnotations, Store_NormalizedStoriesSpecifier, Store_NormalizedStoriesSpecifierEntry, Store_NormalizedStoryAnnotations, Store_PromiseLike, Store_PropDescriptor, Store_RenderContext, Store_Selection, Store_SelectionSpecifier, Store_StoriesSpecifier, Store_StoriesWithPartialProps, Store_Story, Store_StoryFn, Store_StoryIndex, Store_StoryIndexV3, Store_StorySpecifier, Store_V2CompatIndexEntry, StoryAnnotations, StoryAnnotationsOrFn, StoryContext, StoryContextForEnhancers, StoryContextForLoaders, StoryContextUpdate, StoryFn, StoryId, StoryIdentifier, StoryIndex, StoryKind, StoryName, StoryRenderOptions, StorybookConfig, StorybookConfigOptions, StorybookInternalParameters, StorybookParameters, StrictArgTypes, StrictArgs, StrictGlobalTypes, StrictInputType, Tag, TeardownRenderToCanvas, TypescriptOptions, VersionCheck, ViewMode, WebRenderer };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Addon_TypesEnum=(Addon_TypesEnum2=>(Addon_TypesEnum2.TAB="tab",Addon_TypesEnum2.PANEL="panel",Addon_TypesEnum2.TOOL="tool",Addon_TypesEnum2.TOOLEXTRA="toolextra",Addon_TypesEnum2.PREVIEW="preview",Addon_TypesEnum2.NOTES_ELEMENT="notes-element",Addon_TypesEnum2))(Addon_TypesEnum||{});export{Addon_TypesEnum};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/types",
|
|
3
|
-
"version": "7.0.0-alpha.
|
|
3
|
+
"version": "7.0.0-alpha.54",
|
|
4
4
|
"description": "Core Storybook Types",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
@@ -40,8 +40,9 @@
|
|
|
40
40
|
"prep": "../../../scripts/prepare/bundle.ts"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@babel/core": "^7.
|
|
44
|
-
"@
|
|
43
|
+
"@babel/core": "^7.12.10",
|
|
44
|
+
"@storybook/channels": "7.0.0-alpha.54",
|
|
45
|
+
"@types/babel__core": "^7.0.0",
|
|
45
46
|
"@types/express": "^4.7.0",
|
|
46
47
|
"express": "^4.17.1",
|
|
47
48
|
"file-system-cache": "^2.0.0"
|
|
@@ -60,5 +61,5 @@
|
|
|
60
61
|
"./src/index.ts"
|
|
61
62
|
]
|
|
62
63
|
},
|
|
63
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "91177d4e27daec556a24ae6223c3cbe17a998d9b"
|
|
64
65
|
}
|