flowbite-svelte
Version:
Flowbite components for Svelte
16 lines (15 loc) • 632 B
TypeScript
/**
* @template T
* @param {boolean} [nonReactive=false] - use a non-reactive placeholder to allow multiple selection and keep context shallow
* @returns {SingleSelectionContext<T>}
*/
export function createSingleSelectionContext<T>(nonReactive?: boolean): SingleSelectionContext<T>;
/**
* @template T
* @param {(value: T|null) => void} callback
* @returns {(open: boolean, v?: T) => SingleSelectionContext<T>}
*/
export function useSingleSelection<T>(callback: (value: T | null) => void): (open: boolean, v?: T) => SingleSelectionContext<T>;
export type SingleSelectionContext<T> = {
value?: (T | null) | undefined;
};