summaryrefslogtreecommitdiff
path: root/lang/gjs/src/time.ts
diff options
context:
space:
mode:
authorkotontrion <[email protected]>2024-10-29 13:50:41 +0100
committerkotontrion <[email protected]>2024-10-29 13:50:41 +0100
commit57f20666e716fde56579b8aa638eed1264f793de (patch)
tree59b2ebbd770c80049cea4df82109d28f617675fe /lang/gjs/src/time.ts
parent4d9ae88b0bab75779876d465f986791d052414ca (diff)
parent7e484188e7492ac7945c854bcc3f26cec1863c91 (diff)
Merge branch 'main' into feat/cava
Diffstat (limited to 'lang/gjs/src/time.ts')
-rw-r--r--lang/gjs/src/time.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/lang/gjs/src/time.ts b/lang/gjs/src/time.ts
new file mode 100644
index 0000000..1939d98
--- /dev/null
+++ b/lang/gjs/src/time.ts
@@ -0,0 +1,15 @@
+import Astal from "gi://AstalIO"
+
+export const { Time } = Astal
+
+export function interval(interval: number, callback?: () => void) {
+ return Astal.Time.interval(interval, () => void callback?.())
+}
+
+export function timeout(timeout: number, callback?: () => void) {
+ return Astal.Time.timeout(timeout, () => void callback?.())
+}
+
+export function idle(callback?: () => void) {
+ return Astal.Time.idle(() => void callback?.())
+}