import { Application } from '../index.js'; const app = new Application(); // Create a browser window with a webview const browserWindow = app.createBrowserWindow({ title: 'Close Example', width: 800, height: 600, }); const _webview = browserWindow.createWebview({ html: `
This example demonstrates how to close the application gracefully.
`, }); app.on('window-close-requested', () => { console.log('Window close requested'); }); app.on('application-close-requested', () => { console.log('Application close requested'); }); // Example: Programmatically close the application after 5 seconds // setTimeout(() => { // console.log('Closing application programmatically...'); // app.exit(); // }, 5000); // Example: Programmatically hide the window // setTimeout(() => { // console.log('Hiding window...'); // browserWindow.hide(); // }, 3000); // Example: Programmatically show the window // setTimeout(() => { // console.log('Showing window...'); // browserWindow.show(); // }, 4000); // Run the application await app.run();