diff options
author | Aylur <[email protected]> | 2024-05-25 14:44:50 +0200 |
---|---|---|
committer | Aylur <[email protected]> | 2024-05-25 14:44:50 +0200 |
commit | 58fa1ab9be7ee8fd4a8e96865121a54d613978cc (patch) | |
tree | 56f01ba49fd2929690a16ac05a4af8f763e6b30b /js/src/time.ts | |
parent | a7e25a4a5fcf4de89fe5a149a9aaf50a92be7af1 (diff) |
separate node and gjs into its own package
Diffstat (limited to 'js/src/time.ts')
-rw-r--r-- | js/src/time.ts | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/js/src/time.ts b/js/src/time.ts deleted file mode 100644 index ce98c9a..0000000 --- a/js/src/time.ts +++ /dev/null @@ -1,27 +0,0 @@ -interface Time { - connect(sig: "now", fn: () => void): number - cancel(): void -} - -export default function Time<T extends Time>(Time: { - interval(interval: number, closure: any): T - timeout(timeout: number, closure: any): T - idle(closure: any): T -}) { - function interval(interval: number, callback: () => void) { - const t = Time.interval(interval, null) - t.connect("now", callback) - return t - } - function timeout(timeout: number, callback: () => void) { - const t = Time.timeout(timeout, null) - t.connect("now", callback) - return t - } - function idle(callback: () => void) { - const t = Time.idle(null) - t.connect("now", callback) - return t - } - return { interval, timeout, idle } -} |