import { ChangeEvent } from 'react';
import { DateFormatOptions, RegionInfoModel } from '../../models';

type SelectCallback = string | ChangeEvent<HTMLSelectElement>;
type DateFormatMap<T extends {} = any> = (format: DateFormatOptions) => T;
/**
 * The data returned from the useKosRegions hook.
 * @typeParam RegionData - the region data returned from the backend service.  The type must extend BaseRegionResponse from the kos-core-model.
 * @typeParam T - the type of the options returned from the regionMap function.
 */
export interface KosDateFormatHookData<T extends {} = any> {
    /**the raw region data returned from the backend service. */
    raw: string[];
    /**the region model returned from the backend service. */
    regionModel?: RegionInfoModel;
    /**the currently selected region. */
    selectedDateFormat: string;
    dateFormatId: string;
    /**a function that can be used to update the region. */
    updateDateFormat: (e: SelectCallback) => void;
    /**the props that can be spread into a select box component. */
    props: {
        onChange: (e: SelectCallback) => void;
        value: string;
        options: T[];
    };
}
/**
 * A hook that will help manage the use of region date formats on a dispenser.
 * @param dateFormatMap - a function that maps a region string a structure that can be
 * used as an option in a select box.  The default is to return an option element
 * with the date format as the value and label.
 * @returns KosDateFormatHookData - the data returned from the hook.
 * @example
 * In this example the default region map is used to populate a select box with the available regions.  If using a third party select box component where the options
 * are passed in as a prop, the options property can be spread into the props for the component.   In this case, a region map function could be passed in to map the region
 * to a structure that the component expects.
 *
 *
 * ```typescript
 * interface RegionData extends RegionServices.BaseRegionResponse {
 *  rfidRegion: string;
 * }
 * const { regionSelectProps, regionModel, regionData, selectedRegion, updateRegion } = useKosRegions<RegionData>();
 * const { options, ...selectAttributes } = regionSelectProps;
 * ...
 * <div>
 *   <label>Select region: </label>
 *   <select {...selectAttributes}>{options}</select>
 * </div>
 * <div>Selected Region: {selectedRegion}</div>
 * <div>Region Data: {regionData?.rfidRegion}</div>
 * ```
 */
export declare const useKosDateFormats: <T extends {} = any>(dateFormatMap?: DateFormatMap<T>) => KosDateFormatHookData<T>;
export {};
//# sourceMappingURL=use-kos-date-formats.d.ts.map