export type JobCreatedDetail = {
  jobId: string;
  /** 顯示在任務監控上的名稱 */
  label?: string;
  templateType?: string;
  status?: string;
};

export function notifyJobCreated(detail: JobCreatedDetail) {
  window.dispatchEvent(new CustomEvent<JobCreatedDetail>("haixun:job-created", { detail }));
}

export function requestJobsRefresh() {
  window.dispatchEvent(new Event("haixun:jobs-refresh"));
}