@microsoft/windows-admin-center-sdk
Version:
Microsoft - Windows Admin Center Shell
53 lines (52 loc) • 1.79 kB
TypeScript
import { Observable } from 'rxjs';
import { Rpc } from './rpc';
import { RpcObservableRequestContext } from './rpc-observable-request';
import { RpcObservableResultContext } from './rpc-observable-result';
import { RpcOutbound } from './rpc-outbound';
/**
* RPC Observable Client class.
*/
export declare class RpcObservableClient<TRequest extends RpcObservableResultContext, TResult extends RpcObservableRequestContext, TError extends RpcObservableRequestContext> {
protected rpc: Rpc;
protected command: string;
protected version: string;
private id;
private requestCommand;
private resultCommand;
private resultBuffer;
private resultObservers;
/**
* Initializes a new instance of the RpcObservableClient class.
*
* @param rpc The rpc object.
* @param command the command string.
* @param version the version string.
*/
constructor(rpc: Rpc, command: string, version: string);
/**
* Make observable call.
*
* @param request The the request data.
* @param outbound The outbound RPC channel. (request initiated from Shell.)
* @return An observable for the response message
*/
protected observableCall(request: TRequest, outbound?: RpcOutbound): Observable<TResult>;
/**
* Making rpc call to shell or module.
*
* @param request the request packet data.
* @param outbound the outbound object from Shell to module request.
* @return Promise<void> the promise object.
*/
private rpcCall;
/**
* Create a replay observable. Replays result data if results exists.
*/
private replayResult;
/**
* Handles rpc response messages.
*
* @param result the result of observable request.
*/
private handler;
}