@@ -191,8 +191,30 @@ export interface UpdateDialog {
191
191
*/
192
192
title ?: string ;
193
193
}
194
-
195
- declare namespace CodePush {
194
+
195
+ export interface StatusReport {
196
+ /**
197
+ * Whether the deployment succeeded or failed.
198
+ */
199
+ status : CodePush . DeploymentStatus ;
200
+
201
+ /**
202
+ * Details of the package that was deployed (or attempted to).
203
+ */
204
+ package : Package ;
205
+
206
+ /**
207
+ * Deployment key used when deploying the previous package.
208
+ */
209
+ previousDeploymentKey ?: string ;
210
+
211
+ /**
212
+ * The label (v#) of the package that was upgraded from.
213
+ */
214
+ previousLabelOrAppVersion ?: string ;
215
+ }
216
+
217
+ declare namespace CodePush {
196
218
/**
197
219
* Represents the default settings that will be used by the sync method if
198
220
* an update dialog is configured to be displayed.
@@ -216,7 +238,7 @@ declare namespace CodePush {
216
238
/**
217
239
* Notifies the CodePush runtime that an installed update is considered successful.
218
240
*/
219
- function notifyAppReady ( ) : Promise < void > ;
241
+ function notifyAppReady ( ) : Promise < StatusReport > ;
220
242
221
243
/**
222
244
* Allow CodePush to restart the app.
@@ -273,74 +295,89 @@ declare namespace CodePush {
273
295
* The CodePush server is being queried for an update.
274
296
*/
275
297
CHECKING_FOR_UPDATE ,
276
-
298
+
277
299
/**
278
300
* An update is available, and a confirmation dialog was shown
279
301
* to the end user. (This is only applicable when the updateDialog is used)
280
302
*/
281
303
AWAITING_USER_ACTION ,
282
-
304
+
283
305
/**
284
306
* An available update is being downloaded from the CodePush server.
285
307
*/
286
308
DOWNLOADING_PACKAGE ,
287
-
309
+
288
310
/**
289
311
* An available update was downloaded and is about to be installed.
290
312
*/
291
313
INSTALLING_UPDATE ,
292
-
293
- /**
314
+
315
+ /**
294
316
* The app is up-to-date with the CodePush server.
295
317
*/
296
318
UP_TO_DATE ,
297
-
319
+
298
320
/**
299
321
* The app had an optional update which the end user chose to ignore.
300
322
* (This is only applicable when the updateDialog is used)
301
323
*/
302
324
UPDATE_IGNORED ,
303
-
325
+
304
326
/**
305
327
* An available update has been installed and will be run either immediately after the
306
328
* syncStatusChangedCallback function returns or the next time the app resumes/restarts,
307
329
* depending on the InstallMode specified in SyncOptions
308
330
*/
309
331
UPDATE_INSTALLED ,
310
-
332
+
311
333
/**
312
334
* There is an ongoing sync operation running which prevents the current call from being executed.
313
335
*/
314
336
SYNC_IN_PROGRESS ,
315
-
337
+
316
338
/**
317
339
* The sync operation encountered an unknown error.
318
340
*/
319
341
UNKNOWN_ERROR
320
342
}
321
-
343
+
322
344
/**
323
345
* Indicates the state that an update is currently in.
324
346
*/
325
347
enum UpdateState {
326
348
/**
327
349
* Indicates that an update represents the
328
- * version of the app that is currently running.
350
+ * version of the app that is currently running.
329
351
*/
330
352
RUNNING ,
331
-
353
+
332
354
/**
333
355
* Indicates than an update has been installed, but the
334
356
* app hasn't been restarted yet in order to apply it.
335
357
*/
336
358
PENDING ,
337
-
359
+
338
360
/**
339
361
* Indicates than an update represents the latest available
340
362
* release, and can be either currently running or pending.
341
363
*/
342
364
LATEST
343
365
}
366
+
367
+ /**
368
+ * Indicates the status of a deployment (after installing and restarting).
369
+ */
370
+ enum DeploymentStatus {
371
+ /**
372
+ * The deployment failed.
373
+ */
374
+ FAILED ,
375
+
376
+ /**
377
+ * The deployment succeeded.
378
+ */
379
+ SUCCEEDED
380
+ }
344
381
}
345
382
346
- export default CodePush ;
383
+ export default CodePush ;
0 commit comments