Skip to content

Commit

Permalink
[vscode] refactor uri or light/dark uri or ThemeIcon as IconPath type
Browse files Browse the repository at this point in the history
fixes #14579

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>
  • Loading branch information
rschnekenbu committed Dec 5, 2024
1 parent 8378858 commit 2325816
Showing 1 changed file with 25 additions and 46 deletions.
71 changes: 25 additions & 46 deletions packages/plugin/src/theia.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2163,7 +2163,7 @@ export module '@theia/plugin' {
/**
* The icon path or {@link ThemeIcon} for the QuickPickItem.
*/
iconPath?: Uri | { light: Uri; dark: Uri } | ThemeIcon;
iconPath?: IconPath;

/**
* A human-readable string which is rendered less prominent in the same line. Supports rendering of
Expand Down Expand Up @@ -2740,6 +2740,21 @@ export module '@theia/plugin' {
private constructor(id: string, color?: ThemeColor);
}

/**
* Represents an icon in the UI. This is either an uri, separate uris for the light- and dark-themes,
* or a {@link ThemeIcon theme icon}.
*/
export type IconPath = Uri | {
/**
* The icon path for the light theme.
*/
light: Uri;
/**
* The icon path for the dark theme.
*/
dark: Uri;
} | ThemeIcon;

/**
* Represents the state of a window.
*/
Expand Down Expand Up @@ -3520,7 +3535,7 @@ export module '@theia/plugin' {
/**
* The icon path or {@link ThemeIcon} for the terminal.
*/
iconPath?: Uri | { light: Uri; dark: Uri } | ThemeIcon;
iconPath?: IconPath;

/**
* The icon {@link ThemeColor} for the terminal.
Expand Down Expand Up @@ -3640,7 +3655,7 @@ export module '@theia/plugin' {
/**
* The icon path or {@link ThemeIcon} for the terminal.
*/
iconPath?: Uri | { light: Uri; dark: Uri } | ThemeIcon;
iconPath?: IconPath;

/**
* The icon {@link ThemeColor} for the terminal.
Expand Down Expand Up @@ -6227,7 +6242,7 @@ export module '@theia/plugin' {
/**
* Icon for the button.
*/
readonly iconPath: Uri | { light: Uri; dark: Uri } | ThemeIcon;
readonly iconPath: IconPath;

/**
* An optional tooltip.
Expand Down Expand Up @@ -6841,7 +6856,7 @@ export module '@theia/plugin' {
* When `falsy`, {@link ThemeIcon.Folder Folder Theme Icon} is assigned, if item is collapsible otherwise {@link ThemeIcon.File File Theme Icon}.
* When a {@link ThemeIcon ThemeIcon} is specified, icon is derived from the current file icon theme for the specified theme icon using {@link TreeItem.resourceUri resourceUri} (if provided).
*/
iconPath?: string | Uri | { light: string | Uri; dark: string | Uri } | ThemeIcon;
iconPath?: string | IconPath;

/**
* A human readable string which is rendered less prominent.
Expand Down Expand Up @@ -10612,7 +10627,7 @@ export module '@theia/plugin' {
/**
* The icon path or {@link ThemeIcon ThemeIcon} for the edit.
*/
iconPath?: Uri | { light: Uri; dark: Uri } | ThemeIcon;
iconPath?: IconPath;
}

/**
Expand Down Expand Up @@ -17473,16 +17488,7 @@ export module '@theia/plugin' {
/**
* An icon for the participant shown in UI.
*/
iconPath?: Uri | {
/**
* The icon path for the light theme.
*/
light: Uri;
/**
* The icon path for the dark theme.
*/
dark: Uri;
} | ThemeIcon;
iconPath?: IconPath;

/**
* The handler for requests to this participant.
Expand Down Expand Up @@ -17652,16 +17658,7 @@ export module '@theia/plugin' {
* @param value A uri or location
* @param iconPath Icon for the reference shown in UI
*/
reference(value: Uri | Location, iconPath?: Uri | ThemeIcon | {
/**
* The icon path for the light theme.
*/
light: Uri;
/**
* The icon path for the dark theme.
*/
dark: Uri;
}): void;
reference(value: Uri | Location, iconPath?: IconPath): void;

/**
* Pushes a part to this stream.
Expand Down Expand Up @@ -17781,32 +17778,14 @@ export module '@theia/plugin' {
/**
* The icon for the reference.
*/
iconPath?: Uri | ThemeIcon | {
/**
* The icon path for the light theme.
*/
light: Uri;
/**
* The icon path for the dark theme.
*/
dark: Uri;
};
iconPath?: IconPath;

/**
* Create a new ChatResponseReferencePart.
* @param value A uri or location
* @param iconPath Icon for the reference shown in UI
*/
constructor(value: Uri | Location, iconPath?: Uri | ThemeIcon | {
/**
* The icon path for the light theme.
*/
light: Uri;
/**
* The icon path for the dark theme.
*/
dark: Uri;
});
constructor(value: Uri | Location, iconPath?: IconPath);
}

/**
Expand Down

0 comments on commit 2325816

Please sign in to comment.