UNPKG

1.42 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 get(key: string): (Pick<import("./components/types/types").KnobControlConfig<any>, "value"> & {
18 type: any;
19 groupId?: string | undefined;
20 } & {
21 name: string;
22 label: string;
23 used?: boolean | undefined;
24 defaultValue?: any;
25 hideLabel?: boolean | undefined;
26 callback?: (() => any) | undefined;
27 }) | ({
28 value?: undefined;
29 callback: import("./components/types").ButtonTypeOnClickProp;
30 hideLabel: true;
31 } & {
32 type: any;
33 groupId?: string | undefined;
34 } & {
35 name: string;
36 label: string;
37 used?: boolean | undefined;
38 defaultValue?: any;
39 hideLabel?: boolean | undefined;
40 callback?: (() => any) | undefined;
41 });
42 getAll(): Record<string, KnobStoreKnob>;
43 reset(): void;
44 markAllUnused(): void;
45 subscribe(cb: Callback): void;
46 unsubscribe(cb: Callback): void;
47}
48export {};
49
\No newline at end of file