import { TemplateRef } from '@angular/core'; import { PassThroughOption, PassThrough, Confirmation } from 'primeng/api'; import { DialogPassThrough } from 'primeng/types/dialog'; import { ButtonPassThrough } from 'primeng/types/button'; /** * Custom pass-through(pt) options. * @template I Type of instance. * * @see {@link ConfirmDialog.pt} * @group Interface */ interface ConfirmDialogPassThroughOptions { /** * Used to pass attributes to the host's DOM element. */ host?: PassThroughOption; /** * Used to pass attributes to the root's DOM element. * @see {@link DialogPassThrough} */ root?: DialogPassThrough; /** * Used to pass attributes to the mask's DOM element. */ mask?: PassThroughOption; /** * Used to pass attributes to the icon's DOM element. */ icon?: PassThroughOption; /** * Used to pass attributes to the message's DOM element. */ message?: PassThroughOption; /** * Used to pass attributes to the resize handle's DOM element. */ resizeHandle?: PassThroughOption; /** * Used to pass attributes to the header's DOM element. */ header?: PassThroughOption; /** * Used to pass attributes to the title's DOM element. */ title?: PassThroughOption; /** * Used to pass attributes to the header actions' DOM element. */ headerActions?: PassThroughOption; /** * Used to pass attributes to the close Button component. * @see {@link ButtonPassThrough} */ pcCloseButton?: ButtonPassThrough; /** * Used to pass attributes to the content's DOM element. */ content?: PassThroughOption; /** * Used to pass attributes to the footer's DOM element. */ footer?: PassThroughOption; /** * Used to pass attributes to the accept Button component. * @see {@link ButtonPassThrough} */ pcAcceptButton?: ButtonPassThrough; /** * Used to pass attributes to the reject Button component. * @see {@link ButtonPassThrough} */ pcRejectButton?: ButtonPassThrough; } /** * Defines valid pass-through options in ConfirmDialog. * @see {@link ConfirmDialogPassThroughOptions} * * @template I Type of instance. */ type ConfirmDialogPassThrough = PassThrough>; /** * Custom headless template context. * @group Interface */ interface ConfirmDialogHeadlessTemplateContext { /** * Confirmation instance. */ $implicit: Confirmation | null | undefined; /** * Callback to accept the confirmation. */ onAccept: () => void; /** * Callback to reject the confirmation. */ onReject: () => void; } /** * Custom message template context. * @group Interface */ interface ConfirmDialogMessageTemplateContext { /** * Confirmation instance. */ $implicit: Confirmation | null | undefined; } /** * Defines valid templates in ConfirmDialog. * @group Templates */ interface ConfirmDialogTemplates { /** * Custom header template. */ header(): TemplateRef; /** * Custom footer template. */ footer(): TemplateRef; /** * Custom message template. * @param {Object} context - message context. */ message(context: ConfirmDialogMessageTemplateContext): TemplateRef; /** * Custom icon template. */ icon(): TemplateRef; /** * Custom reject icon template. */ rejecticon(): TemplateRef; /** * Custom accept icon template. */ accepticon(): TemplateRef; /** * Custom headless template. * @param {Object} context - headless context. */ headless(context: ConfirmDialogHeadlessTemplateContext): TemplateRef; } export type { ConfirmDialogHeadlessTemplateContext, ConfirmDialogMessageTemplateContext, ConfirmDialogPassThrough, ConfirmDialogPassThroughOptions, ConfirmDialogTemplates };