diff --git a/src/extern/global.d.ts b/src/extern/global.d.ts index 25aede2..c675227 100644 --- a/src/extern/global.d.ts +++ b/src/extern/global.d.ts @@ -1,4 +1,4 @@ -declare const qmlBase; +declare const qmlBase: QmlObject; declare const notificationInvalidWindowRules: Notification; type Notification = { diff --git a/src/extern/qt.d.ts b/src/extern/qt.d.ts index 73c9c16..1a2b32f 100644 --- a/src/extern/qt.d.ts +++ b/src/extern/qt.d.ts @@ -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; +} diff --git a/src/layout/Desktop.ts b/src/layout/Desktop.ts index cf71e2d..704a1ce 100644 --- a/src/layout/Desktop.ts +++ b/src/layout/Desktop.ts @@ -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;