Skip to content

Commit ab931ab

Browse files
committed
docs: add more examples, fix links
1 parent 05f0f10 commit ab931ab

File tree

5 files changed

+26
-19
lines changed

5 files changed

+26
-19
lines changed

docs/monitor-info.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## Object `MonitorInfo`
22

33
- `isPrimary` boolean
4-
- `bounds` [`Rectangle`](#object-rectangle) - the monitor position and bounds
5-
- `workArea` [`Rectangle`](#object-rectangle) - the monitor working area bounds
4+
- `bounds` [`Rectangle`](rectangle.md) - the monitor position and bounds
5+
- `workArea` [`Rectangle`](rectangle.md) - the monitor working area bounds

docs/monitor.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
Control monitors.
44

5+
```typescript
6+
import { windowManager } from 'node-window-manager';
7+
8+
// Gets height of the primary window working area.
9+
const { height } = windowManager.getPrimaryWindow().getWorkArea();
10+
```
11+
512
### new Monitor(id: number)
613

714
- `id` number - the monitor handle
@@ -14,17 +21,17 @@ Control monitors.
1421

1522
#### monitor.getBounds() `Windows`
1623

17-
- Returns [`Rectangle`](#object-rectangle)
24+
- Returns [`Rectangle`](rectangle.md)
1825

1926
#### monitor.getWorkArea() `Windows`
2027

2128
Gets monitor working area bounds.
2229

23-
- Returns [`Rectangle`](#object-rectangle)
30+
- Returns [`Rectangle`](rectangle.md)
2431

2532
#### monitor.getInfo() `Windows`
2633

27-
Returns [`MonitorInfo`](#object-monitorinfo)
34+
Returns [`MonitorInfo`](monitor-info.md)
2835

2936
#### monitor.isPrimary() `Windows`
3037

docs/window-info.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
- `title` string
44
- `processId` string
55
- `path` string - path to executable associated with the window
6-
- `bounds` [`Rectangle`](#object-rectangle)
6+
- `bounds` [`Rectangle`](rectangle.md)
77
- `opacity` number (`Windows`)
8-
- `owner` [`Window`](#class-window) (`Windows`) - owner window of the current window
8+
- `owner` [`Window`](window.md) (`Windows`) - owner window of the current window

docs/window-manager.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,26 @@ console.log(window.getTitle());
2121

2222
#### windowManager.getActiveWindow() `Windows` `macOS`
2323

24-
- Returns [`Window`](#class-window)
24+
- Returns [`Window`](window.md)
2525

2626
#### windowManager.getWindows() `Windows` `macOS`
2727

28-
- Returns [`Window[]`](#class-window)
28+
- Returns [`Window[]`](window.md)
2929

3030
#### windowManager.getMonitors() `Windows`
3131

32-
- Returns [`Monitor[]`](#class-monitor)
32+
- Returns [`Monitor[]`](monitor.md)
3333

3434
#### windowManager.getPrimaryMonitor() `Windows`
3535

36-
- Returns [`Monitor`](#class-monitor)
36+
- Returns [`Monitor`](monitor.md)
3737

3838
### Events
3939

4040
#### Event 'window-activated' `Windows` `macOS`
4141

4242
Returns:
4343

44-
- [`Window`](#class-window)
44+
- [`Window`](window.md)
4545

4646
Emitted when a window has been activated.

docs/window.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Class `Window`
22

3-
Control opened windows.
3+
Control open windows.
44

55
We try to keep this class similar to Electron's known [`BrowserWindow`](https://electronjs.org/docs/api/browser-window) class, to keep it simple to use.
66

@@ -30,7 +30,7 @@ window.setBounds({ height: 50 });
3030

3131
#### win.getInfo() `Windows` `macOS`
3232

33-
Returns [`WindowInfo`](#object-windowinfo)
33+
Returns [`WindowInfo`](window-info.md)
3434

3535
#### win.getTitle() `Windows` `macOS`
3636

@@ -76,7 +76,7 @@ Returns `number` between 0 and 1.
7676

7777
Gets monitor which the window belongs to.
7878

79-
Returns [`Monitor`](#class-monitor)
79+
Returns [`Monitor`](monitor.md)
8080

8181
#### win.isWindow() `Windows` `macOS`
8282

@@ -87,15 +87,15 @@ Returns `boolean` - whether the window is visible or not.
8787

8888
#### win.getOwner() `Windows`
8989

90-
Returns [`Window`](#class-window)
90+
Returns `Window`
9191

92-
#### win.setOwner(win: [`Window`](#class-window) | number | null) `Windows`
92+
#### win.setOwner(win: Window | number | null) `Windows`
9393

94-
- `win` [Window](#class-window) | number | null
94+
- `win` Window | number | null
9595
- pass null to unset window owner.
9696

9797
#### win.getIcon(size: number) `Windows` `macOS`
9898

99-
- `size` number - can be only `16`, `32`, `64`, `256`. By default it's `64`.
99+
- `size` number - can be `16`, `32`, `64` or `256`. By default it's `64`.
100100

101101
Returns a png Buffer

0 commit comments

Comments
 (0)