function map(new_keystroke, old_keystroke, domain, new_annotation) {
        if (_isDomainApplicable(domain)) {
            if (old_keystroke[0] === ':' && old_keystroke.length > 1) {
                var cmdline = old_keystroke.substr(1);
                var keybound = createKeyTarget(function () {
                    front.executeCommand(cmdline);
                }, new_annotation ? parseAnnotation({ annotation: new_annotation }) : null, false);
                normal.mappings.add(KeyboardUtils.encodeKeystroke(new_keystroke), keybound);
            } else {
                if (!mapInMode(normal, new_keystroke, old_keystroke, new_annotation) && old_keystroke in Mode.specialKeys) {
                    Mode.specialKeys[old_keystroke].push(new_keystroke);
                    dispatchSKEvent("front", ['addMapkey', "Mode", new_keystroke, old_keystroke]);
                } else {
                    LOG("warn", `${old_keystroke} not found in normal mode.`);
                }
            }
        }
    }
Map a key sequence to another in normal mode.

@param {string} new_keystroke a key sequence to replace
@param {string} old_keystroke a key sequence to be replaced
@param {regex} [domain=null] a Javascript regex pattern to identify the domains that this mapping works.
@param {string} [new_annotation=null] use it instead of the annotation from old_keystroke if provided.

@example
map(';d', '<Ctrl-Alt-d>');