import GdkPixbuf from "gi://GdkPixbuf"; import Gtk from "gi://Gtk"; import type { WindowTypeHint } 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 { ChildOrderController } from "../../utils/element-extenders/child-order-controller"; 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 type { ApplicationElement } from "../application/application"; import type { TextNode } from "../text-node"; export type WindowEvent

= {}> = SyntheticEvent; export type WindowProps = { decorate?: boolean; defaultHeight?: number; defaultWidth?: number; minHeight?: number; minWidth?: number; hideTitlebarWhenMaximized?: boolean; icon?: GdkPixbuf.Pixbuf; resizable?: boolean; showCloseButton?: boolean; title?: string; windowTypeHint?: WindowTypeHint; /** * If set to `true`, when the close button on the window is pressed, * the application will quit. */ quitOnClose?: boolean; onClose?: (event: WindowEvent) => void; onDestroy?: (event: WindowEvent) => void; onDragBegin?: (event: WindowEvent) => void; onDragEnd?: (event: WindowEvent) => void; onFocus?: (event: WindowEvent) => void; onHide?: (event: WindowEvent) => void; onResize?: (event: WindowEvent<{ width: number; height: number; }>) => void; }; export declare class WindowElement extends BaseElement implements GjsElement<"WINDOW", Gtk.Window> { static getContext(currentContext: HostContext): HostContext; readonly kind = "WINDOW"; protected widget: Gtk.Window; protected accelGroup: Gtk.AccelGroup; protected mainApp?: ApplicationElement; protected parent: GjsElement | null; readonly lifecycle: ElementLifecycleController; protected readonly children: ChildOrderController>; protected readonly handlers: EventHandlers>; protected readonly propsMapper: PropertyMapper; isDisposed: boolean; constructor(props: DiffedProps, context: HostContext); protected addChild(widget: Gtk.Widget, element: GjsElement, index: number): void; protected defaultOnCloseHandler(event: WindowEvent, originalHandler?: WindowProps["onClose"]): void | undefined; protected wrapOnCloseProp(props: DiffedProps): DiffedProps; getAccelGroup(): Gtk.AccelGroup; updateProps(props: DiffedProps): void; appendChild(child: GjsElement | TextNode): void; insertBefore(child: GjsElement | TextNode, beforeChild: GjsElement): void; remove(parent: GjsElement): void; render(): void; notifyWillMountTo(parent: GjsElement): boolean; notifyMounted(): void; notifyChildWillUnmount(child: GjsElement): void; show(): void; hide(): void; getWidget(): Gtk.Window; getParentElement(): GjsElement | null; setProperty(key: string, value: any): void; }