UNPKG

@hypothesis/frontend-shared

Version:

Shared components, styles and utilities for Hypothesis projects

20 lines (19 loc) 655 B
export type ListboxOverflow = 'truncate' | 'wrap'; export type SelectValueOptions = { closeListbox: boolean; }; type SingleSelectContext<T> = { selectValue: (newValue: T, options: SelectValueOptions) => void; value: T; multiple: false; }; type MultiSelectContext<T> = { selectValue: (newValue: T[], options: SelectValueOptions) => void; value: T[]; multiple: true; }; export type SelectContextType<T = unknown> = (SingleSelectContext<T> | MultiSelectContext<T>) & { listboxOverflow: ListboxOverflow; }; declare const SelectContext: import("preact").Context<SelectContextType<unknown> | null>; export default SelectContext;