/** * The diff view's shared store, for other extensions and packages. * * It lives on globalThis under a registered symbol (pi loads each extension in its own module * scope, so a plain module variable would be a separate copy in each). Actions added before the * diff view loads are kept and shown once it does; a diff opened while it is not loaded, or is * switched off in /widgets, reports that by returning false. So does one that could not be shown: * there is no interactive UI, or the view is already open. * * This file imports only types, so it has no files to bring along; the chassis client re-exports it. */ import type { ExtensionContext } from "@earendil-works/pi-coding-agent"; import type { DiffAction, DiffHost, OpenDiffRequest } from "./types.ts"; export declare const DIFF_API_VERSION = 1; export declare function diffHost(): DiffHost; /** * Add an entry to the diff view's action menu (`a`). It is run with the file and hunk under the * cursor, after the panel has closed. Adding the same id again replaces it. The returned function * removes it. */ export declare function addDiffAction(action: DiffAction): () => void; /** * Open the diff view on the uncommitted git changes (as `/diff` does), with `file` selected when it * is among them (a path relative to the session's directory, or absolute). Resolves true once it was * shown and closed, and false, without showing anything, when the diff view is not loaded, has been * switched off, is already open, or there is no interactive UI. */ export declare function openChanges(ctx: ExtensionContext, file?: string): Promise; /** * Show a unified diff in the diff view and resolve true when it closes. Resolves false, without * showing anything, when the diff view is not loaded, has been switched off, is already open, or * there is no interactive UI. */ export declare function openDiff(ctx: ExtensionContext, req: OpenDiffRequest): Promise;