Skip to content

Commit 25329c2

Browse files
maitrerobertMinishlink
authored andcommitted
chore: generate JS documentation from source (#2)
1 parent f8d6edb commit 25329c2

50 files changed

Lines changed: 2035 additions & 617 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ If you would like your app to discover updates more quickly, you can also choose
142142
withCodePush({ checkFrequency: CheckFrequency.ON_APP_RESUME })(MyApp);
143143
```
144144

145-
Alternatively, if you want fine-grained control over when the check happens (like a button press or timer interval), eg. in a staging environment, you can call [`CodePush.sync()`](docs/api-js.md#codepushsync) at any time with your desired `SyncOptions`, and turn off CodePush's automatic checking by specifying a manual `checkFrequency`:
145+
Alternatively, if you want fine-grained control over when the check happens (like a button press or timer interval), eg. in a staging environment, you can call [`CodePush.sync()`](docs/api-js/functions/sync.md) at any time with your desired `SyncOptions`, and turn off CodePush's automatic checking by specifying a manual `checkFrequency`:
146146

147147
```javascript
148148
import withCodePush, { CheckFrequency, InstallMode } from '@appzung/react-native-code-push';
@@ -169,7 +169,7 @@ class MyApp extends Component {
169169
export default withCodePush({ checkFrequency: CheckFrequency.MANUAL })(MyApp);
170170
```
171171

172-
If you would like to display an update confirmation dialog (an "active install"), configure when an available update is installed (like force an immediate restart) or customize the update experience in any other way, refer to the [`codePush()`](docs/api-js.md#codepush) API reference for information on how to tweak this default behavior.
172+
If you would like to display an update confirmation dialog (an "active install"), configure when an available update is installed (like force an immediate restart) or customize the update experience in any other way, refer to the [`withCodePush()`](docs/api-js/functions/withCodePush.md) API reference for information on how to tweak this default behavior.
173173

174174
## Releasing updates
175175

@@ -252,7 +252,7 @@ This is not necessarily the case for `updateDialog`, since it won't force the us
252252

253253
## API Reference
254254

255-
- [JavaScript API](docs/api-js.md)
255+
- [JavaScript API](docs/api-js/README.md)
256256
- [Objective-C API Reference (iOS)](docs/api-ios.md)
257257
- [Java API Reference (Android)](docs/api-android.md)
258258

docs/api-js.md

Lines changed: 0 additions & 557 deletions
This file was deleted.

docs/api-js/README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
**@appzung/react-native-code-push**
2+
3+
---
4+
5+
# @appzung/react-native-code-push
6+
7+
## Enumerations
8+
9+
- [CheckFrequency](enumerations/CheckFrequency.md)
10+
- [DeploymentStatus](enumerations/DeploymentStatus.md)
11+
- [InstallMode](enumerations/InstallMode.md)
12+
- [SyncStatus](enumerations/SyncStatus.md)
13+
- [UpdateState](enumerations/UpdateState.md)
14+
15+
## Interfaces
16+
17+
- [CodePushOptions](interfaces/CodePushOptions.md)
18+
- [DownloadProgress](interfaces/DownloadProgress.md)
19+
- [LocalPackage](interfaces/LocalPackage.md)
20+
- [Package](interfaces/Package.md)
21+
- [RemotePackage](interfaces/RemotePackage.md)
22+
- [RollbackRetryOptions](interfaces/RollbackRetryOptions.md)
23+
- [StatusReport](interfaces/StatusReport.md)
24+
- [SyncOptions](interfaces/SyncOptions.md)
25+
- [UpdateDialog](interfaces/UpdateDialog.md)
26+
27+
## Type Aliases
28+
29+
- [DownloadProgressCallback](type-aliases/DownloadProgressCallback.md)
30+
- [HandleBinaryVersionMismatchCallback](type-aliases/HandleBinaryVersionMismatchCallback.md)
31+
- [SyncStatusChangedCallback](type-aliases/SyncStatusChangedCallback.md)
32+
33+
## Variables
34+
35+
- [DEFAULT_UPDATE_DIALOG](variables/DEFAULT_UPDATE_DIALOG.md)
36+
37+
## Functions
38+
39+
- [allowRestart](functions/allowRestart.md)
40+
- [checkForUpdate](functions/checkForUpdate.md)
41+
- [clearUpdates](functions/clearUpdates.md)
42+
- [disallowRestart](functions/disallowRestart.md)
43+
- [getClientUniqueId](functions/getClientUniqueId.md)
44+
- [getUpdateMetadata](functions/getUpdateMetadata.md)
45+
- [notifyAppReady](functions/notifyAppReady.md)
46+
- [resetClientUniqueId](functions/resetClientUniqueId.md)
47+
- [restartApp](functions/restartApp.md)
48+
- [sync](functions/sync.md)
49+
- [withCodePush](functions/withCodePush.md)
50+
51+
## References
52+
53+
### default
54+
55+
Renames and re-exports [withCodePush](functions/withCodePush.md)
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
[**@appzung/react-native-code-push**](../README.md)
2+
3+
---
4+
5+
[@appzung/react-native-code-push](../README.md) / CheckFrequency
6+
7+
# Enumeration: CheckFrequency
8+
9+
Defined in: [enums/CheckFrequency.enum.ts:4](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/CheckFrequency.enum.ts#L4)
10+
11+
Indicates when you would like to check for (and install) updates from the CodePush server.
12+
13+
## Enumeration Members
14+
15+
### MANUAL
16+
17+
> **MANUAL**: `2`
18+
19+
Defined in: [enums/CheckFrequency.enum.ts:18](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/CheckFrequency.enum.ts#L18)
20+
21+
Don't automatically check for updates, but only do it when `sync()` is manually called in app code.
22+
23+
---
24+
25+
### ON_APP_RESUME
26+
27+
> **ON_APP_RESUME**: `1`
28+
29+
Defined in: [enums/CheckFrequency.enum.ts:13](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/CheckFrequency.enum.ts#L13)
30+
31+
When the app re-enters the foreground after being "backgrounded" (user pressed the home button, app launches a separate payment process, etc.)
32+
33+
---
34+
35+
### ON_APP_START
36+
37+
> **ON_APP_START**: `0`
38+
39+
Defined in: [enums/CheckFrequency.enum.ts:8](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/CheckFrequency.enum.ts#L8)
40+
41+
When the app is fully initialized (or more specifically, when the root component is mounted).
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[**@appzung/react-native-code-push**](../README.md)
2+
3+
---
4+
5+
[@appzung/react-native-code-push](../README.md) / DeploymentStatus
6+
7+
# Enumeration: DeploymentStatus
8+
9+
Defined in: [enums/DeploymentStatus.enum.ts:4](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/DeploymentStatus.enum.ts#L4)
10+
11+
Indicates the status of a deployment (after installing and restarting).
12+
13+
## Enumeration Members
14+
15+
### FAILED
16+
17+
> **FAILED**: `"DeploymentFailed"`
18+
19+
Defined in: [enums/DeploymentStatus.enum.ts:8](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/DeploymentStatus.enum.ts#L8)
20+
21+
The deployment failed (and was rolled back).
22+
23+
---
24+
25+
### SUCCEEDED
26+
27+
> **SUCCEEDED**: `"DeploymentSucceeded"`
28+
29+
Defined in: [enums/DeploymentStatus.enum.ts:13](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/DeploymentStatus.enum.ts#L13)
30+
31+
The deployment succeeded.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
[**@appzung/react-native-code-push**](../README.md)
2+
3+
---
4+
5+
[@appzung/react-native-code-push](../README.md) / InstallMode
6+
7+
# Enumeration: InstallMode
8+
9+
Defined in: [enums/InstallMode.enum.ts:6](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/InstallMode.enum.ts#L6)
10+
11+
Indicates when you would like an installed update to actually be applied.
12+
13+
## Enumeration Members
14+
15+
### IMMEDIATE
16+
17+
> **IMMEDIATE**: `number`
18+
19+
Defined in: [enums/InstallMode.enum.ts:12](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/InstallMode.enum.ts#L12)
20+
21+
Indicates that you want to install the update and restart the app immediately.
22+
23+
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.
24+
25+
---
26+
27+
### ON_NEXT_RESTART
28+
29+
> **ON_NEXT_RESTART**: `number`
30+
31+
Defined in: [enums/InstallMode.enum.ts:19](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/InstallMode.enum.ts#L19)
32+
33+
Indicates that you want to install the update, but not forcibly restart the app.
34+
35+
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.
36+
37+
---
38+
39+
### ON_NEXT_RESUME
40+
41+
> **ON_NEXT_RESUME**: `number`
42+
43+
Defined in: [enums/InstallMode.enum.ts:27](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/InstallMode.enum.ts#L27)
44+
45+
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.
46+
47+
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.
48+
This value is appropriate for silent installs that can be applied on resume in a non-invasive way.
49+
50+
---
51+
52+
### ON_NEXT_SUSPEND
53+
54+
> **ON_NEXT_SUSPEND**: `number`
55+
56+
Defined in: [enums/InstallMode.enum.ts:34](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/InstallMode.enum.ts#L34)
57+
58+
Indicates that you want to install the update when the app is in the background,
59+
but only after it has been in the background for "minimumBackgroundDuration" seconds (0 by default),
60+
so that user context isn't lost unless the app suspension is long enough to not matter.
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
[**@appzung/react-native-code-push**](../README.md)
2+
3+
---
4+
5+
[@appzung/react-native-code-push](../README.md) / SyncStatus
6+
7+
# Enumeration: SyncStatus
8+
9+
Defined in: [enums/SyncStatus.enum.ts:4](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/SyncStatus.enum.ts#L4)
10+
11+
Indicates the current status of a sync operation.
12+
13+
## Enumeration Members
14+
15+
### AWAITING_USER_ACTION
16+
17+
> **AWAITING_USER_ACTION**: `6`
18+
19+
Defined in: [enums/SyncStatus.enum.ts:42](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/SyncStatus.enum.ts#L42)
20+
21+
An update is available, and a confirmation dialog was shown
22+
to the end user. (This is only applicable when the `updateDialog` is used)
23+
24+
---
25+
26+
### CHECKING_FOR_UPDATE
27+
28+
> **CHECKING_FOR_UPDATE**: `5`
29+
30+
Defined in: [enums/SyncStatus.enum.ts:36](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/SyncStatus.enum.ts#L36)
31+
32+
The CodePush server is being queried for an update.
33+
34+
---
35+
36+
### DOWNLOADING_PACKAGE
37+
38+
> **DOWNLOADING_PACKAGE**: `7`
39+
40+
Defined in: [enums/SyncStatus.enum.ts:47](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/SyncStatus.enum.ts#L47)
41+
42+
An available update is being downloaded from the CodePush server.
43+
44+
---
45+
46+
### INSTALLING_UPDATE
47+
48+
> **INSTALLING_UPDATE**: `8`
49+
50+
Defined in: [enums/SyncStatus.enum.ts:52](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/SyncStatus.enum.ts#L52)
51+
52+
An available update was downloaded and is about to be installed.
53+
54+
---
55+
56+
### SYNC_IN_PROGRESS
57+
58+
> **SYNC_IN_PROGRESS**: `4`
59+
60+
Defined in: [enums/SyncStatus.enum.ts:31](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/SyncStatus.enum.ts#L31)
61+
62+
There is an ongoing `sync` operation running which prevents the current call from being executed.
63+
64+
---
65+
66+
### UNKNOWN_ERROR
67+
68+
> **UNKNOWN_ERROR**: `3`
69+
70+
Defined in: [enums/SyncStatus.enum.ts:26](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/SyncStatus.enum.ts#L26)
71+
72+
The `sync` operation encountered an unknown error.
73+
74+
---
75+
76+
### UP_TO_DATE
77+
78+
> **UP_TO_DATE**: `0`
79+
80+
Defined in: [enums/SyncStatus.enum.ts:8](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/SyncStatus.enum.ts#L8)
81+
82+
The app is fully up-to-date with the configured release channel.
83+
84+
---
85+
86+
### UPDATE_IGNORED
87+
88+
> **UPDATE_IGNORED**: `2`
89+
90+
Defined in: [enums/SyncStatus.enum.ts:21](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/SyncStatus.enum.ts#L21)
91+
92+
The app had an optional update which the end user chose to ignore.
93+
(This is only applicable when the `updateDialog` is used)
94+
95+
---
96+
97+
### UPDATE_INSTALLED
98+
99+
> **UPDATE_INSTALLED**: `1`
100+
101+
Defined in: [enums/SyncStatus.enum.ts:15](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/SyncStatus.enum.ts#L15)
102+
103+
An available update has been installed and will be run either immediately after the
104+
`syncStatusChangedCallback` function returns or the next time the app resumes/restarts,
105+
depending on the `InstallMode` specified in `SyncOptions`
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
[**@appzung/react-native-code-push**](../README.md)
2+
3+
---
4+
5+
[@appzung/react-native-code-push](../README.md) / UpdateState
6+
7+
# Enumeration: UpdateState
8+
9+
Defined in: [enums/UpdateState.enum.ts:6](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/UpdateState.enum.ts#L6)
10+
11+
Indicates the state that an update is currently in.
12+
13+
## Enumeration Members
14+
15+
### LATEST
16+
17+
> **LATEST**: `number`
18+
19+
Defined in: [enums/UpdateState.enum.ts:24](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/UpdateState.enum.ts#L24)
20+
21+
Indicates than an update represents the latest available release, and can be either currently running or pending.
22+
23+
---
24+
25+
### PENDING
26+
27+
> **PENDING**: `number`
28+
29+
Defined in: [enums/UpdateState.enum.ts:19](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/UpdateState.enum.ts#L19)
30+
31+
Indicates than an update has been installed, but the app hasn't been restarted yet in order to apply it.
32+
33+
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.
34+
35+
---
36+
37+
### RUNNING
38+
39+
> **RUNNING**: `number`
40+
41+
Defined in: [enums/UpdateState.enum.ts:12](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/UpdateState.enum.ts#L12)
42+
43+
Indicates that an update represents the version of the app that is currently running.
44+
45+
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.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[**@appzung/react-native-code-push**](../README.md)
2+
3+
---
4+
5+
[@appzung/react-native-code-push](../README.md) / allowRestart
6+
7+
# Function: allowRestart()
8+
9+
> **allowRestart**(): `void`
10+
11+
Defined in: [allowRestart.ts:8](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/allowRestart.ts#L8)
12+
13+
Allow CodePush to restart the app.
14+
15+
This is an advanced API and is only necessary if your app explicitly disallowed restarts via the `disallowRestart` method.
16+
17+
## Returns
18+
19+
`void`

0 commit comments

Comments
 (0)