@@ -40,7 +40,7 @@ export class SuggestionGroceryList implements ISuggestionGroceryList {
4040 */
4141 private readonly _suggestionGroceryItems = new Map < string , SuggestionGroceryItem > ( ) ;
4242 private _inStagingMode = false ;
43- public get inStagingMode ( ) {
43+ public get inStagingMode ( ) : boolean {
4444 return this . _inStagingMode ;
4545 }
4646
@@ -86,7 +86,7 @@ export class SuggestionGroceryList implements ISuggestionGroceryList {
8686 }
8787 }
8888
89- public readonly addItem = ( name : string ) => {
89+ public readonly addItem = ( name : string ) : void => {
9090 if ( this . _inStagingMode ) {
9191 // Use timestamp as a hack for a consistent sortable order. Prefixed with 'z' to sort last.
9292 const suggestedAddition = new SuggestionGroceryItem (
@@ -116,7 +116,7 @@ export class SuggestionGroceryList implements ISuggestionGroceryList {
116116 ) ;
117117 } ;
118118
119- public readonly removeItem = ( id : string ) => {
119+ public readonly removeItem = ( id : string ) : void => {
120120 if ( this . _inStagingMode ) {
121121 const suggestedRemoval = this . _suggestionGroceryItems . get ( id ) ;
122122 if ( suggestedRemoval !== undefined ) {
@@ -133,8 +133,8 @@ export class SuggestionGroceryList implements ISuggestionGroceryList {
133133 }
134134 } ;
135135
136- public readonly getSuggestions = ( ) => {
137- const asyncGetSuggestions = async ( ) => {
136+ public readonly getSuggestions = ( ) : void => {
137+ const asyncGetSuggestions = async ( ) : Promise < void > => {
138138 const { adds, removals } = await getChangesFromHealthBot ( this . groceryList ) ;
139139 // Check to make sure we are still in staging mode after we get the results - if not, then just
140140 // discard the suggestions. Alternatively, we could wait for the network call to return before
@@ -154,7 +154,7 @@ export class SuggestionGroceryList implements ISuggestionGroceryList {
154154 asyncGetSuggestions ( ) . catch ( console . error ) ;
155155 } ;
156156
157- public readonly acceptSuggestions = ( ) => {
157+ public readonly acceptSuggestions = ( ) : void => {
158158 const adds = [ ...this . _suggestionGroceryItems . values ( ) ] . filter (
159159 ( item ) => item . suggestion === "add" ,
160160 ) ;
@@ -175,7 +175,7 @@ export class SuggestionGroceryList implements ISuggestionGroceryList {
175175 this . _events . emit ( "leaveStagingMode" ) ;
176176 } ;
177177
178- public readonly rejectSuggestions = ( ) => {
178+ public readonly rejectSuggestions = ( ) : void => {
179179 for ( const item of this . _suggestionGroceryItems . values ( ) ) {
180180 if ( item . suggestion === "add" ) {
181181 item . removeItem ( ) ;
@@ -188,7 +188,7 @@ export class SuggestionGroceryList implements ISuggestionGroceryList {
188188 this . _events . emit ( "leaveStagingMode" ) ;
189189 } ;
190190
191- private readonly onItemAdded = ( item : IGroceryItem ) => {
191+ private readonly onItemAdded = ( item : IGroceryItem ) : void => {
192192 const addedItem = new SuggestionGroceryItem (
193193 item . id ,
194194 item . name ,
@@ -207,7 +207,7 @@ export class SuggestionGroceryList implements ISuggestionGroceryList {
207207 this . _events . emit ( "itemAdded" , addedItem ) ;
208208 } ;
209209
210- private readonly onItemRemoved = ( item : IGroceryItem ) => {
210+ private readonly onItemRemoved = ( item : IGroceryItem ) : void => {
211211 const removedItem = this . _suggestionGroceryItems . get ( item . id ) ;
212212 this . _suggestionGroceryItems . delete ( item . id ) ;
213213 this . _events . emit ( "itemRemoved" , removedItem ) ;
0 commit comments