Skip to content

Commit c0bfa12

Browse files
docs: update window tutorial typings
Clarify typing of certain options and arguments
1 parent 1f33e59 commit c0bfa12

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/tutorial/window/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ the official reactive GUI component library.
4646
* `id` A unique identifier
4747
* `title` The title
4848
* `parent` Parent window instance
49-
* `position` An object with `top/left` for position or a string like `center` / `topleft`
50-
* `dimension` An object with `width/height` for dimension
49+
* `position: {top?: number, left?: nubmer} | string` Position object or a string (ex: `center`, `topleft`, `bottomright`, etc)
50+
* `dimension: {width?: number, height?: number}` Dimension object
5151
* `attributes` A set of attributes
5252
* `state` Default state
5353

@@ -61,7 +61,7 @@ proc.createWindow({
6161

6262
## Attributes
6363

64-
* `gravity: string` - Where to place the window (ex: `center`)
64+
* `gravity: string` - Where to place the window (ex: `center`, `topleft`, `bottomright`, etc)
6565
* `modal: boolean` - If a parent is provided it will be disabled until this window closes
6666
* `ontop: boolean` - Place on-top of all other windows
6767
* `resizable: boolean` - Set if window can be resized
@@ -73,9 +73,9 @@ proc.createWindow({
7373
* `closeable: boolean` - Set if window can be closed
7474
* `header: boolean` - Header visibility
7575
* `controls: boolean` - Header controls visibility (min/max/close buttons)
76-
* `position: object` - Default position object with `top/left`
77-
* `minDimension: object` - Minimum dimension object with `width/height`
78-
* `maxDimension: object` - Maximum dimension object with `width/height`
76+
* `position: {top: number, left: number}` - Default position
77+
* `minDimension: {width: number, height: number}` - Minimum dimension
78+
* `maxDimension: {width: number, height: number}` - Maximum dimension
7979
* `visibility: string` - Set to `restricted` to hide from the panels, etc.
8080
* `clamp: boolean` - Clamps window position to the viewport if it overflows (default)
8181

@@ -136,8 +136,8 @@ win.gravitate(string); // Gravitate toward direction
136136
win.resizeFit(node); // Resize to fit given DOM container
137137
win.setIcon(string); // Sets icon
138138
win.setTitle(string); // Sets title
139-
win.setPosition({top, left}); // Sets position
140-
win.setDimension({width, height}); // Sets dimension
139+
win.setPosition({top?, left?}); // Sets position
140+
win.setDimension({width?, height?}); // Sets dimension
141141
win.setZindex(number); // Sets z-index
142142
win.setNextZindex(); // Sets next z-index (move to top)
143143
```

0 commit comments

Comments
 (0)