import { TemplateRef } from '@angular/core'; import { ComponentType } from '@angular/cdk/portal'; import { DialogRef } from './dialog-ref'; export declare type DialogButtonRole = 'primary' | 'secondary' | 'warn' | (string & {}); export interface DialogButtonConfig { label: string; role?: DialogButtonRole; handler?: (dialogRef: DialogRef) => TResult | void | Promise; closeOnClick?: boolean; /** Static or dynamic disabled state. When a function, it receives the dialog ref * (so consumers can read the rendered component instance via `getComponentInstance`) * and is re-evaluated on every change-detection pass. */ disabled?: boolean | ((dialogRef: DialogRef) => boolean); /** Static or dynamic loading state. Drives the cqa-button spinner so consumers * can keep the dialog open while an async submit is in flight. Same evaluation * contract as `disabled`. */ loading?: boolean | ((dialogRef: DialogRef) => boolean); } export declare type DialogButtonAlignment = 'left' | 'right' | 'center'; export interface TemplateDialogContent { type: 'template'; template: TemplateRef; context?: TContext; } export interface ComponentDialogContent> { type: 'component'; component: ComponentType; inputs?: TInputs; } export declare type DialogContentConfig = TemplateDialogContent | ComponentDialogContent; export interface DialogConfig { title: string; description?: string; warning?: string; content?: TContent; data?: unknown; buttons: DialogButtonConfig[]; buttonAlignment?: DialogButtonAlignment; panelClass?: string | string[]; width?: string; maxWidth?: string; disableClose?: boolean; }