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