@devgrid/netron
Version:
Event bus, streams and remote object invocation.
48 lines (47 loc) • 1.15 kB
TypeScript
import { Definition } from './definition';
export type Abilities = {
tasks?: string[];
services?: Map<string, Definition>;
subsribeForServices?: boolean;
};
export type NetronOptions = {
id?: string;
listenHost?: string;
listenPort?: number;
taskTimeout?: number;
taskOverwriteStrategy?: 'replace' | 'skip' | 'throw';
connectTimeout?: number;
requestTimeout?: number;
abilities?: Abilities;
streamTimeout?: number;
};
export type EventSubscriber = (...args: any[]) => void;
export interface ArgumentInfo {
index: number;
type: string;
}
export interface MethodInfo {
type: string;
arguments: ArgumentInfo[];
}
export interface PropertyInfo {
type: string;
readonly: boolean;
}
export interface ServiceMetadata {
name: string;
properties: Record<string, PropertyInfo>;
methods: Record<string, MethodInfo>;
}
export type ServiceExposeEvent = {
name: string;
peerId: string;
remotePeerId?: string;
definition: Definition;
};
export type ServiceUnexposeEvent = {
name: string;
peerId: string;
remotePeerId?: string;
defId: string;
};