5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 17:52:29 +08:00
wails/v2/internal/frontend/runtime/wrapper/runtime.d.ts
Sebastian Bauer 7dd3f96915 [Feature/1149] Dark mode: functions for manually switching theme (#1291)
* [Feature/1149] Dark mode: functions for manually switching theme
2022-04-01 08:21:37 +11:00

86 lines
1.6 KiB
TypeScript

export interface Position {
x: number;
y: number;
}
export interface Size {
w: number;
h: number;
}
export interface runtime {
EventsEmit(eventName: string, data?: any): void;
EventsOn(eventName: string, callback: (data?: any) => void): void;
EventsOnMultiple(eventName: string, callback: (data?: any) => void, maxCallbacks: number): void;
EventsOnce(eventName: string, callback: (data?: any) => void): void;
LogTrace(message: string): void;
LogDebug(message: string): void;
LogError(message: string): void;
LogFatal(message: string): void;
LogInfo(message: string): void;
LogWarning(message: string): void;
WindowReload(): void;
WindowSetSystemDefaultTheme(): void;
WindowSetLightTheme(): void;
WindowSetDarkTheme(): void;
WindowCenter(): void;
WindowSetTitle(title: string): void;
WindowFullscreen(): void;
WindowUnfullscreen(): void;
WindowSetSize(width: number, height: number): Promise<Size>;
WindowGetSize(): Promise<Size>;
WindowSetMaxSize(width: number, height: number): void;
WindowSetMinSize(width: number, height: number): void;
WindowSetPosition(x: number, y: number): void;
WindowGetPosition(): Promise<Position>;
WindowHide(): void;
WindowShow(): void;
WindowMaximise(): void;
WindowToggleMaximise(): void;
WindowUnmaximise(): void;
WindowMinimise(): void;
WindowUnminimise(): void;
WindowSetRGBA(R: number, G: number, B: number, A: number): void;
BrowserOpenURL(url: string): void;
Quit(): void;
}
declare global {
interface Window {
runtime: runtime;
}
}