/*! Copyright (c) 2018 Siemens AG. Licensed under the MIT License. */ import { Observable } from "rxjs"; import { Controller, IoActor } from ".."; /** * Provides convenience methods for observing IO values and for * monitoring changes in the association state of specific IO actors. */ export declare class IoActorController extends Controller { private _actorItems; onInit(): void; onCommunicationManagerStarting(): void; onCommunicationManagerStopping(): void; /** * Listen to IO values for the given IO actor. The returned observable * always emits the last value received for the given IO actor. When * subscribed, the current value (or undefined if none exists yet) is * emitted immediately. * * Due to this behavior the cached value of the observable will also be * emitted after reassociation. If this is not desired use * `this.communicationManager.observeIoValue` instead. This method doesn't * cache any previously emitted value. * * @remarks Note that subscriptions on the observable returned **must** be * manually unsubscribed by the application; they are not automatically * unsubscribed when communication manager is stopped. * * @param actor an IO actor object * @returns an observable emitting IO values for the given actor */ observeIoValue(actor: IoActor): Observable; /** * Gets the lastest IO value emitted to the given IO actor or `undefined` if * none exists yet. * * @param actor an IO actor object * @returns the latest IO value for the given actor if one exists */ getIoValue(actor: IoActor): T; /** * Listen to associations or disassociations for the given IO actor. * The returned observable emits distinct boolean values until changed, i.e * true when the first association is made and false, when the last * association becomes disassociated. * When subscribed, the current association state is emitted immediately. * * @remarks Note that subscriptions on the observable returned **must** be * manually unsubscribed by the application; they are not automatically * unsubscribed when communication manager is stopped. * * @param actor an IO actor object */ observeAssociation(actor: IoActor): Observable; /** * Determines whether the given IO actor is currently associated. */ isAssociated(actor: IoActor): boolean; private _reregisterAll; private _ensureRegistered; private _onIoStateChanged; private _onIoValueChanged; }