@devgrid/netron
Version:
Event bus, streams and remote object invocation.
31 lines (30 loc) • 1.53 kB
TypeScript
import { Netron } from './netron';
import { Interface } from './interface';
import { Definition } from './definition';
import { RemotePeer } from './remote-peer';
import { ServiceStub } from './service-stub';
import { AbstractPeer } from './abstract-peer';
import { EventSubscriber, ServiceMetadata } from './types';
export declare class LocalPeer extends AbstractPeer {
stubs: Map<string, ServiceStub>;
serviceInstances: Map<any, ServiceStub>;
constructor(netron: Netron);
exposeService(instance: any): Promise<Definition>;
exposeRemoteService(peer: RemotePeer, meta: ServiceMetadata): Definition;
unexposeService(serviceName: string): Promise<void>;
unexposeRemoteService(peer: RemotePeer, serviceName: string): string;
protected releaseInterfaceInternal(iInstance: Interface): Promise<void>;
refService(instance: any, parentDef: Definition): any;
unrefService(defId?: string): void;
subscribe(eventName: string, handler: EventSubscriber): void;
unsubscribe(eventName: string, handler: EventSubscriber): void;
set(defId: string, name: string, value: any): Promise<void>;
get(defId: string, name: string): Promise<any>;
call(defId: string, method: string, args: any[]): Promise<any>;
hasStub(defId: string): boolean;
getServiceNames(): string[];
getStubByDefinitionId(defId: string): ServiceStub;
protected getDefinitionById(defId: string): Definition;
protected getDefinitionByServiceName(name: string): Definition;
private processResult;
}