1 |
|
2 | import { IEvent } from './IEvent';
|
3 | import { IEventListener } from './IEventListener';
|
4 | import { Parameters } from '../run/Parameters';
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 | export declare class Event implements IEvent {
|
24 | private _name;
|
25 | private _listeners;
|
26 | |
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 | constructor(name: string);
|
33 | /**
|
34 | * Gets the name of the event.
|
35 | *
|
36 | * @returns the name of this event.
|
37 | */
|
38 | getName(): string;
|
39 | /**
|
40 | * Gets all listeners registred in this event.
|
41 | *
|
42 | * @returns a list of listeners.
|
43 | */
|
44 | getListeners(): IEventListener[];
|
45 | /**
|
46 | * Adds a listener to receive notifications when this event is fired.
|
47 | *
|
48 | * @param listener the listener reference to add.
|
49 | */
|
50 | addListener(listener: IEventListener): void;
|
51 | /**
|
52 | * Removes a listener, so that it no longer receives notifications for this event.
|
53 | *
|
54 | * @param listener the listener reference to remove.
|
55 | */
|
56 | removeListener(listener: IEventListener): void;
|
57 | /**
|
58 | * Fires this event and notifies all registred listeners.
|
59 | *
|
60 | * @param correlationId (optional) transaction id to trace execution through call chain.
|
61 | * @param args the parameters to raise this event with.
|
62 | * @throws an [[InvocationException]] if the event fails to be raised.
|
63 | */
|
64 | notify(correlationId: string, args: Parameters): void;
|
65 | }
|