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

export type InputRadioOption = {
  value: string;
  label?: string;
};

export type InputRadioParams = {
  options?: InputRadioOption[];
};

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

export type Component = {
  id?: string;
  style?: string;

  show_validation?: "yes" | "no";
  schemaentry: FormSchemaEntry | undefined;
};

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