Path: blob/main/components/gitpod-protocol/src/ide-protocol.ts
2498 views
/**1* Copyright (c) 2021 Gitpod GmbH. All rights reserved.2* Licensed under the GNU Affero General Public License (AGPL).3* See License.AGPL.txt in the project root for license information.4*/56/**7* `IDEServer` provides a list of available IDEs.8*/9export interface IDEServer {10/**11* Returns the IDE preferences.12*/13getIDEOptions(): Promise<IDEOptions>;1415/**16* Returns the IDE versions.17*/18getIDEVersions(ide: string): Promise<string[] | undefined>;19}2021export interface IDEOptions {22/**23* A list of available IDEs.24*/25options: { [key: string]: IDEOption };2627/**28* The default (browser) IDE when the user has not specified one.29*/30defaultIde: string;3132/**33* The default desktop IDE when the user has not specified one.34*/35defaultDesktopIde: string;3637/**38* Client specific IDE options.39*/40clients?: { [id: string]: IDEClient };41}4243export namespace IDEOptions {44export function asArray(options: IDEOptions): (IDEOption & { id: string })[] {45return Object.keys(options.options)46.map((id) => ({ ...options.options[id], id }))47.sort((a, b) => (a.orderKey || "").localeCompare(b.orderKey || ""));48}49}5051export const IDESettingsVersion = "2.2";5253export interface IDEClient {54/**55* The default desktop IDE when the user has not specified one.56*/57defaultDesktopIDE?: string;5859/**60* Desktop IDEs supported by the client.61*/62desktopIDEs?: string[];6364/**65* Steps to install the client on user machine.66*/67installationSteps?: string[];68}6970export interface IDEOption {71/**72* To ensure a stable order one can set an `orderKey`.73*/74orderKey?: string;7576/**77* Human readable title text of the IDE (plain text only).78*/79title: string;8081/**82* The type of the IDE, currently 'browser' or 'desktop'.83*/84type: "browser" | "desktop";8586/**87* The logo for the IDE. That could be a key in (see88* components/dashboard/src/images/ideLogos.ts) or a URL.89*/90logo: string;9192/**93* Text of an optional tooltip (plain text only).94*/95tooltip?: string;9697/**98* Text of an optional label next to the IDE option like “Insiders” (plain99* text only).100*/101label?: string;102103/**104* Notes to the IDE option that are rendered in the preferences when a user105* chooses this IDE.106*/107notes?: string[];108109/**110* If `true` this IDE option is not visible in the IDE preferences.111*/112hidden?: boolean;113114/**115* If `true` this IDE option is conditionally shown in the IDE preferences116*/117experimental?: boolean;118119/**120* The image ref to the IDE image.121*/122image: string;123124/**125* The latest image ref to the IDE image, this image ref always resolve to digest.126*/127latestImage?: string;128129/**130* When this is `true`, the tag of this image is resolved to the latest131* image digest regularly.132*133* This is useful if this image points to a tag like `nightly` that will be134* updated regularly. When `resolveImageDigest` is `true`, we make sure that135* we resolve the tag regularly to the most recent image version.136*/137resolveImageDigest?: boolean;138139/**140* The plugin image ref for the IDE image, this image ref always resolve to digest.141*/142pluginImage?: string;143144/**145* The latest plugin image ref for the latest IDE image, this image ref always resolve to digest.146*/147pluginLatestImage?: string;148149/**150* ImageVersion the semantic version of the IDE image.151*/152imageVersion?: string;153154/**155* LatestImageVersion the semantic version of the latest IDE image.156*/157latestImageVersion?: string;158159/**160* Wether is possible to pin a specific IDE version.161*/162pinnable?: boolean;163}164165166