define qt types

This commit is contained in:
Peter Fajdiga
2023-08-29 21:11:31 +02:00
parent 201dd4463e
commit 6001dd5b02
3 changed files with 36 additions and 8 deletions

View File

@@ -1,4 +1,4 @@
declare const qmlBase;
declare const qmlBase: QmlObject;
declare const notificationInvalidWindowRules: Notification;
type Notification = {

38
src/extern/qt.d.ts vendored
View File

@@ -1,6 +1,34 @@
declare const console;
declare const Qt;
declare const console: {
log(...args: any[]);
assert(boolean);
};
type QRect = any;
type QSignal = any;
type QQmlTimer = any;
declare const Qt: {
rect(x: number, y: number, width: number, height: number): QRect;
createQmlObject(qml: string, parent: QmlObject);
};
type QmlObject = any;
type QRect = {
x: number;
y: number;
width: number;
height: number;
top: number;
bottom: number;
left: number;
right: number;
}
type QSignal = {
connect(handler: (...args: any[]) => void);
disconnect(handler: (...args: any[]) => void);
}
type QQmlTimer = {
interval: number;
triggered: QSignal;
restart(): void;
destroy(): void;
}

View File

@@ -4,8 +4,8 @@ class Desktop {
private readonly config: Desktop.Config;
private scrollX: number;
private dirty: boolean;
public clientArea: QRect;
public tilingArea: QRect;
public clientArea!: QRect;
public tilingArea!: QRect;
constructor(desktopNumber: number, config: Desktop.Config, layoutConfig: LayoutConfig) {
this.config = config;