/** Choosing many: what a pick does to a value, and when the overlay has served its purpose. */ import type { MdyMultiselectMode } from "@modyra/core"; import type { MdyOptionNavigationTarget } from "./keys.js"; import { type MdyKeyOrPress } from "../transitions.js"; export type MdyMultiselectValueIntent = { readonly type: "toggle"; readonly value: T; } | { readonly type: "increment"; readonly value: T; } | { readonly type: "decrement"; readonly value: T; } | { readonly type: "clear"; }; /** Pure multiselect value transition using the same loose key semantics as select. */ export declare function multiselectValueTransition(values: readonly T[], intent: MdyMultiselectValueIntent, keyFor?: (value: T) => string): readonly T[]; export type MdyMultiselectOverlayAction = { readonly type: "open"; } | { readonly type: "close"; readonly restoreFocus: boolean; } | { readonly type: "search"; readonly query: string; } | { readonly type: "select"; readonly optionKey: string; } | { readonly type: "move"; readonly target: MdyOptionNavigationTarget; }; /** Canonical multiselect overlay policy. The host only supplies event facts and executes the action. */ export declare function multiselectOverlayAction(input: { readonly key: MdyKeyOrPress; readonly open: boolean; /** * What the search box holds, where the kind has one. * * Still required though nothing reads it today: it is a fact about the moment that a policy * deciding what a key means may need again, every caller already passes it, and making it optional * would move the published surface for no gain. It stopped being read when Backspace stopped * answering with a no-op. */ readonly query: string; readonly activeKey: string | null; }): MdyMultiselectOverlayAction | null; /** Single-mode closes only when no unselected result remains after the commit. */ export declare function shouldCloseMultiselectOverlay(mode: MdyMultiselectMode, remainingResultCount: number): boolean; /** ISO date bound policy shared by typed input, calendar selection and future hosts. */