Types src/content
This commit is contained in:
parent
992b3ac65d
commit
d01db82c0d
62 changed files with 1411 additions and 468 deletions
|
@ -1,19 +1,19 @@
|
|||
import actions from 'content/actions';
|
||||
import messages from 'shared/messages';
|
||||
import * as actions from './index';
|
||||
import * as messages from '../../shared/messages';
|
||||
|
||||
const startSet = () => {
|
||||
const startSet = (): actions.MarkAction => {
|
||||
return { type: actions.MARK_START_SET };
|
||||
};
|
||||
|
||||
const startJump = () => {
|
||||
const startJump = (): actions.MarkAction => {
|
||||
return { type: actions.MARK_START_JUMP };
|
||||
};
|
||||
|
||||
const cancel = () => {
|
||||
const cancel = (): actions.MarkAction => {
|
||||
return { type: actions.MARK_CANCEL };
|
||||
};
|
||||
|
||||
const setLocal = (key, x, y) => {
|
||||
const setLocal = (key: string, x: number, y: number): actions.MarkAction => {
|
||||
return {
|
||||
type: actions.MARK_SET_LOCAL,
|
||||
key,
|
||||
|
@ -22,22 +22,22 @@ const setLocal = (key, x, y) => {
|
|||
};
|
||||
};
|
||||
|
||||
const setGlobal = (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: '' };
|
||||
return { type: actions.NOOP };
|
||||
};
|
||||
|
||||
const jumpGlobal = (key) => {
|
||||
const jumpGlobal = (key: string): actions.MarkAction => {
|
||||
browser.runtime.sendMessage({
|
||||
type: messages.MARK_JUMP_GLOBAL,
|
||||
key,
|
||||
});
|
||||
return { type: '' };
|
||||
return { type: actions.NOOP };
|
||||
};
|
||||
|
||||
export {
|
||||
|
|
Reference in a new issue