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

27 lines
757 B
TypeScript
Raw Normal View History

2025-01-01 13:38:44 -05:00
import { register } from 'astal';
import { Astal, type ConstructProps } from 'astal/gtk4';
2025-01-13 10:51:02 -05:00
import astalify, { type AstalifyProps } from './astalify';
2025-01-01 13:38:44 -05:00
type SliderSignals = Record<`on${string}`, unknown[]> & {
onClicked: []
};
export type SliderProps = ConstructProps<
2025-01-13 10:51:02 -05:00
SliderClass,
Astal.Slider.ConstructorProps & AstalifyProps,
2025-01-01 13:38:44 -05:00
SliderSignals
>;
@register({ GTypeName: 'Slider' })
2025-01-13 10:51:02 -05:00
export class SliderClass extends astalify(Astal.Slider) {
constructor({ cssName = 'slider', ...props }: SliderProps = {}) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
super({ cssName, ...props as any });
}
2025-01-01 13:38:44 -05:00
getChildren() { return []; }
}
2025-01-13 10:51:02 -05:00
export const Slider = (props?: SliderProps) => new SliderClass(props);