Files
vue-desktop/src/core/events/WindowFormEventManager.ts

62 lines
1.3 KiB
TypeScript
Raw Normal View History

2025-09-16 14:32:57 +08:00
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;
2025-09-19 09:57:14 +08:00
/**
*
*/
windowFormCreated: () => void;
2025-09-16 14:32:57 +08:00
}
interface IWindowFormDataUpdateParams {
/** 窗口id */
id: string;
/** 窗口状态 */
state: TWindowFormState,
/** 窗口宽度 */
width: number,
/** 窗口高度 */
height: number,
/** 窗口x坐标(左上角) */
x: number,
/** 窗口y坐标(左上角) */
y: number
}
/** 窗口事件管理器 */
export const wfem = new EventBuilderImpl<WindowFormEvent>()