nixos-configs/modules/ags/gtk4/widget/subclasses/calendar.ts

29 lines
749 B
TypeScript
Raw Normal View History

2025-01-01 13:38:44 -05:00
import { register } from 'astal';
import { Gtk } from 'astal/gtk4';
2025-01-01 13:38:44 -05:00
import astalify, { type AstalifyProps, type ConstructProps } from '../astalify';
2025-01-01 13:38:44 -05:00
type CalendarSignals = Record<`on${string}`, unknown[]> & {
onDaySelected: []
onNextMonth: []
onNextYear: []
onPrevMonth: []
onPrevYear: []
};
export type CalendarProps = ConstructProps<
2025-01-13 10:51:02 -05:00
CalendarClass,
Gtk.Calendar.ConstructorProps & AstalifyProps,
2025-01-01 13:38:44 -05:00
CalendarSignals
>;
@register({ GTypeName: 'Calendar' })
2025-01-13 10:51:02 -05:00
export class CalendarClass extends astalify(Gtk.Calendar) {
constructor({ cssName = 'calendar', ...props }: CalendarProps = {}) {
super({ cssName, ...props });
2025-01-13 10:51:02 -05:00
}
2025-01-01 13:38:44 -05:00
}
2025-01-13 10:51:02 -05:00
export const Calendar = (props?: CalendarProps) => new CalendarClass(props);