1 |
|
2 | export declare const ListActionTypes: {
|
3 | readonly blur: "list:blur";
|
4 | readonly focus: "list:focus";
|
5 | readonly keyDown: "list:keyDown";
|
6 | readonly itemClick: "list:itemClick";
|
7 | readonly itemHover: "list:itemHover";
|
8 | readonly itemsChange: "list:itemsChange";
|
9 | readonly textNavigation: "list:textNavigation";
|
10 | };
|
11 | interface ItemClickAction<ItemValue> {
|
12 | type: typeof ListActionTypes.itemClick;
|
13 | item: ItemValue;
|
14 | event: React.MouseEvent;
|
15 | }
|
16 | interface ItemHoverAction<ItemValue> {
|
17 | type: typeof ListActionTypes.itemHover;
|
18 | item: ItemValue;
|
19 | event: React.MouseEvent;
|
20 | }
|
21 | interface FocusAction {
|
22 | type: typeof ListActionTypes.focus;
|
23 | event: React.FocusEvent;
|
24 | }
|
25 | interface BlurAction {
|
26 | type: typeof ListActionTypes.blur;
|
27 | event: React.FocusEvent;
|
28 | }
|
29 | interface KeyDownAction {
|
30 | type: typeof ListActionTypes.keyDown;
|
31 | key: string;
|
32 | event: React.KeyboardEvent;
|
33 | }
|
34 | interface TextNavigationAction {
|
35 | type: typeof ListActionTypes.textNavigation;
|
36 | event: React.KeyboardEvent;
|
37 | searchString: string;
|
38 | }
|
39 | interface ItemsChangeAction<ItemValue> {
|
40 | type: typeof ListActionTypes.itemsChange;
|
41 | event: null;
|
42 | items: ItemValue[];
|
43 | previousItems: ItemValue[];
|
44 | }
|
45 |
|
46 |
|
47 |
|
48 | export type ListAction<ItemValue> = BlurAction | FocusAction | ItemClickAction<ItemValue> | ItemHoverAction<ItemValue> | ItemsChangeAction<ItemValue> | KeyDownAction | TextNavigationAction;
|
49 | export {};
|