2016-10-27 09:56:31 +13:00
|
|
|
import * as React from 'react';
|
2016-10-26 21:27:05 +13:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
2016-10-27 09:56:31 +13:00
|
|
|
export function text(name: string, value: string | null): string;
|
2016-10-26 21:27:05 +13:00
|
|
|
|
|
|
|
export function boolean(name: string, value: boolean): boolean;
|
|
|
|
|
|
|
|
export function number(name: string, value: number): number;
|
|
|
|
|
2016-10-28 08:11:50 +13:00
|
|
|
export function object<T>(name: string, value: T): T;
|
2016-10-26 21:27:05 +13:00
|
|
|
|
|
|
|
export function select<T>(name: string, options: { [s: string]: T }, value: string): T;
|
2016-10-27 09:56:31 +13:00
|
|
|
export function select(name: string, options: string[], value: string): string;
|
2016-10-26 21:27:05 +13:00
|
|
|
|
2016-10-28 08:11:50 +13:00
|
|
|
export function date(name: string, value?: Date): Date;
|
2016-10-26 21:27:05 +13:00
|
|
|
|
2016-10-27 09:56:31 +13:00
|
|
|
interface IWrapStoryProps {
|
2016-10-28 08:11:50 +13:00
|
|
|
context?: Object;
|
|
|
|
storyFn?: Function;
|
|
|
|
channel?: Object;
|
|
|
|
knobStore?: Object;
|
|
|
|
initialContent?: Object;
|
2016-10-27 09:56:31 +13:00
|
|
|
}
|
|
|
|
|
2016-10-28 08:11:50 +13:00
|
|
|
export function withKnobs(storyFn: Function, context: StoryContext): React.ReactElement<IWrapStoryProps>;
|