summaryrefslogtreecommitdiff
path: root/lang/gjs/src/time.ts
blob: b581aa95446b0b4c08037da7c6791e08ef1d4c73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import Astal from "gi://AstalIO"

export type Time = Astal.Time
export const Time = Astal.Time

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?.())
}