1 |
|
2 | import type { DropdownContextValue } from './DropdownContext';
|
3 | export interface UseDropdownParameters {
|
4 | |
5 |
|
6 |
|
7 | defaultOpen?: boolean;
|
8 | |
9 |
|
10 |
|
11 | onOpenChange?: (event: React.MouseEvent | React.KeyboardEvent | React.FocusEvent | null, open: boolean) => void;
|
12 | |
13 |
|
14 |
|
15 |
|
16 | open?: boolean;
|
17 | |
18 |
|
19 |
|
20 |
|
21 |
|
22 | componentName?: string;
|
23 | }
|
24 | export interface UseDropdownReturnValue {
|
25 | |
26 |
|
27 |
|
28 | contextValue: DropdownContextValue;
|
29 | |
30 |
|
31 |
|
32 | open: boolean;
|
33 | }
|
34 | export declare const DropdownActionTypes: {
|
35 | readonly blur: "dropdown:blur";
|
36 | readonly escapeKeyDown: "dropdown:escapeKeyDown";
|
37 | readonly toggle: "dropdown:toggle";
|
38 | readonly open: "dropdown:open";
|
39 | readonly close: "dropdown:close";
|
40 | };
|
41 | interface DropdownBlurAction {
|
42 | type: typeof DropdownActionTypes.blur;
|
43 | event: React.FocusEvent;
|
44 | }
|
45 | interface DropdownEscapeKeyDownAction {
|
46 | type: typeof DropdownActionTypes.escapeKeyDown;
|
47 | event: React.KeyboardEvent;
|
48 | }
|
49 | interface DropdownToggleAction {
|
50 | type: typeof DropdownActionTypes.toggle;
|
51 | event: React.MouseEvent | React.KeyboardEvent | React.FocusEvent | null;
|
52 | }
|
53 | interface DropdownOpenAction {
|
54 | type: typeof DropdownActionTypes.open;
|
55 | event: React.MouseEvent | React.KeyboardEvent | React.FocusEvent | null;
|
56 | }
|
57 | interface DropdownCloseAction {
|
58 | type: typeof DropdownActionTypes.close;
|
59 | event: React.MouseEvent | React.KeyboardEvent | React.FocusEvent | null;
|
60 | }
|
61 | export type DropdownAction = DropdownBlurAction | DropdownEscapeKeyDownAction | DropdownToggleAction | DropdownOpenAction | DropdownCloseAction;
|
62 | export type DropdownState = {
|
63 | open: boolean;
|
64 | changeReason: React.MouseEvent | React.KeyboardEvent | React.FocusEvent | null;
|
65 | };
|
66 | export {};
|