@storybook/csf
Advanced tools
Comparing version 0.0.2--canary.48.3bd2bd7.0 to 0.0.2--canary.49.258942b.0
@@ -67,6 +67,11 @@ import { SBType, SBScalarType } from './SBType'; | ||
storyResult: unknown; | ||
T?: unknown; | ||
}; | ||
export declare type StoryContextForEnhancers<TFramework extends AnyFramework = AnyFramework, TArgs = Args> = StoryIdentifier & { | ||
component?: TFramework['component']; | ||
subcomponents?: Record<string, TFramework['component']>; | ||
component?: (TFramework & { | ||
T: any; | ||
})['component']; | ||
subcomponents?: Record<string, (TFramework & { | ||
T: any; | ||
})['component']>; | ||
parameters: Parameters; | ||
@@ -103,3 +108,3 @@ initialArgs: TArgs; | ||
export declare type PlayFunction<TFramework extends AnyFramework = AnyFramework, TArgs = Args> = (context: PlayFunctionContext<TFramework, TArgs>) => Promise<void> | void; | ||
export declare type PartialStoryFn<TFramework extends AnyFramework = AnyFramework, TArgs = Args> = (update?: StoryContextUpdate<TArgs>) => TFramework['storyResult']; | ||
export declare type PartialStoryFn<TFramework extends AnyFramework = AnyFramework, TArgs = Args> = (update?: StoryContextUpdate<Partial<TArgs>>) => TFramework['storyResult']; | ||
export declare type LegacyStoryFn<TFramework extends AnyFramework = AnyFramework, TArgs = Args> = (context: StoryContext<TFramework, TArgs>) => TFramework['storyResult']; | ||
@@ -112,7 +117,7 @@ export declare type ArgsStoryFn<TFramework extends AnyFramework = AnyFramework, TArgs = Args> = (args: TArgs, context: StoryContext<TFramework, TArgs>) => TFramework['storyResult']; | ||
export declare type BaseAnnotations<TFramework extends AnyFramework = AnyFramework, TArgs = Args> = { | ||
decorators?: DecoratorFunction<TFramework, Args>[]; | ||
decorators?: DecoratorFunction<TFramework, TArgs>[]; | ||
parameters?: Parameters; | ||
args?: Partial<TArgs>; | ||
argTypes?: Partial<ArgTypes<TArgs>>; | ||
loaders?: LoaderFunction<TFramework, Args>[]; | ||
loaders?: LoaderFunction<TFramework, TArgs>[]; | ||
render?: ArgsStoryFn<TFramework, TArgs>; | ||
@@ -129,3 +134,3 @@ }; | ||
declare type StoryDescriptor = string[] | RegExp; | ||
export declare type ComponentAnnotations<TFramework extends AnyFramework = AnyFramework, TArgs = Args> = BaseAnnotations<TFramework, TArgs> & { | ||
export interface ComponentAnnotations<TFramework extends AnyFramework = AnyFramework, TArgs = Args> extends BaseAnnotations<TFramework, TArgs> { | ||
title?: ComponentTitle; | ||
@@ -135,6 +140,8 @@ id?: ComponentId; | ||
excludeStories?: StoryDescriptor; | ||
component?: TFramework['component']; | ||
component?: (TFramework & { | ||
T: Args extends TArgs ? any : TArgs; | ||
})['component']; | ||
subcomponents?: Record<string, TFramework['component']>; | ||
}; | ||
export declare type StoryAnnotations<TFramework extends AnyFramework = AnyFramework, TArgs = Args> = BaseAnnotations<TFramework, TArgs> & { | ||
} | ||
export declare type StoryAnnotations<TFramework extends AnyFramework = AnyFramework, TArgs = Args, TRequiredArgs = Partial<TArgs>> = BaseAnnotations<TFramework, TArgs> & { | ||
name?: StoryName; | ||
@@ -144,3 +151,7 @@ storyName?: StoryName; | ||
story?: Omit<StoryAnnotations<TFramework, TArgs>, 'story'>; | ||
}; | ||
} & ({} extends TRequiredArgs ? { | ||
args?: TRequiredArgs; | ||
} : { | ||
args: TRequiredArgs; | ||
}); | ||
export declare type LegacyAnnotatedStoryFn<TFramework extends AnyFramework = AnyFramework, TArgs = Args> = StoryFn<TFramework, TArgs> & StoryAnnotations<TFramework, TArgs>; | ||
@@ -147,0 +158,0 @@ export declare type LegacyStoryAnnotationsOrFn<TFramework extends AnyFramework = AnyFramework, TArgs = Args> = LegacyAnnotatedStoryFn<TFramework, TArgs> | StoryAnnotations<TFramework, TArgs>; |
@@ -9,7 +9,7 @@ "use strict"; | ||
// NOTE Examples of using types from @storybook/<X> in real project | ||
var Button = function Button() { | ||
var Button = function Button(props) { | ||
return 'Button'; | ||
}; | ||
}; // NOTE Various kind usages | ||
// NOTE Various kind usages | ||
var simple = { | ||
@@ -34,6 +34,6 @@ title: 'simple', | ||
args: { | ||
a: 1 | ||
x: '1' | ||
}, | ||
argTypes: { | ||
a: { | ||
x: { | ||
type: { | ||
@@ -40,0 +40,0 @@ name: 'string' |
{ | ||
"name": "@storybook/csf", | ||
"version": "0.0.2--canary.48.3bd2bd7.0", | ||
"version": "0.0.2--canary.49.258942b.0", | ||
"description": "Component Story Format (CSF) utilities", | ||
@@ -64,3 +64,3 @@ "keywords": [ | ||
"jest": "^24.9.0", | ||
"prettier": "^1.19.1", | ||
"prettier": "^2.7.1", | ||
"typescript": "^3.7.2" | ||
@@ -67,0 +67,0 @@ }, |
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
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
42921
1067