import { SelectableCountries } from '../api/models/stamp-duty-rates.types'; import { SerializableStampDutyRate } from '../serializers'; /** * Data from dbapi comes as an array of objects sorted by id. * * ``` * [ * { * "id": 20, * "country_name": "Scotland", * ... * ... * ... * "tax_type": "base", * ... * }, * { * "id": 21, * "country_name": "Wales", * ... * ... * ... * "tax_type": "base", * ... * }, * ``` * * This function helps to organise the data by grouping said objects * under the key passed as an argument (country name or tax type in this case). * Then useStampDutyCalculator can use only the type of data * required for the current calculation under the circunstances and location selected. * * ``` * rates: { * Scotland: { * { * "id": 20, * "country_name": "Scotland", * ... * ... * ... * "tax_type": "base", * ... * }, * ... * }, * Wales: { * { * "id": 21, * "country_name": "Wales", * ... * ... * ... * "tax_type": "base", * ... * }, * ... * }, * ``` * * or * ``` * rates: { * base: { * { * "id": 20, * "country_name": "Scotland", * ... * ... * ... * "tax_type": "base", * ... * }, * ... * }, * first_time_buyer: { * { * "id": 27, * "country_name": "Scotland", * ... * ... * ... * "tax_type": "first_time_buyer", * ... * }, * ... * }, * ``` */ export default function groupedByKey(rates: SerializableStampDutyRate[], key: keyof SerializableStampDutyRate): any; export declare const groupByCountryAndTaxType: (arr: SerializableStampDutyRate[]) => {}; export declare const sortByRanges: (arr: SerializableStampDutyRate[]) => SerializableStampDutyRate[]; /** * Results come sorted by ID, we need them sorted by asc values * for minimum_property_price for each rate type */ export declare const arrangeDataByRateTypeSortedAndCountry: (data: any, country: SelectableCountries) => any; //# sourceMappingURL=stamp-duty-utils.d.ts.map