import { Disposable, IDisposable } from "../../../../../../base/common/lifecycle.js"; import { IStorageService } from "../../../../../../platform/storage/common/storage.service.js"; import { IChatInputNoticeClaimOptions, IChatInputNoticeFocusTarget } from "./chatInputNoticeHost.js"; /** * The space above one chat input, as offered to an introduction. Claiming it is * the only way a card gets on screen: the notice host decides who leads, so * precedence against notifications and recency against a peer introduction are * one thing. */ export type ChatInputNoticeClaim = (options: IChatInputNoticeClaimOptions) => IDisposable; export interface IChatInputOnboardingHostOptions { /** The element the card is appended to. */ readonly container: HTMLElement; /** The element whose focus marks this host as the most recent one. */ readonly focusRoot: HTMLElement; /** Hands focus back to this host's input when the card closes. */ readonly focus?: () => void; /** * Holds the space this host offers. Without one the card shows unconditionally, * which is what the tests and any host with nothing else above the input want. */ readonly claimNotice?: ChatInputNoticeClaim; } type ChatInputOnboardingFactory = (context: IChatInputOnboardingContext) => IChatInputOnboardingBanner; export interface IChatInputOnboardingOptions { readonly storageKey: string; } export interface IChatInputOnboardingContext { readonly container: HTMLElement; readonly dismiss: (restoreFocus?: boolean) => void; } export interface IChatInputOnboardingBanner extends IDisposable, IChatInputNoticeFocusTarget { announce(): void; /** * Called when the card is put away for higher-precedence content, and again * when it comes back. The card is kept alive across this, so anything it runs * while on screen - microphone capture, audio, animation - must stop here * rather than keep going somewhere the user cannot see. */ setVisible?(visible: boolean): void; } export declare class ChatInputOnboarding extends Disposable { private readonly options; private readonly storageService; private readonly hosts; /** The built card, kept alive while standing down so its state survives. */ private readonly currentOnboarding; /** * The held space. Outlives the card: it is what brings a card back. Held in a * plain field rather than a `MutableDisposable` so a claim can be detached and * released only once its replacement is in hand. */ private claim; private activeHost; private activeBanner; /** Builds the card once this claim leads. */ private wanted; private leading; /** Identifies the current request, so claims left on other inputs are ignored. */ private generation; /** Whether a card is built and on screen. */ get isVisible(): boolean; constructor(options: IChatInputOnboardingOptions, storageService: IStorageService); registerHost(options: IChatInputOnboardingHostOptions): IDisposable; /** * Show the card the first time the feature is used. Nothing is built until * the space is actually available, so a card never spends its one showing - * or reports itself shown - somewhere the user would not have seen it. */ showIfNeeded(createOnboarding: ChatInputOnboardingFactory): boolean; /** Show the card again regardless of whether it has already been seen. */ show(createOnboarding: ChatInputOnboardingFactory): boolean; private request; private setLeading; /** Put the card away for whatever now owns the space, without losing it. */ private standDown; private build; private getActiveHost; private hide; /** Take the card down without giving up the space it stands on. */ private hideCard; } export {};