/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ import type { SheetRegisterIndex } from "../model.js"; import { type ActionCase } from "./model.js"; /** The overlay open on an action cell, as its sheet holds it. */ export type ActionOverlayState = { kind: "menu"; r: number; /** The rows it takes on: a range down the column (T8), else the cell's own. */ rs: readonly number[]; key: string; /** The control that opened it, held while it is open. */ part: "next" | "more"; anchor: HTMLElement; /** The cases it lists: a choice's reasons, or the rest of the offer (M5). */ cases: readonly ActionCase[]; /** How the menu names the row (M5). */ head: string; } | { kind: "form"; r: number; /** The rows it takes on: a range down the column asks once (T8), else the cell's own. */ rs: readonly number[]; key: string; part: "next" | "more"; anchor: HTMLElement; /** The case it asks for. */ case: ActionCase; /** The value it opens with (F10), decoded; `undefined` for none. */ initial: unknown; /** How the row is named in its eyebrow (F4). */ name: string | undefined; /** The row's words beside its name (F4). */ meta: string | undefined; }; /** Props of {@link ActionMenu}. */ export interface ActionMenuProps { state: Extract; registers: SheetRegisterIndex; /** A case taken with its value (M8): a button's null, a choice's reason. */ onTake: (c: ActionCase, value: unknown) => void; /** A form case run from the Menu (M8): its Popover opens in the Menu's place, hung from the same control. */ onForm: (c: ActionCase) => void; onClose: () => void; /** The pointer rests on an item, or leaves it (P9): its case, previewed in the strip. */ onPreview?: ((c: ActionCase | undefined) => void) | undefined; } /** * The Menu of an action cell (§5): the direct actions first, numbered, under * how the row is named; then one group per choice, its reasons in their * words. A digit runs the item with that number (K4). */ export declare const ActionMenu: import("react").MemoExoticComponent<({ state, registers, onTake, onForm, onClose, onPreview }: ActionMenuProps) => import("react/jsx-runtime").JSX.Element>; /** Props of {@link ActionForm}. */ export interface ActionFormProps { state: Extract; registers: SheetRegisterIndex; /** What taking it with the values as they stand would write (F8): the consequence line. */ consequence: (c: ActionCase, value: unknown) => string; /** The case taken with its value (F9). */ onTake: (c: ActionCase, value: unknown) => void; onClose: () => void; } /** * A form case's Popover (§6): the eyebrow naming the action and the row, the * case's fields through `FieldForm`, the consequence, Cancel and the verb. A * required field left empty keeps it open, the focus on that field (F9); a * number typed past its field's bounds is refused as it is typed, the field * saying the bound, so an action takes no value its form's bounds don't hold. */ export declare const ActionForm: import("react").MemoExoticComponent<({ state, registers, consequence, onTake, onClose }: ActionFormProps) => import("react/jsx-runtime").JSX.Element>; //# sourceMappingURL=ActionOverlay.d.ts.map