import type { PromptNode } from '../../core/index.js'; import type { PromptProps } from './type.js'; /** * Creates and manages a Prompt modal. * * @typeParam InputValue - Type of the value collected from user input * @typeParam BackgroundValue - Type of background data passed to BackgroundComponent * @param args - Prompt modal configuration options * @returns Object containing modalNode and promiseHandler * * @remarks * - modalNode: live getter for the modal node; undefined while the modal is * queued before the ModalProvider mounts, then set once the queue flushes * - promiseHandler: Promise that resolves with the user input value * - Input component receives value, onChange, onConfirm, onCancel, and context props * - Use disabled function to control confirm button's enabled state * - If returnOnCancel is false (default), the promise resolves with null on cancel * - If returnOnCancel is true, resolves with the input value at cancel time * (initially defaultValue) * * @example * ```tsx * const { modalNode, promiseHandler } = promptHandler({ * title: 'Enter Your Name', * Input: ({ value, onChange, onConfirm }) => ( * onChange(e.target.value)} * onKeyPress={(e) => e.key === 'Enter' && onConfirm()} * /> * ), * defaultValue: '', * }); * * const name = await promiseHandler; * if (name === null) console.log('User cancelled'); * ``` */ export declare const promptHandler: (args: PromptProps) => { readonly modalNode: PromptNode | undefined; promiseHandler: Promise; cancel: import("../../@aileron/declare").Fn<[], void>; };