API reference
components/confirm-action
Import
Section titled “Import”import * as api from "@fungi.computer/caps/components/confirm-action";Exports
Section titled “Exports”| Kind | Export | Description |
|---|---|---|
| type alias | ConfirmActionProps | A deliberate hold, or an exact phrase before a destructive action. |
| function | ConfirmAction() | Confirms once per gesture, owns pending/result feedback, and keeps failed confirmations available for retry. Type mode closes on success and restores focus through Dialog. A pending action cannot be dismissed or cancelled. |
ConfirmActionPropstype alias
Section titled “ConfirmActionProps”type ConfirmActionProps = object & | { mode: "hold"; phrase?: never;} | { mode: "type"; phrase: string;};A deliberate hold, or an exact phrase before a destructive action.
Type Declaration
Section titled “Type Declaration”| Name | Type | Description |
|---|---|---|
label |
string |
The action’s trigger label and dialog title. |
confirmLabel |
string |
The destructive key’s label (and the hold gesture’s instruction). |
onConfirm() |
() => Promise<void> |
Resolve on success; reject on failure. The component prevents concurrent calls. |
error? |
string |
Caller-owned, safe-to-display failure copy; rejection details are never displayed. |
ConfirmAction()function
Section titled “ConfirmAction()”function ConfirmAction(__namedParameters): Element;Confirms once per gesture, owns pending/result feedback, and keeps failed confirmations available for retry. Type mode closes on success and restores focus through Dialog. A pending action cannot be dismissed or cancelled.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
__namedParameters |
ConfirmActionProps |
Returns
Section titled “Returns”Element