import { JupyterFrontEnd } from '@jupyterlab/application'; import { IThemeManager, MainAreaWidget } from '@jupyterlab/apputils'; import { IRenderMimeRegistry } from '@jupyterlab/rendermime'; import { Contents } from '@jupyterlab/services'; import type { TranslationBundle } from '@jupyterlab/translation'; import { ISignal } from '@lumino/signaling'; import type { IAskAgent } from '../askAgent/tokens'; import { XtralabDiffWidget } from './diffWidget'; import { IFileChange } from './tokens'; /** * Command IDs exposed by the launcher's git diff path. */ export declare namespace CommandIDs { const openDiff = "xtralab:git:open-diff"; } /** * Argument shapes used by {@link CommandIDs.openDiff}. */ export declare namespace CommandArguments { interface IOpenDiff { repoPath: string; change: IFileChange; pin?: boolean; } } /** * Widget id of the single, reused preview diff tab. */ export declare const PREVIEW_DIFF_WIDGET_ID = "xtralab:diff:preview"; /** * Deterministic widget id for a pinned file/group pair. */ export declare function pinnedDiffWidgetId(change: IFileChange): string; /** * Launcher-owned host for a shared diff widget. */ export declare class DiffMainAreaWidget extends MainAreaWidget { constructor(options: MainAreaWidget.IOptions, change: IFileChange, pinned: boolean, trans: TranslationBundle); get change(): IFileChange; get pinned(): boolean; pin(): void; get pinnedChanged(): ISignal; setChange(repoPath: string, change: IFileChange): void; private _change; private _pinned; private _trans; private _pinnedChanged; } interface IRegisterGitCommandsOptions { app: JupyterFrontEnd; themeManager: IThemeManager | null; /** * Contents manager used to write hunk-discard results. */ contentsManager: Contents.IManager; /** * Rendermime registry used by notebook diffs; may be `null`. */ rendermime: IRenderMimeRegistry | null; /** * Ask-agent popup for prompting an agent about diff lines; may be `null`. */ askAgent: IAskAgent | null; /** * Translation bundle for user-facing strings. */ trans: TranslationBundle; /** * Track newly created diff widgets before they are added to the shell. */ trackDiff(widget: DiffMainAreaWidget): Promise; /** * Look up an already-open diff widget for a file change. */ findDiff(change: IFileChange, pin?: boolean): DiffMainAreaWidget | undefined; onPinned(widget: DiffMainAreaWidget): void; } /** * Register the launcher's git diff command on the application command * registry. */ export declare function registerGitCommands(options: IRegisterGitCommandsOptions): void; export {};