Commit aa152017 authored by Robert Knight's avatar Robert Knight

Add missing types in selection store module

parent 847e6c85
...@@ -216,6 +216,7 @@ const reducers = { ...@@ -216,6 +216,7 @@ const reducers = {
newTab = 'annotation'; newTab = 'annotation';
} }
/** @param {BooleanMap} collection */
const removeAnns = collection => { const removeAnns = collection => {
action.annotationsToRemove.forEach(annotation => { action.annotationsToRemove.forEach(annotation => {
if (annotation.id) { if (annotation.id) {
...@@ -251,6 +252,7 @@ function clearSelection() { ...@@ -251,6 +252,7 @@ function clearSelection() {
* @param {string[]} ids - Identifiers of annotations to select * @param {string[]} ids - Identifiers of annotations to select
*/ */
function selectAnnotations(ids) { function selectAnnotations(ids) {
/** @param {import('redux').Dispatch} dispatch */
return dispatch => { return dispatch => {
dispatch(clearSelection()); dispatch(clearSelection());
dispatch( dispatch(
...@@ -291,7 +293,11 @@ function setForcedVisible(id, visible) { ...@@ -291,7 +293,11 @@ function setForcedVisible(id, visible) {
return makeAction(reducers, 'SET_FORCED_VISIBLE', { id, visible }); return makeAction(reducers, 'SET_FORCED_VISIBLE', { id, visible });
} }
/** Sets the sort key for the annotation list. */ /**
* Sets the sort key for the annotation list.
*
* @param {SortKey} key
*/
function setSortKey(key) { function setSortKey(key) {
return makeAction(reducers, 'SET_SORT_KEY', { key }); return makeAction(reducers, 'SET_SORT_KEY', { key });
} }
...@@ -375,6 +381,7 @@ const sortKeys = createSelector( ...@@ -375,6 +381,7 @@ const sortKeys = createSelector(
/** @param {State} state */ /** @param {State} state */
state => state.selectedTab, state => state.selectedTab,
selectedTab => { selectedTab => {
/** @type {SortKey[]} */
const sortKeysForTab = ['Newest', 'Oldest']; const sortKeysForTab = ['Newest', 'Oldest'];
if (selectedTab !== 'note') { if (selectedTab !== 'note') {
// Location is inapplicable to Notes tab // Location is inapplicable to Notes tab
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment