UNPKG

1.72 kBTypeScriptView Raw
1import { Knob } from './type-defs';
2declare type Callback = () => any;
3export declare type KnobStoreKnob = Knob & {
4 name: string;
5 label: string;
6 used?: boolean;
7 defaultValue?: any;
8 hideLabel?: boolean;
9 callback?: () => any;
10};
11export default class KnobStore {
12 store: Record<string, KnobStoreKnob>;
13 callbacks: Callback[];
14 timer: number | undefined;
15 has(key: string): boolean;
16 set(key: string, value: KnobStoreKnob): void;
17 update(key: string, options: Partial<KnobStoreKnob>): void;
18 get(key: string): (Pick<import("./components/types").ObjectTypeKnob<any>, "value"> & {
19 type: any;
20 groupId?: string | undefined;
21 disableDebounce?: boolean | undefined;
22 disableForceUpdate?: boolean | undefined;
23 } & {
24 name: string;
25 label: string;
26 used?: boolean | undefined;
27 defaultValue?: any;
28 hideLabel?: boolean | undefined;
29 callback?: (() => any) | undefined;
30 }) | ({
31 value?: undefined;
32 callback: import("./components/types").ButtonTypeOnClickProp;
33 hideLabel: true;
34 } & {
35 type: any;
36 groupId?: string | undefined;
37 disableDebounce?: boolean | undefined;
38 disableForceUpdate?: boolean | undefined;
39 } & {
40 name: string;
41 label: string;
42 used?: boolean | undefined;
43 defaultValue?: any;
44 hideLabel?: boolean | undefined;
45 callback?: (() => any) | undefined;
46 });
47 getAll(): Record<string, KnobStoreKnob>;
48 reset(): void;
49 markAllUnused(): void;
50 subscribe(cb: Callback): void;
51 unsubscribe(cb: Callback): void;
52}
53export {};
54
\No newline at end of file