UNPKG

@manuth/woltlab-compiler

Version:

A compiler for generating WoltLab-Package `.tar` Archives and other WoltLab-Package Components

66 lines 2.17 kB
import { Listener } from "./Listener.js"; /** * Represents the declaration of a PHP-class that should be executed when a specific event occurs. * * Please note that you have to provide your PHP-files using a {@link ApplicationFileSystemInstruction `ApplicationFileSystemInstruction`}. */ export class EventListener extends Listener { /** * Initializes a new instance of the {@link EventListener `EventListener`} class. * * @param options * The options of the event-listener. */ constructor(options) { super(options); /** * A value indicating whether listening to the event thrown by a class inheriting from {@link EventListener.className `className`} is allowed. */ this.allowInherited = false; this.ClassName = options.ClassName; if ((options.AllowInherited !== null) && (options.AllowInherited !== undefined)) { this.AllowInherited = options.AllowInherited; } this.EventHandlerClassName = options.EventHandlerClassName; } /** * Gets or sets the name of the class to listen to. */ get ClassName() { return this.className; } /** * @inheritdoc */ set ClassName(value) { this.className = value; } /** * Gets or sets a value indicating whether listening to the event thrown by a class inheriting from {@link EventListener.ClassName `ClassName`} is allowed. */ get AllowInherited() { return this.allowInherited; } /** * @inheritdoc */ set AllowInherited(value) { this.allowInherited = value; } /** * Gets or sets the name of the event-handler class which is triggered when the event has been executed. * * Please consider that the event-handler class **must** inherit the `wcf\system\event\listener\IParameterizedEventListener`-class. */ get EventHandlerClassName() { return this.eventHandlerClassName; } /** * @inheritdoc */ set EventHandlerClassName(value) { this.eventHandlerClassName = value; } } //# sourceMappingURL=EventListener.js.map