Skip to content

Conversation

KushalMeghani1644
Copy link
Contributor

Fix TypeScript errors in webviewWindow.ts

Problem

The webviewWindow.ts file contained several TypeScript issues:

  • Conflicts when extending both WebviewOptions and WindowOptions due to overlapping properties.
  • The skip option was being used internally but was missing from the type definitions.
  • The parent property was not properly typed on the internal options interface.

Solution

  • Introduced InternalWebviewOptions to extend only non-conflicting properties from WebviewOptions.
  • Added skip and parent properties explicitly to the internal interface.
  • Updated the constructor parameter type to use InternalWebviewOptions.
  • Replaced @ts-expect-error usages with proper typing and safe type assertions.

Changes

  • Maintains existing functionality and API compatibility.
  • No breaking changes to the public API.

AI disclosure: This PR description was polished with the help of AI. The code, commit message, and logic were written without AI assistance.

Fix interface conflicts between WebviewOptions and WindowOptions by properly
handling type intersections and adding missing properties to internal types.
@KushalMeghani1644 KushalMeghani1644 requested a review from a team as a code owner September 2, 2025 09:35
@github-project-automation github-project-automation bot moved this to 📬Proposal in Roadmap Sep 2, 2025
Copy link
Contributor

github-actions bot commented Sep 2, 2025

Package Changes Through c46bedc

There are 9 changes which include @tauri-apps/api with minor, tauri-cli with minor, tauri-utils with minor, tauri-runtime-wry with minor, tauri-runtime with minor, tauri with minor, tauri-bundler with minor, @tauri-apps/cli with minor, tauri-macros with patch

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
@tauri-apps/api 2.8.0 2.9.0
tauri-utils 2.7.0 2.8.0
tauri-bundler 2.6.1 2.7.0
tauri-runtime 2.8.0 2.9.0
tauri-runtime-wry 2.8.1 2.9.0
tauri-codegen 2.4.0 2.4.1
tauri-macros 2.4.0 2.4.1
tauri-plugin 2.4.0 2.4.1
tauri-build 2.4.1 2.4.2
tauri 2.8.5 2.9.0
@tauri-apps/cli 2.8.4 2.9.0
tauri-cli 2.8.4 2.9.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@KushalMeghani1644
Copy link
Contributor Author

Sorry for the weird looking commit message, I accidentally included a backtick. xD

@github-project-automation github-project-automation bot moved this from 📬Proposal to 🏗 In progress in Roadmap Sep 19, 2025
KushalMeghani1644 and others added 3 commits September 20, 2025 21:51
- Hide skip property from public API
- Remove redundant parent property from InternalWebviewOptions
- Restore getAllWebviewWindows doc comment
- Remove misplaced setBackgroundColor documentation
- Use error cause instead of string interpolation
- Remove InternalWebviewOptions interface to simplify code
- Replace with inline type checking using 'skip' in options
- Add skip?: boolean to constructor parameter type
- Remove unnecessary type assertions and @ts-expect-error comments
@KushalMeghani1644
Copy link
Contributor Author

Hey! @amrbashir I have fixed the WebViewWindow.ts and have made all the changes as requested, if there are more improvements remaining, I'd be happy to make them :)

Comment on lines -30 to +29
* Gets a list of instances of `Webview` for all available webview windows.
*
* @since 2.0.0
* Gets a list of instances of `Webview` for all available webviews.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert this

Comment on lines 209 to 219
* #### Platform-specific:
*
* - **Android / iOS:** Unsupported for the window layer.
* - **macOS / iOS**: Not implemented for the webview layer.
* - **Windows**:
* - alpha channel is ignored for the window layer.
* - On Windows 7, alpha channel is ignored for the webview layer.
* - On Windows 8 and newer, if alpha channel is not `0`, it will be ignored.
*
* @returns A promise indicating the success or failure of the operation.
*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert this

}
}

// Order matters, we use window APIs by default
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert this comment, it is vital

Comment on lines -129 to -131
/**
* Gets a list of instances of `Webview` for all available webviews.
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert this

@amrbashir
Copy link
Member

Please run pnpm format to fix all the formatting issue and there are multiple places where you removed documentation for no reason, please revert those.

@KushalMeghani1644
Copy link
Contributor Author

Hey @amrbashir I have reverted all the things as you have requested and committed your suggestions :) I hope the changes are fine and if there are more improvements, I'd be happy to make them :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗 In progress
Development

Successfully merging this pull request may close these issues.

4 participants