forked from alibaba/lowcode-engine
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathevent.ts
More file actions
37 lines (32 loc) · 931 Bytes
/
event.ts
File metadata and controls
37 lines (32 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { IPublicTypeDisposable } from '../type';
export interface IPublicApiEvent {
/**
* 监听事件
* add monitor to a event
* @param event 事件名称
* @param listener 事件回调
*/
on(event: string, listener: (...args: any[]) => void): IPublicTypeDisposable;
/**
* 监听事件,会在其他回调函数之前执行
* add monitor to a event
* @param event 事件名称
* @param listener 事件回调
*/
prependListener(event: string, listener: (...args: any[]) => void): IPublicTypeDisposable;
/**
* 取消监听事件
* cancel a monitor from a event
* @param event 事件名称
* @param listener 事件回调
*/
off(event: string, listener: (...args: any[]) => void): void;
/**
* 触发事件
* emit a message for a event
* @param event 事件名称
* @param args 事件参数
* @returns
*/
emit(event: string, ...args: any[]): void;
}