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

/** Passed to `new Date(...)` for inclusive range checks on the chosen date. */
export type InputDateParams = {
  min?: string | number;
  max?: string | number;
};

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

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 };
  clickEnter: { value: string | undefined; valid: boolean; id?: string };
};
