Skip to content

Commit

Permalink
Fix docs for JS return types in Window API (#3247)
Browse files Browse the repository at this point in the history
* Fix docs for JS return types in Window API

These functions return promises, not raw values.

* Update changelog.mdx for Window API docs fix

* Fix non-versioned docs for JS Window API return types

* Fix docs typo

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Lea Anthony <[email protected]>
  • Loading branch information
3 people authored Mar 24, 2024
1 parent 9cafd85 commit 311aee3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
14 changes: 7 additions & 7 deletions website/docs/reference/runtime/window.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ JS: `WindowUnfullscreen()`
Returns true if the window is full screen.

Go: `WindowIsFullscreen(ctx context.Context) bool`<br/>
JS: `WindowIsFullscreen() bool`
JS: `WindowIsFullscreen() Promise<boolean>`

### WindowCenter

Expand Down Expand Up @@ -110,7 +110,7 @@ JS: `WindowHide()`
Returns true if the window not minimised, maximised or fullscreen.

Go: `WindowIsNormal(ctx context.Context) bool`<br/>
JS: `WindowIsNormal() bool`
JS: `WindowIsNormal() Promise<boolean>`

### WindowSetSize

Expand All @@ -124,7 +124,7 @@ JS: `WindowSetSize(width: number, height: number)`
Gets the width and height of the window.

Go: `WindowGetSize(ctx context.Context) (width int, height int)`<br/>
JS: `WindowGetSize() : Size`
JS: `WindowGetSize(): Promise<Size>`

### WindowSetMinSize

Expand All @@ -151,7 +151,7 @@ JS: `WindowSetMaxSize(width: number, height: number)`
Sets the window AlwaysOnTop or not on top.

Go: `WindowSetAlwaysOnTop(ctx context.Context, b bool)`<br/>
JS: `WindowSetAlwaysOnTop(b: Boolen)`
JS: `WindowSetAlwaysOnTop(b: boolean)`

### WindowSetPosition

Expand All @@ -165,7 +165,7 @@ JS: `WindowSetPosition(x: number, y: number)`
Gets the window position relative to the monitor the window is currently on.

Go: `WindowGetPosition(ctx context.Context) (x int, y int)`<br/>
JS: `WindowGetPosition() : Position`
JS: `WindowGetPosition(): Promise<Position>`

### WindowMaximise

Expand All @@ -186,7 +186,7 @@ JS: `WindowUnmaximise()`
Returns true if the window is maximised.

Go: `WindowIsMaximised(ctx context.Context) bool`<br/>
JS: `WindowIsMaximised() bool`
JS: `WindowIsMaximised() Promise<boolean>`

### WindowToggleMaximise

Expand Down Expand Up @@ -214,7 +214,7 @@ JS: `WindowUnminimise()`
Returns true if the window is minimised.

Go: `WindowIsMinimised(ctx context.Context) bool`<br/>
JS: `WindowIsMinimised() bool`
JS: `WindowIsMinimised() Promise<boolean>`

### WindowSetBackgroundColour

Expand Down
3 changes: 2 additions & 1 deletion website/src/pages/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Remove quarantine attribute on macOS binaries. Changed by @leaanthony in [PR](https://github.com/wailsapp/wails/pull/3118)
- Added documentation for a common GStreamer error on Linux systems. Changed by [@mkwsnyder](https://github.com/mkwsnyder) in [PR](https://github.com/wailsapp/wails/pull/3134)
- Added documentation on explicity example of importing JS runtime. Changed by [@danawoodman](https://github.com/danawoodman) in [PR](https://github.com/wailsapp/wails/pull/3178)
- Add dock icon right-click exit handling by @almas1992 in [PR](https://github.com/wailsapp/wails/pull/3157)
- Add dock icon right-click exit handling by @almas1992 in [PR](https://github.com/wailsapp/wails/pull/3157)

### Fixed
- Fixed vue-ts template build error. Fixed by @atterpac in
Expand All @@ -37,6 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed uninitialized `SecondInstanceData.WorkingDirectory` on linux and windows ([#3154](https://github.com/wailsapp/wails/pull/3154)).
- Fixed save file dialog not appending file extension automatically on Windows by @almas1992 in [PR](https://github.com/wailsapp/wails/pull/3205)
- Fixed compatibility for wails cli being built with go 1.22 and later. Fixed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/3244)
- Fixed documentation for Window API return types. Fixed by @jangler in [PR](https://github.com/wailsapp/wails/pull/3247)

## v2.7.1 - 2023-12-10

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ JS: `WindowUnfullscreen()`
Returns true if the window is full screen.

Go: `WindowIsFullscreen(ctx context.Context) bool`<br/>
JS: `WindowIsFullscreen() bool`
JS: `WindowIsFullscreen() Promise<boolean>`

### WindowCenter

Expand Down Expand Up @@ -110,7 +110,7 @@ JS: `WindowHide()`
Returns true if the window not minimised, maximised or fullscreen.

Go: `WindowIsNormal(ctx context.Context) bool`<br/>
JS: `WindowIsNormal() bool`
JS: `WindowIsNormal() Promise<boolean>`

### WindowSetSize

Expand All @@ -124,7 +124,7 @@ JS: `WindowSetSize(width: number, height: number)`
Gets the width and height of the window.

Go: `WindowGetSize(ctx context.Context) (width int, height int)`<br/>
JS: `WindowGetSize() : Size`
JS: `WindowGetSize(): Promise<Size>`

### WindowSetMinSize

Expand All @@ -151,7 +151,7 @@ JS: `WindowSetMaxSize(width: number, height: number)`
Sets the window AlwaysOnTop or not on top.

Go: `WindowSetAlwaysOnTop(ctx context.Context, b bool)`<br/>
JS: `WindowSetAlwaysOnTop(b: Boolen)`
JS: `WindowSetAlwaysOnTop(b: boolean)`

### WindowSetPosition

Expand All @@ -165,7 +165,7 @@ JS: `WindowSetPosition(x: number, y: number)`
Gets the window position relative to the monitor the window is currently on.

Go: `WindowGetPosition(ctx context.Context) (x int, y int)`<br/>
JS: `WindowGetPosition() : Position`
JS: `WindowGetPosition(): Promise<Position>`

### WindowMaximise

Expand All @@ -186,7 +186,7 @@ JS: `WindowUnmaximise()`
Returns true if the window is maximised.

Go: `WindowIsMaximised(ctx context.Context) bool`<br/>
JS: `WindowIsMaximised() bool`
JS: `WindowIsMaximised() Promise<boolean>`

### WindowToggleMaximise

Expand Down Expand Up @@ -214,7 +214,7 @@ JS: `WindowUnminimise()`
Returns true if the window is minimised.

Go: `WindowIsMinimised(ctx context.Context) bool`<br/>
JS: `WindowIsMinimised() bool`
JS: `WindowIsMinimised() Promise<boolean>`

### WindowSetBackgroundColour

Expand Down

0 comments on commit 311aee3

Please sign in to comment.