@storybook/addon-knobs
Version:
Storybook Addon Prop Editor Component
32 lines (31 loc) • 1.38 kB
TypeScript
import React, { Component } from 'react';
import { KnobControlConfig, KnobControlProps } from './types';
declare type CheckboxesTypeKnobValue = string[];
export interface CheckboxesTypeKnob extends KnobControlConfig<CheckboxesTypeKnobValue> {
options: Record<string, string>;
}
interface CheckboxesTypeProps extends KnobControlProps<CheckboxesTypeKnobValue>, CheckboxesWrapperProps {
knob: CheckboxesTypeKnob;
}
interface CheckboxesTypeState {
values: CheckboxesTypeKnobValue;
}
interface CheckboxesWrapperProps {
isInline: boolean;
}
export default class CheckboxesType extends Component<CheckboxesTypeProps, CheckboxesTypeState> {
static defaultProps: CheckboxesTypeProps;
static propTypes: {
knob: React.Validator<CheckboxesTypeKnob>;
onChange: React.Validator<(value: CheckboxesTypeKnobValue) => CheckboxesTypeKnobValue>;
isInline: React.Validator<boolean>;
};
static serialize: (value: CheckboxesTypeKnobValue) => CheckboxesTypeKnobValue;
static deserialize: (value: CheckboxesTypeKnobValue) => CheckboxesTypeKnobValue;
constructor(props: CheckboxesTypeProps);
handleChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
renderCheckboxList: ({ options }: CheckboxesTypeKnob) => JSX.Element[];
renderCheckbox: (label: string, value: string) => JSX.Element;
render(): JSX.Element;
}
export {};