Skip to content

Commit d555371

Browse files
committed
docs: update docs
1 parent 1bbe2a6 commit d555371

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,20 @@
1919

2020
> Manage multiple windows of Electron gracefully and provide powerful features.
2121
22+
<p align="center"><img src="screenshot.png" width="600px"/></p>
23+
2224
## Installation
2325

2426
```bash
2527
$ npm i electron-windows --save
2628
```
2729

28-
## Demo
29-
30-
![](./screenshot.png)
31-
3230
## Quick Start
3331

3432
```javascript
3533
const WindowManager = require('electron-windows')
3634

35+
// Create a window manager instance
3736
const windowManager = new WindowManager()
3837

3938
// Create a window
@@ -57,13 +56,17 @@ const all = windowManager.getAll()
5756

5857
## API Reference
5958

59+
### Types
60+
61+
- **Window** - A union type of `StatefulWindow` and common `BrowserWindow`. When `storageKey` option is provided, returns `StatefulWindow`; otherwise returns `BrowserWindow`.
62+
6063
### `new WindowManager()`
6164

6265
Creates a new WindowManager instance.
6366

6467
### `windowManager.create(options)`
6568

66-
Creates and manages a new BrowserWindow.
69+
Creates and manages a new window.
6770

6871
- **options** `Object` - Configuration for the window:
6972
- **name** `string` - Window identifier, used by `get()`. Default: `'anonymous'`
@@ -77,23 +80,23 @@ Creates and manages a new BrowserWindow.
7780
- **storagePath** `string` - Custom storage path for window state file
7881
- **globalUserAgent** `string` - Custom User-Agent for all `loadURL` calls in this window
7982

80-
Returns: `BrowserWindow`
83+
Returns: `Window` (`BrowserWindow` or `StatefulWindow`)
8184

8285
### `windowManager.get(name)`
8386

8487
Get a managed window by name.
8588

8689
- **name** `string` - Window name
8790

88-
Returns: `BrowserWindow | undefined`
91+
Returns: `Window | undefined`
8992

9093
### `windowManager.getById(id)`
9194

9295
Get a managed window by Electron window id.
9396

9497
- **id** `number` - Window id
9598

96-
Returns: `BrowserWindow | undefined`
99+
Returns: `Window | undefined`
97100

98101
### `windowManager.getAll()`
99102

@@ -120,7 +123,7 @@ Static method. Set global user agent for all windows.
120123
| :---: | :---: | :---: | :---: | :---: | :---: |
121124
[<img src="https://avatars.githubusercontent.com/u/11213298?v=4" width="80px;"/><br/><sub><b>WynterDing</b></sub>](https://github.com/WynterDing)<br/>|[<img src="https://avatars.githubusercontent.com/u/4081746?v=4" width="80px;"/><br/><sub><b>zlyi</b></sub>](https://github.com/zlyi)<br/>|[<img src="https://avatars.githubusercontent.com/u/50158871?v=4" width="80px;"/><br/><sub><b>moshangqi</b></sub>](https://github.com/moshangqi)<br/>
122125

123-
This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto updated at `Mon Feb 23 2026 15:23:51 GMT+0800`.
126+
This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto updated at `Tue Feb 24 2026 17:35:12 GMT+0800`.
124127

125128
<!-- GITCONTRIBUTOR_END -->
126129

0 commit comments

Comments
 (0)