import SparkBunEvent from "./event";

type MenuClickedData = { id?: number; action: string; data?: unknown };
type OpenUrlData = { url: string };

export default {
	applicationMenuClicked: (data: MenuClickedData) =>
		new SparkBunEvent<MenuClickedData, { allow: boolean }>(
			"application-menu-clicked",
			data,
		),
	contextMenuClicked: (data: MenuClickedData) =>
		new SparkBunEvent<MenuClickedData, { allow: boolean }>(
			"context-menu-clicked",
			data,
		),
	openUrl: (data: OpenUrlData) =>
		new SparkBunEvent<OpenUrlData, void>("open-url", data),
	reopen: (data: {}) => new SparkBunEvent<{}, void>("reopen", data),
	beforeQuit: (data: {}) =>
		new SparkBunEvent<{}, { allow: boolean }>("before-quit", data),
};
