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.
394 lines • 11.3 kB
text/typescript
/**
* A map of internal IPC event names used throughout the application to trigger various
* window and system-level actions. These strings are used as channel names for communication
* between the main and renderer processes in an Electron-based application. This map ensures
* that IPC communication is standardized and centralized to avoid naming inconsistencies.
*/
export type AppEvents = {
/**
* - Opens the developer tools in the application window.
*/
OpenDevTools: string;
/**
* - Sets the title of the application window.
*/
SetTitle: string;
/**
* - Brings the application window to the foreground.
*/
FocusWindow: string;
/**
* - Removes focus from the application window.
*/
BlurWindow: string;
/**
* - Makes the application window visible if hidden.
*/
ShowWindow: string;
/**
* - Forces the application window to gain focus, even if not focused normally.
*/
ForceFocusWindow: string;
/**
* - Requests the amount of time (in ms) the system has been idle.
*/
SystemIdleTime: string;
/**
* - Requests the current idle state of the system (active, idle, locked, etc.).
*/
SystemIdleState: string;
/**
* - Toggles visibility of the application window.
*/
ToggleVisible: string;
/**
* - Quits the application gracefully.
*/
AppQuit: string;
/**
* - Sets a custom network proxy for the application.
*/
SetProxy: string;
/**
* - Triggered when setting the proxy fails.
*/
SetProxyError: string;
/**
* - Asks whether the window is currently maximized.
*/
WindowIsMaximized: string;
/**
* - Maximizes the application window.
*/
WindowMaximize: string;
/**
* - Restores the window from maximized to normal size.
*/
WindowUnmaximize: string;
/**
* - Minimizes the application window to the taskbar or dock.
*/
WindowMinimize: string;
/**
* - Returns whether the application window is currently focused.
*/
WindowIsFocused: string;
/**
* - Returns whether the application window is currently visible.
*/
WindowIsVisible: string;
/**
* - Returns whether the application window is currently in fullscreen mode.
*/
WindowIsFullScreen: string;
/**
* - Notifies that the window has completed initialization and is ready to be displayed.
*/
ReadyToShow: string;
/**
* - Hides the application window from view.
*/
WindowHide: string;
/**
* - Shows the application window if hidden.
*/
WindowShow: string;
/**
* - Closes the application window.
*/
WindowClose: string;
/**
* - Destroys the application window instance entirely.
*/
WindowDestroy: string;
/**
* - Changes the icon of the application window dynamically.
*/
ChangeAppIcon: string;
/**
* - Changes the system tray icon of the application dynamically.
*/
ChangeTrayIcon: string;
/**
* - Sends a message to be printed in the renderer process console for debugging purposes.
*/
ConsoleMessage: string;
/**
* - Requests or responds with cached Electron-related values (e.g., user agent, versions, etc.).
*/
ElectronCacheValues: string;
/**
* - Sends a ping signal to check the connectivity or liveness of the IPC channel.
*/
Ping: string;
/**
* - Fired when the renderer has loaded the DOM content completely.
*/
DOMContentLoaded: string;
/**
* - Resizes the application window to the specified width and height.
*/
Resize: string;
/**
* - Brings the entire application to the foreground, typically from the system tray or background.
*/
ShowApp: string;
/**
* - Returns whether the application window is currently maximizable.
*/
WindowIsMaximizable: string;
/**
* - Returns whether the application window is currently closable.
*/
WindowIsClosable: string;
/**
* - Returns whether the application window is currently focusable.
*/
WindowIsFocusable: string;
/**
* - Returns whether the application window is currently fullscreenable.
*/
WindowIsFullScreenable: string;
/**
* - Updates the maximizable state of the window.
*/
SetWindowIsMaximizable: string;
/**
* - Updates the closable state of the window.
*/
SetWindowIsClosable: string;
/**
* - Updates the focusable state of the window.
*/
SetWindowIsFocusable: string;
/**
* - Updates the fullscreenable state of the window.
*/
SetWindowIsFullScreenable: string;
/**
* - Requests the current window state and capabilities.
*/
GetWindowData: string;
/**
* - Moves the window to a specified position on the screen.
*/
WindowMove: string;
/**
* - Fired after the window has been resized.
*/
Resized: string;
/**
* - Fired right before the window starts being resized.
*/
WillResize: string;
};
export namespace AppEvents {
let OpenDevTools: string;
let SetTitle: string;
let FocusWindow: string;
let BlurWindow: string;
let ShowWindow: string;
let ForceFocusWindow: string;
let SystemIdleTime: string;
let SystemIdleState: string;
let ToggleVisible: string;
let AppQuit: string;
let SetProxy: string;
let SetProxyError: string;
let WindowIsMaximized: string;
let WindowMaximize: string;
let WindowUnmaximize: string;
let WindowMinimize: string;
let WindowIsFocused: string;
let WindowIsVisible: string;
let WindowIsFullScreen: string;
let ReadyToShow: string;
let WindowHide: string;
let WindowClose: string;
let WindowDestroy: string;
let WindowShow: string;
let ChangeAppIcon: string;
let ChangeTrayIcon: string;
let ConsoleMessage: string;
let WindowMove: string;
let ElectronCacheValues: string;
let Ping: string;
let DOMContentLoaded: string;
let GetWindowData: string;
let WindowIsMaximizable: string;
let WindowIsClosable: string;
let WindowIsFocusable: string;
let WindowIsFullScreenable: string;
let SetWindowIsMaximizable: string;
let SetWindowIsClosable: string;
let SetWindowIsFocusable: string;
let SetWindowIsFullScreenable: string;
let Resize: string;
let Resized: string;
let WillResize: string;
let ShowApp: string;
}
/**
* A map of event names used with an internal EventEmitter instance.
* These events are emitted and listened to internally within the application to handle
* lifecycle events, window state changes, and proxy configurations.
*/
export type RootEvents = {
/**
* - Emitted when the window enters or exits maximized state.
*/
IsMaximized: string;
/**
* - Emitted when the window gains or loses focus.
*/
IsFocused: string;
/**
* - Emitted when the window becomes visible or hidden.
*/
IsVisible: string;
/**
* - Emitted when the window enters or exits fullscreen mode.
*/
IsFullScreen: string;
/**
* - Emitted when there is an error applying the proxy configuration.
*/
SetProxyError: string;
/**
* - Emitted when a proxy configuration is successfully applied.
*/
SetProxy: string;
/**
* - Emitted when the window is resized.
*/
Resize: string;
/**
* - Emitted as a heartbeat or connectivity check between internal systems.
*/
Ping: string;
/**
* - Emitted when the application has fully initialized and is ready to start.
*/
Ready: string;
/**
* - Emitted to signal the creation of the first application window during startup.
*/
CreateFirstWindow: string;
/**
* - Emitted when the window is fully initialized and ready to be displayed, but not yet shown.
*/
ReadyToShow: string;
/**
* - Emitted when the renderer process completes loading the DOM content.
*/
DOMContentLoaded: string;
/**
* - Emitted when the application window is actually shown to the user after being ready.
*/
ShowApp: string;
/**
* - Emitted when the fullscreenable state of the window changes.
*/
IsFullScreenable: string;
/**
* - Emitted when the maximizable state of the window changes.
*/
IsMaximizable: string;
/**
* - Emitted when the closable state of the window changes.
*/
IsClosable: string;
/**
* - Emitted when the focusable state of the window changes.
*/
IsFocusable: string;
/**
* - Emitted after the window resizing process completes.
*/
Resized: string;
/**
* - Emitted before the window starts resizing.
*/
WillResize: string;
/**
* - Emitted when the window is moved to a different screen position.
*/
WindowMove: string;
};
export namespace RootEvents {
export let IsFullScreenable: string;
export let IsMaximizable: string;
export let IsClosable: string;
export let IsFocusable: string;
export let IsMaximized: string;
export let IsFocused: string;
export let IsVisible: string;
let SetProxyError_1: string;
export { SetProxyError_1 as SetProxyError };
let SetProxy_1: string;
export { SetProxy_1 as SetProxy };
let Resize_1: string;
export { Resize_1 as Resize };
let Resized_1: string;
export { Resized_1 as Resized };
let WillResize_1: string;
export { WillResize_1 as WillResize };
export let IsFullScreen: string;
let Ping_1: string;
export { Ping_1 as Ping };
export let Ready: string;
export let CreateFirstWindow: string;
let ReadyToShow_1: string;
export { ReadyToShow_1 as ReadyToShow };
let DOMContentLoaded_1: string;
export { DOMContentLoaded_1 as DOMContentLoaded };
let ShowApp_1: string;
export { ShowApp_1 as ShowApp };
let WindowMove_1: string;
export { WindowMove_1 as WindowMove };
}
export type NotificationEvents = {
/**
* - Event triggered when a new notification is created.
*/
Create: string;
/**
* - Event triggered when a notification is shown to the user.
*/
Show: string;
/**
* - Event triggered for any notification-related activity.
*/
All: string;
/**
* - Event triggered when the user clicks on a notification.
*/
Click: string;
/**
* - Event triggered when the user replies to a notification (if supported).
*/
Reply: string;
/**
* - Event triggered when the user interacts with an action button in the notification.
*/
Action: string;
/**
* - Event triggered when showing or creating a notification fails.
*/
Failed: string;
/**
* - Event triggered when a notification is closed or dismissed.
*/
Close: string;
};
export namespace NotificationEvents {
let Create: string;
let Show: string;
let All: string;
let Click: string;
let Reply: string;
let Action: string;
let Failed: string;
let Close: string;
}
//# sourceMappingURL=Events.d.mts.map