1 |
|
2 | import { UseListItemRootSlotProps } from '../useList';
|
3 | import { EventHandlers } from '../utils';
|
4 | export interface SelectOption<Value> {
|
5 | value: Value;
|
6 | label: React.ReactNode;
|
7 | disabled?: boolean;
|
8 | ref: React.RefObject<Element>;
|
9 | id?: string;
|
10 | }
|
11 | export interface UseOptionParameters<Value> {
|
12 | disabled: boolean;
|
13 | label: string | React.ReactNode;
|
14 | value: Value;
|
15 | rootRef?: React.Ref<Element>;
|
16 | id?: string;
|
17 | }
|
18 | export interface UseOptionReturnValue {
|
19 | selected: boolean;
|
20 | highlighted: boolean;
|
21 | index: number;
|
22 | getRootProps: <Other extends EventHandlers>(otherHandlers?: Other) => UseOptionRootSlotProps<Other>;
|
23 | rootRef: React.RefCallback<Element> | null;
|
24 | }
|
25 | export type UseOptionRootSlotProps<Other extends EventHandlers = {}> = UseListItemRootSlotProps<Other> & {
|
26 | ref?: React.RefCallback<Element> | null;
|
27 | } & Other;
|