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

debt - have Dto and UriDto

上级 c975df3b
......@@ -266,10 +266,19 @@ export type AddFirstParameterToFunctions<Target, TargetFunctionsReturnType, Firs
};
/**
* Mapped typed that replaces all occurrences of URI with UriComponents
* todo@joh drop functions
* Mapped-type that replaces all occurrences of URI with UriComponents
*/
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
*/
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
: Serialized<T[K]> };
: T[K] extends Function
? never
: UriDto<T[K]> };
......@@ -13,7 +13,7 @@ import { IDisposable, DisposableStore } from 'vs/base/common/lifecycle';
import { Event, Emitter } from 'vs/base/common/event';
import { URI } from 'vs/base/common/uri';
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 {
value: string;
......@@ -29,7 +29,7 @@ export interface ICommandAction {
toggled?: ContextKeyExpr;
}
export type ISerializableCommandAction = Serialized<ICommandAction>;
export type ISerializableCommandAction = UriDto<ICommandAction>;
export interface IMenuItem {
command: ICommandAction;
......
......@@ -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 { revive } from 'vs/base/common/marshalling';
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 {
isExtensionDevelopmentDebug: boolean;
......@@ -1191,7 +1191,7 @@ export interface ICodeLensDto {
command?: ICommandDto;
}
export type ICallHierarchyItemDto = Serialized<CallHierarchyItem>;
export type ICallHierarchyItemDto = Dto<CallHierarchyItem>;
export interface IIncomingCallDto {
from: ICallHierarchyItemDto;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册