Typescriptify main.js

This commit is contained in:
Scott Nonnenberg 2021-10-01 11:49:59 -07:00 committed by GitHub
parent e033fd2cf3
commit 9a1430a460
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 721 additions and 524 deletions

View file

@ -8,7 +8,7 @@ import { LocaleMessagesType } from '../ts/types/I18N';
export type MenuListType = Array<MenuItemConstructorOptions>;
type OptionsType = {
export type MenuOptionsType = {
// options
development: boolean;
devTools: boolean;
@ -17,6 +17,7 @@ type OptionsType = {
platform: string;
// actions
forceUpdate: () => unknown;
openContactUs: () => unknown;
openForums: () => unknown;
openJoinTheBeta: () => unknown;
@ -24,7 +25,6 @@ type OptionsType = {
openSupportPage: () => unknown;
setupAsNewDevice: () => unknown;
setupAsStandalone: () => unknown;
forceUpdate: () => unknown;
showAbout: () => unknown;
showDebugLog: () => unknown;
showKeyboardShortcuts: () => unknown;
@ -34,7 +34,7 @@ type OptionsType = {
};
export const createTemplate = (
options: OptionsType,
options: MenuOptionsType,
messages: LocaleMessagesType
): MenuListType => {
if (!isString(options.platform)) {
@ -265,7 +265,7 @@ export const createTemplate = (
function updateForMac(
template: MenuListType,
messages: LocaleMessagesType,
options: OptionsType
options: MenuOptionsType
): MenuListType {
const { showAbout, showSettings, showWindow } = options;