import type {
  Component as FormComponent,
  Events as FormEvents,
} from "../form/webcomponent.type";

export type Component = {
  id?: string;
  style?: string;
  show?: "yes" | "no";
  dialogclasses?: string;
  title?: string;
  backdrop?: boolean;
  keyboard?: boolean;
  describedby?: string;
  labelledby?: string;
  content?: string;
  closelabel?: string;
  confirmlabel?: string;
  schema?: FormComponent["schema"];
};

export type Events = {
  modalFormConfirm: { [key: string]: any };
  modalShow: { id: string; show: boolean };
  modalFormCancel: { id: string; error?: string };
  /** Emitted when the inner `hb-form` updates (same detail shape as `hb-form` `update`). */
  updateForm: FormEvents["update"];
};
