This commit is contained in:
2025-10-23 12:14:03 +08:00
parent 900a72e4c9
commit f9fdb1a6c2
49 changed files with 851 additions and 8129 deletions

View File

@@ -1,5 +1,5 @@
import type { IDestroyable } from '@/common/types/IDestroyable'
import type { WindowState } from '@/services/WindowFormService.ts'
import type { WindowState } from '@/services/windowForm/WindowFormService.ts'
import type { ResourceType } from '@/services/ResourceService'
/**
@@ -56,13 +56,13 @@ export interface ISystemBuiltInEventMap extends IEventMap {
*/
export interface IEventBuilder<Events extends IEventMap> extends IDestroyable {
/**
* 添加事件监听
* 订阅事件
* @param eventName 事件名称
* @param handler 事件处理函数
* @param options 配置项 { immediate: 立即执行一次 immediateArgs: 立即执行的参数 once: 只监听一次 }
* @returns void
*/
addEventListener<E extends keyof Events, F extends Events[E]>(
subscribe<E extends keyof Events, F extends Events[E]>(
eventName: E,
handler: F,
options?: {
@@ -70,15 +70,15 @@ export interface IEventBuilder<Events extends IEventMap> extends IDestroyable {
immediateArgs?: Parameters<F>
once?: boolean
}
): void
): () => void
/**
* 移除事件监听
* 移除事件
* @param eventName 事件名称
* @param handler 事件处理函数
* @returns void
*/
removeEventListener<E extends keyof Events, F extends Events[E]>(eventName: E, handler: F): void
remove<E extends keyof Events, F extends Events[E]>(eventName: E, handler: F): void
/**
* 触发事件
@@ -86,7 +86,7 @@ export interface IEventBuilder<Events extends IEventMap> extends IDestroyable {
* @param args 参数
* @returns void
*/
notifyEvent<E extends keyof Events, F extends Events[E]>(
notify<E extends keyof Events, F extends Events[E]>(
eventName: E,
...args: Parameters<F>
): void