Import AITURK IDE 1.0.0-beta.1 from Hermes 63279301; preserve MIT license

This commit is contained in:
2026-09-05 13:26:46 +03:00
commit 03634b1ca3
11340 changed files with 3442369 additions and 0 deletions
@@ -0,0 +1,28 @@
type MainWindowLike = {
isDestroyed: () => boolean
}
type EnsureMainWindowOptions<T extends MainWindowLike> = {
isReady: boolean
createWindow: () => unknown
focusWindow: (window: T) => unknown
focusExisting?: boolean
}
export function ensureMainWindow<T extends MainWindowLike>(
window: T | null | undefined,
{ isReady, createWindow, focusWindow, focusExisting = true }: EnsureMainWindowOptions<T>
) {
if (!window || window.isDestroyed()) {
// a closed electron window stays truthy, so replace it before invoking native methods.
if (isReady) {
createWindow()
}
return
}
if (focusExisting) {
focusWindow(window)
}
}