import { AmPm } from '../../types/general';
import { DatePickerModeType, DatePickerValueType } from '../vega-date-picker/types';

/**
 * Data source categories used in the time picker dropdown.
 */
export type SourceType = 'hour' | 'minute' | 'amPm';

/**
 * Representation of a time value used by the picker.
 */
export type TimeValue = {
	/**
	 * Hour component (two-digit string).
	 */
	hour?: string;
	/**
	 * Minute component (two-digit string).
	 */
	minute?: string;
	/**
	 * AM/PM indicator.
	 */
	amPm?: AmPm;
};

/**
 * Data source arrays provided to the time picker dropdown.
 */
export type TimePickerDropdownSource = {
	/**
	 * Available hour strings.
	 */
	hours: string[];
	/**
	 * Available minute strings.
	 */
	minutes: string[];
};

/**
 * Identifies the start or end position in a time range.
 */
export type TimeRangeIndex = 'start' | 'end';

/**
 * Mode type alias reused from the date-picker component.
 */
export type TimePickerModeType = DatePickerModeType;

/**
 * Value type for the time picker, parameterised by mode.
 */
export type TimePickerValueType<T extends TimePickerModeType> = DatePickerValueType<T>;
