import type { FormSchemaEntryShared } from "../form/webcomponent.type";

export type InputCheckboxParams = {
  /** `"switch"` renders a Bulma-style switch instead of a checkbox. */
  type?: "checkbox" | "switch";
};

export type FormSchemaEntry = Omit<FormSchemaEntryShared, "params"> & {
  /**
   * Optional default value.
   */
  value?: string | number | boolean;
  params?: InputCheckboxParams;
};

export type Component = {
  id?: string;
  style?: string;
  show_validation?: "yes" | "no";
  /** JSON string from HTML, or a parsed object from JavaScript (`parseSchemaentryProp`). */
  schemaentry?: string | FormSchemaEntry;
};

export type Events = {
  setVal: { value: boolean; valid: boolean; id: string };
};
