extern: define function return types

This commit is contained in:
Peter Fajdiga
2024-04-20 13:28:29 +02:00
parent 7b8de5955d
commit 4556198b2e
4 changed files with 7 additions and 7 deletions

View File

@@ -22,7 +22,7 @@ declare const Workspace: {
readonly currentActivityChanged: QSignal<[]>;
readonly virtualScreenSizeChanged: QSignal<[]>;
clientArea(option: ClientAreaOption, output: Output, kwinDesktop: KwinDesktop);
clientArea(option: ClientAreaOption, output: Output, kwinDesktop: KwinDesktop): QmlRect;
};
const enum ClientAreaOption {

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

@@ -1,12 +1,12 @@
declare const console: {
log(...args: any[]);
trace();
assert(boolean, string?);
log(...args: any[]): void;
trace(): void;
assert(boolean, string?): void;
};
declare const Qt: {
rect(x: number, y: number, width: number, height: number): QmlRect;
createQmlObject(qml: string, parent: QmlObject);
createQmlObject(qml: string, parent: QmlObject): QmlObject;
};
type QmlObject = unknown;

View File

@@ -17,7 +17,7 @@ class Delayer {
}
function initQmlTimer() {
return Qt.createQmlObject(
return <QmlTimer>Qt.createQmlObject(
`import QtQuick 6.0
Timer {}`,
qmlBase

View File

@@ -11,7 +11,7 @@ class ShortcutAction {
}
private static initShortcutHandler(keyBinding: KeyBinding) {
return Qt.createQmlObject(
return <ShortcutHandler>Qt.createQmlObject(
`import QtQuick 6.0
import org.kde.kwin 3.0
ShortcutHandler {