Skip to content

Commit

Permalink
Improve types flushed out by CSF changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tmeasday committed Sep 7, 2021
1 parent 4702cf0 commit a504ad3
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion addons/backgrounds/src/decorators/withBackground.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMemo, useEffect } from '@storybook/addons';
import { AnyFramework, StoryFn as StoryFunction, StoryContext } from '@storybook/csf';
import { AnyFramework, PartialStoryFn as StoryFunction, StoryContext } from '@storybook/csf';

import { PARAM_KEY as BACKGROUNDS_PARAM_KEY } from '../constants';
import {
Expand Down
2 changes: 1 addition & 1 deletion addons/backgrounds/src/decorators/withGrid.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import dedent from 'ts-dedent';
import deprecate from 'util-deprecate';
import { useMemo, useEffect } from '@storybook/addons';
import { AnyFramework, StoryFn as StoryFunction, StoryContext } from '@storybook/csf';
import { AnyFramework, PartialStoryFn as StoryFunction, StoryContext } from '@storybook/csf';

import { clearStyles, addGridStyle } from '../helpers';
import { PARAM_KEY as BACKGROUNDS_PARAM_KEY } from '../constants';
Expand Down
2 changes: 1 addition & 1 deletion addons/measure/src/withMeasure.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-env browser */
import { useEffect } from '@storybook/addons';
import { AnyFramework, StoryFn as StoryFunction, StoryContext } from '@storybook/csf';
import { AnyFramework, PartialStoryFn as StoryFunction, StoryContext } from '@storybook/csf';
import { drawSelectedElement } from './box-model/visualizer';
import { init, rescale, destroy } from './box-model/canvas';
import { deepElementFromPoint } from './util';
Expand Down
2 changes: 1 addition & 1 deletion addons/outline/src/withOutline.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMemo, useEffect } from '@storybook/addons';
import { AnyFramework, StoryFn as StoryFunction, StoryContext } from '@storybook/csf';
import { AnyFramework, PartialStoryFn as StoryFunction, StoryContext } from '@storybook/csf';

import { clearStyles, addOutlineStyles } from './helpers';
import { PARAM_KEY } from './constants';
Expand Down
2 changes: 1 addition & 1 deletion app/angular/src/client/preview/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export interface ICollection {

export interface IStorybookStory {
name: string;
render: () => any;
render: (context: any) => any;
}

export interface IStorybookSection {
Expand Down
2 changes: 1 addition & 1 deletion app/html/src/client/preview/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export type StoryFnHtmlReturnType = string | Node;

export interface IStorybookStory {
name: string;
render: () => any;
render: (context: any) => any;
}

export interface IStorybookSection {
Expand Down
2 changes: 1 addition & 1 deletion app/preact/src/client/preview/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface ShowErrorArgs {

export interface IStorybookStory {
name: string;
render: () => any;
render: (context: any) => any;
}

export interface IStorybookSection {
Expand Down
2 changes: 1 addition & 1 deletion app/react/src/client/preview/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export type StoryFnReactReturnType = ReactElement<unknown>;

export interface IStorybookStory {
name: string;
render: () => any;
render: (context: any) => any;
}

export interface IStorybookSection {
Expand Down
2 changes: 1 addition & 1 deletion app/server/src/client/preview/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export type FetchStoryHtmlType = (

export interface IStorybookStory {
name: string;
render: () => any;
render: (context: any) => any;
}

export interface IStorybookSection {
Expand Down
2 changes: 1 addition & 1 deletion app/vue/src/client/preview/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export type StoryFnVueReturnType = string | Component;

export interface IStorybookStory {
name: string;
render: () => any;
render: (context: any) => any;
}

export interface IStorybookSection {
Expand Down
2 changes: 1 addition & 1 deletion app/vue3/src/client/preview/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export type StoryFnVueReturnType = ConcreteComponent<any>;

export interface IStorybookStory {
name: string;
render: () => any;
render: (context: any) => any;
}

export interface IStorybookSection {
Expand Down
2 changes: 1 addition & 1 deletion app/web-components/src/client/preview/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export type StoryFnHtmlReturnType = string | Node | TemplateResult | SVGTemplate

export interface IStorybookStory {
name: string;
render: () => any;
render: (context: any) => any;
}

export interface IStorybookSection {
Expand Down
2 changes: 1 addition & 1 deletion lib/addons/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export interface ClientApiAddons<StoryFnReturnType> {
// Old types for getStorybook()
export interface IStorybookStory {
name: string;
render: () => any;
render: (context: any) => any;
}

export interface IStorybookSection {
Expand Down
3 changes: 2 additions & 1 deletion lib/client-api/src/ClientApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
ComponentTitle,
Globals,
GlobalTypes,
LegacyStoryFn,
} from '@storybook/csf';
import {
NormalizedComponentAnnotations,
Expand All @@ -32,7 +33,7 @@ const { FEATURES } = global;

export interface GetStorybookStory<TFramework extends AnyFramework> {
name: string;
render: StoryFn<TFramework>;
render: LegacyStoryFn<TFramework>;
}

export interface GetStorybookKind<TFramework extends AnyFramework> {
Expand Down

0 comments on commit a504ad3

Please sign in to comment.