UNPKG

880 BTypeScriptView Raw
1export interface ListChangeNotifiers<ItemValue> {
2 /**
3 * Calls all the registered selection change handlers.
4 *
5 * @param newValue - The newly selected value(s).
6 */
7 notifySelectionChanged: (newValue: ItemValue[]) => void;
8 /**
9 * Calls all the registered highlight change handlers.
10 *
11 * @param newValue - The newly highlighted value.
12 */
13 notifyHighlightChanged: (newValue: ItemValue | null) => void;
14 registerSelectionChangeHandler: (handler: (newValue: ItemValue[]) => void) => () => void;
15 registerHighlightChangeHandler: (handler: (newValue: ItemValue | null) => void) => () => void;
16}
17/**
18 * @ignore - internal hook.
19 *
20 * This hook is used to notify any interested components about changes in the Select's selection and highlight.
21 */
22export default function useSelectChangeNotifiers<Item>(): ListChangeNotifiers<Item>;