Adding extra ICommunicationMirror
This commit is contained in:
parent
612bbcadb8
commit
5ebc22488c
@ -309,14 +309,74 @@ export interface ICommunicationBridge extends ICommunicationInterface {
|
|||||||
layer: ICommunicationInterface,
|
layer: ICommunicationInterface,
|
||||||
forwardData?: boolean,
|
forwardData?: boolean,
|
||||||
considerConnection?: boolean
|
considerConnection?: boolean
|
||||||
): void;
|
): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Function, to remove the Layer again.
|
* Function, to remove the Layer again.
|
||||||
*
|
*
|
||||||
* @param {ICommunicationInterface} layer The Layer to Remove
|
* @param {ICommunicationInterface} layer The Layer to Remove
|
||||||
* @memberof ICommunicationBridge
|
* @memberof ICommunicationBridge
|
||||||
*/
|
*/
|
||||||
removeLayer(layer: ICommunicationInterface): void;
|
removeLayer(layer: ICommunicationInterface): Promise<void>;
|
||||||
|
|
||||||
|
addMirror(mirror: IEmitter, addSubscriptions?: boolean): void;
|
||||||
|
|
||||||
|
removeMirror(mirror: IEmitter): boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ValidEventTypesOfMirror =
|
||||||
|
// Default emitters
|
||||||
|
| "aurevoir"
|
||||||
|
| "bonjour"
|
||||||
|
| "NewInstanceGeneratorsAvailable"
|
||||||
|
| "NewInstancesAvailable"
|
||||||
|
| "NewObersvablesAvailable"
|
||||||
|
| "NewServicesAvailable"
|
||||||
|
| "StatusUpdate"
|
||||||
|
| "TaskCancelation"
|
||||||
|
| "event"
|
||||||
|
| "rpcRequest"
|
||||||
|
| "rpcResponse";
|
||||||
|
export const ValidEventTypesOfMirror = [
|
||||||
|
// Default emitters
|
||||||
|
"aurevoir",
|
||||||
|
"bonjour",
|
||||||
|
"NewInstanceGeneratorsAvailable",
|
||||||
|
"NewInstancesAvailable",
|
||||||
|
"NewObersvablesAvailable",
|
||||||
|
"NewServicesAvailable",
|
||||||
|
"StatusUpdate",
|
||||||
|
"TaskCancelation",
|
||||||
|
"event",
|
||||||
|
"rpcRequest",
|
||||||
|
"rpcResponse"
|
||||||
|
];
|
||||||
|
|
||||||
|
export interface ICommunicationMirror {
|
||||||
|
/**
|
||||||
|
* Function, used to subscribe to a specific Event
|
||||||
|
*
|
||||||
|
* @param {(ValidEventTypesOfMirror | symbol)} event The Name of the Event
|
||||||
|
* @param {(...args: any[]) => void} listener The callback.
|
||||||
|
* @memberof ICommunicationMirror
|
||||||
|
*/
|
||||||
|
on(
|
||||||
|
event: ValidEventTypesOfMirror | symbol,
|
||||||
|
listener: (...args: any[]) => void
|
||||||
|
): void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper to emitt an event.
|
||||||
|
*
|
||||||
|
* @param {ValidEventTypesOfMirror} event
|
||||||
|
* @param {*} data
|
||||||
|
* @memberof ICommunicationMirror
|
||||||
|
*/
|
||||||
|
emit(event: ValidEventTypesOfMirror, data: any): void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Flag, indication, whether the Layer is connected or not.
|
||||||
|
*/
|
||||||
|
connected: INopeObservable<boolean>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ITaskCancelationMsg = {
|
export type ITaskCancelationMsg = {
|
||||||
|
Loading…
Reference in New Issue
Block a user