diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2019-05-02 14:08:51 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2019-05-05 23:59:59 +0900 |
commit | d01db82c0dca352de2d7644c383d388fc3ec0366 (patch) | |
tree | ff09ebc545ce00192dff9e1119b0c9e2cf92fdef /src/content/reducers/mark.ts | |
parent | 992b3ac65d7fe86ac7bc3b560960c8bcf86bec69 (diff) |
Types src/content
Diffstat (limited to 'src/content/reducers/mark.ts')
-rw-r--r-- | src/content/reducers/mark.ts | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/content/reducers/mark.ts b/src/content/reducers/mark.ts index 2c96cc5..e78b7b9 100644 --- a/src/content/reducers/mark.ts +++ b/src/content/reducers/mark.ts @@ -1,12 +1,26 @@ -import actions from 'content/actions'; +import * as actions from '../actions'; -const defaultState = { +interface Mark { + x: number; + y: number; +} + +export interface State { + setMode: boolean; + jumpMode: boolean; + marks: { [key: string]: Mark }; +} + +const defaultState: State = { setMode: false, jumpMode: false, marks: {}, }; -export default function reducer(state = defaultState, action = {}) { +export default function reducer( + state: State = defaultState, + action: actions.MarkAction, +): State { switch (action.type) { case actions.MARK_START_SET: return { ...state, setMode: true }; |