UNPKG

pencil.js

Version:

Nice modular interactive 2D drawing library.

36 lines (35 loc) 858 B
/** * @module BaseEvent */ /** * Base event class * @class */ export default class BaseEvent { /** * BaseEvent constructor * @param {String} name - Name of the event * @param {EventEmitter} target - Component concerned by the event * @param {UIEvent} [event] - Original HTML event */ constructor(name: string, target: any, event?: UIEvent); name: string; target: any; event: UIEvent; bubble: boolean; /** * Mark this event as stopped * @return {BaseEvent} Itself */ stop(): BaseEvent; /** * Get the event modifier (should be overridden by child classes) * @return {null} */ getModifier(): null; /** * Prevent the initial event default behavior * @return {BaseEvent} Itself */ prevent(): BaseEvent; }