import { EventGuard } from "../EventGuard"; import { EventMapping } from "../EventMapping"; import { EventListener } from "../EventListener"; import { Event } from "../../event/Event"; /** * Event mappings class used to describe single event name to listener mapping. */ export declare class EventMappingImpl implements EventMapping { readonly event: Event['type']; readonly listener: EventListener; readonly context: Object; private static EVENT_MAPPING_ID; /** * Unique id of a mapping. * @returns {number} */ readonly id: number; private guards; private _executeOnce; /** * Create new mapping * @param event String event name. * @param listener Listener function. * @param context Listener scope to apply as it is executed */ constructor(event: Event['type'], listener: EventListener, context: Object); /** * Defines if this event mapping should be executed only once. * @returns {boolean} */ get executeOnce(): boolean; /** * Mark event mapping to be executed only once. * @returns {EventMappingImpl} so we can call other methods of this class instantly from return value */ once(): this; /** * Set event guards which could prevent event listener to be executed upon some circumstances known only to * guards themselves. * @param guards List of EventGuard callback methods that might prevent execution of listener. * @returns {EventMappingImpl} so we can call other methods of this class instantly from return value */ withGuards(...guards: EventGuard[]): this; /** * Find if event execution is allowed by event mapping guards. * @param event Event object to be dispatched. * @returns {boolean} True if guards aren't set or none of them has reason to stop event execution. */ executionAllowedByGuards(event: Event): boolean; }