import { isMac } from "../utils/platform.js";
import { ModKey as MK } from "./const.js";
class ShortCutFormatter {
    #map = new Map();
    set(name, defs) {
        if (Array.isArray(defs)) {
            this.#map.set(name, defs);
        }
        else {
            const platformedDefs = defs[isMac() ? 'mac' : 'pc'];
            if (platformedDefs) {
                this.#map.set(name, platformedDefs);
            }
        }
        return this;
    }
    toPM(name) {
        const defs = this.#map.get(name);
        if (!defs)
            return null;
        return defs.join('-');
    }
    toCM(name) {
        const defs = this.#map.get(name);
        if (!defs)
            return null;
        return defs.sort((a) => (a === MK.Shift ? -1 : 0)).join('-');
    }
    toView(name) {
        const defs = this.#map.get(name);
        return defs?.join('+');
    }
}
export const formatter = new ShortCutFormatter();
//# sourceMappingURL=formatter.js.map
