@@ -152,6 +152,35 @@ export interface IBoardConfigItem {
152
152
options : IBoardConfigOption [ ] ;
153
153
}
154
154
155
+ /**
156
+ * Return values of calls to IBoard.loadConfig() and IBoard.updateConfig().
157
+ */
158
+ export enum BoardConfigResult {
159
+ /**
160
+ * Setting configuration value(s) was successful
161
+ */
162
+ Success ,
163
+ /**
164
+ * Setting configuration value(s) was successful. All or some items
165
+ * were already set to the requested values.
166
+ */
167
+ SuccessNoChange ,
168
+ /**
169
+ * One or more configuration keys were invalid.
170
+ */
171
+ InvalidConfigID ,
172
+ /**
173
+ * One or more options were invalid.
174
+ */
175
+ InvalidOptionID ,
176
+ /**
177
+ * Can only happen when calling IBoard.loadConfig() and when
178
+ * the raw configuration string did contain invalid/unparsable
179
+ * elements.
180
+ */
181
+ InvalidFormat ,
182
+ }
183
+
155
184
/**
156
185
* Interface for classes that represent an Arduino supported board.
157
186
*
@@ -179,7 +208,7 @@ export interface IBoard {
179
208
180
209
/**
181
210
* Reference to the platform that contains this board.
182
- * @prop {IPlatform }
211
+ * @property {IPlatform }
183
212
*/
184
213
platform : IPlatform ;
185
214
@@ -206,14 +235,32 @@ export interface IBoard {
206
235
getBuildConfig ( ) : string ;
207
236
208
237
/**
209
- * Load default configuration from saved context.
238
+ * Load configuration from saved context.
239
+ * Parses the configuration string and tries to set the individual
240
+ * configuration values. It will bail out on any error.
241
+ * @param {string } configString The configuration string from the
242
+ * configuration file.
243
+ * @returns {BoardConfigResult } Result of the operation - for more
244
+ * information see documentation of BoardConfigResult.
245
+ */
246
+ loadConfig ( configString : string ) : BoardConfigResult ;
247
+
248
+ /**
249
+ * Set configuration value.
250
+ * This function makes sure, that the configuration ID and the option ID
251
+ * are actually valid. It will bail out on any error
252
+ * @param {string } configId The ID of the configuration value
253
+ * @param {string } optionId The ID to which the option of the configuration
254
+ * value should be set to.
255
+ * @returns {BoardConfigResult } Result of the operation - for more
256
+ * information see documentation of BoardConfigResult.
210
257
*/
211
- loadConfig ( configString : string ) : void ;
258
+ updateConfig ( configId : string , optionId : string ) : BoardConfigResult ;
212
259
213
260
/**
214
- * Update the configuration
261
+ * Reset configuration to defaults and update configuration file.
215
262
*/
216
- updateConfig ( configId : string , optionId : string ) : boolean ;
263
+ resetConfig ( ) ;
217
264
218
265
/**
219
266
* Get the board package name
0 commit comments