"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.sortByFieldType = sortByFieldType;
const index_1 = require("../enums/index");
const index_2 = require("./index");
const dateUtilities_1 = require("./dateUtilities");
const utilities_1 = require("../services/utilities");
function sortByFieldType(fieldType, value1, value2, sortDirection, sortColumn, gridOptions) {
    let sortResult = 0;
    if ((0, utilities_1.isColumnDateType)(fieldType)) {
        // @ts-ignore
        sortResult = (0, dateUtilities_1.getAssociatedDateSortComparer)(fieldType).call(this, value1, value2, sortDirection, sortColumn, gridOptions);
    }
    else {
        switch (fieldType) {
            case index_1.FieldType.boolean:
                sortResult = index_2.SortComparers.boolean(value1, value2, sortDirection, sortColumn, gridOptions);
                break;
            case index_1.FieldType.float:
            case index_1.FieldType.integer:
            case index_1.FieldType.number:
                sortResult = index_2.SortComparers.numeric(value1, value2, sortDirection, sortColumn, gridOptions);
                break;
            case index_1.FieldType.object:
                sortResult = index_2.SortComparers.objectString(value1, value2, sortDirection, sortColumn, gridOptions);
                break;
            case index_1.FieldType.string:
            case index_1.FieldType.text:
            case index_1.FieldType.password:
            case index_1.FieldType.readonly:
            default:
                sortResult = index_2.SortComparers.string(value1, value2, sortDirection, sortColumn, gridOptions);
                break;
        }
    }
    return sortResult;
}
//# sourceMappingURL=sortUtilities.js.map