chore(types): re-add type-only BrowserWindow / Tray imports
Follow-up to the CJS refactor: destructuring electron.BrowserWindow /
electron.Tray pulled the values into scope but lost the type
namespace, breaking sites that used the bare class name as a type
(let win: BrowserWindow | null, return-type annotations,
implicitly-any close handlers). Added 'import type { ... as ...Type }'
for each affected file and replaced the type-position references
with the aliased names. Runtime semantics unchanged; typecheck
exits 0 again.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,16 +1,17 @@
|
||||
import electron from 'electron';
|
||||
import type { BrowserWindow as BrowserWindowType } from 'electron';
|
||||
const { BrowserWindow, app } = electron;
|
||||
import { join } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
let inboxWindow: BrowserWindow | null = null;
|
||||
let inboxWindow: BrowserWindowType | null = null;
|
||||
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
||||
|
||||
export function getInboxWindow(): BrowserWindow | null {
|
||||
export function getInboxWindow(): BrowserWindowType | null {
|
||||
return inboxWindow;
|
||||
}
|
||||
|
||||
export function createInboxWindow(): BrowserWindow {
|
||||
export function createInboxWindow(): BrowserWindowType {
|
||||
if (inboxWindow && !inboxWindow.isDestroyed()) {
|
||||
inboxWindow.show();
|
||||
inboxWindow.focus();
|
||||
|
||||
Reference in New Issue
Block a user