This repository has been archived on 2020-04-04. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
Vim-Vixen/src/content/actions/mark.ts
2019-05-05 23:59:59 +09:00

46 lines
986 B
TypeScript

import * as actions from './index';
import * as messages from '../../shared/messages';
const startSet = (): actions.MarkAction => {
return { type: actions.MARK_START_SET };
};
const startJump = (): actions.MarkAction => {
return { type: actions.MARK_START_JUMP };
};
const cancel = (): actions.MarkAction => {
return { type: actions.MARK_CANCEL };
};
const setLocal = (key: string, x: number, y: number): actions.MarkAction => {
return {
type: actions.MARK_SET_LOCAL,
key,
x,
y,
};
};
const setGlobal = (key: string, x: number, y: number): actions.MarkAction => {
browser.runtime.sendMessage({
type: messages.MARK_SET_GLOBAL,
key,
x,
y,
});
return { type: actions.NOOP };
};
const jumpGlobal = (key: string): actions.MarkAction => {
browser.runtime.sendMessage({
type: messages.MARK_JUMP_GLOBAL,
key,
});
return { type: actions.NOOP };
};
export {
startSet, startJump, cancel, setLocal,
setGlobal, jumpGlobal,
};