import { Disposable, DisposableStore } from "../../../../../../base/common/lifecycle.js"; import { ThemeIcon } from "../../../../../../base/common/themables.js"; import { IChatInputNoticeFocusTarget } from "./chatInputNoticeHost.js"; /** * The visual roles a notice above a chat input can take. The border, radius, * background and action shape are one shared rule across all of them, so those * cannot drift apart again. * * What is deliberately not shared is the vertical offset between a notice and * the input below it. That is set by whichever surface the pair sits in, and it * is not one value: some surfaces pull the input up over the notice's bottom * edge so the two read as a single stack, and others leave a deliberate gap. */ export declare enum ChatInputNoticeVariant { /** A first-run introduction. The tallest, most prominent notice. */ Onboarding = "onboarding", /** A one-line getting-started hint. Yields to everything else. */ Tip = "tip", /** Quota, promo, permission and extension-provided messages. */ Notification = "notification" } export interface IChatInputNoticeWidgetOptions { /** * The element the notice is appended to. Omit for producers whose owner * parents the node itself once construction has committed - a chat content * part, whose presenter guards against a re-entrant render appending a second * one - and parent {@link ChatInputNoticeWidget.domNode} instead. */ readonly container?: HTMLElement; readonly variant: ChatInputNoticeVariant; /** Producer-specific class, for styling the content inside the frame. */ readonly className?: string; /** Names the focusable region. Also what {@link ChatInputNoticeWidget.announce} speaks. */ readonly ariaLabel?: string; readonly ariaDescription?: string; /** Spoken after the label, e.g. "notification". */ readonly ariaRoleDescription?: string; /** Called on Escape. Omit to let Escape through to the input. */ readonly onEscape?: () => void; } export interface IChatInputNoticeActionOptions { readonly className?: string; readonly ariaLabel: string; readonly icon: ThemeIcon; readonly onActivate: () => void; /** * Where the action is placed. Defaults to the notice itself, which pins it to * the corner for an onboarding card and lays it out in the row for a tip. */ readonly parent?: HTMLElement; /** * Where the action's listeners are registered. Notices that rebuild their * content pass the store scoped to one render, so repeated renders do not * accumulate listeners for buttons that are already gone. */ readonly store?: DisposableStore; } export type IChatInputNoticeDismissOptions = Omit & { /** Defaults to a generic "Dismiss". */ readonly ariaLabel?: string; }; /** * The container every notice above a chat input is built in. * * Owns the things all five notices have to agree on - the frame, the focusable * ARIA region, the {@link IChatInputNoticeFocusTarget} contract the notice host * routes focus through, the dismiss affordance, and being put away for * higher-precedence content - so a producer only has to build its own content. */ export declare class ChatInputNoticeWidget extends Disposable implements IChatInputNoticeFocusTarget { readonly domNode: HTMLElement; private readonly _variant; private readonly _ariaRoleDescription; private _ariaLabel; private _visible; constructor(options: IChatInputNoticeWidgetOptions); /** * Names the region. Notices whose message is only known per-render - a * notification, a tip being navigated - set this as they build their content. */ setAriaLabel(ariaLabel: string | undefined): void; /** * A notice is only a landmark and a tab stop while it is actually on screen. * Left in place while put away, it would be an unlabelled region the user can * still tab into and find nothing in. */ private _applyRegionAttributes; /** * Speak the notice as it reaches the screen. A tip is advisory - it is in the * lane that yields to everything else - so it is announced politely and waits * its turn; an introduction or a notification is why the user's attention was * wanted in the first place, so it interrupts. */ announce(): void; hasFocus(): boolean; focus(): void; /** * Called when the notice is put away for higher-precedence content, and again * when it comes back. The notice is kept alive across this, so a producer with * live parts - microphone capture, audio, animation - calls this and stands * those down too rather than keep them going where the user cannot see them. */ setVisible(visible: boolean): void; /** * An icon button, in the shape every notice's actions share. Built on * `ActionBar` so keyboard handling, touch, focus and theming come from the * shared action infrastructure rather than being re-implemented per notice. */ addAction(options: IChatInputNoticeActionOptions): HTMLElement; /** * The standard way out of a notice. Kept separate from {@link addAction} so * every notice's dismiss reads and behaves the same, wherever it appears. */ addDismissAction(options: IChatInputNoticeDismissOptions): HTMLElement; }