import GdkPixbuf from "gi://GdkPixbuf"; import type Gio from "gi://Gio"; import Gtk from "gi://Gtk"; import { ButtonType } from "../../../enums/custom"; import type { PositionType } from "../../../enums/gtk3-index"; import type { GjsContext } from "../../../reconciler/gjs-renderer"; import type { HostContext } from "../../../reconciler/host-context"; import { BaseElement, type GjsElement } from "../../gjs-element"; import type { ElementMargin } from "../../utils/apply-margin"; import { ElementLifecycleController } from "../../utils/element-extenders/element-lifecycle-controller"; import type { SyntheticEvent } from "../../utils/element-extenders/event-handlers"; import { EventHandlers } from "../../utils/element-extenders/event-handlers"; import type { DiffedProps } from "../../utils/element-extenders/map-properties"; import { PropertyMapper } from "../../utils/element-extenders/map-properties"; import { TextChildController } from "../../utils/element-extenders/text-child-controller"; import type { PointerData } from "../../utils/gdk-events/pointer-event"; import type { AccelProps } from "../../utils/property-maps-factories/create-accel-prop-mapper"; import type { AlignmentProps } from "../../utils/property-maps-factories/create-alignment-prop-mapper"; import type { ChildPropertiesProps } from "../../utils/property-maps-factories/create-child-props-mapper"; import type { ExpandProps } from "../../utils/property-maps-factories/create-expand-prop-mapper"; import type { MarginProps } from "../../utils/property-maps-factories/create-margin-prop-mapper"; import type { SizeRequestProps } from "../../utils/property-maps-factories/create-size-request-prop-mapper"; import type { StyleProps } from "../../utils/property-maps-factories/create-style-prop-mapper"; import type { TooltipProps } from "../../utils/property-maps-factories/create-tooltip-prop-mapper"; import type { TextNode } from "../text-node"; type ButtonPropsMixin = ChildPropertiesProps & SizeRequestProps & AlignmentProps & MarginProps & ExpandProps & StyleProps & TooltipProps & AccelProps; export type ButtonEvent

= {}> = SyntheticEvent; export interface ButtonProps extends ButtonPropsMixin { type?: ButtonType; label?: string; image?: string | GdkPixbuf.Pixbuf; imageWidth?: number; imageHeight?: number; imagePreserveAspectRatio?: boolean; icon?: Rg.IconName; iconPixelSize?: number; imagePosition?: PositionType; useUnderline?: boolean; margin?: ElementMargin; focusOnClick?: boolean; alwaysShowImage?: boolean; onClick?: (event: ButtonEvent) => void; onActivate?: (event: ButtonEvent) => void; onPressed?: (event: ButtonEvent) => void; onReleased?: (event: ButtonEvent) => void; onMouseEnter?: (event: ButtonEvent) => void; onMouseLeave?: (event: ButtonEvent) => void; } export declare class ButtonElement extends BaseElement implements GjsElement<"BUTTON", Gtk.Button> { static getContext(currentContext: HostContext): HostContext; readonly kind = "BUTTON"; protected widget: Gtk.Button; protected parent: GjsElement | null; readonly lifecycle: ElementLifecycleController; protected readonly handlers: EventHandlers; protected readonly propsMapper: PropertyMapper; protected readonly children: TextChildController; constructor(props: DiffedProps); protected resizeCurrentImage(width?: number, height?: number, preserveAspectRatio?: boolean): void; protected setImage(src: string | GdkPixbuf.Pixbuf, width?: number, height?: number, preserveAspectRatio?: boolean): void; protected setImageIcon(icon: string | Gio.Icon, pixelSize?: number): void; updateProps(props: DiffedProps): void; appendChild(child: TextNode | GjsElement): void; insertBefore(child: TextNode | GjsElement, beforeChild: TextNode | GjsElement): void; remove(parent: GjsElement): void; render(): void; notifyWillMountTo(parent: GjsElement): boolean; notifyMounted(): void; notifyChildWillUnmount(child: TextNode | GjsElement): void; show(): void; hide(): void; getWidget(): Gtk.Button; getParentElement(): GjsElement | null; } export {};