import { TemplateRef } from '@angular/core'; import { MotionOptions } from '@primeuix/motion'; import { PassThrough, PassThroughOption } from 'primeng/api'; /** * Message severity type. * @group Types */ type MessageSeverity = 'success' | 'info' | 'warn' | 'error' | 'secondary' | 'contrast'; /** * Message variant type. * @group Types */ type MessageVariant = 'outlined' | 'text' | 'simple'; /** * Message size type. * @group Types */ type MessageSize = 'large' | 'small'; /** * Message close event. * @group Interface */ interface MessageCloseEvent { /** * Browser event. */ originalEvent: Event; } /** * Custom pass-through(pt) options. * @template I Type of instance. * * @see {@link Message.pt} * @group Interface */ interface MessagePassThroughOptions { /** * Used to pass attributes to the host's DOM element. */ host?: PassThroughOption; /** * Used to pass attributes to the root's DOM element. */ root?: PassThroughOption; /** * Used to pass attributes to the content's DOM element. */ content?: PassThroughOption; /** * Used to pass attributes to the content's DOM element. */ contentWrapper?: PassThroughOption; /** * Used to pass attributes to the icon's DOM element. */ icon?: PassThroughOption; /** * Used to pass attributes to the text's DOM element. */ text?: PassThroughOption; /** * Used to pass attributes to the close button's DOM element. */ closeButton?: PassThroughOption; /** * Used to pass attributes to the close icon's DOM element. */ closeIcon?: PassThroughOption; /** * Used to pass options to the motion component/directive. */ motion?: MotionOptions; } /** * Defines valid pass-through options in Message. * @see {@link MessagePassThroughOptions} * * @template I Type of instance. */ type MessagePassThrough = PassThrough>; /** * Custom container template context. * @group Interface */ interface MessageContainerTemplateContext { /** * Callback to close the message. */ closeCallback: (event: Event) => void; } /** * Defines valid templates in Message. * @group Templates */ interface MessageTemplates { /** * Custom container template. * @param {Object} context - container context. */ container(context: MessageContainerTemplateContext): TemplateRef; /** * Custom icon template. */ icon(): TemplateRef; /** * Custom close icon template. */ closeicon(): TemplateRef; } export type { MessageCloseEvent, MessageContainerTemplateContext, MessagePassThrough, MessagePassThroughOptions, MessageSeverity, MessageSize, MessageTemplates, MessageVariant };