UNPKG

@rontian/egret-robotlegs

Version:

Egret View Integration with RobotlegsJS

36 lines (35 loc) 1.83 kB
import { IClass, IEvent, IEventMap, IEventDispatcher, Event } from "@robotlegsjs/core"; import { IMediator } from "../api/IMediator"; /** * Classic Robotlegs mediator implementation * * <p>Override initialize and destroy to hook into the mediator lifecycle.</p> */ export declare abstract class Mediator<T extends egret.EventDispatcher> implements IMediator { private _viewConverted; protected _eventMap: IEventMap; protected _eventDispatcher: IEventDispatcher; protected _viewComponent: T; set view(view: T); get view(): T; /** * @inheritDoc */ abstract initialize(): void; /** * @inheritDoc */ abstract destroy(): void; /** * Runs after the mediator has been destroyed. * Cleans up listeners mapped through the local EventMap. */ postDestroy(): void; protected addViewListener(eventString: string, listener: Function, thisObject?: any, eventClass?: IClass<IEvent>, useCapture?: boolean, priority?: number): void; protected addContextListener(eventString: string, listener: Function, thisObject?: any, eventClass?: IClass<IEvent>, useCapture?: boolean, priority?: number): void; protected addDomListener(eventTarget: EventTarget, eventString: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; protected removeViewListener(eventString: string, listener: Function, thisObject?: any, eventClass?: IClass<IEvent>, useCapture?: boolean): void; protected removeContextListener(eventString: string, listener: Function, thisObject?: any, eventClass?: IClass<IEvent>, useCapture?: boolean): void; protected removeDomListener(eventTarget: EventTarget, eventString: string, listener: EventListenerOrEventListenerObject): void; protected dispatch(event: Event): void; }