import Gtk from "gi://Gtk"; import type { GjsContext } from "../../../reconciler/gjs-renderer"; import type { HostContext } from "../../../reconciler/host-context"; import { BaseElement, type GjsElement } from "../../gjs-element"; import { ElementLifecycleController } from "../../utils/element-extenders/element-lifecycle-controller"; 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 { 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 { TextNode } from "../text-node"; import { GridItemsList } from "./helpers/grid-items-list"; type GridPropsMixin = ChildPropertiesProps & SizeRequestProps & AlignmentProps & MarginProps & ExpandProps & StyleProps; export interface GridProps extends GridPropsMixin { columns: number; columnSpacing?: number; rowSpacing?: number; /** * Whether the grid rows should all have the same height. * * @default false */ sameRowHeight?: boolean; /** * Whether the grid columns should all have the same width. * * @default true */ sameColumnWidth?: boolean; } export declare class GridElement extends BaseElement implements GjsElement<"GRID", Gtk.Grid> { static getContext(currentContext: HostContext): HostContext; readonly kind = "GRID"; protected widget: Gtk.Grid; protected parent: GjsElement | null; protected columns: number; /** * The column count that was used the last time the grid was * re-arranged. */ protected previousColumnCount: number; readonly lifecycle: ElementLifecycleController; protected readonly handlers: EventHandlers; protected readonly children: GridItemsList; protected readonly propsMapper: PropertyMapper; constructor(props: DiffedProps); protected rearrangeChildren(): void; updateProps(props: DiffedProps): void; appendChild(child: GjsElement | TextNode): void; insertBefore(child: TextNode | GjsElement, beforeChild: GjsElement): void; remove(parent: GjsElement): void; render(): void; notifyWillMountTo(parent: GjsElement): boolean; notifyMounted(): void; notifyChildWillUnmount(): void; show(): void; hide(): void; getWidget(): Gtk.Grid; getParentElement(): GjsElement | null; } export {};