import { IAction } from "../../../../../../base/common/actions.js"; import { Disposable, IDisposable } from "../../../../../../base/common/lifecycle.js"; import { IObservable, IReaderWithStore } from "../../../../../../base/common/observable.js"; import { URI } from "../../../../../../base/common/uri.js"; import { IEditorOptions } from "../../../../../../platform/editor/common/editor.js"; import { IHoverService } from "../../../../../../platform/hover/browser/hover.service.js"; import { IConfigurationService } from "../../../../../../platform/configuration/common/configuration.service.js"; import { IInstantiationService } from "../../../../../../platform/instantiation/common/instantiation.js"; import { IThemeService } from "../../../../../../platform/theme/common/themeService.service.js"; import { IEditorService } from "../../../../../services/editor/common/editorService.service.js"; import { IChatEditingSession, IEditSessionEntryDiff } from "../../../common/editing/chatEditingService.js"; import { IChatService } from "../../../common/chatService/chatService.service.js"; import { IChatChangesSummaryPart as IChatFileChangesSummaryPart, IChatRendererContent } from "../../../common/model/chatViewModel.js"; import { IChatResponseFileChangesService } from "../../chatResponseFileChangesService.service.js"; import { ChatTreeItem } from "../../chat.js"; import { IChatContentPart, IChatContentPartRenderContext } from "./chatContentParts.js"; export declare function getChatFileChangeLineCounts(added: number, removed: number): string; /** Options controlling how {@link renderChangesSummaryFileList} renders each row. */ export interface IChangesSummaryFileListOptions { /** Overrides how activating a row opens its file. */ readonly openEditor?: (diff: IEditSessionEntryDiff, inDiffEditor: boolean, options: IEditorOptions, sideBySide: boolean) => void; readonly ariaLabel?: string; /** * Provides the actions shown in a per-row action bar (right-aligned). Return * an empty array for rows that should have no actions. When omitted, no action * bar is rendered. The actions are provided again when observables read with * `reader` change, and disposables added to its store live until then or until * the row is rendered again. */ readonly getRowActions?: (diff: IEditSessionEntryDiff, reader: IReaderWithStore) => IAction[]; /** * Shows the row actions as icons after the change counts, revealed while the * row is hovered, focused, or selected, instead of as links before the counts. */ readonly rowActionIcons?: boolean; } /** A list rendered by {@link renderChangesSummaryFileList}. */ export interface IChangesSummaryFileList extends IDisposable { /** The changes of the selected rows. */ getSelectedElements(): readonly IEditSessionEntryDiff[]; } /** * Opens the diff of a file's change, or the multi-diff editor with the absent * side empty when the change created or deleted the file. */ export declare function openChatFileChangeDiff(editorService: IEditorService, diff: IEditSessionEntryDiff, options?: IEditorOptions, sideBySide?: boolean): void; /** * Renders the collapsible list of changed files (one row per {@link IEditSessionEntryDiff}, * showing the file's resource label and its +added/-removed counts) into `container`, * keeping it in sync with `diffs`. Rows open the file or its diff on activation. * Use a {@link ChangesSummaryFileListPool} instead to render many lists that share * their resources. */ export declare function renderChangesSummaryFileList(container: HTMLElement, diffs: IObservable, instantiationService: IInstantiationService, options?: IChangesSummaryFileListOptions): IChangesSummaryFileList; export declare class ChatCheckpointFileChangesSummaryContentPart extends Disposable implements IChatContentPart { private readonly content; private readonly hoverService; private readonly chatService; private readonly editorService; private readonly instantiationService; private readonly chatResponseFileChangesService; readonly domNode: HTMLElement; private readonly diffsBetweenRequests; private fileChangesDiffsObservable; private readonly detailsElement; constructor(content: IChatFileChangesSummaryPart, context: IChatContentPartRenderContext, listPool: ChangesSummaryFileListPool, hoverService: IHoverService, chatService: IChatService, editorService: IEditorService, instantiationService: IInstantiationService, chatResponseFileChangesService: IChatResponseFileChangesService); private computeFileChangesDiffs; getCachedEntryDiffBetweenRequests(editSession: IChatEditingSession, uri: URI, startRequestId: string, stopRequestId: string): IObservable | undefined; private renderHeader; private renderViewAllFileChangesButton; hasSameContent(other: IChatRendererContent, followingContent: IChatRendererContent[], element: ChatTreeItem): boolean; addDisposable(disposable: IDisposable): void; } /** * Provides the lists of changed files rendered by changes summaries. The lists * share one set of resource labels, so rendering more lists does not add * listeners to global services, and a list released by one summary is reused * by the next. */ export declare class ChangesSummaryFileListPool extends Disposable { private readonly options; private readonly instantiationService; private readonly themeService; private readonly editorService; private readonly configurationService; private readonly _pool; private _resourceLabels; constructor(options: IChangesSummaryFileListOptions | undefined, instantiationService: IInstantiationService, themeService: IThemeService, editorService: IEditorService, configurationService: IConfigurationService); /** * Renders a list of changed files into `details` when it is already * expanded, or else the first time it is expanded, so collapsed summaries * create no list. */ renderOnFirstExpand(details: HTMLDetailsElement, diffs: IObservable): IDisposable; /** * Renders a list of changed files into `container`, keeping it in sync with * `diffs`. Disposing the result returns the list to the pool. */ render(container: HTMLElement, diffs: IObservable): IChangesSummaryFileList; /** * Disposes the lists that are not in use. */ clear(): void; private listFactory; }