primevue-mirror/components/lib/toastservice/ToastService.d.ts

53 lines
1.2 KiB
TypeScript
Raw Normal View History

2023-03-07 08:00:59 +00:00
/**
*
* [Live Demo](https://www.primevue.org/toast/)
*
2023-03-07 13:37:45 +00:00
* @module toastservice-usetoast
* @todo 'use' is not a valid name for a module. Next release will change.
2023-03-07 08:00:59 +00:00
*/
2022-09-06 12:03:37 +00:00
import { Plugin } from 'vue';
import { ToastMessageOptions } from '../toast';
declare const plugin: Plugin;
export default plugin;
2023-03-07 08:00:59 +00:00
/**
* Toast Service methods.
*
2023-03-07 13:37:45 +00:00
* @group Model
2023-03-07 08:00:59 +00:00
*
*/
2022-09-06 12:03:37 +00:00
export interface ToastServiceMethods {
/**
* Displays the message in a suitable Toast component.
* @param {ToastMessageOptions} message - Message instance.
*/
2023-03-07 08:00:59 +00:00
add(message: ToastMessageOptions): void;
/**
* Clears the message.
* @param {ToastMessageOptions} message - Message instance.
*/
remove(message: ToastMessageOptions): void;
2022-09-06 12:03:37 +00:00
/**
* Clears the messages that belongs to the group.
* @param {string} group - Name of the message group.
*/
2023-03-07 08:00:59 +00:00
removeGroup(group: string): void;
2022-09-06 12:03:37 +00:00
/**
* Clears all the messages.
*/
2023-03-07 08:00:59 +00:00
removeAllGroups(): void;
2022-09-06 12:03:37 +00:00
}
declare module 'vue/types/vue' {
interface Vue {
$toast: ToastServiceMethods;
}
}
declare module '@vue/runtime-core' {
interface ComponentCustomProperties {
$toast: ToastServiceMethods;
}
}