import { Observer, Subject, Subscribable, Unsubscribable } from "rxjs" /* -------------------------------------------- Fis actor to declare its own subscribable but extended from RXJS */ interface ActorService { } /* Stateful actor service to be instantiated by concrete class. To add in behaviour and model state repository */ interface ActorContext { } /* references to associate actors */ // Please note members of an interface are ALWAYS PUBLIC. interface FisActor extends Subscribable { actorId: String actorName: String actorContext: ActorContext incomingBus: Subscribable outgoingBus: Subscribable actorService: ActorService } export abstract class FisActorBaseImpl implements FisActor { actorId!: String actorName!: String incomingBus!: Subscribable outgoingBus!: Subscribable actorService!: ActorService actorContext!: Object constructor(actorContext: ActorContext) { // logic here } subscribe(observer: Partial>): Unsubscribable { throw new Error("Method to be defined....") } } interface Actor extends Subscribable { actorId: String actorName: String actorStream: Subscribable } abstract class Sample implements Actor { actorId!: String actorName!: String actorStream!: Subscribable subscribe(observer: Partial>): Unsubscribable { throw new Error("Method not implemented.") } }