Added a cli method to check the visibility of a window. (#301)
This commit is contained in:
1
globals.d.ts
vendored
1
globals.d.ts
vendored
@@ -6,6 +6,7 @@ import { Options, Variable as VariableType } from 'types/variable';
|
||||
declare global {
|
||||
var globalMousePos: VariableType<number[]>;
|
||||
var useTheme: (filePath: string) => void;
|
||||
var isWindowVisible: (windowName: string) => boolean;
|
||||
var globalWeatherVar: VariableType<Weather>;
|
||||
var options: Options;
|
||||
var removingNotifications: VariableType<boolean>;
|
||||
|
||||
8
globals/utilities.ts
Normal file
8
globals/utilities.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
globalThis.isWindowVisible = (windowName: string): boolean => {
|
||||
const appWindow = App.getWindow(windowName);
|
||||
|
||||
if (appWindow === undefined) {
|
||||
return false;
|
||||
}
|
||||
return appWindow.visible;
|
||||
};
|
||||
Reference in New Issue
Block a user