-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
fix(api): resolve TypeScript errors in webviewWindow.ts #14140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
fix(api): resolve TypeScript errors in webviewWindow.ts #14140
Conversation
Fix interface conflicts between WebviewOptions and WindowOptions by properly handling type intersections and adding missing properties to internal types.
Package Changes Through c46bedcThere 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 VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
Sorry for the weird looking commit message, I accidentally included a backtick. xD |
- 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
… into webviewWindowFIX
- 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
… into webviewWindowFIX
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 :) |
* 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this
* #### 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. | ||
* |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
/** | ||
* Gets a list of instances of `Webview` for all available webviews. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this
Please run |
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 :) |
Fix TypeScript errors in
webviewWindow.ts
Problem
The
webviewWindow.ts
file contained several TypeScript issues:WebviewOptions
andWindowOptions
due to overlapping properties.skip
option was being used internally but was missing from the type definitions.parent
property was not properly typed on the internal options interface.Solution
InternalWebviewOptions
to extend only non-conflicting properties fromWebviewOptions
.skip
andparent
properties explicitly to the internal interface.InternalWebviewOptions
.@ts-expect-error
usages with proper typing and safe type assertions.Changes
AI disclosure: This PR description was polished with the help of AI. The code, commit message, and logic were written without AI assistance.