refactor: replace a few any-s with proper types (#25681)
This commit is contained in:
parent
603f9242d9
commit
fb11a12d5b
19 changed files with 170 additions and 53 deletions
|
@ -19,7 +19,7 @@ function completeURL (project: string, path: string) {
|
|||
}
|
||||
|
||||
// The DOM implementation expects (message?: string) => boolean
|
||||
(window.confirm as any) = function (message: string, title: string) {
|
||||
window.confirm = function (message?: string, title?: string) {
|
||||
return ipcRendererUtils.invokeSync('ELECTRON_INSPECTOR_CONFIRM', message, title) as boolean;
|
||||
};
|
||||
|
||||
|
|
|
@ -262,7 +262,7 @@ export const setupMethods = (WebViewElement: typeof ElectronInternal.WebViewElem
|
|||
|
||||
for (const property of properties) {
|
||||
Object.defineProperty(WebViewElement.prototype, property, {
|
||||
get: createPropertyGetter(property) as any,
|
||||
get: createPropertyGetter(property),
|
||||
set: createPropertySetter(property)
|
||||
});
|
||||
}
|
||||
|
|
|
@ -255,13 +255,13 @@ export const windowSetup = (
|
|||
if (!usesNativeWindowOpen) {
|
||||
// TODO(MarshallOfSound): Make compatible with ctx isolation without hole-punch
|
||||
// Make the browser window or guest view emit "new-window" event.
|
||||
(window as any).open = function (url?: string, frameName?: string, features?: string) {
|
||||
window.open = function (url?: string, frameName?: string, features?: string) {
|
||||
if (url != null && url !== '') {
|
||||
url = resolveURL(url, location.href);
|
||||
}
|
||||
const guestId = ipcRendererInternal.sendSync('ELECTRON_GUEST_WINDOW_MANAGER_WINDOW_OPEN', url, toString(frameName), toString(features));
|
||||
if (guestId != null) {
|
||||
return getOrCreateProxy(guestId);
|
||||
return getOrCreateProxy(guestId) as any as WindowProxy;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue