import type { Fn } from '../../@aileron/declare/index.js'; import type { ModalNode } from '../../core/node/index.js'; import type { Modal } from '../../types/index.js'; interface DispatchModalOptions { /** Abort signal that cancels the modal (before or after mount). */ signal?: AbortSignal; /** Maps the node's raw resolve payload to the public promise result. */ mapResult: Fn<[result: unknown], Result>; /** Raw payload used when the modal is aborted before React ever mounted. */ cancelResult: Fn<[], unknown>; } /** * Opens a modal through ModalManager and wires its promise settlement. * * The resolver travels inside the modal data (`handleResolve`), so the wiring * survives the prerender queue: modals opened before the provider mounts are * flushed later and still settle the very same promise. * * @returns modalNode - live getter: undefined while the modal is queued before * mount, then the node created by the flush (late reads see the real node) * @returns promiseHandler - settles on user interaction or abort; rejects only * when the open handler itself throws */ export declare const dispatchModal: (modal: Modal, { signal, mapResult, cancelResult }: DispatchModalOptions) => { readonly modalNode: Node | undefined; promiseHandler: Promise; cancel: Fn<[], void>; }; export {};