import { Ref } from 'vue'; import { ModalController } from './state'; /** * Injects the modal controller from the Vue component tree. * This function should only be called within modal components. * * @template T - The expected response type from the modal * @returns {Ref> | null} A reactive reference to the modal controller, or null if not in modal context * * @example * ```typescript * // In a modal component * const modal = injectModal<{ confirmed: boolean }>(); * if (modal) { * modal.value.close({ confirmed: true }); * } * ``` */ export declare function injectModal(): Ref> | null; /** * Provides a modal controller to child components via dependency injection. * This is typically used internally by the modal system. * * @template T - The expected response type from the modal * @param {Ref>} controller - The modal controller to provide * * @example * ```typescript * // In a modal wrapper component * const controller = ref(modalController); * provideModal(controller); * ``` */ export declare function provideModal(controller: Ref>): void; /** * Composable function for working with modals within Vue components. * Provides reactive access to modal state and control methods. * * When used within a modal opened via the modal service, it uses the injected controller. * When used inline (modal rendered directly in template), it creates a standalone controller. * * @template T - The expected response type from the modal * @param {Object} [options] - Configuration options for the modal * @param {boolean} [options.removeOnClose] - Whether to remove the modal when it closes * @returns {Object} Modal state and control methods * @returns {ComputedRef} returns.id - The unique identifier of the modal * @returns {ComputedRef} returns.visible - Whether the modal is currently visible * @returns {ComputedRef} returns.child - Any child modal controller * @returns {Function} returns.close - Function to close the modal with optional payload * @returns {Function} returns.remove - Function to remove the modal from the stack * @returns {boolean} returns.isInline - Whether the modal is being used inline (without modal service) * * @example * ```typescript * // In a modal component * const { visible, close, remove } = useModal<{ confirmed: boolean }>({ * removeOnClose: true * }); * * // Close with a response * const handleConfirm = () => close({ confirmed: true }); * * // Close without response (dismissed) * const handleCancel = () => close(); * ``` */ export declare function useModal(options?: { removeOnClose?: boolean; }): { id: import('vue').ComputedRef; visible: import('vue').WritableComputedRef; child: import('vue').ComputedRef | null>; close: (payload?: T) => Promise; remove: () => void; isInline: boolean; };