// 假设 HotkeyParames 类的定义如下
class HotkeyParames {
    static CombHotKey(key: string): string {
        // 实现具体逻辑
        return key;
    }
    static GetNameByValue(keyValue: string): string {
        // 实现具体逻辑
        return keyValue;
    }
    static Separator: string = ",";
}

// 假设 Keyboard 类的定义如下
class Keyboard {
    static get Modifiers() {
        // 实现具体逻辑
        return { toString: () => "none" };
    }
}

// 定义 Key 类型
type Key = string;

export class HotKeyHelper {
    private static _dicKeys: { [key: string]: string } = null;

    public static SetHotKey(dicKeys: { [key: string]: string }) {
        if (Object.keys(dicKeys).length === 0) {
            return;
        }
        this._dicKeys = dicKeys;
    }

    public static GetHotKey() {
        return this._dicKeys;
    }

    public static GetKeyName(keyValue: Key) {
        if (this._dicKeys === null) return "";
        let key = HotkeyParames.CombHotKey(HotkeyParames.GetNameByValue(keyValue)).replace(" ", "");
        if (Keyboard.Modifiers.toString().toLowerCase() === "none" && key.includes("Ctrl")) {
            key = key.replace("Ctrl+", "");
        }
        if (key.length <= 0) return "";
        const result = Object.entries(this._dicKeys)
           .find(([_, value]) => value.startsWith(`${key}${HotkeyParames.Separator}`) || value.includes(`${HotkeyParames.Separator}${key}${HotkeyParames.Separator}`))
           ?.[0].toUpperCase().trim();

        return result;
    }

    public static GetKeyValue(keyName: string) {
        if (this._dicKeys === null) return "";
        const result = Object.entries(this._dicKeys)
           .find(([key]) => key === keyName.toLowerCase())
           ?.[1].replace(HotkeyParames.Separator, "; ");

        return result;
    }

    public static get IsShift() {
        return Keyboard.Modifiers.toString().toLowerCase() === "shift";
    }

    public static get IsControl() {
        return Keyboard.Modifiers.toString().toLowerCase() === "control";
    }

    public static get IsAlt() {
        return Keyboard.Modifiers.toString().toLowerCase() === "alt";
    }
}