/** * 事件记录列表 */ export interface ISubject { [key: string]: { func: IEventHandler; context?: any; once?: boolean; called?: boolean; }[]; } /** * 标准事件对象 * 参考 CustomEvent 事件对象结构 */ export declare type ICustomEvent = { type: string; detail?: T; }; /** * 事件函数 */ export declare type IEventHandler = (evt: ICustomEvent) => void; /** * 事件管理对象 */ export declare type IEvent = { on: (func: IEventHandler, context?: any) => void; once: (func: IEventHandler, context?: any) => void; off: (func: IEventHandler) => void; emit: (params?: T) => Promise; };