extern: split type definitions and global constant declarations

This commit is contained in:
Peter Fajdiga
2024-04-20 12:40:59 +02:00
parent 3e14440180
commit beeba74442
2 changed files with 12 additions and 6 deletions

View File

@@ -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;

View File

@@ -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;