Converted a significant amount of files from js to ts.

This commit is contained in:
Jas Singh
2024-07-26 02:02:47 -07:00
parent b293d0b060
commit ca5dcc629b
70 changed files with 2838 additions and 1521 deletions

View File

@@ -0,0 +1,28 @@
import Gdk from 'gi://Gdk?version=3.0';
import GLib from "gi://GLib";
import { openMenu } from "../utils.js";
import options from "options";
const { format } = options.bar.clock;
const date = Variable(GLib.DateTime.new_now_local(), {
poll: [1000, () => GLib.DateTime.new_now_local()],
});
const time = Utils.derive([date, format], (c, f) => c.format(f) || "");
const Clock = () => {
return {
component: Widget.Label({
class_name: "clock",
label: time.bind(),
}),
isVisible: true,
boxClass: "clock",
props: {
on_primary_click: (clicked: any, event: Gdk.Event) => {
openMenu(clicked, event, "calendarmenu");
},
},
};
};
export { Clock };