@appzung/react-native-code-push 10.0.0 → 10.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/README.md +3 -3
  2. package/android/app/src/main/java/com/appzung/codepush/react/CodePushNativeModule.java +14 -0
  3. package/ios/CodePush/CodePush.h +1 -0
  4. package/ios/CodePush/CodePush.m +64 -13
  5. package/lib/commonjs/CodePush.js +6 -2
  6. package/lib/commonjs/CodePush.js.map +1 -1
  7. package/lib/commonjs/allowRestart.js +2 -0
  8. package/lib/commonjs/allowRestart.js.map +1 -1
  9. package/lib/commonjs/clearUpdates.js +2 -1
  10. package/lib/commonjs/clearUpdates.js.map +1 -1
  11. package/lib/commonjs/disallowRestart.js +2 -0
  12. package/lib/commonjs/disallowRestart.js.map +1 -1
  13. package/lib/commonjs/enums/CheckFrequency.enum.js +2 -2
  14. package/lib/commonjs/enums/InstallMode.enum.js +7 -3
  15. package/lib/commonjs/enums/InstallMode.enum.js.map +1 -1
  16. package/lib/commonjs/enums/SyncStatus.enum.js +7 -7
  17. package/lib/commonjs/enums/UpdateState.enum.js +7 -6
  18. package/lib/commonjs/enums/UpdateState.enum.js.map +1 -1
  19. package/lib/commonjs/getClientUniqueId.js +16 -0
  20. package/lib/commonjs/getClientUniqueId.js.map +1 -0
  21. package/lib/commonjs/index.js +24 -0
  22. package/lib/commonjs/index.js.map +1 -1
  23. package/lib/commonjs/internals/getConfiguration.js +4 -0
  24. package/lib/commonjs/internals/getConfiguration.js.map +1 -1
  25. package/lib/commonjs/internals/version.js +1 -1
  26. package/lib/commonjs/notifyAppReady.js +2 -0
  27. package/lib/commonjs/notifyAppReady.js.map +1 -1
  28. package/lib/commonjs/resetClientUniqueId.js +18 -0
  29. package/lib/commonjs/resetClientUniqueId.js.map +1 -0
  30. package/lib/commonjs/restartApp.js +2 -0
  31. package/lib/commonjs/restartApp.js.map +1 -1
  32. package/lib/commonjs/sync.js +5 -3
  33. package/lib/commonjs/sync.js.map +1 -1
  34. package/lib/module/CodePush.js +6 -2
  35. package/lib/module/CodePush.js.map +1 -1
  36. package/lib/module/allowRestart.js +2 -0
  37. package/lib/module/allowRestart.js.map +1 -1
  38. package/lib/module/clearUpdates.js +2 -1
  39. package/lib/module/clearUpdates.js.map +1 -1
  40. package/lib/module/disallowRestart.js +2 -0
  41. package/lib/module/disallowRestart.js.map +1 -1
  42. package/lib/module/enums/CheckFrequency.enum.js +2 -2
  43. package/lib/module/enums/InstallMode.enum.js +7 -3
  44. package/lib/module/enums/InstallMode.enum.js.map +1 -1
  45. package/lib/module/enums/SyncStatus.enum.js +7 -7
  46. package/lib/module/enums/UpdateState.enum.js +7 -6
  47. package/lib/module/enums/UpdateState.enum.js.map +1 -1
  48. package/lib/module/getClientUniqueId.js +12 -0
  49. package/lib/module/getClientUniqueId.js.map +1 -0
  50. package/lib/module/index.js +2 -0
  51. package/lib/module/index.js.map +1 -1
  52. package/lib/module/internals/getConfiguration.js +3 -0
  53. package/lib/module/internals/getConfiguration.js.map +1 -1
  54. package/lib/module/internals/version.js +1 -1
  55. package/lib/module/notifyAppReady.js +2 -0
  56. package/lib/module/notifyAppReady.js.map +1 -1
  57. package/lib/module/resetClientUniqueId.js +14 -0
  58. package/lib/module/resetClientUniqueId.js.map +1 -0
  59. package/lib/module/restartApp.js +2 -0
  60. package/lib/module/restartApp.js.map +1 -1
  61. package/lib/module/sync.js +5 -3
  62. package/lib/module/sync.js.map +1 -1
  63. package/lib/typescript/commonjs/src/CodePush.d.ts +10 -5
  64. package/lib/typescript/commonjs/src/CodePush.d.ts.map +1 -1
  65. package/lib/typescript/commonjs/src/allowRestart.d.ts +2 -0
  66. package/lib/typescript/commonjs/src/allowRestart.d.ts.map +1 -1
  67. package/lib/typescript/commonjs/src/clearUpdates.d.ts +2 -1
  68. package/lib/typescript/commonjs/src/clearUpdates.d.ts.map +1 -1
  69. package/lib/typescript/commonjs/src/disallowRestart.d.ts +2 -0
  70. package/lib/typescript/commonjs/src/disallowRestart.d.ts.map +1 -1
  71. package/lib/typescript/commonjs/src/enums/CheckFrequency.enum.d.ts +2 -2
  72. package/lib/typescript/commonjs/src/enums/InstallMode.enum.d.ts +7 -3
  73. package/lib/typescript/commonjs/src/enums/InstallMode.enum.d.ts.map +1 -1
  74. package/lib/typescript/commonjs/src/enums/SyncStatus.enum.d.ts +7 -7
  75. package/lib/typescript/commonjs/src/enums/UpdateState.enum.d.ts +7 -6
  76. package/lib/typescript/commonjs/src/enums/UpdateState.enum.d.ts.map +1 -1
  77. package/lib/typescript/commonjs/src/getClientUniqueId.d.ts +5 -0
  78. package/lib/typescript/commonjs/src/getClientUniqueId.d.ts.map +1 -0
  79. package/lib/typescript/commonjs/src/index.d.ts +2 -0
  80. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  81. package/lib/typescript/commonjs/src/internals/RNAppZungCodePushModuleSpec.d.ts +1 -0
  82. package/lib/typescript/commonjs/src/internals/RNAppZungCodePushModuleSpec.d.ts.map +1 -1
  83. package/lib/typescript/commonjs/src/internals/getConfiguration.d.ts +1 -0
  84. package/lib/typescript/commonjs/src/internals/getConfiguration.d.ts.map +1 -1
  85. package/lib/typescript/commonjs/src/internals/version.d.ts +1 -1
  86. package/lib/typescript/commonjs/src/notifyAppReady.d.ts +2 -0
  87. package/lib/typescript/commonjs/src/notifyAppReady.d.ts.map +1 -1
  88. package/lib/typescript/commonjs/src/resetClientUniqueId.d.ts +5 -0
  89. package/lib/typescript/commonjs/src/resetClientUniqueId.d.ts.map +1 -0
  90. package/lib/typescript/commonjs/src/restartApp.d.ts +2 -0
  91. package/lib/typescript/commonjs/src/restartApp.d.ts.map +1 -1
  92. package/lib/typescript/commonjs/src/sync.d.ts +3 -1
  93. package/lib/typescript/commonjs/src/sync.d.ts.map +1 -1
  94. package/lib/typescript/commonjs/src/types.d.ts +68 -26
  95. package/lib/typescript/commonjs/src/types.d.ts.map +1 -1
  96. package/lib/typescript/module/src/CodePush.d.ts +10 -5
  97. package/lib/typescript/module/src/CodePush.d.ts.map +1 -1
  98. package/lib/typescript/module/src/allowRestart.d.ts +2 -0
  99. package/lib/typescript/module/src/allowRestart.d.ts.map +1 -1
  100. package/lib/typescript/module/src/clearUpdates.d.ts +2 -1
  101. package/lib/typescript/module/src/clearUpdates.d.ts.map +1 -1
  102. package/lib/typescript/module/src/disallowRestart.d.ts +2 -0
  103. package/lib/typescript/module/src/disallowRestart.d.ts.map +1 -1
  104. package/lib/typescript/module/src/enums/CheckFrequency.enum.d.ts +2 -2
  105. package/lib/typescript/module/src/enums/InstallMode.enum.d.ts +7 -3
  106. package/lib/typescript/module/src/enums/InstallMode.enum.d.ts.map +1 -1
  107. package/lib/typescript/module/src/enums/SyncStatus.enum.d.ts +7 -7
  108. package/lib/typescript/module/src/enums/UpdateState.enum.d.ts +7 -6
  109. package/lib/typescript/module/src/enums/UpdateState.enum.d.ts.map +1 -1
  110. package/lib/typescript/module/src/getClientUniqueId.d.ts +5 -0
  111. package/lib/typescript/module/src/getClientUniqueId.d.ts.map +1 -0
  112. package/lib/typescript/module/src/index.d.ts +2 -0
  113. package/lib/typescript/module/src/index.d.ts.map +1 -1
  114. package/lib/typescript/module/src/internals/RNAppZungCodePushModuleSpec.d.ts +1 -0
  115. package/lib/typescript/module/src/internals/RNAppZungCodePushModuleSpec.d.ts.map +1 -1
  116. package/lib/typescript/module/src/internals/getConfiguration.d.ts +1 -0
  117. package/lib/typescript/module/src/internals/getConfiguration.d.ts.map +1 -1
  118. package/lib/typescript/module/src/internals/version.d.ts +1 -1
  119. package/lib/typescript/module/src/notifyAppReady.d.ts +2 -0
  120. package/lib/typescript/module/src/notifyAppReady.d.ts.map +1 -1
  121. package/lib/typescript/module/src/resetClientUniqueId.d.ts +5 -0
  122. package/lib/typescript/module/src/resetClientUniqueId.d.ts.map +1 -0
  123. package/lib/typescript/module/src/restartApp.d.ts +2 -0
  124. package/lib/typescript/module/src/restartApp.d.ts.map +1 -1
  125. package/lib/typescript/module/src/sync.d.ts +3 -1
  126. package/lib/typescript/module/src/sync.d.ts.map +1 -1
  127. package/lib/typescript/module/src/types.d.ts +68 -26
  128. package/lib/typescript/module/src/types.d.ts.map +1 -1
  129. package/package.json +4 -2
  130. package/src/CodePush.tsx +12 -5
  131. package/src/allowRestart.ts +2 -0
  132. package/src/clearUpdates.ts +2 -1
  133. package/src/disallowRestart.ts +2 -0
  134. package/src/enums/CheckFrequency.enum.ts +2 -2
  135. package/src/enums/InstallMode.enum.ts +7 -3
  136. package/src/enums/SyncStatus.enum.ts +7 -7
  137. package/src/enums/UpdateState.enum.ts +7 -6
  138. package/src/getClientUniqueId.ts +9 -0
  139. package/src/index.ts +2 -0
  140. package/src/internals/RNAppZungCodePushModuleSpec.ts +1 -0
  141. package/src/internals/getConfiguration.ts +4 -0
  142. package/src/internals/version.ts +1 -1
  143. package/src/notifyAppReady.ts +2 -0
  144. package/src/resetClientUniqueId.ts +11 -0
  145. package/src/restartApp.ts +2 -0
  146. package/src/sync.ts +5 -3
  147. package/src/types.ts +70 -26
  148. package/typedoc.json +9 -0
  149. package/android/app/.gradle/config.properties +0 -2
  150. package/android/app/local.properties +0 -8
  151. package/docs/advanced-usage.md +0 -56
  152. package/docs/api-android.md +0 -22
  153. package/docs/api-ios.md +0 -19
  154. package/docs/api-js.md +0 -557
  155. package/docs/code-signing.md +0 -62
  156. package/docs/migrating-to-v10.md +0 -31
  157. package/docs/setup-android.md +0 -81
  158. package/docs/setup-ios.md +0 -108
  159. package/docs/setup-windows.md +0 -55
@@ -3,26 +3,26 @@
3
3
  */
4
4
  export declare enum SyncStatus {
5
5
  /**
6
- * The app is up-to-date with the CodePush server.
6
+ * The app is fully up-to-date with the configured release channel.
7
7
  */
8
8
  UP_TO_DATE = 0,
9
9
  /**
10
10
  * An available update has been installed and will be run either immediately after the
11
- * syncStatusChangedCallback function returns or the next time the app resumes/restarts,
12
- * depending on the InstallMode specified in SyncOptions
11
+ * `syncStatusChangedCallback` function returns or the next time the app resumes/restarts,
12
+ * depending on the `InstallMode` specified in `SyncOptions`
13
13
  */
14
14
  UPDATE_INSTALLED = 1,
15
15
  /**
16
16
  * The app had an optional update which the end user chose to ignore.
17
- * (This is only applicable when the updateDialog is used)
17
+ * (This is only applicable when the `updateDialog` is used)
18
18
  */
19
19
  UPDATE_IGNORED = 2,
20
20
  /**
21
- * The sync operation encountered an unknown error.
21
+ * The `sync` operation encountered an unknown error.
22
22
  */
23
23
  UNKNOWN_ERROR = 3,
24
24
  /**
25
- * There is an ongoing sync operation running which prevents the current call from being executed.
25
+ * There is an ongoing `sync` operation running which prevents the current call from being executed.
26
26
  */
27
27
  SYNC_IN_PROGRESS = 4,
28
28
  /**
@@ -31,7 +31,7 @@ export declare enum SyncStatus {
31
31
  CHECKING_FOR_UPDATE = 5,
32
32
  /**
33
33
  * An update is available, and a confirmation dialog was shown
34
- * to the end user. (This is only applicable when the updateDialog is used)
34
+ * to the end user. (This is only applicable when the `updateDialog` is used)
35
35
  */
36
36
  AWAITING_USER_ACTION = 6,
37
37
  /**
@@ -3,18 +3,19 @@
3
3
  */
4
4
  export declare enum UpdateState {
5
5
  /**
6
- * Indicates that an update represents the
7
- * version of the app that is currently running.
6
+ * Indicates that an update represents the version of the app that is currently running.
7
+ *
8
+ * This can be useful for identifying attributes about the app, for scenarios such as displaying the release description in a "what's new?" dialog or reporting the latest version to an analytics and/or crash reporting service.
8
9
  */
9
10
  RUNNING,
10
11
  /**
11
- * Indicates than an update has been installed, but the
12
- * app hasn't been restarted yet in order to apply it.
12
+ * Indicates than an update has been installed, but the app hasn't been restarted yet in order to apply it.
13
+ *
14
+ * This can be useful for determining whether there is a pending update, which you may want to force a programmatic restart (via `restartApp`) in order to apply.
13
15
  */
14
16
  PENDING,
15
17
  /**
16
- * Indicates than an update represents the latest available
17
- * release, and can be either currently running or pending.
18
+ * Indicates than an update represents the latest available release, and can be either currently running or pending.
18
19
  */
19
20
  LATEST
20
21
  }
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateState.enum.d.ts","sourceRoot":"","sources":["../../../../../src/enums/UpdateState.enum.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,oBAAY,WAAW;IACrB;;;OAGG;IACH,OAAiF;IAEjF;;;OAGG;IACH,OAAiF;IAEjF;;;OAGG;IACH,MAA+E;CAChF"}
1
+ {"version":3,"file":"UpdateState.enum.d.ts","sourceRoot":"","sources":["../../../../../src/enums/UpdateState.enum.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,oBAAY,WAAW;IACrB;;;;OAIG;IACH,OAAiF;IAEjF;;;;OAIG;IACH,OAAiF;IAEjF;;OAEG;IACH,MAA+E;CAChF"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Gets the client's unique ID set by the module. You may also see `resetClientUniqueId`.
3
+ */
4
+ export declare const getClientUniqueId: () => Promise<string>;
5
+ //# sourceMappingURL=getClientUniqueId.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getClientUniqueId.d.ts","sourceRoot":"","sources":["../../../../src/getClientUniqueId.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,iBAAiB,uBAG7B,CAAC"}
@@ -8,6 +8,8 @@ export * from './getUpdateMetadata';
8
8
  export * from './notifyAppReady';
9
9
  export * from './restartApp';
10
10
  export * from './sync';
11
+ export * from './getClientUniqueId';
12
+ export * from './resetClientUniqueId';
11
13
  export * from './types';
12
14
  export * from './enums/SyncStatus.enum';
13
15
  export * from './enums/InstallMode.enum';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AAEvB,cAAc,SAAS,CAAC;AAExB,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AAEtC,cAAc,SAAS,CAAC;AAExB,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC"}
@@ -16,6 +16,7 @@ export interface Spec extends TurboModule {
16
16
  codePushUpdateStateRunning: number;
17
17
  };
18
18
  getConfiguration(): Promise<Configuration>;
19
+ resetClientUniqueId(): Promise<string>;
19
20
  getUpdateMetadata(updateState: UpdateState): Promise<OmitFunctions<LocalPackage>>;
20
21
  installUpdate(localPackage: OmitFunctions<LocalPackage>, installMode: InstallMode, minimumBackgroundDuration: number): Promise<void>;
21
22
  downloadUpdate(remotePackage: OmitFunctions<RemotePackage>, notifyProgress: boolean): Promise<OmitFunctions<LocalPackage>>;
@@ -1 +1 @@
1
- {"version":3,"file":"RNAppZungCodePushModuleSpec.d.ts","sourceRoot":"","sources":["../../../../../src/internals/RNAppZungCodePushModuleSpec.ts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C5C,oBAAoB,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;IACvD,wBAAwB,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;IAE3D,qBAAqB,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAErD,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAClD,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACvD"}
@@ -1,3 +1,4 @@
1
1
  import type { Configuration } from './types';
2
2
  export declare function getConfiguration(): Promise<Configuration>;
3
+ export declare function reloadCachedConfiguration(): Promise<void>;
3
4
  //# sourceMappingURL=getConfiguration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getConfiguration.d.ts","sourceRoot":"","sources":["../../../../../src/internals/getConfiguration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAI7C,wBAAsB,gBAAgB,2BAMrC"}
1
+ {"version":3,"file":"getConfiguration.d.ts","sourceRoot":"","sources":["../../../../../src/internals/getConfiguration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAI7C,wBAAsB,gBAAgB,2BAMrC;AAED,wBAAsB,yBAAyB,kBAE9C"}
@@ -1,2 +1,2 @@
1
- export declare const version = "10.0.0";
1
+ export declare const version = "10.1.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1,6 +1,8 @@
1
1
  import type { StatusReport } from './types';
2
2
  /**
3
3
  * Notifies the CodePush runtime that an installed update is considered successful.
4
+ *
5
+ * If you are manually checking for and installing updates (i.e. not using the `sync` method to handle it all for you), then this method **MUST** be called; otherwise CodePush will treat the update as failed and rollback to the previous version when the app next restarts.
4
6
  */
5
7
  export declare const notifyAppReady: () => Promise<void | StatusReport>;
6
8
  //# sourceMappingURL=notifyAppReady.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"notifyAppReady.d.ts","sourceRoot":"","sources":["../../../../src/notifyAppReady.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;GAEG;AACH,eAAO,MAAM,cAAc,oCAYvB,CAAC"}
1
+ {"version":3,"file":"notifyAppReady.d.ts","sourceRoot":"","sources":["../../../../src/notifyAppReady.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;;;GAIG;AACH,eAAO,MAAM,cAAc,oCAYvB,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Resets the client's unique ID. You may use this in some GDPR compliance scenarios. Note that this will create a new MAU if a new request is sent later.
3
+ */
4
+ export declare const resetClientUniqueId: () => Promise<string>;
5
+ //# sourceMappingURL=resetClientUniqueId.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resetClientUniqueId.d.ts","sourceRoot":"","sources":["../../../../src/resetClientUniqueId.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,eAAO,MAAM,mBAAmB,uBAI/B,CAAC"}
@@ -1,6 +1,8 @@
1
1
  /**
2
2
  * Immediately restarts the app.
3
3
  *
4
+ * If there is an update pending, it will be immediately displayed to the end user. Otherwise, calling this method simply has the same behavior as the end user killing and restarting the process.
5
+ *
4
6
  * @param onlyIfUpdateIsPending Indicates whether you want the restart to no-op if there isn't currently a pending update.
5
7
  */
6
8
  export declare function restartApp(onlyIfUpdateIsPending?: boolean): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"restartApp.d.ts","sourceRoot":"","sources":["../../../../src/restartApp.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,qBAAqB,UAAQ,iBAE7D"}
1
+ {"version":3,"file":"restartApp.d.ts","sourceRoot":"","sources":["../../../../src/restartApp.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAAsB,UAAU,CAAC,qBAAqB,UAAQ,iBAE7D"}
@@ -8,10 +8,12 @@ export declare const DEFAULT_UPDATE_DIALOG: UpdateDialog;
8
8
  /**
9
9
  * Allows checking for an update, downloading it and installing it, all with a single call.
10
10
  *
11
+ * Unless you need custom UI and/or behavior, we recommend most developers to use this method when integrating CodePush into their apps, if they are not using the `withCodePush` HOC.
12
+ *
11
13
  * @param options Options used to configure the end-user update experience (e.g. show a prompt?, install the update immediately?).
12
14
  * @param syncStatusChangedCallback An optional callback that allows tracking the status of the sync operation, as opposed to simply checking the resolved state via the returned Promise.
13
15
  * @param downloadProgressCallback An optional callback that allows tracking the progress of an update while it is being downloaded.
14
16
  * @param handleBinaryVersionMismatchCallback An optional callback for handling target binary version mismatch
15
17
  */
16
- export declare const sync: (options?: SyncOptions, syncStatusChangeCallback?: SyncStatusChangedCallback, downloadProgressCallback?: DownloadProgressCallback, handleBinaryVersionMismatchCallback?: HandleBinaryVersionMismatchCallback) => Promise<SyncStatus>;
18
+ export declare const sync: (options?: SyncOptions, syncStatusChangedCallback?: SyncStatusChangedCallback, downloadProgressCallback?: DownloadProgressCallback, handleBinaryVersionMismatchCallback?: HandleBinaryVersionMismatchCallback) => Promise<SyncStatus>;
17
19
  //# sourceMappingURL=sync.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../../../src/sync.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAKrD,OAAO,KAAK,EACV,wBAAwB,EACxB,mCAAmC,EACnC,WAAW,EACX,yBAAyB,EACzB,YAAY,EACb,MAAM,SAAS,CAAC;AAEjB;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,YASnC,CAAC;AAgLF;;;;;;;GAOG;AACH,eAAO,MAAM,IAAI,aAUH,WAAW,6BACM,yBAAyB,6BACzB,wBAAwB,wCACb,mCAAmC,KACxE,OAAO,CAAC,UAAU,CA4CnB,CAAC"}
1
+ {"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../../../src/sync.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAKrD,OAAO,KAAK,EACV,wBAAwB,EACxB,mCAAmC,EACnC,WAAW,EACX,yBAAyB,EACzB,YAAY,EACb,MAAM,SAAS,CAAC;AAEjB;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,YASnC,CAAC;AAgLF;;;;;;;;;GASG;AACH,eAAO,MAAM,IAAI,aAUH,WAAW,8BACO,yBAAyB,6BAC1B,wBAAwB,wCACb,mCAAmC,KACxE,OAAO,CAAC,UAAU,CA4CnB,CAAC"}
@@ -5,42 +5,68 @@ import type { SyncStatus } from './enums/SyncStatus.enum';
5
5
  export interface UpdateDialog {
6
6
  /**
7
7
  * Indicates whether you would like to append the description of an available release to the
8
- * notification message which is displayed to the end user. Defaults to false.
8
+ * notification message which is displayed to the end user.
9
+ *
10
+ * Defaults to false.
9
11
  */
10
12
  appendReleaseDescription?: boolean;
11
13
  /**
12
14
  * Indicates the string you would like to prefix the release description with, if any, when
13
- * displaying the update notification to the end user. Defaults to " Description: "
15
+ * displaying the update notification to the end user.
16
+ *
17
+ * Defaults to " Description: "
14
18
  */
15
19
  descriptionPrefix?: string;
16
20
  /**
17
- * The text to use for the button the end user must press in order to install a mandatory update. Defaults to "Continue".
21
+ * The text to use for the button the end user must press in order to install a mandatory update.
22
+ *
23
+ * Defaults to "Continue".
18
24
  */
19
25
  mandatoryContinueButtonLabel?: string;
20
26
  /**
21
27
  * The text used as the body of an update notification, when the update is specified as mandatory.
28
+ *
22
29
  * Defaults to "An update is available that must be installed.".
23
30
  */
24
31
  mandatoryUpdateMessage?: string;
25
32
  /**
26
- * The text to use for the button the end user can press in order to ignore an optional update that is available. Defaults to "Ignore".
33
+ * The text to use for the button the end user can press in order to ignore an optional update that is available.
34
+ *
35
+ * Defaults to "Ignore".
27
36
  */
28
37
  optionalIgnoreButtonLabel?: string;
29
38
  /**
30
- * The text to use for the button the end user can press in order to install an optional update. Defaults to "Install".
39
+ * The text to use for the button the end user can press in order to install an optional update.
40
+ *
41
+ * Defaults to "Install".
31
42
  */
32
43
  optionalInstallButtonLabel?: string;
33
44
  /**
34
- * The text used as the body of an update notification, when the update is optional. Defaults to "An update is available. Would you like to install it?".
45
+ * The text used as the body of an update notification, when the update is optional.
46
+ *
47
+ * Defaults to "An update is available. Would you like to install it?".
35
48
  */
36
49
  optionalUpdateMessage?: string;
37
50
  /**
38
- * The text used as the header of an update notification that is displayed to the end user. Defaults to "Update available".
51
+ * The text used as the header of an update notification that is displayed to the end user.
52
+ *
53
+ * Defaults to "Update available".
39
54
  */
40
55
  title?: string;
41
56
  }
57
+ /**
58
+ * Called periodically when an available update is being downloaded from the CodePush server.
59
+ */
42
60
  export type DownloadProgressCallback = (progress: DownloadProgress) => void;
61
+ /**
62
+ * Called when the sync process moves from one stage to another in the overall update process.
63
+ *
64
+ * The method is called with a status code which represents the current state, and can be any of the `SyncStatus` values.
65
+ */
43
66
  export type SyncStatusChangedCallback = (status: SyncStatus) => void;
67
+ /**
68
+ * Called when there are any binary update available.
69
+ */
44
70
  export type HandleBinaryVersionMismatchCallback = (update: NativeUpdateNotification) => void;
45
71
  export interface DownloadProgress {
46
72
  /**
@@ -52,6 +78,9 @@ export interface DownloadProgress {
52
78
  */
53
79
  receivedBytes: number;
54
80
  }
81
+ /**
82
+ * Represents a downloaded update that is either already running, or has been installed and is pending an app restart.
83
+ */
55
84
  export interface LocalPackage extends Package {
56
85
  /**
57
86
  * Installs the update by saving it to the location on disk where the runtime expects to find the latest version of the app.
@@ -65,7 +94,7 @@ export interface LocalPackage extends Package {
65
94
  export interface Package {
66
95
  /**
67
96
  * The app binary version that this update is dependent on. This is the value that was
68
- * specified via the appStoreVersion parameter when calling the CLI's release command.
97
+ * specified via the --target-binary-version parameter when calling the CLI's release command.
69
98
  */
70
99
  appVersion: string;
71
100
  /**
@@ -78,10 +107,14 @@ export interface Package {
78
107
  description: string;
79
108
  /**
80
109
  * Indicates whether this update has been previously installed but was rolled back.
110
+ *
111
+ * The `sync` method will automatically ignore updates which have previously failed, so you only need to worry about this property if using `checkForUpdate`.
81
112
  */
82
113
  failedInstall: boolean;
83
114
  /**
84
115
  * Indicates whether this is the first time the update has been run after being installed.
116
+ *
117
+ * This is useful for determining whether you would like to show a "What's New?" UI to the end user after installing an update.
85
118
  */
86
119
  isFirstRun: boolean;
87
120
  /**
@@ -106,6 +139,9 @@ export interface Package {
106
139
  */
107
140
  packageSize: number;
108
141
  }
142
+ /**
143
+ * Represents an available update on the CodePush server that hasn't been downloaded yet.
144
+ */
109
145
  export interface RemotePackage extends Package {
110
146
  /**
111
147
  * Downloads the available update from the CodePush service.
@@ -115,24 +151,28 @@ export interface RemotePackage extends Package {
115
151
  download(downloadProgressCallback?: DownloadProgressCallback): Promise<LocalPackage>;
116
152
  /**
117
153
  * The URL at which the package is available for download.
154
+ *
155
+ * This property is only needed for advanced usage, since the `download` method will automatically handle the acquisition of updates for you.
118
156
  */
119
157
  downloadUrl: string;
120
158
  }
121
159
  export interface SyncOptions {
122
160
  /**
123
- * Specifies the release channel you want to query for an update against. By default, this value is derived from the Info.plist
124
- * file (iOS) and strings resources (Android), but this option allows you to override it from the script-side if you need to
125
- * dynamically use a different release channel for a specific call to sync.
161
+ * Specifies the release channel you want to query for an update against.
162
+ *
163
+ * By default, this value is derived from the Info.plist file (iOS) and strings resources (Android), but this option allows you to override it from the JS-side if you need to dynamically use a different release channel for a specific call to sync.
126
164
  */
127
165
  releaseChannelPublicId?: string;
128
166
  /**
129
- * Specifies when you would like to install optional updates (i.e. those that aren't marked as mandatory).
130
- * Defaults to codePush.InstallMode.ON_NEXT_RESTART.
167
+ * Specifies when you would like to install regular updates (i.e. those that aren't marked as mandatory).
168
+ *
169
+ * Defaults to InstallMode.ON_NEXT_RESTART.
131
170
  */
132
171
  installMode?: InstallMode;
133
172
  /**
134
173
  * Specifies when you would like to install updates which are marked as mandatory.
135
- * Defaults to codePush.InstallMode.IMMEDIATE.
174
+ *
175
+ * Defaults to InstallMode.IMMEDIATE.
136
176
  */
137
177
  mandatoryInstallMode?: InstallMode;
138
178
  /**
@@ -143,31 +183,33 @@ export interface SyncOptions {
143
183
  */
144
184
  minimumBackgroundDuration?: number;
145
185
  /**
146
- * An "options" object used to determine whether a confirmation dialog should be displayed to the end user when an update is available,
147
- * and if so, what strings to use. Defaults to null, which has the effect of disabling the dialog completely. Setting this to any truthy
148
- * value will enable the dialog with the default strings, and passing an object to this parameter allows enabling the dialog as well as
149
- * overriding one or more of the default strings.
186
+ * Used to determine whether a confirmation dialog should be displayed to the end user when an update is available, and if so, what strings to use.
187
+ *
188
+ * Defaults to null, which has the effect of disabling the dialog completely.
189
+ * Setting this to true will enable the dialog with the default strings, and passing an object to this parameter allows enabling the dialog as well as overriding one or more of the default strings.
150
190
  */
151
191
  updateDialog?: UpdateDialog | true;
152
192
  /**
153
- * The rollback retry mechanism allows the application to attempt to reinstall an update that was previously rolled back (with the restrictions
154
- * specified in the options). It is an "options" object used to determine whether a rollback retry should occur, and if so, what settings to use
155
- * for the rollback retry. This defaults to null, which has the effect of disabling the retry mechanism. Setting this to true will enable
156
- * the retry mechanism with the default settings, and passing an object to this parameter allows enabling the rollback retry as well as overriding
157
- * one or more of the default values.
193
+ * The rollback retry mechanism allows the application to attempt to reinstall an update that was previously rolled back (with the restrictions specified in the options).
194
+ *
195
+ * This defaults to null, which has the effect of disabling the retry mechanism.
196
+ * Setting this to true will enable the retry mechanism with the default settings, and passing an object to this parameter allows enabling the rollback retry as well as overriding one or more of the default values.
158
197
  */
159
198
  rollbackRetryOptions?: RollbackRetryOptions | true;
160
199
  ignoreFailedUpdates?: boolean;
161
200
  }
162
201
  export interface RollbackRetryOptions {
163
202
  /**
164
- * Specifies the minimum time in hours that the app will wait after the latest rollback
165
- * before attempting to reinstall same rolled-back package. Defaults to `24`.
203
+ * Specifies the minimum time in hours that the app will wait after the latest rollback before attempting to reinstall same rolled-back package.
204
+ *
205
+ * Defaults to `24`.
166
206
  */
167
207
  delayInHours?: number;
168
208
  /**
169
209
  * Specifies the maximum number of retry attempts that the app can make before it stops trying.
170
- * Cannot be less than `1`. Defaults to `1`.
210
+ * Cannot be less than `1`.
211
+ *
212
+ * Defaults to `1`.
171
213
  */
172
214
  maxRetryAttempts?: number;
173
215
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IAEnC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,4BAA4B,CAAC,EAAE,MAAM,CAAC;IAEtC;;;OAGG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAEhC;;OAEG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAC;IAEnC;;OAEG;IACH,0BAA0B,CAAC,EAAE,MAAM,CAAC;IAEpC;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAE/B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,wBAAwB,GAAG,CAAC,QAAQ,EAAE,gBAAgB,KAAK,IAAI,CAAC;AAC5E,MAAM,MAAM,yBAAyB,GAAG,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;AACrE,MAAM,MAAM,mCAAmC,GAAG,CAAC,MAAM,EAAE,wBAAwB,KA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WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,OAAO;IAC5C;;;;OAIG;IACH,QAAQ,CAAC,wBAAwB,CAAC,EAAE,wBAAwB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAErF;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAEhC;;;;OAIG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,WAAW,CAAC;IAEnC;;;;;OAKG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAC;IAEnC;;;;;OAKG;IACH,YAAY,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IAEnC;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAEnD,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,MAAM,EAAE,gBAAgB,CAAC;IAEzB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,8BAA8B,CAAC,EAAE,MAAM,CAAC;IAExC;;OAEG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAC;CACpC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appzung/react-native-code-push",
3
- "version": "10.0.0",
3
+ "version": "10.1.0",
4
4
  "description": "React Native plugin for the CodePush service",
5
5
  "author": "Louis Lagrange <lagrange.louis@gmail.com> (https://github.com/Minishlink)",
6
6
  "license": "MIT",
@@ -44,7 +44,7 @@
44
44
  "test:types": "tsc --noEmit",
45
45
  "test:format": "prettier --check \"{src,docs}/**/*.{ts,js,md}\" README.md react-native.config.js",
46
46
  "tslint": "tslint -c tslint.json test/**/*.ts",
47
- "prepare": "genversion src/internals/version.ts --esm -s && bob build"
47
+ "prepare": "genversion src/internals/version.ts --esm -s && typedoc && bob build"
48
48
  },
49
49
  "repository": {
50
50
  "type": "git",
@@ -77,6 +77,8 @@
77
77
  "shx": "^0.3.4",
78
78
  "slash": "^3.0.0",
79
79
  "tslint": "^6.1.3",
80
+ "typedoc": "^0.27.7",
81
+ "typedoc-plugin-markdown": "^4.4.2",
80
82
  "typescript": "^5.7.3"
81
83
  },
82
84
  "react-native-builder-bob": {
package/src/CodePush.tsx CHANGED
@@ -14,25 +14,32 @@ import type {
14
14
  export interface CodePushOptions extends SyncOptions {
15
15
  /**
16
16
  * Specifies when you would like to synchronize updates with the CodePush server.
17
- * Defaults to codePush.CheckFrequency.ON_APP_START.
17
+ *
18
+ * Defaults to CheckFrequency.ON_APP_START.
18
19
  */
19
20
  checkFrequency?: CheckFrequency;
20
21
  }
21
22
 
22
23
  /**
23
- * Decorates a React Component configuring it to sync for updates with the CodePush server.
24
+ * Wraps a React component inside a "higher order" React component that knows how to synchronize your app's JavaScript bundle and image assets when it is mounted.
25
+ *
26
+ * Internally, the higher-order component calls `sync` inside its `componentDidMount` lifecycle handle, which in turns performs an update check, downloads the update if it exists and installs the update for you.
24
27
  *
25
28
  * @param component the React Component that will be decorated
26
29
  */
27
30
  // @ts-ignore
28
- export function withCodePush(component: any): React.FunctionComponent;
31
+ export function withCodePush<P extends object>(component: React.ComponentType<P>): React.ComponentType;
29
32
 
30
33
  /**
31
- * Decorates a React Component configuring it to sync for updates with the CodePush server.
34
+ * Wraps a React component inside a "higher order" React component that knows how to synchronize your app's JavaScript bundle and image assets when it is mounted.
35
+ *
36
+ * Internally, the higher-order component calls `sync` inside its `componentDidMount` lifecycle handle, which in turns performs an update check, downloads the update if it exists and installs the update for you.
32
37
  *
33
38
  * @param options Options used to configure the end-user sync and update experience (e.g. when to check for updates?, show a prompt?, install the update immediately?).
34
39
  */
35
- export function withCodePush(options: CodePushOptions): (component: any) => React.FunctionComponent;
40
+ export function withCodePush<P extends object>(
41
+ options: CodePushOptions,
42
+ ): (component: React.ComponentType<P>) => React.ComponentType;
36
43
 
37
44
  export function withCodePush<P extends object>(optionsOrComponent: CodePushOptions | React.ComponentType<P>) {
38
45
  const options: CodePushOptions = typeof optionsOrComponent === 'function' ? {} : optionsOrComponent;
@@ -2,5 +2,7 @@ import { NativeRNAppZungCodePushModule } from './internals/NativeRNAppZungCodePu
2
2
 
3
3
  /**
4
4
  * Allow CodePush to restart the app.
5
+ *
6
+ * This is an advanced API and is only necessary if your app explicitly disallowed restarts via the `disallowRestart` method.
5
7
  */
6
8
  export const allowRestart: () => void = NativeRNAppZungCodePushModule.allow;
@@ -2,8 +2,9 @@ import { NativeRNAppZungCodePushModule } from './internals/NativeRNAppZungCodePu
2
2
 
3
3
  /**
4
4
  * Clears all downloaded CodePush updates.
5
+ *
5
6
  * This is useful when switching to a different release channel which may have an older release than the current package.
6
- * Note: we don’t recommend to use this method in scenarios other than that (CodePush will call
7
+ * Note: we don’t recommend using this method in scenarios other than that (CodePush will call
7
8
  * this method automatically when needed in other cases) as it could lead to unpredictable behavior.
8
9
  */
9
10
  export const clearUpdates: () => void = NativeRNAppZungCodePushModule.clearUpdates;
@@ -2,5 +2,7 @@ import { NativeRNAppZungCodePushModule } from './internals/NativeRNAppZungCodePu
2
2
 
3
3
  /**
4
4
  * Forbid CodePush to restart the app.
5
+ *
6
+ * This is an advanced API, and is useful when a component within your app (for example an onboarding process) needs to ensure that no end-user interruptions can occur during its lifetime.
5
7
  */
6
8
  export const disallowRestart: () => void = NativeRNAppZungCodePushModule.disallow;
@@ -8,12 +8,12 @@ export enum CheckFrequency {
8
8
  ON_APP_START,
9
9
 
10
10
  /**
11
- * When the app re-enters the foreground.
11
+ * When the app re-enters the foreground after being "backgrounded" (user pressed the home button, app launches a separate payment process, etc.)
12
12
  */
13
13
  ON_APP_RESUME,
14
14
 
15
15
  /**
16
- * Don't automatically check for updates, but only do it when codePush.sync() is manually called inside app code.
16
+ * Don't automatically check for updates, but only do it when `sync()` is manually called in app code.
17
17
  */
18
18
  MANUAL,
19
19
  }
@@ -6,18 +6,22 @@ import { NativeRNAppZungCodePushModule } from '../internals/NativeRNAppZungCodeP
6
6
  export enum InstallMode {
7
7
  /**
8
8
  * Indicates that you want to install the update and restart the app immediately.
9
+ *
10
+ * This value is appropriate for debugging scenarios as well as when displaying an update prompt to the user, since they would expect to see the changes immediately after accepting the installation. Additionally, this mode can be used to enforce mandatory updates, since it removes the potentially undesired latency between the update installation and the next time the end user restarts or resumes the app.
9
11
  */
10
12
  IMMEDIATE = NativeRNAppZungCodePushModule.getConstants().codePushInstallModeImmediate,
11
13
 
12
14
  /**
13
15
  * Indicates that you want to install the update, but not forcibly restart the app.
16
+ *
17
+ * When the app is "naturally" restarted (due the OS or end user killing it), the update will be seamlessly picked up. This value is appropriate when performing silent updates, since it would likely be disruptive to the end user if the app suddenly restarted out of nowhere, since they wouldn't have realized an update was even downloaded. This is the default mode used for both the `sync` and `LocalPackage.install` methods.
14
18
  */
15
19
  ON_NEXT_RESTART = NativeRNAppZungCodePushModule.getConstants().codePushInstallModeOnNextRestart,
16
20
 
17
21
  /**
18
- * Indicates that you want to install the update, but don't want to restart the app until the next time
19
- * the end user resumes it from the background. This way, you don't disrupt their current session,
20
- * but you can get the update in front of them sooner than having to wait for the next natural restart.
22
+ * Indicates that you want to install the update, but don't want to restart the app until the next time the end user resumes it from the background.
23
+ *
24
+ * This way, you don't disrupt their current session,but you can get the update in front of them sooner than having to wait for the next natural restart.
21
25
  * This value is appropriate for silent installs that can be applied on resume in a non-invasive way.
22
26
  */
23
27
  ON_NEXT_RESUME = NativeRNAppZungCodePushModule.getConstants().codePushInstallModeOnNextResume,
@@ -3,30 +3,30 @@
3
3
  */
4
4
  export enum SyncStatus {
5
5
  /**
6
- * The app is up-to-date with the CodePush server.
6
+ * The app is fully up-to-date with the configured release channel.
7
7
  */
8
8
  UP_TO_DATE,
9
9
 
10
10
  /**
11
11
  * An available update has been installed and will be run either immediately after the
12
- * syncStatusChangedCallback function returns or the next time the app resumes/restarts,
13
- * depending on the InstallMode specified in SyncOptions
12
+ * `syncStatusChangedCallback` function returns or the next time the app resumes/restarts,
13
+ * depending on the `InstallMode` specified in `SyncOptions`
14
14
  */
15
15
  UPDATE_INSTALLED,
16
16
 
17
17
  /**
18
18
  * The app had an optional update which the end user chose to ignore.
19
- * (This is only applicable when the updateDialog is used)
19
+ * (This is only applicable when the `updateDialog` is used)
20
20
  */
21
21
  UPDATE_IGNORED,
22
22
 
23
23
  /**
24
- * The sync operation encountered an unknown error.
24
+ * The `sync` operation encountered an unknown error.
25
25
  */
26
26
  UNKNOWN_ERROR,
27
27
 
28
28
  /**
29
- * There is an ongoing sync operation running which prevents the current call from being executed.
29
+ * There is an ongoing `sync` operation running which prevents the current call from being executed.
30
30
  */
31
31
  SYNC_IN_PROGRESS,
32
32
 
@@ -37,7 +37,7 @@ export enum SyncStatus {
37
37
 
38
38
  /**
39
39
  * An update is available, and a confirmation dialog was shown
40
- * to the end user. (This is only applicable when the updateDialog is used)
40
+ * to the end user. (This is only applicable when the `updateDialog` is used)
41
41
  */
42
42
  AWAITING_USER_ACTION,
43
43