Added typescript definitions

This commit is contained in:
Guylian Cox 2016-09-30 22:59:25 +02:00
parent dd63e49111
commit 46391582b8

29
config/storybook-addon-knobs.d.ts vendored Normal file
View File

@ -0,0 +1,29 @@
declare module 'storybook-addon-knobs' {
import WrapStory from "../src/components/WrapStory.js";
interface KnobOption<T> {
value: T,
type: 'text' | 'boolean' | 'number' | 'object' | 'select' | 'date',
}
interface StoryContext {
kind: string,
story: string,
}
export function knob<T>(name: string, options: KnobOption<T>): T;
export function text(name: string, value: string): string;
export function boolean(name: string, value: boolean): boolean;
export function number(name: string, value: number): number;
export function object(name: string, value: Object): Object;
export function select<T>(name: string, options: { [s: string]: T }, value: string): T;
export function date(name: string, value: Date = new Date(0));
export function withKnobs(storyFn: Function, context: StoryContext): WrapStory;
}