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

/**
 * Slider bounds. Keys are read with `hasOwnProperty`; values may be numbers or numeric strings.
 */
export type InputRangeParams = {
  min?: number | string;
  max?: number | string;
};

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

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

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

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