mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-08 15:55:15 +01:00
debt - have Dto and UriDto
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user