@@ -15,13 +15,10 @@ import { observer } from 'mobx-react';
1515import { GlobalSetting , IPackageManager } from '../../interfaces' ;
1616import { AppState } from '../state' ;
1717
18- /**
19- * @TODO make this a proper enum again once we update Typescript
20- */
21- export const SettingItemType = {
22- EnvVars : GlobalSetting . environmentVariables ,
23- Flags : GlobalSetting . executionFlags ,
24- } as const ;
18+ export enum SettingItemType {
19+ EnvVars = GlobalSetting . environmentVariables ,
20+ Flags = GlobalSetting . executionFlags ,
21+ }
2522
2623interface ExecutionSettingsProps {
2724 appState : AppState ;
@@ -118,11 +115,11 @@ export const ExecutionSettings = observer(
118115 * run with the Electron executable.
119116 *
120117 * @param {React.ChangeEvent<HTMLInputElement> } event
121- * @param {GlobalSetting } type
118+ * @param {SettingItemType } type
122119 */
123120 public handleSettingsItemChange (
124121 event : React . ChangeEvent < HTMLInputElement > ,
125- type : GlobalSetting ,
122+ type : SettingItemType ,
126123 ) {
127124 const { name, value } = event . currentTarget ;
128125
@@ -137,9 +134,9 @@ export const ExecutionSettings = observer(
137134 /**
138135 * Adds a new settings item input field.
139136 *
140- * @param {GlobalSetting } type
137+ * @param {SettingItemType } type
141138 */
142- private addNewSettingsItem ( type : GlobalSetting ) {
139+ private addNewSettingsItem ( type : SettingItemType ) {
143140 const array = Object . entries ( this . state [ type ] ) ;
144141
145142 this . setState ( ( prevState ) => ( {
@@ -163,7 +160,7 @@ export const ExecutionSettings = observer(
163160 appState . packageManager = value as IPackageManager ;
164161 } ;
165162
166- public renderDeleteItem ( idx : string , type : GlobalSetting ) : JSX . Element {
163+ public renderDeleteItem ( idx : string , type : SettingItemType ) : JSX . Element {
167164 const updated = this . state [ type ] ;
168165
169166 const removeFn = ( ) => {
0 commit comments