import { LabIcon } from '@jupyterlab/ui-components'; /** * A terminal text editor surfaced on the launcher's "Open" section. An editor * takes no initial prompt and is launched by typing its command into a fresh * terminal (e.g. `nvim`). The launcher shows a single editor tile (the first * available candidate; see {@link resolveEditor}); the full list is shared with * the terminals panel to badge running editors. */ export interface IEditor { /** * Stable id; also the default `$PATH` command probed for availability. */ id: string; /** * Tile label, e.g. "Neovim". */ label: string; /** * Tile tooltip. */ caption: string; /** * The literal command typed into the new terminal, e.g. `nvim`. */ command: string; /** * Brand icon for the tile. */ icon: LabIcon; /** * Preference order for the single launcher tile: the first candidate, by * ascending rank, that qualifies wins (Neovim before Vim by default). */ rank: number; /** * When false, the launcher skips the `which`-based availability check for * this entry — useful for a shell alias or function that isn't on PATH but * still resolves when typed in a real terminal. Defaults to true. */ requireAvailable: boolean; } /** * The settings-side shape: every field except `id` is optional, so a user can * override a single field on a built-in editor (e.g. swap `vim`'s command for * a wrapper) without restating the whole entry. New ids define brand-new * editors. Mirrors `IAgentSettings` minus `promptArgs`. */ export interface IEditorSettings { id: string; label?: string; caption?: string; command?: string; /** * Inline SVG for a custom editor's icon. Required for new ids whose icon * isn't shipped with xtralab; ignored for built-in ids unless explicitly * set (in which case it overrides the built-in). */ iconSvg?: string; rank?: number; /** * When false, the editor is hidden from the launcher's Open section (and no * longer recognised by the terminals panel). Disable both built-ins to drop * the editor tile entirely. Defaults to true. */ enabled?: boolean; /** * See {@link IEditor.requireAvailable}. Defaults to true for a built-in * editor that still uses its shipped command, and to false once you override * the `command` (a user-chosen command — often a shell alias — is trusted and * always shown). Set it explicitly to force the check on or off. */ requireAvailable?: boolean; } /** * The built-in editors projected into the JSON settings shape * ({@link IEditorSettings}), dropping the runtime-only {@link LabIcon}. Mirrors * {@link defaultAgentSettings}: {@link registerLauncherSchemaDefaults} injects * this as the `editors` setting's schema default so the Settings Editor shows * the shipped list. */ export declare function defaultEditorSettings(): IEditorSettings[]; /** * Merge xtralab's built-in editors with the user's `editors` settings. Built-in * entries keep their fields unless explicitly overridden; user-only entries are * appended. `enabled: false` filters an entry out of the result entirely (so * callers don't need to re-check the flag). The result is sorted by rank, which * is also the launcher's tile-preference order. Mirrors `mergeAgents`, including * turning `requireAvailable` off when the user overrides a built-in's `command` * so an aliased editor still shows. */ export declare function mergeEditors(overrides: IEditorSettings[]): IEditor[]; /** * Pick the single editor tile to show, given the merged editor list and the * set of commands known to be on `$PATH` (from the launcher's availability * probe). Returns the first candidate, by rank, that is either available or * opts out of the check (`requireAvailable: false`) — Neovim before Vim by * default — or `null` when none qualifies. * * When `available` is `null` (the endpoint couldn't be reached), a * `requireAvailable` editor is not shown; an entry with * `requireAvailable: false` is shown regardless. */ export declare function resolveEditor(editors: IEditor[], available: Set | null): IEditor | null;