Skip to content

Commit

Permalink
💄 use conditional, mapped types magic
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed May 16, 2019
1 parent 7fc0c65 commit a69d0f8
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/vs/platform/actions/common/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,18 @@ export interface ILocalizedString {
original: string;
}

export interface IBaseCommandAction {
export interface ICommandAction {
id: string;
title: string | ILocalizedString;
category?: string | ILocalizedString;
}

export interface ICommandAction extends IBaseCommandAction {
iconLocation?: { dark: URI; light?: URI; };
precondition?: ContextKeyExpr;
toggled?: ContextKeyExpr;
}

export interface ISerializableCommandAction extends IBaseCommandAction {
iconLocation?: { dark: UriComponents; light?: UriComponents; };
}
type Serialized<T> = { [K in keyof T]: T[K] extends URI ? UriComponents : Serialized<T[K]> };

export type ISerializableCommandAction = Serialized<ICommandAction>;

export interface IMenuItem {
command: ICommandAction;
Expand Down

0 comments on commit a69d0f8

Please sign in to comment.