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,14 +1,15 @@
|
||||
import electron from 'electron';
|
||||
import type { BrowserWindow as BrowserWindowType } from 'electron';
|
||||
const { BrowserWindow, screen } = electron;
|
||||
import { join } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
let win: BrowserWindow | null = null;
|
||||
let win: BrowserWindowType | null = null;
|
||||
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
||||
|
||||
export function getQuickCaptureWindow(): BrowserWindow | null { return win; }
|
||||
export function getQuickCaptureWindow(): BrowserWindowType | null { return win; }
|
||||
|
||||
export function createQuickCaptureWindow(): BrowserWindow {
|
||||
export function createQuickCaptureWindow(): BrowserWindowType {
|
||||
if (win && !win.isDestroyed()) return win;
|
||||
const primary = screen.getPrimaryDisplay();
|
||||
const W = 640, H = 280;
|
||||
|
||||
Reference in New Issue
Block a user