/** * @file Core.d.ts * @author Gage Sorrell * @copyright (c) 2024 Gage Sorrell * @license MIT */ export * from "./Log.Types.mjs"; type TArray = Array; /** @todo Temporary; replace with separate type for each callback. */ export type FMessageLoopCallback = (Argument: unknown) => void; /** * Initializes the Windows API message loop created by `@sorrell/wm-windows`. * * @todo The signatures of the arguments are probably wrong. * * @param {() => void} _EmptyCallback - An empty callback, currently unused. */ export function InitializeMessageLoop(_EmptyCallback: (() => void)): void; export type HWindow = { Handle: string; }; export type FVector2D = { X: number; Y: number; }; export type FBox = FVector2D & { Width: number; Height: number; }; export type FHexColor = `#${ string }`; export type FHslColor = { Hue: number; Saturation: number; Lightness: number; }; export type FColor = | FHexColor | FHslColor; /** * Description placeholder. * * @todo Export these via macro, and remove this type declaration * * @param {HWindow} Handle - The handle to cover. */ export function CoverWindow(Handle: HWindow): void; // Functions that are used in this project: // export function GetFocusedWindow(): HWindow; // export function CaptureWindowScreenshot(Handle: HWindow): string; export function InitializeIpc(Callback: ((Channel: string, Message: unknown) => void)): void; export function InitializeHooks(): void; // export function GetWindowLocationAndSize(Handle: HWindow): FBox; // export function InitializeWinEvents(): void; // export function CoverWindow(Handle: HWindow): void; // export function GetIsLightMode(): boolean; // export function Test(): void; // export function TestTwo(): void; // export function TestFun(): void; // export function GetTitlebarHeight(): number; // export function GetThemeColor(): FColor; // export type FRect = { // Bottom: number; // Left: number, // Right: number, // Top: number, // }; // export type FMonitor = // { // IsPrimary: boolean; // Name: string; // Rectangle: FRect; // WorkArea: FRect; // }; // Declarations from last attempt at SorrellWm: // export function GetMonitorFromRect(Handle: HWindow): FRect; // export function GetMonitorFromWindow(Handle: HWindow): HMonitor; // export function RestoreWindow(Handle: HWindow): void; // export function GetWindowClassInfo(Handle: HWindow): bigint; // export function GetDwmMargins(Handle: HWindow): FRect; // export function InitializeWindowProcedure(CallbackOne, CallbackTwo, CallbackThree): void; // export function GetForegroundWindow(): HWindow; // export function DisableStyling(Handle: HWindow): boolean; // export function GetMonitorRefreshRate(Handle: HMonitor): number; // export function GetMonitorHandles(): TArray; // export function GetMonitorInfo(Handle: HMonitor): FMonitor; // export function GetWindowRect(Handle: HWindow): FRect; // export function GetWindowHandles(): TArray; // export function GetWindowText(Handle: HWindow): string; // export function IsIconic(Handle: HWindow): boolean; // export function IsWindowVisible(Handle: HWindow): boolean; // export function GetStyles(Handle: HWindow): bigint; // export function SetupFocusHook(Callback: (Handle: HWindow) => void): void; // export function RemoveFocusHook(): void; // export function SetWindowPos( // Handle: HWindow, // X: number, // Y: number, // Width: number, // Height: number // ): boolean; export type HMonitor = { Handle: number; }; export type FMonitorInfo = { Handle: HMonitor; Size: FBox; WorkSize: FBox; IsPrimary: boolean; }; export type FThemeMode = | "Dark" | "Light" | "Indeterminate"; export function InitializeWinEvents(): void; export type TRecord< KeyType extends PropertyKey = PropertyKey, PropertyType = unknown > = Record; export type FRecord = TRecord; export type FOnIpcMessage = (Channel: string, Message: unknown) => void;