1 | import { Options as Options$1 } from 'telejson';
|
2 |
|
3 | declare const PARAM_KEY = "actions";
|
4 | declare const ADDON_ID = "storybook/actions";
|
5 | declare const PANEL_ID: string;
|
6 | declare const EVENT_ID: string;
|
7 | declare const CLEAR_ID: string;
|
8 | declare const CYCLIC_KEY = "$___storybook.isCyclic";
|
9 |
|
10 | interface Options {
|
11 | depth: number;
|
12 | clearOnStoryChange: boolean;
|
13 | limit: number;
|
14 | }
|
15 | type ActionOptions = Partial<Options> & Partial<Options$1>;
|
16 |
|
17 | interface ActionDisplay {
|
18 | id: string;
|
19 | data: {
|
20 | name: string;
|
21 | args: any[];
|
22 | };
|
23 | count: number;
|
24 | options: ActionOptions;
|
25 | }
|
26 |
|
27 | type HandlerFunction = (...args: any[]) => void;
|
28 |
|
29 | type ActionsMap<T extends string = string> = Record<T, HandlerFunction>;
|
30 |
|
31 | interface ActionsFunction {
|
32 | <T extends string>(handlerMap: Record<T, string>, options?: ActionOptions): ActionsMap<T>;
|
33 | <T extends string>(...handlers: T[]): ActionsMap<T>;
|
34 | <T extends string>(handler1: T, options?: ActionOptions): ActionsMap<T>;
|
35 | <T extends string>(handler1: T, handler2: T, options?: ActionOptions): ActionsMap<T>;
|
36 | <T extends string>(handler1: T, handler2: T, handler3: T, options?: ActionOptions): ActionsMap<T>;
|
37 | <T extends string>(handler1: T, handler2: T, handler3: T, handler4: T, options?: ActionOptions): ActionsMap<T>;
|
38 | <T extends string>(handler1: T, handler2: T, handler3: T, handler4: T, handler5: T, options?: ActionOptions): ActionsMap<T>;
|
39 | <T extends string>(handler1: T, handler2: T, handler3: T, handler4: T, handler5: T, handler6: T, options?: ActionOptions): ActionsMap<T>;
|
40 | <T extends string>(handler1: T, handler2: T, handler3: T, handler4: T, handler5: T, handler6: T, handler7: T, options?: ActionOptions): ActionsMap<T>;
|
41 | <T extends string>(handler1: T, handler2: T, handler3: T, handler4: T, handler5: T, handler6: T, handler7: T, handler8: T, options?: ActionOptions): ActionsMap<T>;
|
42 | <T extends string>(handler1: T, handler2: T, handler3: T, handler4: T, handler5: T, handler6: T, handler7: T, handler8: T, handler9: T, options?: ActionOptions): ActionsMap<T>;
|
43 | <T extends string>(handler1: T, handler2: T, handler3: T, handler4: T, handler5: T, handler6: T, handler7: T, handler8: T, handler9: T, handler10: T, options?: ActionOptions): ActionsMap<T>;
|
44 | }
|
45 |
|
46 | type DecoratorFunction = (args: any[]) => any[];
|
47 |
|
48 | declare function action(name: string, options?: ActionOptions): HandlerFunction;
|
49 |
|
50 | declare const actions: ActionsFunction;
|
51 |
|
52 | declare const config: ActionOptions;
|
53 | declare const configureActions: (options?: ActionOptions) => void;
|
54 |
|
55 | export { ADDON_ID, ActionDisplay, ActionOptions, ActionsFunction, ActionsMap, CLEAR_ID, CYCLIC_KEY, DecoratorFunction, EVENT_ID, HandlerFunction, PANEL_ID, PARAM_KEY, action, actions, config, configureActions };
|