From beeba74442d0aa86fff4aa1f66f285ffe86f142c Mon Sep 17 00:00:00 2001 From: Peter Fajdiga Date: Sat, 20 Apr 2024 12:40:59 +0200 Subject: [PATCH] extern: split type definitions and global constant declarations --- src/lib/extern/kwin.d.ts | 7 +++++-- src/lib/extern/qt.d.ts | 11 +++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/lib/extern/kwin.d.ts b/src/lib/extern/kwin.d.ts index 7717783..343fed9 100644 --- a/src/lib/extern/kwin.d.ts +++ b/src/lib/extern/kwin.d.ts @@ -1,8 +1,11 @@ -declare const KWin: { +declare const KWin: KWin; +declare const Workspace: Workspace; + +type KWin = { readConfig(key: string, defaultValue: any): any; }; -declare const Workspace: { +type Workspace = { readonly activities: string[]; readonly desktops: KwinDesktop[]; readonly currentDesktop: KwinDesktop; diff --git a/src/lib/extern/qt.d.ts b/src/lib/extern/qt.d.ts index cfcb536..5e1645a 100644 --- a/src/lib/extern/qt.d.ts +++ b/src/lib/extern/qt.d.ts @@ -1,13 +1,16 @@ -declare const console: { +declare const console: Console; +declare const Qt: Qt; + +type Console = { log(...args: any[]): void; trace(): void; assert(boolean, string?): void; -}; +} -declare const Qt: { +type Qt = { rect(x: number, y: number, width: number, height: number): QmlRect; createQmlObject(qml: string, parent: QmlObject): QmlObject; -}; +} type QmlObject = unknown;