diff --git a/src/story.ts b/src/story.ts index 1ac4f3a..d29c5a2 100644 --- a/src/story.ts +++ b/src/story.ts @@ -60,35 +60,47 @@ export interface InputType { control?: | ControlType | { - /** - * @see https://storybook.js.org/docs/api/arg-types#controltype - */ - type: ControlType; - /** - * @see https://storybook.js.org/docs/api/arg-types#controlaccept - */ - accept?: string; - /** - * @see https://storybook.js.org/docs/api/arg-types#controllabels - */ - labels?: { [options: string]: string }; - /** - * @see https://storybook.js.org/docs/api/arg-types#controlmax - */ - max?: number; - /** - * @see https://storybook.js.org/docs/api/arg-types#controlmin - */ - min?: number; - /** - * @see https://storybook.js.org/docs/api/arg-types#controlpresetcolors - */ - presetColors?: string[]; - /** - * @see https://storybook.js.org/docs/api/arg-types#controlstep - */ - step?: number; - } + /** + * @see https://storybook.js.org/docs/api/arg-types#controltype + */ + type: ControlType; + } + | { + type: 'color'; + /** + * @see https://storybook.js.org/docs/api/arg-types#controlpresetcolors + */ + presetColors?: string[]; + } + | { + type: 'file'; + /** + * @see https://storybook.js.org/docs/api/arg-types#controlaccept + */ + accept?: string; + } + | { + type: 'inline-check' | 'radio' | 'inline-radio' | 'select' | 'multi-select'; + /** + * @see https://storybook.js.org/docs/api/arg-types#controllabels + */ + labels?: { [options: string]: string }; + } + | { + type: 'number' | 'range'; + /** + * @see https://storybook.js.org/docs/api/arg-types#controlmax + */ + max?: number; + /** + * @see https://storybook.js.org/docs/api/arg-types#controlmin + */ + min?: number; + /** + * @see https://storybook.js.org/docs/api/arg-types#controlstep + */ + step?: number; + } | false; /** * @see https://storybook.js.org/docs/api/arg-types#description