import { DecoratorFunction, Parameters, StoryApi, StoryFn } from "@storybook/addons"; import { StoryContext } from "@storybook/csf/dist/story"; import { ComponentType, ReactElement } from "react"; export interface WrapStoryProps { storyFn?: StoryFn | undefined; context?: object | undefined; options?: object | undefined; } export interface TableComponentOptionProps { propDefinitions: Array<{ property: string; propType: object | string; // TODO: info about what this object is... required: boolean; description: string; defaultValue: any; }>; } export interface Options { text?: string | undefined; header?: boolean | undefined; inline?: boolean | undefined; source?: boolean | undefined; propTables?: Array> | false | undefined; propTablesExclude?: Array> | undefined; styles?: object | undefined; components?: { [key: string]: ComponentType; } | undefined; /** * @deprecated "marksyConf" option has been renamed to "components" */ marksyConf?: object | undefined; maxPropsIntoLine?: number | undefined; maxPropObjectKeys?: number | undefined; maxPropArrayLength?: number | undefined; maxPropStringLength?: number | undefined; TableComponent?: ComponentType | undefined; excludedPropTypes?: string[] | undefined; } export function withInfo( story: StoryFn, context: StoryContext<{ component: any; storyResult: A }>, ): ReturnType>; // Legacy, but supported /** * @deprecated withInfo wrapper is deprecated, use the info parameter globally or on each story */ export function withInfo( textOrOptions?: string | Options, ): (storyFn: StoryFn) => (context?: object) => ReactElement; /** * @deprecated setDefaults is deprecated. Instead, you can pass options into withInfo(options) directly, or use the info parameter. */ export function setDefaults(newDefaults: Options): Options; declare module "@storybook/addons" { interface ClientStoryApi { storiesOf(kind: string, module: NodeModule): StoryApi; addParameters(parameter: Parameters & { info: Options }): StoryApi; addDecorator(decorator: DecoratorFunction): StoryApi; } }