"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.updateKaitianIconMap = exports.getKaitianIcon = exports.getIcon = exports.getIconShapeClxList = exports.updateIconMap = exports.ANIM_TYPE = exports.ROTATE_TYPE = void 0;
const iconManager_1 = require("./iconfont/iconManager");
var ROTATE_TYPE;
(function (ROTATE_TYPE) {
    ROTATE_TYPE[ROTATE_TYPE["rotate_90"] = 0] = "rotate_90";
    ROTATE_TYPE[ROTATE_TYPE["rotate_180"] = 1] = "rotate_180";
    ROTATE_TYPE[ROTATE_TYPE["rotate_270"] = 2] = "rotate_270";
    ROTATE_TYPE[ROTATE_TYPE["flip_horizontal"] = 3] = "flip_horizontal";
    ROTATE_TYPE[ROTATE_TYPE["flip_vertical"] = 4] = "flip_vertical";
    ROTATE_TYPE[ROTATE_TYPE["flip_both"] = 5] = "flip_both";
})(ROTATE_TYPE = exports.ROTATE_TYPE || (exports.ROTATE_TYPE = {}));
var ANIM_TYPE;
(function (ANIM_TYPE) {
    ANIM_TYPE[ANIM_TYPE["spin"] = 0] = "spin";
    ANIM_TYPE[ANIM_TYPE["pulse"] = 1] = "pulse";
})(ANIM_TYPE = exports.ANIM_TYPE || (exports.ANIM_TYPE = {}));
const ROTATE_CLASS_NAME = ['rotate-90', 'rotate-180', 'rotate-270', 'flip-horizontal', 'flip-vertical', 'flip-both'];
const ANIM_CLASS_NAME = ['spin', 'pulse'];
function updateIconMap(prefix, customIconMap) {
    iconManager_1.iconManager.update(prefix, customIconMap);
}
exports.updateIconMap = updateIconMap;
function getIconShapeClxList(options) {
    const { rotate, anim, fill } = options || {};
    const iconClassList = [];
    if (rotate !== undefined) {
        iconClassList.push(`iconfont-${ROTATE_CLASS_NAME[rotate]}`);
    }
    if (anim !== undefined) {
        iconClassList.push(`iconfont-anim-${ANIM_CLASS_NAME[anim]}`);
    }
    if (fill) {
        iconClassList.push('toggled');
    }
    return iconClassList;
}
exports.getIconShapeClxList = getIconShapeClxList;
/**
 * 获取 icon className
 * @param iconKey
 * @param options
 * @return 获取拼接好的 className，如果拿不到则返回空字符串
 */
function getIcon(iconKey, options) {
    const iconClassList = iconManager_1.iconManager.getIconClx(iconKey);
    const iconShapeClxList = getIconShapeClxList(options);
    iconClassList.push(...iconShapeClxList);
    return iconClassList.join(' ');
}
exports.getIcon = getIcon;
/**
 * @deprecated please use `getIcon` instead
 */
exports.getKaitianIcon = getIcon;
/**
 * @deprecated please use `updateIconMap` instead
 */
exports.updateKaitianIconMap = updateIconMap;
//# sourceMappingURL=util.js.map