Files
RuneStone/packages/plugin-sdk/src/contributions.ts
T
Knotty Wyvern c06d48f250 Show the engine setup until the browser engine is installed
A browser tab shows the download size, Download the engine, Install from
file, and Open in default browser until the engine can start. It shows
progress, Cancel, the cause of a failure, and Retry, and then opens the
page. Settings -> Browser shows the engine state and Remove engine. Web
links open in the system browser until the engine is installed. Open
link in app browser always opens a browser tab.
2026-10-29 01:18:21 -07:00

31 lines
1.5 KiB
TypeScript

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<string | null>; getSelection?: () => string; onConfigureTasks?: () => Promise<void>;
}
export interface TerminalMount {
update(props: TerminalProps): void;
command(action: Exclude<TerminalAction, "toggle">): void | Promise<void>;
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<GitLineInfo | null> };
browser: {
/** Opens a browser tab, with `url` when it is given. */
newTab?(url?: string): Promise<void>;
mountSettings(container: HTMLElement): Dispose | Promise<Dispose>;
mountBookmarks(container: HTMLElement): Dispose | Promise<Dispose>;
/** Opens a web link from a document. False means that the system browser opens it. */
open(url: string): Promise<boolean>;
};
terminal: {
mount(container: HTMLElement, props: TerminalProps): TerminalMount;
shortcut(event: Pick<KeyboardEvent, "ctrlKey" | "metaKey" | "altKey" | "shiftKey" | "code" | "key">): TerminalAction | null;
};
}