@microsoft/windows-admin-center-sdk
Version:
Microsoft - Windows Admin Center Shell
46 lines (45 loc) • 1.59 kB
TypeScript
import { Observable } from 'rxjs';
import { Rpc } from './rpc';
import { RpcObservableRequestContext } from './rpc-observable-request';
import { RpcObservableResultContext } from './rpc-observable-result';
/**
* RPC Observable Server class.
* Extends this class and populate rpcCall and callback properties.
*
* @template TRequest the request data object.
* @template TResult the result data object.
* @template TError the error object which must be serializable.
*/
export declare class RpcObservableServer<TRequest extends RpcObservableResultContext, TResult extends RpcObservableRequestContext, TError extends RpcObservableRequestContext> {
protected rpc: Rpc;
protected command: string;
protected version: string;
private requestCommand;
private resultCommand;
private callback;
/**
* Initializes a new instance of the RpcObservableServer class.
*
* @param rpc the rpc object.
* @param command the command string.
*/
constructor(rpc: Rpc, command: string, version: string);
/**
* Register the call back observable.
*/
register(value: (request: TRequest) => Observable<TResult>): void;
/**
* Making rpc call to shell or module.
*
* @param result the result packet data.
* @param outbound the outbound object from Shell to module request.
* @return Promise<void> the promise object.
*/
private rpcCall;
/**
* Handle the request from inbound iframe window.
*
* @param observableRequest the observable request data.
*/
private handler;
}