import { FieldType } from '../enums/index.js';
import { SortComparers } from './index.js';
import { getAssociatedDateSortComparer } from './dateUtilities.js';
import { isColumnDateType } from '../services/utilities.js';
export function sortByFieldType(fieldType, value1, value2, sortDirection, sortColumn, gridOptions) {
    let sortResult = 0;
    if (isColumnDateType(fieldType)) {
        // @ts-ignore
        sortResult = getAssociatedDateSortComparer(fieldType).call(this, value1, value2, sortDirection, sortColumn, gridOptions);
    }
    else {
        switch (fieldType) {
            case FieldType.boolean:
                sortResult = SortComparers.boolean(value1, value2, sortDirection, sortColumn, gridOptions);
                break;
            case FieldType.float:
            case FieldType.integer:
            case FieldType.number:
                sortResult = SortComparers.numeric(value1, value2, sortDirection, sortColumn, gridOptions);
                break;
            case FieldType.object:
                sortResult = SortComparers.objectString(value1, value2, sortDirection, sortColumn, gridOptions);
                break;
            case FieldType.string:
            case FieldType.text:
            case FieldType.password:
            case FieldType.readonly:
            default:
                sortResult = SortComparers.string(value1, value2, sortDirection, sortColumn, gridOptions);
                break;
        }
    }
    return sortResult;
}
//# sourceMappingURL=sortUtilities.js.map