import type { Writable } from "svelte/store";

export const selectSearchContextKey = Symbol("select-search");

export type SelectSearchContext = {
	query: Writable<string>;
	open: Writable<boolean>;
	setOpen: (next: boolean) => void;
	/** Nodo del trigger para devolver foco al cerrar (bits-ui bloquea onCloseAutoFocus por defecto). */
	triggerRef: Writable<HTMLElement | null>;
	/** Valor actual del Select (single: string; multiple: string[]). */
	selectedValue: Writable<string | string[] | undefined>;
	selectionType: Writable<'single' | 'multiple'>;
	/** Limpia la selección (single → ''; multiple → []). */
	clearValue: () => void;
};
