types overview
Storybook types for Typed projects.
Added in v1.0.0
Table of contents
utils
Decorator (type alias)
Signature
export type Decorator<TArgs = StrictArgs> = DecoratorFunction<TypedRenderer, TArgs>
Added in v1.0.0
FrameworkOptions (type alias)
Signature
export type FrameworkOptions = {
builder?: BuilderOptions
}
Added in v1.0.0
Loader (type alias)
Signature
export type Loader<TArgs = StrictArgs> = LoaderFunction<TypedRenderer, TArgs>
Added in v1.0.0
Meta (type alias)
Signature
export type Meta<Args> = {
title?: string
id?: string
includeStories?: RegExp | Array<string>
excludeStories?: RegExp | Array<string>
tags?: Array<string>
play?: PlayFunction<TypedRenderer, Args>
decorators?:
| Array<DecoratorFunction<TypedRenderer, Types.Simplify<Args>>>
| DecoratorFunction<TypedRenderer, Types.Simplify<Args>>
parameters?: Parameters
argTypes?: Partial<ArgTypes<Args>>
loaders?: Array<LoaderFunction<TypedRenderer, Args>> | LoaderFunction<TypedRenderer, Args>
component: TypedComponent
args?: Partial<Args>
}
Added in v1.0.0
Preview (type alias)
Signature
export type Preview = ProjectAnnotations<TypedRenderer>
Added in v1.0.0
RenderContext
Signature
export declare const RenderContext: RenderContext<TRenderer>
Added in v1.0.0
StoryContext (type alias)
Signature
export type StoryContext<TArgs = StrictArgs> = GenericStoryContext<TypedRenderer, TArgs>
Added in v1.0.0
StoryObj (type alias)
Signature
export type StoryObj<Args, T extends Meta<any> = never> = Types.Simplify<
Omit<StoryAnnotations<TypedRenderer, Args, Omit<Args, keyof T["args"]>>, "render"> & {
render: (
args: Args,
ctx: Types.Simplify<StoryContext<typeof args> & { readonly component: T["component"] }>
) => TypedRenderer["storyResult"]
}
>
Added in v1.0.0
StorybookConfig (type alias)
Signature
export type StorybookConfig = Types.Simplify<
Omit<StorybookConfigBase, keyof StorybookConfigVite | keyof StorybookConfigFramework> &
StorybookConfigVite &
StorybookConfigFramework
>
Added in v1.0.0
StorybookConfigFramework (type alias)
Signature
export type StorybookConfigFramework = {
framework:
| FrameworkName
| {
name: FrameworkName
options: FrameworkOptions
}
core?: StorybookConfigBase["core"] & {
builder?:
| BuilderName
| {
name: BuilderName
options: BuilderOptions
}
}
}
Added in v1.0.0
TypedComponent (type alias)
Signature
export type TypedComponent<Props = any, R = any, E = any> = (
props: Props,
...children: ReadonlyArray<Renderable<CoreDomServices, E>>
) => Fx<RenderEvent, E, R | CoreDomServices>
Added in v1.0.0
TypedRenderer (interface)
Signature
export interface TypedRenderer extends WebRenderer {
component: TypedComponent
storyResult: Fx<RenderEvent, any, CoreDomServices>
}
Added in v1.0.0