/**
 * Type definitions and constants for QuantityControlComponent
 */

/**
 * Quantity constraints and default values
 */
export const QUANTITY_CONSTRAINTS = {
  MIN_VALUE: 1,
  MAX_VALUE: Number.MAX_SAFE_INTEGER,
  DEFAULT_VALUE: 1,
  DEFAULT_MAX_SELECTABLE: 10,
  PARSE_RADIX: 10,
} as const;

/**
 * Callback function type for form control value changes
 */
export type OnChangeFn = (value: number) => void;

/**
 * Callback function type for form control touched event
 */
export type OnTouchedFn = () => void;

/**
 * Supported keyboard keys for component navigation
 */
export const SUPPORTED_KEYS = {
  ENTER: 'Enter',
  SPACE: ' ',
  ESCAPE: 'Escape',
  ARROW_DOWN: 'ArrowDown',
  ARROW_UP: 'ArrowUp',
  HOME: 'Home',
  END: 'End',
} as const;

/**
 * Union type of all supported keyboard keys
 */
export type SupportedKey = (typeof SUPPORTED_KEYS)[keyof typeof SUPPORTED_KEYS];
