import Gtk from "gi://Gtk?version=3.0";
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 { ChildPropertiesProps } from "../../utils/property-maps-factories/create-child-props-mapper";
import type { StyleProps } from "../../utils/property-maps-factories/create-style-prop-mapper";
import type { TextNode } from "../text-node";
import type { WindowElement } from "../window/window";
type SearchBarPropsMixin = ChildPropertiesProps & StyleProps;
export type SearchBarEvent
= {}> = SyntheticEvent
;
export interface SearchBarProps extends SearchBarPropsMixin {
isVisible?: boolean;
showCloseButton?: boolean;
/**
* When enabled, search bar will be shown when a keyboard symbol is
* pressed, unless `isVisible` is set to `false`.
*
* @default true
*/
showOnKeypress?: boolean | ((window: Gtk.Window, event: SearchBarEvent) => boolean);
/**
* When a keyboard symbol is pressed and no other input is in focus,
* this event will be fired. If the `isVisible` property of the
* SearchBar component is set to false, the search bar will not be
* shown even if the event is emitted with a `isVisible` value of
* `true`.
*/
onVisibilityChange?: (event: SearchBarEvent<{
isVisible: boolean;
}>) => void;
}
interface SearchBarInternalProps extends SearchBarProps {
__rg_onMount?: (elem: SearchBarElement) => void;
}
export declare class SearchBarElement extends BaseElement implements GjsElement<"SEARCH_BAR", Gtk.SearchBar> {
static getContext(currentContext: HostContext): HostContext;
readonly kind = "SEARCH_BAR";
protected widget: Gtk.SearchBar;
protected parent: GjsElement | null;
protected searchEntry: Gtk.SearchEntry | null;
readonly lifecycle: ElementLifecycleController;
protected readonly handlers: EventHandlers;
protected readonly children: ChildOrderController>;
protected readonly propsMapper: PropertyMapper;
constructor(props: DiffedProps);
protected onWindowKeyPress: (w: Gtk.Widget, e: any) => void;
registerEntry(entry: Gtk.SearchEntry): void;
connectToWindowEvents(window: WindowElement): void;
disconnectFromWindowEvents(window: WindowElement): void;
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.SearchBar;
getParentElement(): GjsElement | null;
}
export {};