@storybook/csf
Advanced tools
Comparing version 0.0.2--canary.a1972cb.0 to 0.0.2--canary.a925d24.0
@@ -33,7 +33,7 @@ import { SBType, SBScalarType } from './SBType'; | ||
}; | ||
export declare type ArgTypes = { | ||
[name: string]: InputType; | ||
export declare type ArgTypes<TArgs = Args> = { | ||
[name in keyof TArgs]: InputType; | ||
}; | ||
export declare type StrictArgTypes = { | ||
[name: string]: StrictInputType; | ||
export declare type StrictArgTypes<TArgs = Args> = { | ||
[name in keyof TArgs]: StrictInputType; | ||
}; | ||
@@ -53,15 +53,15 @@ export declare type Globals = { | ||
}; | ||
export declare type StoryContextForEnhancers<TFramework extends AnyFramework> = StoryIdentifier & { | ||
export declare type StoryContextForEnhancers<TFramework extends AnyFramework, TArgs = Args> = StoryIdentifier & { | ||
component?: TFramework['component']; | ||
subcomponents?: Record<string, TFramework['component']>; | ||
parameters: Parameters; | ||
initialArgs: Args; | ||
argTypes: StrictArgTypes; | ||
initialArgs: TArgs; | ||
argTypes: StrictArgTypes<TArgs>; | ||
}; | ||
export declare type ArgsEnhancer<TFramework extends AnyFramework> = (context: StoryContextForEnhancers<TFramework>) => Args; | ||
export declare type ArgTypesEnhancer<TFramework extends AnyFramework> = ((context: StoryContextForEnhancers<TFramework>) => StrictArgTypes) & { | ||
export declare type ArgsEnhancer<TFramework extends AnyFramework, TArgs = Args> = (context: StoryContextForEnhancers<TFramework, TArgs>) => TArgs; | ||
export declare type ArgTypesEnhancer<TFramework extends AnyFramework, TArgs = Args> = ((context: StoryContextForEnhancers<TFramework, TArgs>) => StrictArgTypes<TArgs>) & { | ||
secondPass?: boolean; | ||
}; | ||
export declare type StoryContextUpdate = { | ||
args?: Args; | ||
export declare type StoryContextUpdate<TArgs = Args> = { | ||
args?: TArgs; | ||
globals?: Globals; | ||
@@ -71,3 +71,3 @@ [key: string]: any; | ||
export declare type ViewMode = 'story' | 'docs'; | ||
export declare type StoryContextForLoaders<TFramework extends AnyFramework> = StoryContextForEnhancers<TFramework> & Required<StoryContextUpdate> & { | ||
export declare type StoryContextForLoaders<TFramework extends AnyFramework, TArgs = Args> = StoryContextForEnhancers<TFramework, TArgs> & Required<StoryContextUpdate<TArgs>> & { | ||
hooks: unknown; | ||
@@ -77,27 +77,27 @@ viewMode: ViewMode; | ||
}; | ||
export declare type LoaderFunction<TFramework extends AnyFramework> = (c: StoryContextForLoaders<TFramework>) => Promise<Record<string, any>>; | ||
export declare type StoryContext<TFramework extends AnyFramework> = StoryContextForLoaders<TFramework> & { | ||
export declare type LoaderFunction<TFramework extends AnyFramework, TArgs = Args> = (c: StoryContextForLoaders<TFramework, TArgs>) => Promise<Record<string, any>>; | ||
export declare type StoryContext<TFramework extends AnyFramework, TArgs = Args> = StoryContextForLoaders<TFramework, TArgs> & { | ||
loaded: Record<string, any>; | ||
}; | ||
export declare type PartialStoryFn<TFramework extends AnyFramework> = (p?: StoryContextUpdate) => TFramework['storyResult']; | ||
export declare type LegacyStoryFn<TFramework extends AnyFramework> = (p?: StoryContext<TFramework>) => TFramework['storyResult']; | ||
export declare type ArgsStoryFn<TFramework extends AnyFramework> = (a?: Args, p?: StoryContext<TFramework>) => TFramework['storyResult']; | ||
export declare type StoryFn<TFramework extends AnyFramework> = LegacyStoryFn<TFramework> | ArgsStoryFn<TFramework>; | ||
export declare type DecoratorFunction<TFramework extends AnyFramework> = (fn: PartialStoryFn<TFramework>, c: StoryContext<TFramework>) => TFramework['storyResult']; | ||
export declare type DecoratorApplicator<TFramework extends AnyFramework> = (storyFn: LegacyStoryFn<TFramework>, decorators: DecoratorFunction<TFramework>[]) => LegacyStoryFn<TFramework>; | ||
export declare type PartialStoryFn<TFramework extends AnyFramework, TArgs = Args> = (p?: StoryContextUpdate<TArgs>) => TFramework['storyResult']; | ||
export declare type LegacyStoryFn<TFramework extends AnyFramework, TArgs = Args> = (p?: StoryContext<TFramework, TArgs>) => TFramework['storyResult']; | ||
export declare type ArgsStoryFn<TFramework extends AnyFramework, TArgs = Args> = (a?: TArgs, p?: StoryContext<TFramework, TArgs>) => TFramework['storyResult']; | ||
export declare type StoryFn<TFramework extends AnyFramework, TArgs = Args> = LegacyStoryFn<TFramework, TArgs> | ArgsStoryFn<TFramework, TArgs>; | ||
export declare type DecoratorFunction<TFramework extends AnyFramework, TArgs = Args> = (fn: PartialStoryFn<TFramework, TArgs>, c: StoryContext<TFramework, TArgs>) => TFramework['storyResult']; | ||
export declare type DecoratorApplicator<TFramework extends AnyFramework, TArgs = Args> = (storyFn: LegacyStoryFn<TFramework, TArgs>, decorators: DecoratorFunction<TFramework, TArgs>[]) => LegacyStoryFn<TFramework, TArgs>; | ||
export declare type BaseAnnotations<TFramework extends AnyFramework, TArgs = Args> = { | ||
decorators?: DecoratorFunction<TFramework>[]; | ||
decorators?: DecoratorFunction<TFramework, TArgs>[]; | ||
parameters?: Parameters; | ||
args?: Partial<TArgs>; | ||
argTypes?: ArgTypes; | ||
loaders?: LoaderFunction<TFramework>[]; | ||
render?: ArgsStoryFn<TFramework>; | ||
argTypes?: Partial<ArgTypes<TArgs>>; | ||
loaders?: LoaderFunction<TFramework, TArgs>[]; | ||
render?: ArgsStoryFn<TFramework, TArgs>; | ||
play?: () => Promise<void>; | ||
}; | ||
export declare type GlobalAnnotations<TFramework extends AnyFramework, TArgs = Args> = BaseAnnotations<TFramework, TArgs> & { | ||
argsEnhancers?: ArgsEnhancer<TFramework>[]; | ||
argTypesEnhancers?: ArgTypesEnhancer<TFramework>[]; | ||
export declare type ProjectAnnotations<TFramework extends AnyFramework, TArgs = Args> = BaseAnnotations<TFramework, TArgs> & { | ||
argsEnhancers?: ArgsEnhancer<TFramework, TArgs>[]; | ||
argTypesEnhancers?: ArgTypesEnhancer<TFramework, TArgs>[]; | ||
globals?: Globals; | ||
globalTypes?: GlobalTypes; | ||
applyDecorators?: DecoratorApplicator<TFramework>; | ||
applyDecorators?: DecoratorApplicator<TFramework, TArgs>; | ||
}; | ||
@@ -118,3 +118,5 @@ declare type StoryDescriptor = string[] | RegExp; | ||
}; | ||
declare type AnnotatedStoryFn<TFramework extends AnyFramework, TArgs = Args> = StoryFn<TFramework> & StoryAnnotations<TFramework, TArgs>; | ||
declare type LegacyAnnotatedStoryFn<TFramework extends AnyFramework, TArgs = Args> = StoryFn<TFramework, TArgs> & StoryAnnotations<TFramework, TArgs>; | ||
export declare type LegacyStoryAnnotationsOrFn<TFramework extends AnyFramework, TArgs = Args> = LegacyAnnotatedStoryFn<TFramework, TArgs> | StoryAnnotations<TFramework, TArgs>; | ||
declare type AnnotatedStoryFn<TFramework extends AnyFramework, TArgs = Args> = ArgsStoryFn<TFramework, TArgs> & StoryAnnotations<TFramework, TArgs>; | ||
export declare type StoryAnnotationsOrFn<TFramework extends AnyFramework, TArgs = Args> = AnnotatedStoryFn<TFramework, TArgs> | StoryAnnotations<TFramework, TArgs>; |
{ | ||
"name": "@storybook/csf", | ||
"version": "0.0.2--canary.a1972cb.0", | ||
"version": "0.0.2--canary.a925d24.0", | ||
"description": "Component Story Format (CSF) utilities", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26772
579
1