chore: remove bunch of usages of any (#27512)
This commit is contained in:
parent
c7aa35a519
commit
79b3393768
16 changed files with 101 additions and 81 deletions
|
@ -12,7 +12,7 @@ const contextBridge: Electron.ContextBridge = {
|
|||
checkContextIsolationEnabled();
|
||||
return binding.exposeAPIInMainWorld(key, api);
|
||||
}
|
||||
} as any;
|
||||
};
|
||||
|
||||
export default contextBridge;
|
||||
|
||||
|
|
|
@ -144,7 +144,7 @@ if (nodeIntegration) {
|
|||
// We do not want to add `uncaughtException` to our definitions
|
||||
// because we don't want anyone else (anywhere) to throw that kind
|
||||
// of error.
|
||||
global.process.emit('uncaughtException' as any, error as any);
|
||||
global.process.emit('uncaughtException', error as any);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
|
|
@ -79,7 +79,7 @@ const isLocalhost = function () {
|
|||
*/
|
||||
const isUnsafeEvalEnabled: () => Promise<boolean> = function () {
|
||||
// Call _executeJavaScript to bypass the world-safe deprecation warning
|
||||
return (webFrame as any)._executeJavaScript(`(${(() => {
|
||||
return webFrame._executeJavaScript(`(${(() => {
|
||||
try {
|
||||
eval(window.trustedTypes.emptyScript); // eslint-disable-line no-eval
|
||||
} catch {
|
||||
|
|
|
@ -60,7 +60,7 @@ export class WebViewAttribute implements MutationHandler {
|
|||
}
|
||||
|
||||
// Called when the attribute's value changes.
|
||||
public handleMutation: MutationHandler['handleMutation'] = () => undefined as any
|
||||
public handleMutation: MutationHandler['handleMutation'] = () => undefined
|
||||
}
|
||||
|
||||
// An attribute that is treated as a Boolean.
|
||||
|
|
|
@ -94,7 +94,7 @@ const registerWebViewElement = (v8Util: NodeJS.V8UtilBinding, webViewImpl: typeo
|
|||
// The customElements.define has to be called in a special scope.
|
||||
webViewImpl.webFrame.allowGuestViewElementDefinition(window, () => {
|
||||
window.customElements.define('webview', WebViewElement);
|
||||
(window as any).WebView = WebViewElement;
|
||||
window.WebView = WebViewElement;
|
||||
|
||||
// Delete the callbacks so developers cannot call them and produce unexpected
|
||||
// behavior.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue