@@ -100,6 +100,25 @@ export enum ConnectionStatus {
100
100
RECONNECTING = "RECONNECTING" ,
101
101
}
102
102
103
+ export interface FlashOptions {
104
+ /**
105
+ * True to use a partial flash where possible, false to force a full flash.
106
+ */
107
+ partial : boolean ;
108
+ /**
109
+ * A progress callback. Called with undefined when the process is complete or has failed.
110
+ *
111
+ * Requesting a partial flash doesn't guarantee one is performed. Partial flashes are avoided
112
+ * if too many blocks have changed and failed partial flashes are retried as full flashes.
113
+ * The partial parameter reports the flash type currently in progress.
114
+ */
115
+ progress : ( percentage : number | undefined , partial : boolean ) => void ;
116
+ /**
117
+ * Smallest possible progress increment to limit callback rate.
118
+ */
119
+ minimumProgressIncrement ?: number ;
120
+ }
121
+
103
122
export class FlashDataError extends Error { }
104
123
105
124
export type FlashDataSource = (
@@ -201,23 +220,7 @@ export interface DeviceConnection
201
220
* @param dataSource The data to use.
202
221
* @param options Flash options and progress callback.
203
222
*/
204
- flash ?(
205
- dataSource : FlashDataSource ,
206
- options : {
207
- /**
208
- * True to use a partial flash where possible, false to force a full flash.
209
- */
210
- partial : boolean ;
211
- /**
212
- * A progress callback. Called with undefined when the process is complete or has failed.
213
- *
214
- * Requesting a partial flash doesn't guarantee one is performed. Partial flashes are avoided
215
- * if too many blocks have changed and failed partial flashes are retried as full flashes.
216
- * The partial parameter reports the flash type currently in progress.
217
- */
218
- progress : ( percentage : number | undefined , partial : boolean ) => void ;
219
- } ,
220
- ) : Promise < void > ;
223
+ flash ?( dataSource : FlashDataSource , options : { } ) : Promise < void > ;
221
224
222
225
/**
223
226
* Disconnect from the device.
0 commit comments