62 lines
1.3 KiB
TypeScript
62 lines
1.3 KiB
TypeScript
import { EventBuilderImpl } from '@/core/events/impl/EventBuilderImpl.ts'
|
|
import type { IEventMap } from '@/core/events/IEventBuilder.ts'
|
|
import type { TWindowFormState } from '@/core/window/types/WindowFormTypes.ts'
|
|
|
|
/**
|
|
* 窗口的事件
|
|
*/
|
|
export interface WindowFormEvent extends IEventMap {
|
|
/**
|
|
* 窗口最小化
|
|
* @param id 窗口id
|
|
*/
|
|
windowFormMinimize: (id: string) => void;
|
|
/**
|
|
* 窗口最大化
|
|
* @param id 窗口id
|
|
*/
|
|
windowFormMaximize: (id: string) => void;
|
|
/**
|
|
* 窗口还原
|
|
* @param id 窗口id
|
|
*/
|
|
windowFormRestore: (id: string) => void;
|
|
/**
|
|
* 窗口关闭
|
|
* @param id 窗口id
|
|
*/
|
|
windowFormClose: (id: string) => void;
|
|
/**
|
|
* 窗口聚焦
|
|
* @param id 窗口id
|
|
*/
|
|
windowFormFocus: (id: string) => void;
|
|
/**
|
|
* 窗口数据更新
|
|
* @param data 窗口数据
|
|
*/
|
|
windowFormDataUpdate: (data: IWindowFormDataUpdateParams) => void;
|
|
/**
|
|
* 窗口创建完成
|
|
*/
|
|
windowFormCreated: () => void;
|
|
}
|
|
|
|
interface IWindowFormDataUpdateParams {
|
|
/** 窗口id */
|
|
id: string;
|
|
/** 窗口状态 */
|
|
state: TWindowFormState,
|
|
/** 窗口宽度 */
|
|
width: number,
|
|
/** 窗口高度 */
|
|
height: number,
|
|
/** 窗口x坐标(左上角) */
|
|
x: number,
|
|
/** 窗口y坐标(左上角) */
|
|
y: number
|
|
}
|
|
|
|
/** 窗口事件管理器 */
|
|
export const wfem = new EventBuilderImpl<WindowFormEvent>()
|