@@ -15,13 +15,10 @@ import { observer } from 'mobx-react';
15
15
import { GlobalSetting , IPackageManager } from '../../interfaces' ;
16
16
import { AppState } from '../state' ;
17
17
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
+ }
25
22
26
23
interface ExecutionSettingsProps {
27
24
appState : AppState ;
@@ -118,11 +115,11 @@ export const ExecutionSettings = observer(
118
115
* run with the Electron executable.
119
116
*
120
117
* @param {React.ChangeEvent<HTMLInputElement> } event
121
- * @param {GlobalSetting } type
118
+ * @param {SettingItemType } type
122
119
*/
123
120
public handleSettingsItemChange (
124
121
event : React . ChangeEvent < HTMLInputElement > ,
125
- type : GlobalSetting ,
122
+ type : SettingItemType ,
126
123
) {
127
124
const { name, value } = event . currentTarget ;
128
125
@@ -137,9 +134,9 @@ export const ExecutionSettings = observer(
137
134
/**
138
135
* Adds a new settings item input field.
139
136
*
140
- * @param {GlobalSetting } type
137
+ * @param {SettingItemType } type
141
138
*/
142
- private addNewSettingsItem ( type : GlobalSetting ) {
139
+ private addNewSettingsItem ( type : SettingItemType ) {
143
140
const array = Object . entries ( this . state [ type ] ) ;
144
141
145
142
this . setState ( ( prevState ) => ( {
@@ -163,7 +160,7 @@ export const ExecutionSettings = observer(
163
160
appState . packageManager = value as IPackageManager ;
164
161
} ;
165
162
166
- public renderDeleteItem ( idx : string , type : GlobalSetting ) : JSX . Element {
163
+ public renderDeleteItem ( idx : string , type : SettingItemType ) : JSX . Element {
167
164
const updated = this . state [ type ] ;
168
165
169
166
const removeFn = ( ) => {
0 commit comments