import { IContextMenuProvider } from "../../base/browser/contextmenu.js"; import { ResolvedKeybinding } from "../../base/common/keybindings.js"; import { ThemeIcon } from "../../base/common/themables.js"; import { Event } from "../../base/common/event.js"; import { Disposable } from "../../base/common/lifecycle.js"; export interface IFeedbackInputWidgetAction { readonly label: string; readonly icon: ThemeIcon; readonly keybindingLabel: string; readonly menuKeybinding?: ResolvedKeybinding; } export interface IFeedbackInputWidgetAdditionalAction { readonly id: string; readonly label: string; readonly run: () => void | Promise; } interface IFeedbackInputWidgetBaseOptions { readonly placeholder: string; readonly ariaLabel?: string; /** Returns the available content width (e.g. editor content width, or a host container's width) to clamp against. */ readonly getMaxContentWidth: () => number; readonly primaryAction: IFeedbackInputWidgetAction; } export type IFeedbackInputWidgetOptions = IFeedbackInputWidgetBaseOptions & ({ readonly secondaryAction?: undefined; readonly contextMenuProvider?: undefined; } | { /** When provided, holding Alt swaps the visible action to this one. */ readonly secondaryAction: IFeedbackInputWidgetAction; readonly contextMenuProvider: IContextMenuProvider; }); /** * Reusable auto-sizing textarea + action bar shared by the editor "Add * Feedback" overlay and the chat response-selection "Ask Question" * affordance. Positioning and hosting (overlay widget vs. absolute DOM child) * are left to the caller; this only owns the DOM structure, sizing and input. */ export declare class FeedbackInputWidget extends Disposable { private readonly _options; private static readonly _MIN_WIDTH; private static readonly _MAX_WIDTH; private static readonly _MAX_WIDTH_HOST_FRACTION; private static readonly _LINE_HEIGHT; readonly domNode: HTMLElement; readonly inputElement: HTMLTextAreaElement; private readonly _measureElement; private readonly _actionsContainer; private readonly _busyIndicator; private readonly _actionBar; private readonly _primaryAction; private readonly _secondaryAction; private readonly _additionalActionsStore; private _additionalActions; private _isShowingSecondary; private _busy; private readonly _hasExplicitAriaLabel; /** Whether {@link setBusy} is currently active; callers must not submit again while true. */ get isBusy(): boolean; private readonly _onDidTriggerPrimary; readonly onDidTriggerPrimary: Event; private readonly _onDidTriggerSecondary; readonly onDidTriggerSecondary: Event; constructor(_options: IFeedbackInputWidgetOptions); private _updateActionForAlt; show(): void; hide(): void; clearInput(): void; setPlaceholder(placeholder: string): void; updateActionEnabled(): void; setAdditionalActions(actions: readonly IFeedbackInputWidgetAdditionalAction[]): void; setActionLabels(primaryLabel: string, secondaryLabel?: string): void; /** * Toggles an accessible busy state: disables the input/actions, swaps the * action bar for a spinning loading codicon, and (when turning busy on) * announces `statusLabel` to screen readers via `aria-busy` + a status * announcement. Idempotent; a no-op call does not re-announce. */ setBusy(busy: boolean, statusLabel?: string): void; autoSize(): void; private _computeMaxWidth; } export {};