提交 798a4026 编写于 作者: J Johannes Rieken

debt - have Dto and UriDto

上级 c975df3b
...@@ -266,10 +266,19 @@ export type AddFirstParameterToFunctions<Target, TargetFunctionsReturnType, Firs ...@@ -266,10 +266,19 @@ export type AddFirstParameterToFunctions<Target, TargetFunctionsReturnType, Firs
}; };
/** /**
* Mapped typed that replaces all occurrences of URI with UriComponents * Mapped-type that replaces all occurrences of URI with UriComponents
* todo@joh drop functions */
export type UriDto<T> = { [K in keyof T]: T[K] extends URI
? UriComponents
: UriDto<T[K]> };
/**
* Mapped-type that replaces all occurrences of URI with UriComponents and
* drops all functions.
* todo@joh use toJSON-results * todo@joh use toJSON-results
*/ */
export type Serialized<T> = { [K in keyof T]: T[K] extends URI export type Dto<T> = { [K in keyof T]: T[K] extends URI
? UriComponents ? UriComponents
: Serialized<T[K]> }; : T[K] extends Function
? never
: UriDto<T[K]> };
...@@ -13,7 +13,7 @@ import { IDisposable, DisposableStore } from 'vs/base/common/lifecycle'; ...@@ -13,7 +13,7 @@ import { IDisposable, DisposableStore } from 'vs/base/common/lifecycle';
import { Event, Emitter } from 'vs/base/common/event'; import { Event, Emitter } from 'vs/base/common/event';
import { URI } from 'vs/base/common/uri'; import { URI } from 'vs/base/common/uri';
import { ThemeIcon } from 'vs/platform/theme/common/themeService'; import { ThemeIcon } from 'vs/platform/theme/common/themeService';
import { Serialized } from 'vs/base/common/types'; import { UriDto } from 'vs/base/common/types';
export interface ILocalizedString { export interface ILocalizedString {
value: string; value: string;
...@@ -29,7 +29,7 @@ export interface ICommandAction { ...@@ -29,7 +29,7 @@ export interface ICommandAction {
toggled?: ContextKeyExpr; toggled?: ContextKeyExpr;
} }
export type ISerializableCommandAction = Serialized<ICommandAction>; export type ISerializableCommandAction = UriDto<ICommandAction>;
export interface IMenuItem { export interface IMenuItem {
command: ICommandAction; command: ICommandAction;
......
...@@ -52,7 +52,7 @@ import { TunnelOptions } from 'vs/platform/remote/common/tunnel'; ...@@ -52,7 +52,7 @@ import { TunnelOptions } from 'vs/platform/remote/common/tunnel';
import { Timeline, TimelineChangeEvent, TimelineCursor, TimelineProviderDescriptor } from 'vs/workbench/contrib/timeline/common/timeline'; import { Timeline, TimelineChangeEvent, TimelineCursor, TimelineProviderDescriptor } from 'vs/workbench/contrib/timeline/common/timeline';
import { revive } from 'vs/base/common/marshalling'; import { revive } from 'vs/base/common/marshalling';
import { CallHierarchyItem } from 'vs/workbench/contrib/callHierarchy/common/callHierarchy'; import { CallHierarchyItem } from 'vs/workbench/contrib/callHierarchy/common/callHierarchy';
import { Serialized } from 'vs/base/common/types'; import { Dto } from 'vs/base/common/types';
export interface IEnvironment { export interface IEnvironment {
isExtensionDevelopmentDebug: boolean; isExtensionDevelopmentDebug: boolean;
...@@ -1191,7 +1191,7 @@ export interface ICodeLensDto { ...@@ -1191,7 +1191,7 @@ export interface ICodeLensDto {
command?: ICommandDto; command?: ICommandDto;
} }
export type ICallHierarchyItemDto = Serialized<CallHierarchyItem>; export type ICallHierarchyItemDto = Dto<CallHierarchyItem>;
export interface IIncomingCallDto { export interface IIncomingCallDto {
from: ICallHierarchyItemDto; from: ICallHierarchyItemDto;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册