1 | declare const PARAM_KEY = "actions";
|
2 | declare const ADDON_ID = "storybook/actions";
|
3 | declare const PANEL_ID = "storybook/actions/panel";
|
4 | declare const EVENT_ID = "storybook/actions/action-event";
|
5 | declare const CLEAR_ID = "storybook/actions/action-clear";
|
6 | declare const CYCLIC_KEY = "$___storybook.isCyclic";
|
7 |
|
8 | interface Options$1 {
|
9 | allowRegExp: boolean;
|
10 | allowFunction: boolean;
|
11 | allowSymbol: boolean;
|
12 | allowDate: boolean;
|
13 | allowUndefined: boolean;
|
14 | allowClass: boolean;
|
15 | allowError: boolean;
|
16 | maxDepth: number;
|
17 | space: number | undefined;
|
18 | lazyEval: boolean;
|
19 | }
|
20 |
|
21 | interface Options {
|
22 | depth: number;
|
23 | clearOnStoryChange: boolean;
|
24 | limit: number;
|
25 | implicit: boolean;
|
26 | id: string;
|
27 | }
|
28 | type ActionOptions = Partial<Options> & Partial<Options$1>;
|
29 |
|
30 | interface ActionDisplay {
|
31 | id: string;
|
32 | data: {
|
33 | name: string;
|
34 | args: any[];
|
35 | };
|
36 | count: number;
|
37 | options: ActionOptions;
|
38 | }
|
39 |
|
40 | type HandlerFunction = (...args: any[]) => void;
|
41 |
|
42 | type ActionsMap<T extends string = string> = Record<T, HandlerFunction>;
|
43 |
|
44 | interface ActionsFunction {
|
45 | <T extends string>(handlerMap: Record<T, string>, options?: ActionOptions): ActionsMap<T>;
|
46 | <T extends string>(...handlers: T[]): ActionsMap<T>;
|
47 | <T extends string>(handler1: T, options?: ActionOptions): ActionsMap<T>;
|
48 | <T extends string>(handler1: T, handler2: T, options?: ActionOptions): ActionsMap<T>;
|
49 | <T extends string>(handler1: T, handler2: T, handler3: T, options?: ActionOptions): ActionsMap<T>;
|
50 | <T extends string>(handler1: T, handler2: T, handler3: T, handler4: T, options?: ActionOptions): ActionsMap<T>;
|
51 | <T extends string>(handler1: T, handler2: T, handler3: T, handler4: T, handler5: T, options?: ActionOptions): ActionsMap<T>;
|
52 | <T extends string>(handler1: T, handler2: T, handler3: T, handler4: T, handler5: T, handler6: T, options?: ActionOptions): ActionsMap<T>;
|
53 | <T extends string>(handler1: T, handler2: T, handler3: T, handler4: T, handler5: T, handler6: T, handler7: T, options?: ActionOptions): ActionsMap<T>;
|
54 | <T extends string>(handler1: T, handler2: T, handler3: T, handler4: T, handler5: T, handler6: T, handler7: T, handler8: T, options?: ActionOptions): ActionsMap<T>;
|
55 | <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>;
|
56 | <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>;
|
57 | }
|
58 |
|
59 | type DecoratorFunction = (args: any[]) => any[];
|
60 |
|
61 | declare function action(name: string, options?: ActionOptions): HandlerFunction;
|
62 |
|
63 | declare const actions: ActionsFunction;
|
64 |
|
65 | declare const config: ActionOptions;
|
66 | declare const configureActions: (options?: ActionOptions) => void;
|
67 |
|
68 | export { ADDON_ID, ActionDisplay, ActionOptions, ActionsFunction, ActionsMap, CLEAR_ID, CYCLIC_KEY, DecoratorFunction, EVENT_ID, HandlerFunction, PANEL_ID, PARAM_KEY, action, actions, config, configureActions };
|