@sussudio/platform
Version:
Internal APIs for VS Code's service injection the base services.
41 lines (39 loc) • 1.86 kB
text/typescript
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { IChannel, IServerChannel, ProxyChannel } from '@sussudio/base/parts/ipc/common/ipc.mjs';
import { ServiceIdentifier } from '../../instantiation/common/instantiation.mjs';
type ChannelClientCtor<T> = {
new (channel: IChannel, ...args: any[]): T;
};
export interface IRemoteServiceWithChannelClientOptions<T> {
readonly channelClientCtor: ChannelClientCtor<T>;
}
export interface IRemoteServiceWithProxyOptions {
readonly proxyOptions?: ProxyChannel.ICreateProxyServiceOptions;
}
export declare const IMainProcessService: ServiceIdentifier<IMainProcessService>;
export interface IMainProcessService {
readonly _serviceBrand: undefined;
getChannel(channelName: string): IChannel;
registerChannel(channelName: string, channel: IServerChannel<string>): void;
}
export declare function registerMainProcessRemoteService<T>(
id: ServiceIdentifier<T>,
channelName: string,
options?: IRemoteServiceWithChannelClientOptions<T> | IRemoteServiceWithProxyOptions,
): void;
export declare const ISharedProcessService: ServiceIdentifier<ISharedProcessService>;
export interface ISharedProcessService {
readonly _serviceBrand: undefined;
getChannel(channelName: string): IChannel;
registerChannel(channelName: string, channel: IServerChannel<string>): void;
notifyRestored(): void;
}
export declare function registerSharedProcessRemoteService<T>(
id: ServiceIdentifier<T>,
channelName: string,
options?: IRemoteServiceWithChannelClientOptions<T> | IRemoteServiceWithProxyOptions,
): void;
export {};