UNPKG

1.48 kBTypeScriptView Raw
1import React, { PureComponent } from 'react';
2import { API } from '@storybook/api';
3import { KnobStoreKnob } from '../KnobStore';
4export declare const DEFAULT_GROUP_ID = "Other";
5interface KnobPanelProps {
6 active: boolean;
7 onReset?: object;
8 api: Pick<API, 'on' | 'off' | 'emit' | 'getQueryParam' | 'setQueryParams'>;
9}
10interface KnobPanelState {
11 knobs: Record<string, KnobStoreKnob>;
12}
13interface KnobPanelOptions {
14 timestamps?: boolean;
15}
16export default class KnobPanel extends PureComponent<KnobPanelProps> {
17 static propTypes: {
18 active: React.Validator<boolean>;
19 onReset: React.Validator<object | undefined>;
20 api: React.Validator<Pick<API, "on" | "off" | "emit" | "getQueryParam" | "setQueryParams">>;
21 };
22 static defaultProps: KnobPanelProps;
23 state: KnobPanelState;
24 options: KnobPanelOptions;
25 lastEdit: number;
26 loadedFromUrl: boolean;
27 mounted: boolean;
28 componentDidMount(): void;
29 componentWillUnmount(): void;
30 setOptions: (options?: KnobPanelOptions) => void;
31 setKnobs: ({ knobs, timestamp, }: {
32 knobs: Record<string, KnobStoreKnob>;
33 timestamp?: number | undefined;
34 }) => void;
35 reset: () => void;
36 copy: () => void;
37 emitChange: (changedKnob: KnobStoreKnob) => void;
38 handleChange: (changedKnob: KnobStoreKnob) => void;
39 handleClick: (knob: KnobStoreKnob) => void;
40 stopListeningOnStory: Function;
41 render(): JSX.Element | null;
42}
43export {};