import type Gtk from "gi://Gtk"; import type { ElementLifecycle } from "../../element-extender"; import type { GjsElement } from "../../gjs-element"; export declare class ChildOrderController { private element; private container; private addChildToContainer; private removeChildFromContainer; private children; constructor(element: ElementLifecycle, container: Gtk.Container, addChildToContainer?: (child: ReturnType, element: C, index: number) => void, removeChildFromContainer?: (child: ReturnType, element: C) => void); forEach(callback: (child: C) => void): void; /** * Returns the number of children in the container, including top * level elements that are not directly added to the container. */ count(): number; /** * Adds the child to the container, unless it's a top level element. * (even if the child is top level this method should be called on * it regardless, otherwise there's a chance for `insertBefore` * method to fail in the future) */ addChild(child: C, shouldOmitMount?: boolean): void; /** * Removes the child from the tracked children list. This does not * detach or destroy the child. Children are responsible for * destroying themselves when the reconciler requests so. */ removeChild(child: GjsElement): void; /** * Inserts the new child before the `beforeChild` element, unless * the new child is a top level element. (even if the child is top * level this method should be called on it regardless, otherwise * there's a chance for `insertBefore` method to fail in the * future) */ insertBefore(newChild: C, beforeChild: GjsElement, shouldOmitMount?: boolean): void; reattachWidget(child: C): void; }