tiny-electron-essentials
Version:
A lightweight and modular utility library for Electron apps, offering simplified window management, tray support, IPC channels, and custom frameless window styling.
44 lines • 1.95 kB
text/typescript
export default TinyElectronNotification;
export type NotificationConstructorOptions = Electron.NotificationConstructorOptions & {
tag?: string;
};
/** @typedef {Electron.NotificationConstructorOptions & { tag?: string; }} NotificationConstructorOptions */
/**
* Provides an interface to manage notifications with event handling
* through Electron's IPC. Each notification instance supports lifecycle
* management (create, show, close) and full event listener control based
* on Node.js `EventEmitter`.
*
* This class acts as a bridge between the renderer and the main process,
* allowing you to create persistent notification instances identified by tags.
*
* @beta This API is experimental and may change in future versions.
*/
declare class TinyElectronNotification {
/**
* @param {Object} [settings={}] - Configuration settings for the notifications.
* @param {NotificationEvents} [settings.eventNames=this.#Events] - Set of event names for internal messaging.
* @param {TinyIpcResponder} [settings.ipcResponder] - The IPC responder instance used for communication.
* @param {string} [settings.folderPath]
*/
constructor({ ipcResponder, folderPath, eventNames }?: {
eventNames?: NotificationEvents | undefined;
ipcResponder?: TinyIpcResponder | undefined;
folderPath?: string | undefined;
});
/**
* Deletes all files inside the configured folder path.
*
* This method asynchronously reads the directory and deletes
* all files found within it.
*
* @async
* @returns {Promise<void>} Resolves when all files are deleted.
* @throws {Error} If reading the directory or deleting any file fails.
*/
deleteAllFilesInDir(): Promise<void>;
#private;
}
import { NotificationEvents } from '../global/Events.mjs';
import TinyIpcResponder from './TinyIpcResponder.mjs';
//# sourceMappingURL=TinyElectronNotification.d.mts.map