import SparkBunEvent from "./event";

type IdData = { id: number };
type ResizeData = {
	id: number;
	x: number;
	y: number;
	width: number;
	height: number;
};
type MoveData = { id: number; x: number; y: number };
type KeyData = { id: number; keyCode: number; modifiers: number; isRepeat: boolean };

export default {
	close: (data: IdData) => new SparkBunEvent<IdData, {}>("close", data),
	resize: (data: ResizeData) =>
		new SparkBunEvent<ResizeData, {}>("resize", data),
	move: (data: MoveData) => new SparkBunEvent<MoveData, {}>("move", data),
	focus: (data: IdData) => new SparkBunEvent<IdData, {}>("focus", data),
	blur: (data: IdData) => new SparkBunEvent<IdData, {}>("blur", data),
	keyDown: (data: KeyData) => new SparkBunEvent<KeyData, {}>("keyDown", data),
	keyUp: (data: KeyData) => new SparkBunEvent<KeyData, {}>("keyUp", data),
};
