import type { Dispose } from "./api.ts"; import type { GitLineInfo } from "./git.ts"; export type TerminalAction = "toggle" | "new" | "window" | "split" | "previous" | "next" | "commands" | "directories"; export interface TerminalProps { cwd: string; visible: boolean; maximized?: boolean; standalone?: boolean; onClose: () => void; onMaximize?: () => void; activeFile?: boolean; onRunFile?: () => Promise; getSelection?: () => string; onConfigureTasks?: () => Promise; } export interface TerminalMount { update(props: TerminalProps): void; command(action: Exclude): void | Promise; dispose: Dispose; } /** Host features that `api.contribute(key, value)` registers. Only one enabled plugin can own each key. */ export interface Contributions { git: { blame(path: string, line: number): Promise }; browser: { /** Opens a browser tab, with `url` when it is given. */ newTab?(url?: string): Promise; mountSettings(container: HTMLElement): Dispose | Promise; mountBookmarks(container: HTMLElement): Dispose | Promise; /** Opens a web link from a document. False means that the system browser opens it. */ open(url: string): Promise; }; terminal: { mount(container: HTMLElement, props: TerminalProps): TerminalMount; shortcut(event: Pick): TerminalAction | null; }; }