import type { Duration } from '../@aileron/declare/index.js';
import type { ModalNode } from '../core/index.js';
/**
* Hook that automatically destroys a modal after it becomes hidden.
*
* Monitors the modal's visibility state and schedules destruction after a specified
* duration once the modal is hidden but still alive. Useful for cleanup after
* closing animations complete.
*
* @param modalId - ID of the modal to monitor
* @param duration - Delay before destruction (ms or duration string like '300ms')
*
* @example
* Basic usage with milliseconds:
* ```tsx
* function AnimatedModal({ modalId }) {
* // Destroy modal 300ms after it becomes hidden
* useDestroyAfter(modalId, 300);
*
* return (
*
* );
* }
* ```
*
* @remarks
* - Only triggers when modal is hidden (visible: false) but still alive
* - Automatically cancels if modal becomes visible again
* - Useful for cleanup after exit animations
* - Works with both millisecond numbers and duration strings
* - The timer resets if modal visibility changes
*/
export declare const useDestroyAfter: (modalId: ModalNode["id"], duration: Duration | number) => void;