import { Disposable } from "../../../../../../base/common/lifecycle.js"; export interface IChatInputPickerResponsiveLayoutDelegate { getItems(): readonly IChatInputPickerResponsiveLayoutItem[]; /** Size a content-fitting lane against its intrinsic width, ignoring animated item bounds. */ readonly usePreferredWidth?: boolean; isCompactionEnabled?(): boolean; hasOverflow?(): boolean; relayout?(): void; } export interface IChatInputPickerResponsiveState { isCompact(): boolean; setCompact(compact: boolean): void; isMinimal?(): boolean; setMinimal?(minimal: boolean): void; } export interface IChatInputPickerResponsiveLayoutItem extends IChatInputPickerResponsiveState { readonly element: HTMLElement | undefined; /** Let the item's CSS minimum width determine when its expanded form compacts. */ readonly canShrink?: boolean; } export declare function isChatInputPickerResponsiveState(candidate: object | undefined): candidate is IChatInputPickerResponsiveState; /** * Compacts a picker lane only when its expanded contents no longer fit the width assigned by its surrounding layout. */ export declare class ChatInputPickerResponsiveLayout extends Disposable { private readonly _element; private readonly _delegate; private readonly _mutationObserver; private readonly _scheduledLayout; private _isLayouting; /** The {@link _getLayoutKey key} recorded when the last layout pass finished. */ private _lastLayoutKey; constructor(name: string, _element: HTMLElement, _delegate: IChatInputPickerResponsiveLayoutDelegate); /** * Lays out the lane immediately. Unlike passes triggered by the lane's own * resize and mutation observers, this always runs, so callers can react to * changes the observers cannot see, such as ancestor styles that change the * pickers' widths. */ layout(): void; /** * Every pass forces several synchronous layouts while it expands and * recompacts the pickers. Mutations often arrive in bursts, or leave the * lane exactly as the last pass did (for example, a toolbar re-rendering * identical actions), so run at most one mutation-triggered pass per * animation frame, and skip it when nothing it depends on has changed. */ private _scheduleLayout; private _layout; /** * Describes everything a pass depends on: the width it lays out against, * the lane's computed font (which stands in for inherited styles that resize * its contents), the lane's markup including its own attributes (such as an * inline gap), and each item's state (including items rendered outside the * lane, such as overflowed actions). A pass expands every item before * compacting, so starting a new pass from the state a previous pass ended * in, against the same width, produces that same state again. */ private _getLayoutKey; areAllItemsCompact(): boolean; private _restoreCompactItems; private _setHiddenItemsCompact; private _getVisibleItemBounds; private _fitsAvailableWidth; private _measurePreferredLayout; private _getElementPath; private _getElementAtPath; private _observeMutations; }