primevue-mirror/components/message/Message.d.ts

75 lines
1.9 KiB
TypeScript
Raw Normal View History

2022-12-08 11:04:25 +00:00
import { ButtonHTMLAttributes, VNode } from 'vue';
2022-09-06 12:03:37 +00:00
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
type MessageSeverityType = 'success' | 'info' | 'warn' | 'error' | undefined;
export interface MessageProps {
/**
* Severity level of the message.
* @see MessageSeverityType
* Default value is 'info'.
*/
severity?: MessageSeverityType;
/**
* Whether the message can be closed manually using the close icon.
* Default value is true.
*/
closable?: boolean | undefined;
/**
* When enabled, message is not removed automatically.
*/
sticky?: boolean | undefined;
/**
* Delay in milliseconds to close the message automatically.
* Default value is 3000.
*/
life?: number | undefined;
/**
* Display a custom icon for the message.
*/
icon?: string | undefined;
2022-12-08 11:04:25 +00:00
/**
* Icon to display in the message close button.
* Default value is 'pi pi-times'.
*/
closeIcon?: string | undefined;
/**
* Uses to pass all properties of the HTMLButtonElement to the close button.
*/
closeButtonProps?: ButtonHTMLAttributes | undefined;
2022-09-06 12:03:37 +00:00
}
export interface MessageSlots {
/**
* Default custom slot.
*/
default: () => VNode[];
}
export declare type MessageEmits = {
/**
* Callback to invoke when a message is closed.
* @param {Event} event - Browser event.
*/
2022-09-14 11:26:01 +00:00
close: (event: Event) => void;
};
2022-09-06 12:03:37 +00:00
2022-09-14 11:26:01 +00:00
declare class Message extends ClassComponent<MessageProps, MessageSlots, MessageEmits> {}
2022-09-06 12:03:37 +00:00
declare module '@vue/runtime-core' {
interface GlobalComponents {
2022-09-14 11:26:01 +00:00
Message: GlobalComponentConstructor<Message>;
2022-09-06 12:03:37 +00:00
}
}
/**
*
* Messages is used to display inline messages with various severities.
*
* Demos:
*
2022-09-14 11:26:01 +00:00
* - [Message](https://www.primefaces.org/primevue/message)
2022-09-06 12:03:37 +00:00
*
*/
export default Message;