1
>
/*---------------------------------------------------------------------------------------------
extHostRpcService.ts
2
>
* Copyright (c) Microsoft Corporation. All rights reserved.
3
>
* Licensed under the MIT License. See License.txt in the project root for license information.
4
>
*--------------------------------------------------------------------------------------------*/
5
>
6
>
import { ProxyIdentifier, IRPCProtocol, Proxied } from '../../services/extensions/common/proxyIdentifier.js';
7
>
import { createDecorator } from '../../../platform/instantiation/common/instantiation.js';
8
>
9
>
export const IExtHostRpcService = createDecorator<IExtHostRpcService>('IExtHostRpcService');
10
>
11
>
export interface IExtHostRpcService extends IRPCProtocol {
12
>
readonly _serviceBrand: undefined;
13
>
}
14
>
15
>
export class ExtHostRpcService implements IExtHostRpcService {
16
>
readonly _serviceBrand: undefined;
17
>
18
>
readonly getProxy: <T>(identifier: ProxyIdentifier<T>) => Proxied<T>;
19
>
readonly set: <T, R extends T> (identifier: ProxyIdentifier<T>, instance: R) => R;
20
>
readonly dispose: () => void;
21
>
readonly assertRegistered: (identifiers: ProxyIdentifier<any>[]) => void;
22
>
readonly drain: () => Promise<void>;
23
>
24
>
constructor(rpcProtocol: IRPCProtocol) {
25
this.getProxy = rpcProtocol.getProxy.bind(rpcProtocol);
26
this.set = rpcProtocol.set.bind(rpcProtocol);