Skip to content

Commit

Permalink
Merge pull request #92 from ComponentDriven/shilman/initial-globals
Browse files Browse the repository at this point in the history
Add project initialGlobals & component/story globals, deprecate project globals
  • Loading branch information
shilman authored Jun 3, 2024
2 parents 81a58c9 + 6fb63cd commit fa77c25
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/story.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,11 @@ export type ProjectAnnotations<
> = BaseAnnotations<TRenderer, TArgs> & {
argsEnhancers?: ArgsEnhancer<TRenderer, Args>[];
argTypesEnhancers?: ArgTypesEnhancer<TRenderer, Args>[];
/**
* @deprecated Project `globals` renamed to `initiaGlobals`
*/
globals?: Globals;
initialGlobals?: Globals;
globalTypes?: GlobalTypes;
applyDecorators?: DecoratorApplicator<TRenderer, Args>;
runStep?: StepRunner<TRenderer, TArgs>;
Expand Down Expand Up @@ -490,6 +494,11 @@ export interface ComponentAnnotations<TRenderer extends Renderer = Renderer, TAr
* Function that is executed after the story is rendered.
*/
play?: PlayFunction<TRenderer, TArgs>;

/**
* Override the globals values for all stories in this component
*/
globals?: Globals;
}

export type StoryAnnotations<
Expand All @@ -512,6 +521,11 @@ export type StoryAnnotations<
*/
play?: PlayFunction<TRenderer, TArgs>;

/**
* Override the globals values for this story
*/
globals?: Globals;

/** @deprecated */
story?: Omit<StoryAnnotations<TRenderer, TArgs>, 'story'>;
// eslint-disable-next-line @typescript-eslint/ban-types
Expand Down

0 comments on commit fa77c25

Please sign in to comment.