UNPKG

895 BTypeScriptView Raw
1/// <reference types="react" />
2import { UseListItemRootSlotProps } from '../useList';
3import { EventHandlers } from '../utils';
4export interface SelectOption<Value> {
5 value: Value;
6 label: React.ReactNode;
7 disabled?: boolean;
8 ref: React.RefObject<Element>;
9 id?: string;
10}
11export interface UseOptionParameters<Value> {
12 disabled: boolean;
13 label: string | React.ReactNode;
14 value: Value;
15 rootRef?: React.Ref<Element>;
16 id?: string;
17}
18export 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}
25export type UseOptionRootSlotProps<Other extends EventHandlers = {}> = UseListItemRootSlotProps<Other> & {
26 ref?: React.RefCallback<Element> | null;
27} & Other;