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