@@ -2,20 +2,20 @@ import Config, { setConfig } from "../../config";
22import { capitalizeFirstLetterOfEachWord } from "../../utils/strings" ;
33import * as ThemeController from "../../controllers/theme-controller" ;
44import { Command , CommandsSubgroup } from "../types" ;
5- import { Theme , ThemesList } from "../../constants/themes" ;
5+ import { ThemesList , ThemeWithName } from "../../constants/themes" ;
66import { not } from "@monkeytype/util/predicates" ;
77import * as ConfigEvent from "../../observables/config-event" ;
88import * as Misc from "../../utils/misc" ;
99
10- const isFavorite = ( theme : Theme ) : boolean =>
10+ const isFavorite = ( theme : ThemeWithName ) : boolean =>
1111 Config . favThemes . includes ( theme . name ) ;
1212
1313/**
1414 * creates a theme command object for the given theme
1515 * @param theme the theme to create a command for
1616 * @returns a command object for the theme
1717 */
18- const createThemeCommand = ( theme : Theme ) : Command => {
18+ const createThemeCommand = ( theme : ThemeWithName ) : Command => {
1919 return {
2020 id : "changeTheme" + capitalizeFirstLetterOfEachWord ( theme . name ) ,
2121 display : theme . name . replace ( / _ / g, " " ) ,
@@ -43,7 +43,7 @@ const createThemeCommand = (theme: Theme): Command => {
4343 * @param themes the themes to sort
4444 * @returns sorted array of themes
4545 */
46- const sortThemesByFavorite = ( themes : Theme [ ] ) : Theme [ ] => [
46+ const sortThemesByFavorite = ( themes : ThemeWithName [ ] ) : ThemeWithName [ ] => [
4747 ...themes . filter ( isFavorite ) ,
4848 ...themes . filter ( not ( isFavorite ) ) ,
4949] ;
@@ -65,7 +65,7 @@ const commands: Command[] = [
6565 } ,
6666] ;
6767
68- export function update ( themes : Theme [ ] ) : void {
68+ export function update ( themes : ThemeWithName [ ] ) : void {
6969 // clear the current list
7070 subgroup . list = [ ] ;
7171
0 commit comments