primevue-mirror/components/toast/Toast.d.ts

158 lines
3.8 KiB
TypeScript
Raw Normal View History

2023-03-01 13:06:17 +00:00
/**
*
* Toast is used to display messages in an overlay.
*
* [Live Demo](https://www.primevue.org/toast/)
*
* @module toast
*
*/
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';
export interface ToastMessageOptions {
/**
* Severity level of the message.
* Default value is 'info'.
*/
2023-03-01 13:06:17 +00:00
severity?: 'success' | 'info' | 'warn' | 'error' | undefined;
2022-09-06 12:03:37 +00:00
/**
* Summary content of the message.
*/
summary?: string | undefined;
/**
* Detail content of the message.
*/
detail?: any | undefined;
/**
* Whether the message can be closed manually using the close icon.
* Default value is true.
*/
closable?: boolean | undefined;
/**
* Delay in milliseconds to close the message automatically.
* Default value is 3000.
*/
life?: number | undefined;
/**
* Key of the Toast to display the message.
*/
group?: string | undefined;
/**
* Style class of the message.
*/
styleClass?: any;
/**
* Style class of the content.
*/
contentStyleClass?: any;
}
export interface ToastBreakpointsType {
/**
* Breakpoint for responsive mode.
*
* Example:
*
* <Toast :breakpoints="{'960px': { width: '75vw', ... }" ... />
*
*/
[key: string]: any;
}
2023-03-01 13:06:17 +00:00
/**
* Defines valid properties in Toast component.
*/
2022-09-06 12:03:37 +00:00
export interface ToastProps {
/**
* Unique identifier of a message group.
*/
group?: string | undefined;
/**
* Position of the toast in viewport.
2023-03-01 13:06:17 +00:00
* @defaultValue top-right
2022-09-06 12:03:37 +00:00
*/
2023-03-01 13:06:17 +00:00
position?: 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | 'center' | undefined;
2022-09-06 12:03:37 +00:00
/**
* Whether to automatically manage layering.
2023-03-01 13:06:17 +00:00
* @defaultValue true
2022-09-06 12:03:37 +00:00
*/
autoZIndex?: boolean | undefined;
/**
* Base zIndex value to use in layering.
2023-03-01 13:06:17 +00:00
* @defaultValue 0
2022-09-06 12:03:37 +00:00
*/
baseZIndex?: number | undefined;
/**
* Object literal to define styles per screen size.
* @see ToastBreakpointsType
*/
breakpoints?: ToastBreakpointsType;
2022-12-08 11:04:25 +00:00
/**
* Icon to display in the toast close button.
2023-03-01 13:06:17 +00:00
* @defaultValue pi pi-times
2022-12-08 11:04:25 +00:00
*/
closeIcon?: string | undefined;
/**
* Icon to display in the toast with info severity.
2023-03-01 13:06:17 +00:00
* @defaultValue pi pi-info-circle
2022-12-08 11:04:25 +00:00
*/
infoIcon?: string | undefined;
/**
* Icon to display in the toast with warn severity.
2023-03-01 13:06:17 +00:00
* @defaultValue pi pi-exclamation-triangle
2022-12-08 11:04:25 +00:00
*/
warnIcon?: string | undefined;
/**
* Icon to display in the toast with error severity.
2023-03-01 13:06:17 +00:00
* @defaultValue pi pi-times
2022-12-08 11:04:25 +00:00
*/
errorIcon?: string | undefined;
/**
* Icon to display in the toast with success severity.
2023-03-01 13:06:17 +00:00
* @defaultValue pi pi-check
2022-12-08 11:04:25 +00:00
*/
successIcon?: 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 ToastSlots {
/**
* Custom message template.
* @param {Object} scope - message slot's params.
*/
2023-03-01 13:06:17 +00:00
message(scope: {
2022-09-14 11:26:01 +00:00
/**
* Message of the component
*/
message: any;
2023-03-01 13:06:17 +00:00
}): VNode[];
2022-09-06 12:03:37 +00:00
}
2023-03-01 13:06:17 +00:00
export interface ToastEmits {}
2022-09-06 12:03:37 +00:00
2023-03-01 13:06:17 +00:00
/**
* **PrimeVue - Toast**
*
* _Toast is used to display messages in an overlay._
*
* [Live Demo](https://www.primevue.org/toast/)
* --- ---
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo.svg)
*
* @group Component
*
*/
2022-09-14 11:26:01 +00:00
declare class Toast extends ClassComponent<ToastProps, ToastSlots, ToastEmits> {}
2022-09-06 12:03:37 +00:00
declare module '@vue/runtime-core' {
interface GlobalComponents {
2022-09-14 11:26:01 +00:00
Toast: GlobalComponentConstructor<Toast>;
2022-09-06 12:03:37 +00:00
}
}
export default Toast;