import { Observable } from 'rxjs';
/**
 * Represents the UX-relevant cause why a Page Dialog might require user confirmation before closing.
 *
 * This is intentionally **not** the close trigger (ESC / close icon / cancel button / navigation).
 * In Quadrel those triggers must behave consistently; only the underlying UX state matters.
 *
 * @default 'UNSAVED_CHANGES'
 */
export type QdPageDialogCloseCause = 'UNSAVED_CHANGES';
/**
 * Result of a Page Dialog close check.
 *
 * The Page (and its form-state integration) is the single source of truth for pending changes.
 * The dialog host uses this result to decide whether it can close immediately or must show a confirmation dialog.
 */
export interface QdPageDialogCanCloseResult {
    /**
     * Whether the Page Dialog is allowed to close right now.
     */
    canClose: boolean;
    /**
     * Indicates whether the user has made changes that would be lost on close.
     *
     * This is used to ensure deterministic cancel behavior, e.g.:
     * - always execute the cancel handler
     * - optionally pass a boolean flag (changed / unchanged) to downstream logic
     *
     * @default false
     */
    hasChanges: boolean;
    /**
     * Optional UX cause that can be used to derive the confirmation dialog message.
     *
     * Typical usage is a framework-owned i18n mapping such as:
     * i18n.qd.page.dialog.close.confirmation.<cause>
     *
     * @default 'UNSAVED_CHANGES'
     */
    cause?: QdPageDialogCloseCause;
}
/**
 * Contract for Page Dialog close decisions.
 *
 * The Page registers this function (e.g. when rendered inside the dialog router-outlet).
 * The dialog host calls it before closing to enforce consistent, framework-defined UX behavior.
 *
 * Observable is used to support asynchronous decisions (e.g. confirmation dialogs).
 */
export type QdPageDialogCanCloseFn = () => Observable<QdPageDialogCanCloseResult>;
//# sourceMappingURL=dialog-close.model.d.ts.map