@silexlabs/grapesjs-notifications
Version:
This GrapesJs plugin is designed to enhance the user experience within the editor by providing a robust notification system. This plugin captures and displays various types of notifications including errors, warnings, and activities, thereby facilitating
40 lines • 1.16 kB
TypeScript
import { Editor } from 'grapesjs';
export interface NotificationOptions {
id?: string;
message: string;
group?: string;
timeout?: number;
componentId?: string;
type: 'info' | 'warning' | 'error' | 'success';
icons: {
info: string;
warning: string;
error: string;
success: string;
};
}
export declare class Notification {
protected editor: Editor;
id: string | null;
componentId: string | null;
group: string | null;
timeoutRef: NodeJS.Timeout | undefined;
message: string;
type: 'info' | 'warning' | 'error' | 'success';
options: NotificationOptions;
model: any;
private removeCallback?;
constructor(editor: Editor, options: NotificationOptions | any, removeCallback?: (notification: Notification) => void);
select(): void;
remove(): void;
getSvgIcon(type: string): string;
private getDefaultOptions;
/**
* Get all components in the editor
* This is a heavy operation
*/
private getAllComponents;
private getAllComponentInPage;
private getAllChildrenComponent;
}
//# sourceMappingURL=Notification.d.ts.map