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.
66 lines • 2.24 kB
text/typescript
export default TinyElectronNotification;
export type IconCacheData = {
/**
* - The unique tag identifying the notification.
*/
tag: string;
/**
* - The filename of the cached icon.
*/
iconFile: string;
/**
* - Indicates if the icon was generated from a base64 string.
*/
isBase64: boolean;
};
export type NotificationResult = {
/**
* - The notification tag.
*/
tag: string | null;
/**
* - Whether the system supports notifications.
*/
isSupported: boolean;
};
/**
* @typedef {Object} IconCacheData
* @property {string} tag - The unique tag identifying the notification.
* @property {string} iconFile - The filename of the cached icon.
* @property {boolean} isBase64 - Indicates if the icon was generated from a base64 string.
*/
/**
* @typedef {Object} NotificationResult
* @property {string|null} tag - The notification tag.
* @property {boolean} isSupported - Whether the system supports notifications.
*/
/**
* Provides an interface to manage notifications with event handling
* through Electron's native IPC. Each notification instance supports lifecycle
* management (create, show, close) and full event listener control.
*
* @beta This API is experimental and may change in future versions.
*/
declare class TinyElectronNotification {
/**
* Initializes the notification manager and registers native IPC handlers.
*
* @param {Object} [settings={}] - Configuration settings for the notifications.
* @param {NotificationEvents} [settings.eventNames=this.#Events] - Set of event names for internal messaging.
* @param {string} [settings.folderPath] - Directory path to store temporary notification icons.
*/
constructor({ folderPath, eventNames }?: {
eventNames?: NotificationEvents | undefined;
folderPath?: string | undefined;
});
/**
* Deletes all files inside the configured folder path.
*
* @async
* @returns {Promise<void>} Resolves when all files are deleted.
*/
deleteAllFilesInDir(): Promise<void>;
#private;
}
import { NotificationEvents } from '../global/Events.mjs';
//# sourceMappingURL=TinyElectronNotification.d.mts.map