Persisted window bounds for Electron.
import { watchWindowBounds } from 'electron-bounds'
function createWindow(): void {
const mainWindow = new BrowserWindow()
watchWindowBounds(mainWindow)
}
app.whenReady().then(createWindow)
Watch a window for changes in size and position and persist them in the store.
Retrieve the window bounds from the store. Requires a window in case the store is empty.
Persist the bounds of a window in the store.
Set a window's bounds to the bounds persisted in the store.
Get the path to the store file.
Check if the stored bounds would escape the screen.
Center a window on the screen.