@openmrs/esm-framework 3.2.1-pre.986 → 3.3.1-pre.1177
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.
- package/.turbo/turbo-build.log +154 -0
- package/dist/openmrs-esm-framework.js +1 -1
- package/dist/openmrs-esm-framework.js.LICENSE.txt +47 -1
- package/dist/openmrs-esm-framework.js.map +1 -1
- package/docs/API.md +1387 -1947
- package/docs/classes/OpenmrsFetchError.md +3 -3
- package/docs/enums/Type.md +11 -0
- package/docs/enums/VisitMode.md +3 -3
- package/docs/enums/VisitStatus.md +2 -2
- package/docs/interfaces/AssignedExtension.md +21 -8
- package/docs/interfaces/BreadcrumbRegistration.md +4 -4
- package/docs/interfaces/BreadcrumbSettings.md +6 -6
- package/docs/interfaces/ClearDynamicRoutesMessage.md +3 -3
- package/docs/interfaces/ConfigSchema.md +3 -3
- package/docs/interfaces/ConfigurableLinkProps.md +3 -3
- package/docs/interfaces/ConnectedExtension.md +18 -5
- package/docs/interfaces/CurrentPatientOptions.md +1 -1
- package/docs/interfaces/ExtensionRegistration.md +9 -15
- package/docs/interfaces/ExtensionSlotConfig.md +4 -4
- package/docs/interfaces/ExtensionSlotConfigObject.md +3 -3
- package/docs/interfaces/ExtensionSlotState.md +5 -5
- package/docs/interfaces/ExtensionStore.md +3 -3
- package/docs/interfaces/FHIRRequestObj.md +3 -3
- package/docs/interfaces/LoggedInUser.md +12 -12
- package/docs/interfaces/LoggedInUserFetchResponse.md +2 -2
- package/docs/interfaces/MessageServiceWorkerResult.md +5 -5
- package/docs/interfaces/NavigateOptions.md +3 -3
- package/docs/interfaces/NotificationDescriptor.md +74 -0
- package/docs/interfaces/OfflineModeResult.md +5 -5
- package/docs/interfaces/OfflinePatientArgs.md +4 -4
- package/docs/interfaces/OfflinePatientDataSyncHandler.md +4 -4
- package/docs/interfaces/OfflinePatientDataSyncState.md +8 -8
- package/docs/interfaces/OfflinePatientDataSyncStore.md +4 -4
- package/docs/interfaces/OmrsServiceWorkerMessage.md +3 -3
- package/docs/interfaces/OnImportMapChangedMessage.md +4 -4
- package/docs/interfaces/OnlyThePatient.md +1 -1
- package/docs/interfaces/PatientWithFullResponse.md +1 -1
- package/docs/interfaces/Person.md +3 -3
- package/docs/interfaces/Privilege.md +4 -4
- package/docs/interfaces/QueueItemDescriptor.md +6 -6
- package/docs/interfaces/RegisterDynamicRouteMessage.md +6 -6
- package/docs/interfaces/RetryOptions.md +3 -3
- package/docs/interfaces/Role.md +3 -3
- package/docs/interfaces/Session.md +92 -0
- package/docs/interfaces/SessionLocation.md +3 -3
- package/docs/interfaces/ShowNotificationEvent.md +5 -5
- package/docs/interfaces/ShowToastEvent.md +4 -4
- package/docs/interfaces/SyncItem.md +9 -9
- package/docs/interfaces/SyncProcessOptions.md +8 -8
- package/docs/interfaces/ToastDescriptor.md +69 -0
- package/docs/interfaces/ToastNotificationMeta.md +100 -0
- package/docs/interfaces/UserHasAccessProps.md +3 -3
- package/docs/interfaces/VisitItem.md +4 -4
- package/jest.config.js +1 -1
- package/mock.tsx +34 -3
- package/package.json +13 -13
- package/src/index.ts +8 -8
- package/src/integration-tests/extension-config.test.tsx +129 -14
- package/src/internal.ts +11 -0
- package/webpack.config.js +10 -2
- package/babel.config.js +0 -7
- package/docs/interfaces/ComponentConfig.md +0 -30
- package/docs/interfaces/ComponentDecoratorOptions.md +0 -52
- package/docs/interfaces/ExtensionInfo.md +0 -140
- package/docs/interfaces/ExtensionInstance.md +0 -19
- package/docs/interfaces/ExtensionInternalStore.md +0 -34
- package/docs/interfaces/ExtensionSlotInfo.md +0 -64
- package/docs/interfaces/NavigationContext.md +0 -50
- package/docs/interfaces/NetworkRequestFailedEvent.md +0 -49
- package/docs/interfaces/OfflineSynchronizationStore.md +0 -30
- package/docs/interfaces/OmrsServiceWorkerEvent.md +0 -31
- package/docs/interfaces/OpenmrsReactComponentProps.md +0 -19
- package/docs/interfaces/OpenmrsReactComponentState.md +0 -41
- package/docs/interfaces/SessionUser.md +0 -92
- package/docs/interfaces/UnauthenticatedUser.md +0 -52
- package/docs/interfaces/User.md +0 -107
package/docs/API.md
CHANGED
|
@@ -22,6 +22,12 @@
|
|
|
22
22
|
- [toLocationObject](API.md#tolocationobject)
|
|
23
23
|
- [toVisitTypeObject](API.md#tovisittypeobject)
|
|
24
24
|
- [updateVisit](API.md#updatevisit)
|
|
25
|
+
- [useCurrentPatient](API.md#usecurrentpatient)
|
|
26
|
+
- [useLocations](API.md#uselocations)
|
|
27
|
+
- [usePatient](API.md#usepatient)
|
|
28
|
+
- [useSession](API.md#usesession)
|
|
29
|
+
- [useVisit](API.md#usevisit)
|
|
30
|
+
- [useVisitTypes](API.md#usevisittypes)
|
|
25
31
|
- [userHasAccess](API.md#userhasaccess)
|
|
26
32
|
|
|
27
33
|
### Breadcrumb Functions
|
|
@@ -32,7 +38,22 @@
|
|
|
32
38
|
- [registerBreadcrumb](API.md#registerbreadcrumb)
|
|
33
39
|
- [registerBreadcrumbs](API.md#registerbreadcrumbs)
|
|
34
40
|
|
|
35
|
-
###
|
|
41
|
+
### Config Functions
|
|
42
|
+
|
|
43
|
+
- [defineConfigSchema](API.md#defineconfigschema)
|
|
44
|
+
- [defineExtensionConfigSchema](API.md#defineextensionconfigschema)
|
|
45
|
+
- [getConfig](API.md#getconfig)
|
|
46
|
+
- [provide](API.md#provide)
|
|
47
|
+
- [useConfig](API.md#useconfig)
|
|
48
|
+
|
|
49
|
+
### Config Validation Functions
|
|
50
|
+
|
|
51
|
+
- [inRange](API.md#inrange)
|
|
52
|
+
- [isUrl](API.md#isurl)
|
|
53
|
+
- [isUrlWithTemplateParameters](API.md#isurlwithtemplateparameters)
|
|
54
|
+
- [validator](API.md#validator)
|
|
55
|
+
|
|
56
|
+
### Date and Time Functions
|
|
36
57
|
|
|
37
58
|
- [formatDate](API.md#formatdate)
|
|
38
59
|
- [formatDatetime](API.md#formatdatetime)
|
|
@@ -48,122 +69,96 @@
|
|
|
48
69
|
- [toOmrsTimeString24](API.md#toomrstimestring24)
|
|
49
70
|
- [toOmrsYearlessDateFormat](API.md#toomrsyearlessdateformat)
|
|
50
71
|
|
|
72
|
+
### Error Handling Functions
|
|
73
|
+
|
|
74
|
+
- [createErrorHandler](API.md#createerrorhandler)
|
|
75
|
+
- [reportError](API.md#reporterror)
|
|
76
|
+
|
|
77
|
+
### Extension Functions
|
|
78
|
+
|
|
79
|
+
- [attach](API.md#attach)
|
|
80
|
+
- [detach](API.md#detach)
|
|
81
|
+
- [detachAll](API.md#detachall)
|
|
82
|
+
- [getAssignedExtensions](API.md#getassignedextensions)
|
|
83
|
+
- [getConnectedExtensions](API.md#getconnectedextensions)
|
|
84
|
+
- [getExtensionNameFromId](API.md#getextensionnamefromid)
|
|
85
|
+
- [getExtensionStore](API.md#getextensionstore)
|
|
86
|
+
- [renderExtension](API.md#renderextension)
|
|
87
|
+
- [useAssignedExtensionIds](API.md#useassignedextensionids)
|
|
88
|
+
- [useAssignedExtensions](API.md#useassignedextensions)
|
|
89
|
+
- [useConnectedExtensions](API.md#useconnectedextensions)
|
|
90
|
+
- [useExtensionSlotMeta](API.md#useextensionslotmeta)
|
|
91
|
+
- [useExtensionStore](API.md#useextensionstore)
|
|
92
|
+
|
|
93
|
+
### Framework Functions
|
|
94
|
+
|
|
95
|
+
- [getAsyncExtensionLifecycle](API.md#getasyncextensionlifecycle)
|
|
96
|
+
- [getAsyncLifecycle](API.md#getasynclifecycle)
|
|
97
|
+
- [getLifecycle](API.md#getlifecycle)
|
|
98
|
+
- [getSyncLifecycle](API.md#getsynclifecycle)
|
|
99
|
+
|
|
51
100
|
### Navigation Functions
|
|
52
101
|
|
|
53
102
|
- [interpolateString](API.md#interpolatestring)
|
|
54
103
|
- [interpolateUrl](API.md#interpolateurl)
|
|
55
|
-
- [isUrl](API.md#isurl)
|
|
56
|
-
- [isUrlWithTemplateParameters](API.md#isurlwithtemplateparameters)
|
|
57
104
|
- [navigate](API.md#navigate)
|
|
58
105
|
|
|
59
|
-
###
|
|
106
|
+
### Offline Functions
|
|
60
107
|
|
|
61
|
-
- [activateOfflineCapability](API.md#activateofflinecapability)
|
|
62
|
-
- [age](API.md#age)
|
|
63
|
-
- [attach](API.md#attach)
|
|
64
108
|
- [beginEditSynchronizationItem](API.md#begineditsynchronizationitem)
|
|
65
109
|
- [canBeginEditSynchronizationItemsOfType](API.md#canbegineditsynchronizationitemsoftype)
|
|
66
|
-
- [checkStatus](API.md#checkstatus)
|
|
67
|
-
- [checkStatusFor](API.md#checkstatusfor)
|
|
68
|
-
- [createErrorHandler](API.md#createerrorhandler)
|
|
69
|
-
- [createGlobalStore](API.md#createglobalstore)
|
|
70
|
-
- [createUseStore](API.md#createusestore)
|
|
71
|
-
- [daysIntoYear](API.md#daysintoyear)
|
|
72
|
-
- [defineConfigSchema](API.md#defineconfigschema)
|
|
73
110
|
- [deleteSynchronizationItem](API.md#deletesynchronizationitem)
|
|
74
|
-
- [detach](API.md#detach)
|
|
75
|
-
- [detachAll](API.md#detachall)
|
|
76
|
-
- [dispatchConnectivityChanged](API.md#dispatchconnectivitychanged)
|
|
77
|
-
- [dispatchNetworkRequestFailed](API.md#dispatchnetworkrequestfailed)
|
|
78
|
-
- [dispatchNotificationShown](API.md#dispatchnotificationshown)
|
|
79
|
-
- [dispatchPrecacheStaticDependencies](API.md#dispatchprecachestaticdependencies)
|
|
80
111
|
- [generateOfflineUuid](API.md#generateofflineuuid)
|
|
81
|
-
- [getAppState](API.md#getappstate)
|
|
82
|
-
- [getAssignedExtensions](API.md#getassignedextensions)
|
|
83
|
-
- [getAsyncExtensionLifecycle](API.md#getasyncextensionlifecycle)
|
|
84
|
-
- [getAsyncLifecycle](API.md#getasynclifecycle)
|
|
85
|
-
- [getConfig](API.md#getconfig)
|
|
86
|
-
- [getConnectedExtensions](API.md#getconnectedextensions)
|
|
87
112
|
- [getCurrentOfflineMode](API.md#getcurrentofflinemode)
|
|
88
|
-
- [
|
|
89
|
-
- [
|
|
90
|
-
- [getExtensionRegistration](API.md#getextensionregistration)
|
|
91
|
-
- [getExtensionRegistrationFrom](API.md#getextensionregistrationfrom)
|
|
92
|
-
- [getExtensionStore](API.md#getextensionstore)
|
|
93
|
-
- [getGlobalStore](API.md#getglobalstore)
|
|
94
|
-
- [getLifecycle](API.md#getlifecycle)
|
|
113
|
+
- [getFullSynchronizationItems](API.md#getfullsynchronizationitems)
|
|
114
|
+
- [getFullSynchronizationItemsFor](API.md#getfullsynchronizationitemsfor)
|
|
95
115
|
- [getOfflinePatientDataStore](API.md#getofflinepatientdatastore)
|
|
96
|
-
- [getOfflineSynchronizationStore](API.md#getofflinesynchronizationstore)
|
|
97
|
-
- [getOmrsServiceWorker](API.md#getomrsserviceworker)
|
|
98
|
-
- [getSyncLifecycle](API.md#getsynclifecycle)
|
|
99
116
|
- [getSynchronizationItem](API.md#getsynchronizationitem)
|
|
100
117
|
- [getSynchronizationItems](API.md#getsynchronizationitems)
|
|
101
|
-
- [getSynchronizationItemsFor](API.md#getsynchronizationitemsfor)
|
|
102
|
-
- [handleApiError](API.md#handleapierror)
|
|
103
|
-
- [inRange](API.md#inrange)
|
|
104
|
-
- [integrateBreakpoints](API.md#integratebreakpoints)
|
|
105
118
|
- [isOfflineUuid](API.md#isofflineuuid)
|
|
106
|
-
- [isSameDay](API.md#issameday)
|
|
107
|
-
- [isVersionSatisfied](API.md#isversionsatisfied)
|
|
108
119
|
- [loadPersistedPatientDataSyncState](API.md#loadpersistedpatientdatasyncstate)
|
|
109
120
|
- [messageOmrsServiceWorker](API.md#messageomrsserviceworker)
|
|
110
|
-
- [openmrsComponentDecorator](API.md#openmrscomponentdecorator)
|
|
111
|
-
- [patchXMLHttpRequest](API.md#patchxmlhttprequest)
|
|
112
|
-
- [processConfig](API.md#processconfig)
|
|
113
|
-
- [provide](API.md#provide)
|
|
114
|
-
- [pushNavigationContext](API.md#pushnavigationcontext)
|
|
115
121
|
- [queueSynchronizationItem](API.md#queuesynchronizationitem)
|
|
116
|
-
- [queueSynchronizationItemFor](API.md#queuesynchronizationitemfor)
|
|
117
122
|
- [registerOfflinePatientHandler](API.md#registerofflinepatienthandler)
|
|
118
|
-
- [registerOmrsServiceWorker](API.md#registeromrsserviceworker)
|
|
119
|
-
- [renderExtension](API.md#renderextension)
|
|
120
|
-
- [renderInlineNotifications](API.md#renderinlinenotifications)
|
|
121
|
-
- [renderLoadingSpinner](API.md#renderloadingspinner)
|
|
122
|
-
- [renderModals](API.md#rendermodals)
|
|
123
|
-
- [renderToasts](API.md#rendertoasts)
|
|
124
|
-
- [reportError](API.md#reporterror)
|
|
125
|
-
- [retry](API.md#retry)
|
|
126
|
-
- [runSynchronization](API.md#runsynchronization)
|
|
127
|
-
- [setCurrentOfflineMode](API.md#setcurrentofflinemode)
|
|
128
123
|
- [setupOfflineSync](API.md#setupofflinesync)
|
|
129
|
-
- [setupPaths](API.md#setuppaths)
|
|
130
|
-
- [setupUtils](API.md#setuputils)
|
|
131
|
-
- [showModal](API.md#showmodal)
|
|
132
|
-
- [showNotification](API.md#shownotification)
|
|
133
|
-
- [showToast](API.md#showtoast)
|
|
134
124
|
- [subscribeConnectivity](API.md#subscribeconnectivity)
|
|
135
125
|
- [subscribeConnectivityChanged](API.md#subscribeconnectivitychanged)
|
|
136
|
-
- [subscribeNetworkRequestFailed](API.md#subscribenetworkrequestfailed)
|
|
137
|
-
- [subscribeNotificationShown](API.md#subscribenotificationshown)
|
|
138
126
|
- [subscribePrecacheStaticDependencies](API.md#subscribeprecachestaticdependencies)
|
|
127
|
+
- [syncOfflinePatientData](API.md#syncofflinepatientdata)
|
|
128
|
+
- [useConnectivity](API.md#useconnectivity)
|
|
129
|
+
|
|
130
|
+
### Store Functions
|
|
131
|
+
|
|
132
|
+
- [createGlobalStore](API.md#createglobalstore)
|
|
133
|
+
- [createUseStore](API.md#createusestore)
|
|
134
|
+
- [getAppState](API.md#getappstate)
|
|
135
|
+
- [getGlobalStore](API.md#getglobalstore)
|
|
139
136
|
- [subscribeTo](API.md#subscribeto)
|
|
137
|
+
- [useStore](API.md#usestore)
|
|
138
|
+
- [useStoreWithActions](API.md#usestorewithactions)
|
|
139
|
+
|
|
140
|
+
### UI Functions
|
|
141
|
+
|
|
142
|
+
- [setLeftNav](API.md#setleftnav)
|
|
143
|
+
- [showModal](API.md#showmodal)
|
|
144
|
+
- [showNotification](API.md#shownotification)
|
|
145
|
+
- [showToast](API.md#showtoast)
|
|
146
|
+
- [subscribeNotificationShown](API.md#subscribenotificationshown)
|
|
140
147
|
- [subscribeToastShown](API.md#subscribetoastshown)
|
|
141
|
-
- [
|
|
142
|
-
- [syncOfflinePatientData](API.md#syncofflinepatientdata)
|
|
143
|
-
- [translateFrom](API.md#translatefrom)
|
|
144
|
-
- [update](API.md#update)
|
|
145
|
-
- [useAssignedExtensionIds](API.md#useassignedextensionids)
|
|
146
|
-
- [useAssignedExtensions](API.md#useassignedextensions)
|
|
148
|
+
- [unsetLeftNav](API.md#unsetleftnav)
|
|
147
149
|
- [useBodyScrollLock](API.md#usebodyscrolllock)
|
|
148
|
-
- [useConfig](API.md#useconfig)
|
|
149
|
-
- [useConnectedExtensions](API.md#useconnectedextensions)
|
|
150
|
-
- [useConnectivity](API.md#useconnectivity)
|
|
151
|
-
- [useCurrentPatient](API.md#usecurrentpatient)
|
|
152
|
-
- [useExtensionSlotMeta](API.md#useextensionslotmeta)
|
|
153
|
-
- [useExtensionStore](API.md#useextensionstore)
|
|
154
|
-
- [useForceUpdate](API.md#useforceupdate)
|
|
155
150
|
- [useLayoutType](API.md#uselayouttype)
|
|
156
|
-
- [useLocations](API.md#uselocations)
|
|
157
|
-
- [useNavigationContext](API.md#usenavigationcontext)
|
|
158
151
|
- [useOnClickOutside](API.md#useonclickoutside)
|
|
159
152
|
- [usePagination](API.md#usepagination)
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
- [
|
|
164
|
-
- [
|
|
165
|
-
- [
|
|
166
|
-
- [
|
|
153
|
+
|
|
154
|
+
### Utility Functions
|
|
155
|
+
|
|
156
|
+
- [age](API.md#age)
|
|
157
|
+
- [daysIntoYear](API.md#daysintoyear)
|
|
158
|
+
- [isSameDay](API.md#issameday)
|
|
159
|
+
- [isVersionSatisfied](API.md#isversionsatisfied)
|
|
160
|
+
- [retry](API.md#retry)
|
|
161
|
+
- [translateFrom](API.md#translatefrom)
|
|
167
162
|
|
|
168
163
|
## API Type aliases
|
|
169
164
|
|
|
@@ -173,7 +168,17 @@
|
|
|
173
168
|
|
|
174
169
|
#### Defined in
|
|
175
170
|
|
|
176
|
-
[packages/framework/esm-api/src/shared-api-objects/current-patient.ts:
|
|
171
|
+
[packages/framework/esm-api/src/shared-api-objects/current-patient.ts:5](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/current-patient.ts#L5)
|
|
172
|
+
|
|
173
|
+
___
|
|
174
|
+
|
|
175
|
+
### NullablePatient
|
|
176
|
+
|
|
177
|
+
Ƭ **NullablePatient**: `fhir.Patient` \| ``null``
|
|
178
|
+
|
|
179
|
+
#### Defined in
|
|
180
|
+
|
|
181
|
+
[packages/framework/esm-react-utils/src/usePatient.ts:5](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/usePatient.ts#L5)
|
|
177
182
|
|
|
178
183
|
___
|
|
179
184
|
|
|
@@ -183,11 +188,11 @@ ___
|
|
|
183
188
|
|
|
184
189
|
#### Defined in
|
|
185
190
|
|
|
186
|
-
[packages/framework/esm-api/src/shared-api-objects/current-patient.ts:
|
|
191
|
+
[packages/framework/esm-api/src/shared-api-objects/current-patient.ts:19](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/current-patient.ts#L19)
|
|
187
192
|
|
|
188
193
|
___
|
|
189
194
|
|
|
190
|
-
## Date and
|
|
195
|
+
## Date and Time Type aliases
|
|
191
196
|
|
|
192
197
|
### DateInput
|
|
193
198
|
|
|
@@ -228,61 +233,7 @@ ___
|
|
|
228
233
|
|
|
229
234
|
___
|
|
230
235
|
|
|
231
|
-
##
|
|
232
|
-
|
|
233
|
-
### Actions
|
|
234
|
-
|
|
235
|
-
Ƭ **Actions**: `Function` \| { `[key: string]`: `Function`; }
|
|
236
|
-
|
|
237
|
-
#### Defined in
|
|
238
|
-
|
|
239
|
-
[packages/framework/esm-react-utils/src/createUseStore.ts:4](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/createUseStore.ts#L4)
|
|
240
|
-
|
|
241
|
-
___
|
|
242
|
-
|
|
243
|
-
### BoundActions
|
|
244
|
-
|
|
245
|
-
Ƭ **BoundActions**: `Object`
|
|
246
|
-
|
|
247
|
-
#### Index signature
|
|
248
|
-
|
|
249
|
-
▪ [key: `string`]: `BoundAction`
|
|
250
|
-
|
|
251
|
-
#### Defined in
|
|
252
|
-
|
|
253
|
-
[packages/framework/esm-react-utils/src/createUseStore.ts:5](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/createUseStore.ts#L5)
|
|
254
|
-
|
|
255
|
-
___
|
|
256
|
-
|
|
257
|
-
### ConfigValue
|
|
258
|
-
|
|
259
|
-
Ƭ **ConfigValue**: `string` \| `number` \| `boolean` \| `void` \| `any`[] \| `object`
|
|
260
|
-
|
|
261
|
-
#### Defined in
|
|
262
|
-
|
|
263
|
-
[packages/framework/esm-config/src/types.ts:31](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/types.ts#L31)
|
|
264
|
-
|
|
265
|
-
___
|
|
266
|
-
|
|
267
|
-
### ExtensionSlotProps
|
|
268
|
-
|
|
269
|
-
Ƭ **ExtensionSlotProps**: [`ExtensionSlotBaseProps`](interfaces/ExtensionSlotBaseProps.md) & `React.HTMLAttributes`<`HTMLDivElement`\>
|
|
270
|
-
|
|
271
|
-
#### Defined in
|
|
272
|
-
|
|
273
|
-
[packages/framework/esm-react-utils/src/ExtensionSlot.tsx:48](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/ExtensionSlot.tsx#L48)
|
|
274
|
-
|
|
275
|
-
___
|
|
276
|
-
|
|
277
|
-
### KnownOmrsServiceWorkerEvents
|
|
278
|
-
|
|
279
|
-
Ƭ **KnownOmrsServiceWorkerEvents**: [`NetworkRequestFailedEvent`](interfaces/NetworkRequestFailedEvent.md)
|
|
280
|
-
|
|
281
|
-
#### Defined in
|
|
282
|
-
|
|
283
|
-
[packages/framework/esm-offline/src/service-worker-events.ts:15](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker-events.ts#L15)
|
|
284
|
-
|
|
285
|
-
___
|
|
236
|
+
## Offline Type aliases
|
|
286
237
|
|
|
287
238
|
### KnownOmrsServiceWorkerMessages
|
|
288
239
|
|
|
@@ -290,37 +241,7 @@ ___
|
|
|
290
241
|
|
|
291
242
|
#### Defined in
|
|
292
243
|
|
|
293
|
-
[packages/framework/esm-offline/src/service-worker-messaging.ts:
|
|
294
|
-
|
|
295
|
-
___
|
|
296
|
-
|
|
297
|
-
### LayoutType
|
|
298
|
-
|
|
299
|
-
Ƭ **LayoutType**: ``"tablet"`` \| ``"phone"`` \| ``"desktop"``
|
|
300
|
-
|
|
301
|
-
#### Defined in
|
|
302
|
-
|
|
303
|
-
[packages/framework/esm-react-utils/src/useLayoutType.ts:3](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/useLayoutType.ts#L3)
|
|
304
|
-
|
|
305
|
-
___
|
|
306
|
-
|
|
307
|
-
### LoggedInUserData
|
|
308
|
-
|
|
309
|
-
Ƭ **LoggedInUserData**: [`UnauthenticatedUser`](interfaces/UnauthenticatedUser.md) & { `user?`: [`LoggedInUser`](interfaces/LoggedInUser.md) }
|
|
310
|
-
|
|
311
|
-
#### Defined in
|
|
312
|
-
|
|
313
|
-
[packages/framework/esm-api/src/types/fetch.ts:7](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/types/fetch.ts#L7)
|
|
314
|
-
|
|
315
|
-
___
|
|
316
|
-
|
|
317
|
-
### NavigationContextType
|
|
318
|
-
|
|
319
|
-
Ƭ **NavigationContextType**: ``"workspace"`` \| ``"dialog"`` \| ``"link"``
|
|
320
|
-
|
|
321
|
-
#### Defined in
|
|
322
|
-
|
|
323
|
-
[packages/framework/esm-extensions/src/contexts.ts:3](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/contexts.ts#L3)
|
|
244
|
+
[packages/framework/esm-offline/src/service-worker-messaging.ts:46](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker-messaging.ts#L46)
|
|
324
245
|
|
|
325
246
|
___
|
|
326
247
|
|
|
@@ -330,7 +251,7 @@ ___
|
|
|
330
251
|
|
|
331
252
|
#### Defined in
|
|
332
253
|
|
|
333
|
-
[packages/framework/esm-offline/src/mode.ts:
|
|
254
|
+
[packages/framework/esm-offline/src/mode.ts:38](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/mode.ts#L38)
|
|
334
255
|
|
|
335
256
|
___
|
|
336
257
|
|
|
@@ -345,7 +266,7 @@ ___
|
|
|
345
266
|
|
|
346
267
|
#### Defined in
|
|
347
268
|
|
|
348
|
-
[packages/framework/esm-offline/src/service-worker-http-headers.ts:
|
|
269
|
+
[packages/framework/esm-offline/src/service-worker-http-headers.ts:18](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker-http-headers.ts#L18)
|
|
349
270
|
|
|
350
271
|
___
|
|
351
272
|
|
|
@@ -355,7 +276,7 @@ ___
|
|
|
355
276
|
|
|
356
277
|
#### Defined in
|
|
357
278
|
|
|
358
|
-
[packages/framework/esm-offline/src/service-worker-http-headers.ts:
|
|
279
|
+
[packages/framework/esm-offline/src/service-worker-http-headers.ts:45](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker-http-headers.ts#L45)
|
|
359
280
|
|
|
360
281
|
___
|
|
361
282
|
|
|
@@ -376,43 +297,29 @@ HTTP requests with these headers are handled in a special way by the SPA's servi
|
|
|
376
297
|
|
|
377
298
|
#### Defined in
|
|
378
299
|
|
|
379
|
-
[packages/framework/esm-offline/src/service-worker-http-headers.ts:
|
|
300
|
+
[packages/framework/esm-offline/src/service-worker-http-headers.ts:26](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker-http-headers.ts#L26)
|
|
380
301
|
|
|
381
302
|
___
|
|
382
303
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
Ƭ **ProcessSyncItem**<`T`\>: (`item`: `T`, `options`: [`SyncProcessOptions`](interfaces/SyncProcessOptions.md)<`T`\>) => `Promise`<`any`\>
|
|
386
|
-
|
|
387
|
-
#### Type parameters
|
|
388
|
-
|
|
389
|
-
| Name |
|
|
390
|
-
| :------ |
|
|
391
|
-
| `T` |
|
|
304
|
+
## Other Type aliases
|
|
392
305
|
|
|
393
|
-
|
|
306
|
+
### ConfigValue
|
|
394
307
|
|
|
395
|
-
|
|
308
|
+
Ƭ **ConfigValue**: `string` \| `number` \| `boolean` \| `void` \| `any`[] \| `object`
|
|
396
309
|
|
|
397
|
-
|
|
398
|
-
`item` (which is the actual data to be synchronized).
|
|
399
|
-
The function receives additional `options` which provide additional data that can be used
|
|
400
|
-
for synchronizing.
|
|
310
|
+
#### Defined in
|
|
401
311
|
|
|
402
|
-
|
|
312
|
+
[packages/framework/esm-config/src/types.ts:32](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/types.ts#L32)
|
|
403
313
|
|
|
404
|
-
|
|
405
|
-
| :------ | :------ |
|
|
406
|
-
| `item` | `T` |
|
|
407
|
-
| `options` | [`SyncProcessOptions`](interfaces/SyncProcessOptions.md)<`T`\> |
|
|
314
|
+
___
|
|
408
315
|
|
|
409
|
-
|
|
316
|
+
### ExtensionSlotProps
|
|
410
317
|
|
|
411
|
-
`
|
|
318
|
+
Ƭ **ExtensionSlotProps**: [`ExtensionSlotBaseProps`](interfaces/ExtensionSlotBaseProps.md) & `React.HTMLAttributes`<`HTMLDivElement`\>
|
|
412
319
|
|
|
413
320
|
#### Defined in
|
|
414
321
|
|
|
415
|
-
[packages/framework/esm-
|
|
322
|
+
[packages/framework/esm-react-utils/src/ExtensionSlot.tsx:48](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/ExtensionSlot.tsx#L48)
|
|
416
323
|
|
|
417
324
|
___
|
|
418
325
|
|
|
@@ -429,7 +336,7 @@ ___
|
|
|
429
336
|
|
|
430
337
|
#### Defined in
|
|
431
338
|
|
|
432
|
-
[packages/framework/esm-config/src/types.ts:
|
|
339
|
+
[packages/framework/esm-config/src/types.ts:60](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/types.ts#L60)
|
|
433
340
|
|
|
434
341
|
___
|
|
435
342
|
|
|
@@ -473,7 +380,7 @@ ___
|
|
|
473
380
|
|
|
474
381
|
#### Defined in
|
|
475
382
|
|
|
476
|
-
[packages/framework/esm-config/src/types.ts:
|
|
383
|
+
[packages/framework/esm-config/src/types.ts:67](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/types.ts#L67)
|
|
477
384
|
|
|
478
385
|
___
|
|
479
386
|
|
|
@@ -497,163 +404,182 @@ ___
|
|
|
497
404
|
|
|
498
405
|
#### Defined in
|
|
499
406
|
|
|
500
|
-
[packages/framework/esm-config/src/types.ts:
|
|
407
|
+
[packages/framework/esm-config/src/types.ts:65](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/types.ts#L65)
|
|
501
408
|
|
|
502
|
-
|
|
409
|
+
___
|
|
503
410
|
|
|
504
|
-
|
|
411
|
+
## Store Type aliases
|
|
505
412
|
|
|
506
|
-
|
|
413
|
+
### Actions
|
|
507
414
|
|
|
508
|
-
|
|
509
|
-
that can be used to call FHIR-compliant OpenMRS APIs. See
|
|
510
|
-
[the docs for fhir.js](https://github.com/FHIR/fhir.js) for more info
|
|
511
|
-
and example usage.
|
|
415
|
+
Ƭ **Actions**: `Function` \| { `[key: string]`: `Function`; }
|
|
512
416
|
|
|
513
417
|
#### Defined in
|
|
514
418
|
|
|
515
|
-
[packages/framework/esm-
|
|
419
|
+
[packages/framework/esm-react-utils/src/createUseStore.ts:5](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/createUseStore.ts#L5)
|
|
516
420
|
|
|
517
421
|
___
|
|
518
422
|
|
|
519
|
-
###
|
|
423
|
+
### BoundActions
|
|
520
424
|
|
|
521
|
-
|
|
425
|
+
Ƭ **BoundActions**: `Object`
|
|
426
|
+
|
|
427
|
+
#### Index signature
|
|
428
|
+
|
|
429
|
+
▪ [key: `string`]: `BoundAction`
|
|
522
430
|
|
|
523
431
|
#### Defined in
|
|
524
432
|
|
|
525
|
-
[packages/framework/esm-
|
|
433
|
+
[packages/framework/esm-react-utils/src/createUseStore.ts:6](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/createUseStore.ts#L6)
|
|
526
434
|
|
|
527
435
|
___
|
|
528
436
|
|
|
529
|
-
|
|
437
|
+
## UI Type aliases
|
|
530
438
|
|
|
531
|
-
|
|
439
|
+
### InlineNotificationType
|
|
440
|
+
|
|
441
|
+
Ƭ **InlineNotificationType**: ``"error"`` \| ``"info"`` \| ``"info-square"`` \| ``"success"`` \| ``"warning"`` \| ``"warning-alt"``
|
|
532
442
|
|
|
533
443
|
#### Defined in
|
|
534
444
|
|
|
535
|
-
[packages/framework/esm-
|
|
445
|
+
[packages/framework/esm-styleguide/src/notifications/notification.component.tsx:22](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-styleguide/src/notifications/notification.component.tsx#L22)
|
|
536
446
|
|
|
537
447
|
___
|
|
538
448
|
|
|
539
|
-
###
|
|
449
|
+
### LayoutType
|
|
540
450
|
|
|
541
|
-
|
|
451
|
+
Ƭ **LayoutType**: ``"tablet"`` \| ``"phone"`` \| ``"desktop"``
|
|
542
452
|
|
|
543
453
|
#### Defined in
|
|
544
454
|
|
|
545
|
-
[packages/framework/esm-
|
|
455
|
+
[packages/framework/esm-react-utils/src/useLayoutType.ts:4](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/useLayoutType.ts#L4)
|
|
546
456
|
|
|
547
457
|
___
|
|
548
458
|
|
|
549
|
-
|
|
459
|
+
### ToastType
|
|
550
460
|
|
|
551
|
-
|
|
461
|
+
Ƭ **ToastType**: ``"error"`` \| ``"info"`` \| ``"info-square"`` \| ``"success"`` \| ``"warning"`` \| ``"warning-alt"``
|
|
552
462
|
|
|
553
|
-
|
|
463
|
+
#### Defined in
|
|
554
464
|
|
|
555
|
-
|
|
465
|
+
[packages/framework/esm-styleguide/src/toasts/toast.component.tsx:26](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-styleguide/src/toasts/toast.component.tsx#L26)
|
|
556
466
|
|
|
557
|
-
|
|
467
|
+
## API Variables
|
|
558
468
|
|
|
559
|
-
|
|
469
|
+
### UserHasAccess
|
|
560
470
|
|
|
561
|
-
|
|
471
|
+
• **UserHasAccess**: `React.FC`<[`UserHasAccessProps`](interfaces/UserHasAccessProps.md)\>
|
|
562
472
|
|
|
563
473
|
#### Defined in
|
|
564
474
|
|
|
565
|
-
[packages/framework/esm-react-utils/src/
|
|
475
|
+
[packages/framework/esm-react-utils/src/UserHasAccess.tsx:9](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/UserHasAccess.tsx#L9)
|
|
566
476
|
|
|
567
477
|
___
|
|
568
478
|
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
### ComponentContext
|
|
572
|
-
|
|
573
|
-
• **ComponentContext**: `Context`<[`ComponentConfig`](interfaces/ComponentConfig.md)\>
|
|
479
|
+
### defaultVisitCustomRepresentation
|
|
574
480
|
|
|
575
|
-
|
|
481
|
+
• **defaultVisitCustomRepresentation**: `string`
|
|
576
482
|
|
|
577
483
|
#### Defined in
|
|
578
484
|
|
|
579
|
-
[packages/framework/esm-
|
|
485
|
+
[packages/framework/esm-api/src/shared-api-objects/visit-utils.ts:12](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/visit-utils.ts#L12)
|
|
580
486
|
|
|
581
487
|
___
|
|
582
488
|
|
|
583
|
-
###
|
|
489
|
+
### fhir
|
|
584
490
|
|
|
585
|
-
• **
|
|
491
|
+
• **fhir**: `FhirClient`
|
|
586
492
|
|
|
587
|
-
|
|
588
|
-
|
|
493
|
+
The `fhir` object is [an instance of fhir.js](https://github.com/FHIR/fhir.js)
|
|
494
|
+
that can be used to call FHIR-compliant OpenMRS APIs. See
|
|
495
|
+
[the docs for fhir.js](https://github.com/FHIR/fhir.js) for more info
|
|
496
|
+
and example usage.
|
|
589
497
|
|
|
590
|
-
|
|
498
|
+
#### Defined in
|
|
591
499
|
|
|
592
|
-
|
|
593
|
-
|
|
500
|
+
[packages/framework/esm-api/src/fhir.ts:42](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/fhir.ts#L42)
|
|
501
|
+
|
|
502
|
+
___
|
|
503
|
+
|
|
504
|
+
### fhirBaseUrl
|
|
505
|
+
|
|
506
|
+
• **fhirBaseUrl**: ``"/ws/fhir2/R4"``
|
|
594
507
|
|
|
595
508
|
#### Defined in
|
|
596
509
|
|
|
597
|
-
[packages/framework/esm-
|
|
510
|
+
[packages/framework/esm-api/src/fhir.ts:5](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/fhir.ts#L5)
|
|
598
511
|
|
|
599
512
|
___
|
|
600
513
|
|
|
601
|
-
###
|
|
514
|
+
### getStartedVisit
|
|
602
515
|
|
|
603
|
-
• **
|
|
516
|
+
• **getStartedVisit**: `BehaviorSubject`<``null`` \| [`VisitItem`](interfaces/VisitItem.md)\>
|
|
604
517
|
|
|
605
518
|
#### Defined in
|
|
606
519
|
|
|
607
|
-
[packages/framework/esm-
|
|
520
|
+
[packages/framework/esm-api/src/shared-api-objects/visit-utils.ts:74](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/visit-utils.ts#L74)
|
|
608
521
|
|
|
609
522
|
___
|
|
610
523
|
|
|
611
|
-
###
|
|
524
|
+
### sessionEndpoint
|
|
612
525
|
|
|
613
|
-
• **
|
|
526
|
+
• **sessionEndpoint**: ``"/ws/rest/v1/session"``
|
|
614
527
|
|
|
615
528
|
#### Defined in
|
|
616
529
|
|
|
617
|
-
[packages/framework/esm-
|
|
530
|
+
[packages/framework/esm-api/src/openmrs-fetch.ts:7](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/openmrs-fetch.ts#L7)
|
|
618
531
|
|
|
619
532
|
___
|
|
620
533
|
|
|
621
|
-
|
|
534
|
+
## Config Validation Variables
|
|
622
535
|
|
|
623
|
-
|
|
536
|
+
### validators
|
|
537
|
+
|
|
538
|
+
• **validators**: `Object`
|
|
624
539
|
|
|
625
540
|
#### Type declaration
|
|
626
541
|
|
|
627
542
|
| Name | Type |
|
|
628
543
|
| :------ | :------ |
|
|
629
|
-
| `
|
|
630
|
-
| `
|
|
544
|
+
| `inRange` | (`min`: `number`, `max`: `number`) => [`Validator`](API.md#validator) |
|
|
545
|
+
| `isUrl` | [`Validator`](API.md#validator) |
|
|
546
|
+
| `isUrlWithTemplateParameters` | (`allowedTemplateParameters`: `string`[]) => [`Validator`](API.md#validator) |
|
|
631
547
|
|
|
632
548
|
#### Defined in
|
|
633
549
|
|
|
634
|
-
[packages/framework/esm-
|
|
550
|
+
[packages/framework/esm-config/src/validators/validators.ts:58](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/validators/validators.ts#L58)
|
|
635
551
|
|
|
636
552
|
___
|
|
637
553
|
|
|
638
|
-
|
|
554
|
+
## Navigation Variables
|
|
555
|
+
|
|
556
|
+
### ConfigurableLink
|
|
557
|
+
|
|
558
|
+
• **ConfigurableLink**: `React.FC`<[`ConfigurableLinkProps`](interfaces/ConfigurableLinkProps.md)\>
|
|
559
|
+
|
|
560
|
+
A React link component which calls [navigate](API.md#navigate) when clicked
|
|
561
|
+
|
|
562
|
+
**`param`** The target path or URL. Supports interpolation. See [navigate](API.md#navigate)
|
|
639
563
|
|
|
640
|
-
|
|
564
|
+
**`param`** Inline elements within the link
|
|
641
565
|
|
|
642
|
-
**`
|
|
566
|
+
**`param`** Any other valid props for an <a> tag except `href` and `onClick`
|
|
643
567
|
|
|
644
568
|
#### Defined in
|
|
645
569
|
|
|
646
|
-
[packages/framework/esm-
|
|
570
|
+
[packages/framework/esm-react-utils/src/ConfigurableLink.tsx:32](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/ConfigurableLink.tsx#L32)
|
|
647
571
|
|
|
648
572
|
___
|
|
649
573
|
|
|
574
|
+
## Offline Variables
|
|
575
|
+
|
|
650
576
|
### offlineUuidPrefix
|
|
651
577
|
|
|
652
578
|
• **offlineUuidPrefix**: ``"OFFLINE+"``
|
|
653
579
|
|
|
654
580
|
#### Defined in
|
|
655
581
|
|
|
656
|
-
[packages/framework/esm-offline/src/uuid.ts:
|
|
582
|
+
[packages/framework/esm-offline/src/uuid.ts:4](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/uuid.ts#L4)
|
|
657
583
|
|
|
658
584
|
___
|
|
659
585
|
|
|
@@ -663,7 +589,7 @@ ___
|
|
|
663
589
|
|
|
664
590
|
#### Defined in
|
|
665
591
|
|
|
666
|
-
[packages/framework/esm-offline/src/service-worker-http-headers.ts:
|
|
592
|
+
[packages/framework/esm-offline/src/service-worker-http-headers.ts:7](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker-http-headers.ts#L7)
|
|
667
593
|
|
|
668
594
|
___
|
|
669
595
|
|
|
@@ -673,7 +599,7 @@ ___
|
|
|
673
599
|
|
|
674
600
|
#### Defined in
|
|
675
601
|
|
|
676
|
-
[packages/framework/esm-offline/src/service-worker-http-headers.ts:
|
|
602
|
+
[packages/framework/esm-offline/src/service-worker-http-headers.ts:3](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker-http-headers.ts#L3)
|
|
677
603
|
|
|
678
604
|
___
|
|
679
605
|
|
|
@@ -683,25 +609,66 @@ ___
|
|
|
683
609
|
|
|
684
610
|
#### Defined in
|
|
685
611
|
|
|
686
|
-
[packages/framework/esm-offline/src/service-worker-http-headers.ts:
|
|
612
|
+
[packages/framework/esm-offline/src/service-worker-http-headers.ts:5](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker-http-headers.ts#L5)
|
|
687
613
|
|
|
688
614
|
___
|
|
689
615
|
|
|
690
|
-
|
|
616
|
+
## Other Variables
|
|
691
617
|
|
|
692
|
-
|
|
618
|
+
### Extension
|
|
619
|
+
|
|
620
|
+
• **Extension**: `React.FC`<[`ExtensionProps`](interfaces/ExtensionProps.md)\>
|
|
621
|
+
|
|
622
|
+
Represents the position in the DOM where each extension within
|
|
623
|
+
an extension slot is rendered.
|
|
624
|
+
|
|
625
|
+
Renders once for each extension attached to that extension slot.
|
|
626
|
+
|
|
627
|
+
Usage of this component *must* have an ancestor `<ExtensionSlot>`,
|
|
628
|
+
and *must* only be used once within that `<ExtensionSlot>`.
|
|
629
|
+
|
|
630
|
+
#### Defined in
|
|
631
|
+
|
|
632
|
+
[packages/framework/esm-react-utils/src/Extension.tsx:23](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/Extension.tsx#L23)
|
|
633
|
+
|
|
634
|
+
___
|
|
635
|
+
|
|
636
|
+
### ExtensionSlot
|
|
637
|
+
|
|
638
|
+
• **ExtensionSlot**: `React.FC`<[`ExtensionSlotProps`](API.md#extensionslotprops)\>
|
|
639
|
+
|
|
640
|
+
#### Defined in
|
|
641
|
+
|
|
642
|
+
[packages/framework/esm-react-utils/src/ExtensionSlot.tsx:55](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/ExtensionSlot.tsx#L55)
|
|
643
|
+
|
|
644
|
+
___
|
|
645
|
+
|
|
646
|
+
### backendDependencies
|
|
647
|
+
|
|
648
|
+
• **backendDependencies**: `Object`
|
|
693
649
|
|
|
694
650
|
#### Type declaration
|
|
695
651
|
|
|
696
652
|
| Name | Type |
|
|
697
653
|
| :------ | :------ |
|
|
698
|
-
| `
|
|
699
|
-
| `
|
|
700
|
-
|
|
654
|
+
| `fhir2` | `string` |
|
|
655
|
+
| `webservices.rest` | `string` |
|
|
656
|
+
|
|
657
|
+
#### Defined in
|
|
658
|
+
|
|
659
|
+
[packages/framework/esm-api/src/openmrs-backend-dependencies.ts:1](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/openmrs-backend-dependencies.ts#L1)
|
|
660
|
+
|
|
661
|
+
___
|
|
662
|
+
|
|
663
|
+
## UI Variables
|
|
664
|
+
|
|
665
|
+
### LeftNavMenu
|
|
666
|
+
|
|
667
|
+
• **LeftNavMenu**: `ForwardRefExoticComponent`<`SideNavProps` & `RefAttributes`<`HTMLElement`\>\>
|
|
701
668
|
|
|
702
669
|
#### Defined in
|
|
703
670
|
|
|
704
|
-
[packages/framework/esm-
|
|
671
|
+
[packages/framework/esm-styleguide/src/left-nav/index.tsx:30](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-styleguide/src/left-nav/index.tsx#L30)
|
|
705
672
|
|
|
706
673
|
## API Functions
|
|
707
674
|
|
|
@@ -722,7 +689,7 @@ ___
|
|
|
722
689
|
|
|
723
690
|
#### Defined in
|
|
724
691
|
|
|
725
|
-
[packages/framework/esm-api/src/shared-api-objects/current-patient.ts:
|
|
692
|
+
[packages/framework/esm-api/src/shared-api-objects/current-patient.ts:21](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/current-patient.ts#L21)
|
|
726
693
|
|
|
727
694
|
___
|
|
728
695
|
|
|
@@ -767,9 +734,9 @@ leak and source of bugs.
|
|
|
767
734
|
|
|
768
735
|
#### Defined in
|
|
769
736
|
|
|
770
|
-
[packages/framework/esm-api/src/shared-api-objects/current-user.ts:
|
|
737
|
+
[packages/framework/esm-api/src/shared-api-objects/current-user.ts:57](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/current-user.ts#L57)
|
|
771
738
|
|
|
772
|
-
▸ **getCurrentUser**(`opts`): `Observable`<[`
|
|
739
|
+
▸ **getCurrentUser**(`opts`): `Observable`<[`Session`](interfaces/Session.md)\>
|
|
773
740
|
|
|
774
741
|
#### Parameters
|
|
775
742
|
|
|
@@ -779,11 +746,11 @@ leak and source of bugs.
|
|
|
779
746
|
|
|
780
747
|
#### Returns
|
|
781
748
|
|
|
782
|
-
`Observable`<[`
|
|
749
|
+
`Observable`<[`Session`](interfaces/Session.md)\>
|
|
783
750
|
|
|
784
751
|
#### Defined in
|
|
785
752
|
|
|
786
|
-
[packages/framework/esm-api/src/shared-api-objects/current-user.ts:
|
|
753
|
+
[packages/framework/esm-api/src/shared-api-objects/current-user.ts:58](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/current-user.ts#L58)
|
|
787
754
|
|
|
788
755
|
▸ **getCurrentUser**(`opts`): `Observable`<[`LoggedInUser`](interfaces/LoggedInUser.md)\>
|
|
789
756
|
|
|
@@ -799,7 +766,7 @@ leak and source of bugs.
|
|
|
799
766
|
|
|
800
767
|
#### Defined in
|
|
801
768
|
|
|
802
|
-
[packages/framework/esm-api/src/shared-api-objects/current-user.ts:
|
|
769
|
+
[packages/framework/esm-api/src/shared-api-objects/current-user.ts:61](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/current-user.ts#L61)
|
|
803
770
|
|
|
804
771
|
___
|
|
805
772
|
|
|
@@ -813,7 +780,7 @@ ___
|
|
|
813
780
|
|
|
814
781
|
#### Defined in
|
|
815
782
|
|
|
816
|
-
[packages/framework/esm-api/src/shared-api-objects/location.ts:
|
|
783
|
+
[packages/framework/esm-api/src/shared-api-objects/location.ts:14](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/location.ts#L14)
|
|
817
784
|
|
|
818
785
|
___
|
|
819
786
|
|
|
@@ -827,7 +794,7 @@ ___
|
|
|
827
794
|
|
|
828
795
|
#### Defined in
|
|
829
796
|
|
|
830
|
-
[packages/framework/esm-api/src/shared-api-objects/current-user.ts:
|
|
797
|
+
[packages/framework/esm-api/src/shared-api-objects/current-user.ts:136](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/current-user.ts#L136)
|
|
831
798
|
|
|
832
799
|
___
|
|
833
800
|
|
|
@@ -841,7 +808,7 @@ ___
|
|
|
841
808
|
|
|
842
809
|
#### Defined in
|
|
843
810
|
|
|
844
|
-
[packages/framework/esm-api/src/shared-api-objects/current-user.ts:
|
|
811
|
+
[packages/framework/esm-api/src/shared-api-objects/current-user.ts:145](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/current-user.ts#L145)
|
|
845
812
|
|
|
846
813
|
___
|
|
847
814
|
|
|
@@ -855,7 +822,7 @@ ___
|
|
|
855
822
|
|
|
856
823
|
#### Defined in
|
|
857
824
|
|
|
858
|
-
[packages/framework/esm-api/src/shared-api-objects/visit-type.ts:
|
|
825
|
+
[packages/framework/esm-api/src/shared-api-objects/visit-type.ts:15](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/visit-type.ts#L15)
|
|
859
826
|
|
|
860
827
|
___
|
|
861
828
|
|
|
@@ -877,7 +844,7 @@ ___
|
|
|
877
844
|
|
|
878
845
|
#### Defined in
|
|
879
846
|
|
|
880
|
-
[packages/framework/esm-api/src/shared-api-objects/visit-utils.ts:
|
|
847
|
+
[packages/framework/esm-api/src/shared-api-objects/visit-utils.ts:20](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/visit-utils.ts#L20)
|
|
881
848
|
|
|
882
849
|
___
|
|
883
850
|
|
|
@@ -885,6 +852,15 @@ ___
|
|
|
885
852
|
|
|
886
853
|
▸ **makeUrl**(`path`): `string`
|
|
887
854
|
|
|
855
|
+
Append `path` to the OpenMRS SPA base.
|
|
856
|
+
|
|
857
|
+
#### Example
|
|
858
|
+
|
|
859
|
+
```ts
|
|
860
|
+
makeUrl('/foo/bar');
|
|
861
|
+
// => '/openmrs/foo/bar'
|
|
862
|
+
```
|
|
863
|
+
|
|
888
864
|
#### Parameters
|
|
889
865
|
|
|
890
866
|
| Name | Type |
|
|
@@ -897,7 +873,7 @@ ___
|
|
|
897
873
|
|
|
898
874
|
#### Defined in
|
|
899
875
|
|
|
900
|
-
[packages/framework/esm-api/src/openmrs-fetch.ts:
|
|
876
|
+
[packages/framework/esm-api/src/openmrs-fetch.ts:19](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/openmrs-fetch.ts#L19)
|
|
901
877
|
|
|
902
878
|
___
|
|
903
879
|
|
|
@@ -964,7 +940,7 @@ free up memory and network resources and to prevent race conditions.
|
|
|
964
940
|
|
|
965
941
|
#### Defined in
|
|
966
942
|
|
|
967
|
-
[packages/framework/esm-api/src/openmrs-fetch.ts:
|
|
943
|
+
[packages/framework/esm-api/src/openmrs-fetch.ts:72](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/openmrs-fetch.ts#L72)
|
|
968
944
|
|
|
969
945
|
___
|
|
970
946
|
|
|
@@ -1015,7 +991,7 @@ To cancel the network request, simply call `subscription.unsubscribe();`
|
|
|
1015
991
|
|
|
1016
992
|
#### Defined in
|
|
1017
993
|
|
|
1018
|
-
[packages/framework/esm-api/src/openmrs-fetch.ts:
|
|
994
|
+
[packages/framework/esm-api/src/openmrs-fetch.ts:243](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/openmrs-fetch.ts#L243)
|
|
1019
995
|
|
|
1020
996
|
___
|
|
1021
997
|
|
|
@@ -1041,7 +1017,7 @@ refetchCurrentUser()
|
|
|
1041
1017
|
|
|
1042
1018
|
#### Defined in
|
|
1043
1019
|
|
|
1044
|
-
[packages/framework/esm-api/src/shared-api-objects/current-user.ts:
|
|
1020
|
+
[packages/framework/esm-api/src/shared-api-objects/current-user.ts:115](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/current-user.ts#L115)
|
|
1045
1021
|
|
|
1046
1022
|
___
|
|
1047
1023
|
|
|
@@ -1062,7 +1038,7 @@ ___
|
|
|
1062
1038
|
|
|
1063
1039
|
#### Defined in
|
|
1064
1040
|
|
|
1065
|
-
[packages/framework/esm-api/src/shared-api-objects/visit-utils.ts:
|
|
1041
|
+
[packages/framework/esm-api/src/shared-api-objects/visit-utils.ts:45](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/visit-utils.ts#L45)
|
|
1066
1042
|
|
|
1067
1043
|
___
|
|
1068
1044
|
|
|
@@ -1083,7 +1059,7 @@ ___
|
|
|
1083
1059
|
|
|
1084
1060
|
#### Defined in
|
|
1085
1061
|
|
|
1086
|
-
[packages/framework/esm-api/src/shared-api-objects/current-user.ts:
|
|
1062
|
+
[packages/framework/esm-api/src/shared-api-objects/current-user.ts:157](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/current-user.ts#L157)
|
|
1087
1063
|
|
|
1088
1064
|
___
|
|
1089
1065
|
|
|
@@ -1103,7 +1079,7 @@ ___
|
|
|
1103
1079
|
|
|
1104
1080
|
#### Defined in
|
|
1105
1081
|
|
|
1106
|
-
[packages/framework/esm-api/src/shared-api-objects/location.ts:
|
|
1082
|
+
[packages/framework/esm-api/src/shared-api-objects/location.ts:7](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/location.ts#L7)
|
|
1107
1083
|
|
|
1108
1084
|
___
|
|
1109
1085
|
|
|
@@ -1123,7 +1099,7 @@ ___
|
|
|
1123
1099
|
|
|
1124
1100
|
#### Defined in
|
|
1125
1101
|
|
|
1126
|
-
[packages/framework/esm-api/src/shared-api-objects/visit-type.ts:
|
|
1102
|
+
[packages/framework/esm-api/src/shared-api-objects/visit-type.ts:7](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/visit-type.ts#L7)
|
|
1127
1103
|
|
|
1128
1104
|
___
|
|
1129
1105
|
|
|
@@ -1145,7 +1121,132 @@ ___
|
|
|
1145
1121
|
|
|
1146
1122
|
#### Defined in
|
|
1147
1123
|
|
|
1148
|
-
[packages/framework/esm-api/src/shared-api-objects/visit-utils.ts:
|
|
1124
|
+
[packages/framework/esm-api/src/shared-api-objects/visit-utils.ts:59](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/visit-utils.ts#L59)
|
|
1125
|
+
|
|
1126
|
+
___
|
|
1127
|
+
|
|
1128
|
+
### useCurrentPatient
|
|
1129
|
+
|
|
1130
|
+
▸ **useCurrentPatient**(`patientUuid?`): [`boolean`, `NullablePatient`, [`PatientUuid`](API.md#patientuuid), `Error` \| ``null``]
|
|
1131
|
+
|
|
1132
|
+
This React hook returns the current patient, as specified by the current route. It returns
|
|
1133
|
+
all the information needed to render a loading state, error state, and normal/success state.
|
|
1134
|
+
|
|
1135
|
+
**`deprecated`** Use [usePatient](API.md#usepatient) instead.
|
|
1136
|
+
|
|
1137
|
+
#### Parameters
|
|
1138
|
+
|
|
1139
|
+
| Name | Type |
|
|
1140
|
+
| :------ | :------ |
|
|
1141
|
+
| `patientUuid` | [`PatientUuid`](API.md#patientuuid) |
|
|
1142
|
+
|
|
1143
|
+
#### Returns
|
|
1144
|
+
|
|
1145
|
+
[`boolean`, `NullablePatient`, [`PatientUuid`](API.md#patientuuid), `Error` \| ``null``]
|
|
1146
|
+
|
|
1147
|
+
#### Defined in
|
|
1148
|
+
|
|
1149
|
+
[packages/framework/esm-react-utils/src/useCurrentPatient.ts:83](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/useCurrentPatient.ts#L83)
|
|
1150
|
+
|
|
1151
|
+
___
|
|
1152
|
+
|
|
1153
|
+
### useLocations
|
|
1154
|
+
|
|
1155
|
+
▸ **useLocations**(): [`Location`](interfaces/Location.md)[]
|
|
1156
|
+
|
|
1157
|
+
#### Returns
|
|
1158
|
+
|
|
1159
|
+
[`Location`](interfaces/Location.md)[]
|
|
1160
|
+
|
|
1161
|
+
#### Defined in
|
|
1162
|
+
|
|
1163
|
+
[packages/framework/esm-react-utils/src/useLocations.tsx:5](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/useLocations.tsx#L5)
|
|
1164
|
+
|
|
1165
|
+
___
|
|
1166
|
+
|
|
1167
|
+
### usePatient
|
|
1168
|
+
|
|
1169
|
+
▸ **usePatient**(`patientUuid?`): `Object`
|
|
1170
|
+
|
|
1171
|
+
This React hook returns a patient object. If the `patientUuid` is provided
|
|
1172
|
+
as a parameter, then the patient for that UUID is returned. If the parameter
|
|
1173
|
+
is not provided, the patient UUID is obtained from the current route, and
|
|
1174
|
+
a route listener is set up to update the patient whenever the route changes.
|
|
1175
|
+
|
|
1176
|
+
#### Parameters
|
|
1177
|
+
|
|
1178
|
+
| Name | Type |
|
|
1179
|
+
| :------ | :------ |
|
|
1180
|
+
| `patientUuid?` | `string` |
|
|
1181
|
+
|
|
1182
|
+
#### Returns
|
|
1183
|
+
|
|
1184
|
+
`Object`
|
|
1185
|
+
|
|
1186
|
+
| Name | Type |
|
|
1187
|
+
| :------ | :------ |
|
|
1188
|
+
| `error` | ``null`` \| `Error` |
|
|
1189
|
+
| `isLoading` | `boolean` |
|
|
1190
|
+
| `patient` | [`NullablePatient`](API.md#nullablepatient) |
|
|
1191
|
+
| `patientUuid` | ``null`` \| `string` |
|
|
1192
|
+
|
|
1193
|
+
#### Defined in
|
|
1194
|
+
|
|
1195
|
+
[packages/framework/esm-react-utils/src/usePatient.ts:92](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/usePatient.ts#L92)
|
|
1196
|
+
|
|
1197
|
+
___
|
|
1198
|
+
|
|
1199
|
+
### useSession
|
|
1200
|
+
|
|
1201
|
+
▸ **useSession**(): ``null`` \| [`Session`](interfaces/Session.md)
|
|
1202
|
+
|
|
1203
|
+
#### Returns
|
|
1204
|
+
|
|
1205
|
+
``null`` \| [`Session`](interfaces/Session.md)
|
|
1206
|
+
|
|
1207
|
+
#### Defined in
|
|
1208
|
+
|
|
1209
|
+
[packages/framework/esm-react-utils/src/useSessionUser.tsx:5](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/useSessionUser.tsx#L5)
|
|
1210
|
+
|
|
1211
|
+
___
|
|
1212
|
+
|
|
1213
|
+
### useVisit
|
|
1214
|
+
|
|
1215
|
+
▸ **useVisit**(`patientUuid`): `VisitReturnType`
|
|
1216
|
+
|
|
1217
|
+
This React hook returns a visit object. If the `patientUuid` is provided
|
|
1218
|
+
as a parameter, then the currentVisit, error and mutate function
|
|
1219
|
+
for that patient visit is returned.
|
|
1220
|
+
|
|
1221
|
+
#### Parameters
|
|
1222
|
+
|
|
1223
|
+
| Name | Type | Description |
|
|
1224
|
+
| :------ | :------ | :------ |
|
|
1225
|
+
| `patientUuid` | `string` | Unique patient identifier `string` |
|
|
1226
|
+
|
|
1227
|
+
#### Returns
|
|
1228
|
+
|
|
1229
|
+
`VisitReturnType`
|
|
1230
|
+
|
|
1231
|
+
Object {`error` `isValidating`, `currentVisit`, `mutate`}
|
|
1232
|
+
|
|
1233
|
+
#### Defined in
|
|
1234
|
+
|
|
1235
|
+
[packages/framework/esm-react-utils/src/useVisit.ts:27](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/useVisit.ts#L27)
|
|
1236
|
+
|
|
1237
|
+
___
|
|
1238
|
+
|
|
1239
|
+
### useVisitTypes
|
|
1240
|
+
|
|
1241
|
+
▸ **useVisitTypes**(): [`VisitType`](interfaces/VisitType.md)[]
|
|
1242
|
+
|
|
1243
|
+
#### Returns
|
|
1244
|
+
|
|
1245
|
+
[`VisitType`](interfaces/VisitType.md)[]
|
|
1246
|
+
|
|
1247
|
+
#### Defined in
|
|
1248
|
+
|
|
1249
|
+
[packages/framework/esm-react-utils/src/useVisitTypes.ts:5](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/useVisitTypes.ts#L5)
|
|
1149
1250
|
|
|
1150
1251
|
___
|
|
1151
1252
|
|
|
@@ -1158,7 +1259,9 @@ ___
|
|
|
1158
1259
|
| Name | Type |
|
|
1159
1260
|
| :------ | :------ |
|
|
1160
1261
|
| `requiredPrivilege` | `string` |
|
|
1161
|
-
| `user` |
|
|
1262
|
+
| `user` | `Object` |
|
|
1263
|
+
| `user.privileges` | [`Privilege`](interfaces/Privilege.md)[] |
|
|
1264
|
+
| `user.roles` | [`Role`](interfaces/Role.md)[] |
|
|
1162
1265
|
|
|
1163
1266
|
#### Returns
|
|
1164
1267
|
|
|
@@ -1166,7 +1269,7 @@ ___
|
|
|
1166
1269
|
|
|
1167
1270
|
#### Defined in
|
|
1168
1271
|
|
|
1169
|
-
[packages/framework/esm-api/src/shared-api-objects/current-user.ts:
|
|
1272
|
+
[packages/framework/esm-api/src/shared-api-objects/current-user.ts:129](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-api/src/shared-api-objects/current-user.ts#L129)
|
|
1170
1273
|
|
|
1171
1274
|
___
|
|
1172
1275
|
|
|
@@ -1189,7 +1292,7 @@ ___
|
|
|
1189
1292
|
|
|
1190
1293
|
#### Defined in
|
|
1191
1294
|
|
|
1192
|
-
[packages/framework/esm-breadcrumbs/src/filter.ts:
|
|
1295
|
+
[packages/framework/esm-breadcrumbs/src/filter.ts:43](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-breadcrumbs/src/filter.ts#L43)
|
|
1193
1296
|
|
|
1194
1297
|
___
|
|
1195
1298
|
|
|
@@ -1203,7 +1306,7 @@ ___
|
|
|
1203
1306
|
|
|
1204
1307
|
#### Defined in
|
|
1205
1308
|
|
|
1206
|
-
[packages/framework/esm-breadcrumbs/src/db.ts:
|
|
1309
|
+
[packages/framework/esm-breadcrumbs/src/db.ts:35](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-breadcrumbs/src/db.ts#L35)
|
|
1207
1310
|
|
|
1208
1311
|
___
|
|
1209
1312
|
|
|
@@ -1223,7 +1326,7 @@ ___
|
|
|
1223
1326
|
|
|
1224
1327
|
#### Defined in
|
|
1225
1328
|
|
|
1226
|
-
[packages/framework/esm-breadcrumbs/src/filter.ts:
|
|
1329
|
+
[packages/framework/esm-breadcrumbs/src/filter.ts:66](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-breadcrumbs/src/filter.ts#L66)
|
|
1227
1330
|
|
|
1228
1331
|
___
|
|
1229
1332
|
|
|
@@ -1243,7 +1346,7 @@ ___
|
|
|
1243
1346
|
|
|
1244
1347
|
#### Defined in
|
|
1245
1348
|
|
|
1246
|
-
[packages/framework/esm-breadcrumbs/src/db.ts:
|
|
1349
|
+
[packages/framework/esm-breadcrumbs/src/db.ts:21](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-breadcrumbs/src/db.ts#L21)
|
|
1247
1350
|
|
|
1248
1351
|
___
|
|
1249
1352
|
|
|
@@ -1263,58 +1366,292 @@ ___
|
|
|
1263
1366
|
|
|
1264
1367
|
#### Defined in
|
|
1265
1368
|
|
|
1266
|
-
[packages/framework/esm-breadcrumbs/src/db.ts:
|
|
1369
|
+
[packages/framework/esm-breadcrumbs/src/db.ts:25](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-breadcrumbs/src/db.ts#L25)
|
|
1267
1370
|
|
|
1268
1371
|
___
|
|
1269
1372
|
|
|
1270
|
-
##
|
|
1271
|
-
|
|
1272
|
-
### formatDate
|
|
1273
|
-
|
|
1274
|
-
▸ **formatDate**(`date`, `options?`): `string`
|
|
1373
|
+
## Config Functions
|
|
1275
1374
|
|
|
1276
|
-
|
|
1277
|
-
given options.
|
|
1375
|
+
### defineConfigSchema
|
|
1278
1376
|
|
|
1279
|
-
|
|
1280
|
-
- mode: "standard",
|
|
1281
|
-
- time: "for today",
|
|
1282
|
-
- day: true,
|
|
1283
|
-
- year: true
|
|
1377
|
+
▸ **defineConfigSchema**(`moduleName`, `schema`): `void`
|
|
1284
1378
|
|
|
1285
|
-
|
|
1379
|
+
This defines a configuration schema for a module. The schema tells the
|
|
1380
|
+
configuration system how the module can be configured. It specifies
|
|
1381
|
+
what makes configuration valid or invalid.
|
|
1286
1382
|
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
locales.
|
|
1383
|
+
See [Configuration System](http://o3-dev.docs.openmrs.org/#/main/config)
|
|
1384
|
+
for more information about defining a config schema.
|
|
1290
1385
|
|
|
1291
1386
|
#### Parameters
|
|
1292
1387
|
|
|
1293
|
-
| Name | Type |
|
|
1294
|
-
| :------ | :------ |
|
|
1295
|
-
| `
|
|
1296
|
-
| `
|
|
1388
|
+
| Name | Type | Description |
|
|
1389
|
+
| :------ | :------ | :------ |
|
|
1390
|
+
| `moduleName` | `string` | Name of the module the schema is being defined for. Generally should be the one in which the `defineConfigSchema` call takes place. |
|
|
1391
|
+
| `schema` | [`ConfigSchema`](interfaces/ConfigSchema.md) | The config schema for the module |
|
|
1297
1392
|
|
|
1298
1393
|
#### Returns
|
|
1299
1394
|
|
|
1300
|
-
`
|
|
1395
|
+
`void`
|
|
1301
1396
|
|
|
1302
1397
|
#### Defined in
|
|
1303
1398
|
|
|
1304
|
-
[packages/framework/esm-
|
|
1399
|
+
[packages/framework/esm-config/src/module-config/module-config.ts:193](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/module-config/module-config.ts#L193)
|
|
1305
1400
|
|
|
1306
1401
|
___
|
|
1307
1402
|
|
|
1308
|
-
###
|
|
1403
|
+
### defineExtensionConfigSchema
|
|
1309
1404
|
|
|
1310
|
-
▸ **
|
|
1405
|
+
▸ **defineExtensionConfigSchema**(`extensionName`, `schema`): `void`
|
|
1311
1406
|
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1407
|
+
This defines a configuration schema for an extension. When a schema is defined
|
|
1408
|
+
for an extension, that extension will receive the configuration corresponding
|
|
1409
|
+
to that schema, rather than the configuration corresponding to the module
|
|
1410
|
+
in which it is defined.
|
|
1315
1411
|
|
|
1316
|
-
|
|
1317
|
-
|
|
1412
|
+
The schema tells the configuration system how the module can be configured.
|
|
1413
|
+
It specifies what makes configuration valid or invalid.
|
|
1414
|
+
|
|
1415
|
+
See [Configuration System](http://o3-dev.docs.openmrs.org/#/main/config)
|
|
1416
|
+
for more information about defining a config schema.
|
|
1417
|
+
|
|
1418
|
+
#### Parameters
|
|
1419
|
+
|
|
1420
|
+
| Name | Type | Description |
|
|
1421
|
+
| :------ | :------ | :------ |
|
|
1422
|
+
| `extensionName` | `string` | Name of the extension the schema is being defined for. Should match the `name` of one of the `extensions` entries being returned by `setupOpenMRS`. |
|
|
1423
|
+
| `schema` | [`ConfigSchema`](interfaces/ConfigSchema.md) | The config schema for the extension |
|
|
1424
|
+
|
|
1425
|
+
#### Returns
|
|
1426
|
+
|
|
1427
|
+
`void`
|
|
1428
|
+
|
|
1429
|
+
#### Defined in
|
|
1430
|
+
|
|
1431
|
+
[packages/framework/esm-config/src/module-config/module-config.ts:218](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/module-config/module-config.ts#L218)
|
|
1432
|
+
|
|
1433
|
+
___
|
|
1434
|
+
|
|
1435
|
+
### getConfig
|
|
1436
|
+
|
|
1437
|
+
▸ **getConfig**(`moduleName`): `Promise`<[`Config`](interfaces/Config.md)\>
|
|
1438
|
+
|
|
1439
|
+
A promise-based way to access the config as soon as it is fully loaded.
|
|
1440
|
+
If it is already loaded, resolves the config in its present state.
|
|
1441
|
+
|
|
1442
|
+
In general you should use the Unistore-based API provided by
|
|
1443
|
+
`getConfigStore`, which allows creating a subscription so that you always
|
|
1444
|
+
have the latest config. If using React, just use `useConfig`.
|
|
1445
|
+
|
|
1446
|
+
This is a useful function if you need to get the config in the course
|
|
1447
|
+
of the execution of a function.
|
|
1448
|
+
|
|
1449
|
+
#### Parameters
|
|
1450
|
+
|
|
1451
|
+
| Name | Type | Description |
|
|
1452
|
+
| :------ | :------ | :------ |
|
|
1453
|
+
| `moduleName` | `string` | The name of the module for which to look up the config |
|
|
1454
|
+
|
|
1455
|
+
#### Returns
|
|
1456
|
+
|
|
1457
|
+
`Promise`<[`Config`](interfaces/Config.md)\>
|
|
1458
|
+
|
|
1459
|
+
#### Defined in
|
|
1460
|
+
|
|
1461
|
+
[packages/framework/esm-config/src/module-config/module-config.ts:254](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/module-config/module-config.ts#L254)
|
|
1462
|
+
|
|
1463
|
+
___
|
|
1464
|
+
|
|
1465
|
+
### provide
|
|
1466
|
+
|
|
1467
|
+
▸ **provide**(`config`, `sourceName?`): `void`
|
|
1468
|
+
|
|
1469
|
+
#### Parameters
|
|
1470
|
+
|
|
1471
|
+
| Name | Type | Default value |
|
|
1472
|
+
| :------ | :------ | :------ |
|
|
1473
|
+
| `config` | [`Config`](interfaces/Config.md) | `undefined` |
|
|
1474
|
+
| `sourceName` | `string` | `"provided"` |
|
|
1475
|
+
|
|
1476
|
+
#### Returns
|
|
1477
|
+
|
|
1478
|
+
`void`
|
|
1479
|
+
|
|
1480
|
+
#### Defined in
|
|
1481
|
+
|
|
1482
|
+
[packages/framework/esm-config/src/module-config/module-config.ts:234](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/module-config/module-config.ts#L234)
|
|
1483
|
+
|
|
1484
|
+
___
|
|
1485
|
+
|
|
1486
|
+
### useConfig
|
|
1487
|
+
|
|
1488
|
+
▸ **useConfig**(): `Object`
|
|
1489
|
+
|
|
1490
|
+
Use this React Hook to obtain your module's configuration.
|
|
1491
|
+
|
|
1492
|
+
#### Returns
|
|
1493
|
+
|
|
1494
|
+
`Object`
|
|
1495
|
+
|
|
1496
|
+
| Name | Type | Description |
|
|
1497
|
+
| :------ | :------ | :------ |
|
|
1498
|
+
| `constructor` | `Function` | The initial value of Object.prototype.constructor is the standard built-in Object constructor. |
|
|
1499
|
+
| `hasOwnProperty` | (`v`: `PropertyKey`) => `boolean` | Determines whether an object has a property with the specified name. |
|
|
1500
|
+
| `isPrototypeOf` | (`v`: `Object`) => `boolean` | Determines whether an object exists in another object's prototype chain. |
|
|
1501
|
+
| `propertyIsEnumerable` | (`v`: `PropertyKey`) => `boolean` | Determines whether a specified property is enumerable. |
|
|
1502
|
+
| `toLocaleString` | () => `string` | Returns a date converted to a string using the current locale. |
|
|
1503
|
+
| `toString` | () => `string` | Returns a string representation of an object. |
|
|
1504
|
+
| `valueOf` | () => `Object` | Returns the primitive value of the specified object. |
|
|
1505
|
+
|
|
1506
|
+
#### Defined in
|
|
1507
|
+
|
|
1508
|
+
[packages/framework/esm-react-utils/src/useConfig.ts:163](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/useConfig.ts#L163)
|
|
1509
|
+
|
|
1510
|
+
___
|
|
1511
|
+
|
|
1512
|
+
## Config Validation Functions
|
|
1513
|
+
|
|
1514
|
+
### inRange
|
|
1515
|
+
|
|
1516
|
+
▸ `Const` **inRange**(`min`, `max`): [`Validator`](API.md#validator)
|
|
1517
|
+
|
|
1518
|
+
Verifies that the value is between the provided minimum and maximum
|
|
1519
|
+
|
|
1520
|
+
#### Parameters
|
|
1521
|
+
|
|
1522
|
+
| Name | Type | Description |
|
|
1523
|
+
| :------ | :------ | :------ |
|
|
1524
|
+
| `min` | `number` | Minimum acceptable value |
|
|
1525
|
+
| `max` | `number` | Maximum acceptable value |
|
|
1526
|
+
|
|
1527
|
+
#### Returns
|
|
1528
|
+
|
|
1529
|
+
[`Validator`](API.md#validator)
|
|
1530
|
+
|
|
1531
|
+
#### Defined in
|
|
1532
|
+
|
|
1533
|
+
[packages/framework/esm-config/src/validators/validators.ts:10](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/validators/validators.ts#L10)
|
|
1534
|
+
|
|
1535
|
+
___
|
|
1536
|
+
|
|
1537
|
+
### isUrl
|
|
1538
|
+
|
|
1539
|
+
▸ `Const` **isUrl**(`value`): `string` \| `void`
|
|
1540
|
+
|
|
1541
|
+
Verifies that a string contains only the default URL template parameters.
|
|
1542
|
+
|
|
1543
|
+
**`category`** Navigation
|
|
1544
|
+
|
|
1545
|
+
#### Parameters
|
|
1546
|
+
|
|
1547
|
+
| Name | Type |
|
|
1548
|
+
| :------ | :------ |
|
|
1549
|
+
| `value` | `any` |
|
|
1550
|
+
|
|
1551
|
+
#### Returns
|
|
1552
|
+
|
|
1553
|
+
`string` \| `void`
|
|
1554
|
+
|
|
1555
|
+
#### Defined in
|
|
1556
|
+
|
|
1557
|
+
[packages/framework/esm-config/src/validators/validators.ts:56](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/validators/validators.ts#L56)
|
|
1558
|
+
|
|
1559
|
+
___
|
|
1560
|
+
|
|
1561
|
+
### isUrlWithTemplateParameters
|
|
1562
|
+
|
|
1563
|
+
▸ `Const` **isUrlWithTemplateParameters**(`allowedTemplateParameters`): [`Validator`](API.md#validator)
|
|
1564
|
+
|
|
1565
|
+
Verifies that a string contains only the default URL template
|
|
1566
|
+
parameters, plus any specified in `allowedTemplateParameters`.
|
|
1567
|
+
|
|
1568
|
+
**`category`** Navigation
|
|
1569
|
+
|
|
1570
|
+
#### Parameters
|
|
1571
|
+
|
|
1572
|
+
| Name | Type | Description |
|
|
1573
|
+
| :------ | :------ | :------ |
|
|
1574
|
+
| `allowedTemplateParameters` | `string`[] | To be added to `openmrsBase` and `openmrsSpaBase` |
|
|
1575
|
+
|
|
1576
|
+
#### Returns
|
|
1577
|
+
|
|
1578
|
+
[`Validator`](API.md#validator)
|
|
1579
|
+
|
|
1580
|
+
#### Defined in
|
|
1581
|
+
|
|
1582
|
+
[packages/framework/esm-config/src/validators/validators.ts:24](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/validators/validators.ts#L24)
|
|
1583
|
+
|
|
1584
|
+
___
|
|
1585
|
+
|
|
1586
|
+
### validator
|
|
1587
|
+
|
|
1588
|
+
▸ **validator**(`validationFunction`, `message`): [`Validator`](API.md#validator)
|
|
1589
|
+
|
|
1590
|
+
#### Parameters
|
|
1591
|
+
|
|
1592
|
+
| Name | Type |
|
|
1593
|
+
| :------ | :------ |
|
|
1594
|
+
| `validationFunction` | [`ValidatorFunction`](API.md#validatorfunction) |
|
|
1595
|
+
| `message` | `string` |
|
|
1596
|
+
|
|
1597
|
+
#### Returns
|
|
1598
|
+
|
|
1599
|
+
[`Validator`](API.md#validator)
|
|
1600
|
+
|
|
1601
|
+
#### Defined in
|
|
1602
|
+
|
|
1603
|
+
[packages/framework/esm-config/src/validators/validator.ts:4](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/validators/validator.ts#L4)
|
|
1604
|
+
|
|
1605
|
+
___
|
|
1606
|
+
|
|
1607
|
+
## Date and Time Functions
|
|
1608
|
+
|
|
1609
|
+
### formatDate
|
|
1610
|
+
|
|
1611
|
+
▸ **formatDate**(`date`, `options?`): `string`
|
|
1612
|
+
|
|
1613
|
+
Formats the input date according to the current locale and the
|
|
1614
|
+
given options.
|
|
1615
|
+
|
|
1616
|
+
Default options:
|
|
1617
|
+
- mode: "standard",
|
|
1618
|
+
- time: "for today",
|
|
1619
|
+
- day: true,
|
|
1620
|
+
- year: true
|
|
1621
|
+
|
|
1622
|
+
If the date is today then "Today" is produced (in the locale language).
|
|
1623
|
+
|
|
1624
|
+
When time is included, it is appended with a comma and a space. This
|
|
1625
|
+
agrees with the output of `Date.prototype.toLocaleString` for *most*
|
|
1626
|
+
locales.
|
|
1627
|
+
|
|
1628
|
+
#### Parameters
|
|
1629
|
+
|
|
1630
|
+
| Name | Type |
|
|
1631
|
+
| :------ | :------ |
|
|
1632
|
+
| `date` | `Date` |
|
|
1633
|
+
| `options?` | `Partial`<[`FormatDateOptions`](API.md#formatdateoptions)\> |
|
|
1634
|
+
|
|
1635
|
+
#### Returns
|
|
1636
|
+
|
|
1637
|
+
`string`
|
|
1638
|
+
|
|
1639
|
+
#### Defined in
|
|
1640
|
+
|
|
1641
|
+
[packages/framework/esm-utils/src/omrs-dates.ts:182](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/omrs-dates.ts#L182)
|
|
1642
|
+
|
|
1643
|
+
___
|
|
1644
|
+
|
|
1645
|
+
### formatDatetime
|
|
1646
|
+
|
|
1647
|
+
▸ **formatDatetime**(`date`, `options?`): `string`
|
|
1648
|
+
|
|
1649
|
+
Formats the input into a string showing the date and time, according
|
|
1650
|
+
to the current locale. The `mode` parameter is as described for
|
|
1651
|
+
`formatDate`.
|
|
1652
|
+
|
|
1653
|
+
This is created by concatenating the results of `formatDate`
|
|
1654
|
+
and `formatTime` with a comma and space. This agrees with the
|
|
1318
1655
|
output of `Date.prototype.toLocaleString` for *most* locales.
|
|
1319
1656
|
|
|
1320
1657
|
#### Parameters
|
|
@@ -1584,132 +1921,43 @@ Formats the input as a date string using the format "DD-MMM".
|
|
|
1584
1921
|
|
|
1585
1922
|
___
|
|
1586
1923
|
|
|
1587
|
-
##
|
|
1924
|
+
## Error Handling Functions
|
|
1588
1925
|
|
|
1589
|
-
###
|
|
1926
|
+
### createErrorHandler
|
|
1590
1927
|
|
|
1591
|
-
▸ **
|
|
1928
|
+
▸ **createErrorHandler**(): (`incomingErr`: `any`) => `void`
|
|
1592
1929
|
|
|
1593
|
-
|
|
1930
|
+
#### Returns
|
|
1594
1931
|
|
|
1595
|
-
|
|
1932
|
+
`fn`
|
|
1596
1933
|
|
|
1597
|
-
|
|
1598
|
-
```js
|
|
1599
|
-
navigate({
|
|
1600
|
-
to: interpolateString(
|
|
1601
|
-
config.links.patientChart,
|
|
1602
|
-
{ patientUuid: patient.uuid }
|
|
1603
|
-
)
|
|
1604
|
-
});
|
|
1605
|
-
```
|
|
1934
|
+
▸ (`incomingErr`): `void`
|
|
1606
1935
|
|
|
1607
|
-
|
|
1936
|
+
##### Parameters
|
|
1608
1937
|
|
|
1609
|
-
| Name | Type |
|
|
1610
|
-
| :------ | :------ |
|
|
1611
|
-
| `
|
|
1612
|
-
| `params` | `object` | Values to interpolate into the string template |
|
|
1938
|
+
| Name | Type |
|
|
1939
|
+
| :------ | :------ |
|
|
1940
|
+
| `incomingErr` | `any` |
|
|
1613
1941
|
|
|
1614
|
-
|
|
1942
|
+
##### Returns
|
|
1615
1943
|
|
|
1616
|
-
`
|
|
1617
|
-
|
|
1618
|
-
#### Defined in
|
|
1619
|
-
|
|
1620
|
-
[packages/framework/esm-config/src/navigation/interpolate-string.ts:41](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/navigation/interpolate-string.ts#L41)
|
|
1621
|
-
|
|
1622
|
-
___
|
|
1623
|
-
|
|
1624
|
-
### interpolateUrl
|
|
1625
|
-
|
|
1626
|
-
▸ **interpolateUrl**(`template`): `string`
|
|
1627
|
-
|
|
1628
|
-
Interpolates a string with openmrsBase and openmrsSpaBase.
|
|
1629
|
-
|
|
1630
|
-
Useful for accepting `${openmrsBase}` or `${openmrsSpaBase}` template
|
|
1631
|
-
parameters in configurable URLs.
|
|
1632
|
-
|
|
1633
|
-
#### Parameters
|
|
1634
|
-
|
|
1635
|
-
| Name | Type | Description |
|
|
1636
|
-
| :------ | :------ | :------ |
|
|
1637
|
-
| `template` | `string` | A string to interpolate |
|
|
1638
|
-
|
|
1639
|
-
#### Returns
|
|
1640
|
-
|
|
1641
|
-
`string`
|
|
1944
|
+
`void`
|
|
1642
1945
|
|
|
1643
1946
|
#### Defined in
|
|
1644
1947
|
|
|
1645
|
-
[packages/framework/esm-
|
|
1948
|
+
[packages/framework/esm-error-handling/src/index.ts:24](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-error-handling/src/index.ts#L24)
|
|
1646
1949
|
|
|
1647
1950
|
___
|
|
1648
1951
|
|
|
1649
|
-
###
|
|
1650
|
-
|
|
1651
|
-
▸ `Const` **isUrl**(`value`): `string` \| `void`
|
|
1952
|
+
### reportError
|
|
1652
1953
|
|
|
1653
|
-
|
|
1954
|
+
▸ **reportError**(`err`): `void`
|
|
1654
1955
|
|
|
1655
1956
|
#### Parameters
|
|
1656
1957
|
|
|
1657
1958
|
| Name | Type |
|
|
1658
1959
|
| :------ | :------ |
|
|
1659
|
-
| `
|
|
1660
|
-
|
|
1661
|
-
#### Returns
|
|
1662
|
-
|
|
1663
|
-
`string` \| `void`
|
|
1664
|
-
|
|
1665
|
-
#### Defined in
|
|
1666
|
-
|
|
1667
|
-
[packages/framework/esm-config/src/validators/validators.ts:55](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/validators/validators.ts#L55)
|
|
1668
|
-
|
|
1669
|
-
___
|
|
1670
|
-
|
|
1671
|
-
### isUrlWithTemplateParameters
|
|
1672
|
-
|
|
1673
|
-
▸ `Const` **isUrlWithTemplateParameters**(`allowedTemplateParameters`): [`Validator`](API.md#validator)
|
|
1674
|
-
|
|
1675
|
-
Verifies that a string contains only the default URL template
|
|
1676
|
-
parameters, plus any specified in `allowedTemplateParameters`.
|
|
1677
|
-
|
|
1678
|
-
#### Parameters
|
|
1679
|
-
|
|
1680
|
-
| Name | Type | Description |
|
|
1681
|
-
| :------ | :------ | :------ |
|
|
1682
|
-
| `allowedTemplateParameters` | `string`[] | To be added to `openmrsBase` and `openmrsSpaBase` |
|
|
1683
|
-
|
|
1684
|
-
#### Returns
|
|
1685
|
-
|
|
1686
|
-
[`Validator`](API.md#validator)
|
|
1687
|
-
|
|
1688
|
-
#### Defined in
|
|
1689
|
-
|
|
1690
|
-
[packages/framework/esm-config/src/validators/validators.ts:23](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/validators/validators.ts#L23)
|
|
1691
|
-
|
|
1692
|
-
___
|
|
1693
|
-
|
|
1694
|
-
### navigate
|
|
1695
|
-
|
|
1696
|
-
▸ **navigate**(`to`): `void`
|
|
1697
|
-
|
|
1698
|
-
Calls `location.assign` for non-SPA paths and [navigateToUrl](https://single-spa.js.org/docs/api/#navigatetourl) for SPA paths
|
|
1699
|
-
|
|
1700
|
-
Example usage:
|
|
1701
|
-
```js
|
|
1702
|
-
const config = getConfig();
|
|
1703
|
-
const submitHandler = () => {
|
|
1704
|
-
navigate({ to: config.links.submitSuccess });
|
|
1705
|
-
};
|
|
1706
|
-
```
|
|
1707
|
-
|
|
1708
|
-
#### Parameters
|
|
1709
|
-
|
|
1710
|
-
| Name | Type | Description |
|
|
1711
|
-
| :------ | :------ | :------ |
|
|
1712
|
-
| `to` | [`NavigateOptions`](interfaces/NavigateOptions.md) | The target path or URL. Supports templating with 'openmrsBase' and 'openmrsSpaBase'. For example, `${openmrsSpaBase}/home` will resolve to `/openmrs/spa/home` for implementations using the standard OpenMRS and SPA base paths. |
|
|
1960
|
+
| `err` | `any` |
|
|
1713
1961
|
|
|
1714
1962
|
#### Returns
|
|
1715
1963
|
|
|
@@ -1717,49 +1965,11 @@ const submitHandler = () => {
|
|
|
1717
1965
|
|
|
1718
1966
|
#### Defined in
|
|
1719
1967
|
|
|
1720
|
-
[packages/framework/esm-
|
|
1721
|
-
|
|
1722
|
-
___
|
|
1723
|
-
|
|
1724
|
-
## Other Functions
|
|
1725
|
-
|
|
1726
|
-
### activateOfflineCapability
|
|
1727
|
-
|
|
1728
|
-
▸ **activateOfflineCapability**(): `Promise`<`void`\>
|
|
1729
|
-
|
|
1730
|
-
#### Returns
|
|
1731
|
-
|
|
1732
|
-
`Promise`<`void`\>
|
|
1733
|
-
|
|
1734
|
-
#### Defined in
|
|
1735
|
-
|
|
1736
|
-
[packages/framework/esm-offline/src/mode.ts:65](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/mode.ts#L65)
|
|
1968
|
+
[packages/framework/esm-error-handling/src/index.ts:17](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-error-handling/src/index.ts#L17)
|
|
1737
1969
|
|
|
1738
1970
|
___
|
|
1739
1971
|
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
▸ **age**(`dateString`): `string`
|
|
1743
|
-
|
|
1744
|
-
Gets a human readable age represention of the provided date string.
|
|
1745
|
-
|
|
1746
|
-
#### Parameters
|
|
1747
|
-
|
|
1748
|
-
| Name | Type | Description |
|
|
1749
|
-
| :------ | :------ | :------ |
|
|
1750
|
-
| `dateString` | `string` | The stringified date. |
|
|
1751
|
-
|
|
1752
|
-
#### Returns
|
|
1753
|
-
|
|
1754
|
-
`string`
|
|
1755
|
-
|
|
1756
|
-
A human-readable string version of the age.
|
|
1757
|
-
|
|
1758
|
-
#### Defined in
|
|
1759
|
-
|
|
1760
|
-
[packages/framework/esm-utils/src/age-helpers.tsx:37](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/age-helpers.tsx#L37)
|
|
1761
|
-
|
|
1762
|
-
___
|
|
1972
|
+
## Extension Functions
|
|
1763
1973
|
|
|
1764
1974
|
### attach
|
|
1765
1975
|
|
|
@@ -1791,1488 +2001,680 @@ writing a module for a specific implementation.
|
|
|
1791
2001
|
|
|
1792
2002
|
#### Defined in
|
|
1793
2003
|
|
|
1794
|
-
[packages/framework/esm-extensions/src/extensions.ts:
|
|
2004
|
+
[packages/framework/esm-extensions/src/extensions.ts:172](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/extensions.ts#L172)
|
|
1795
2005
|
|
|
1796
2006
|
___
|
|
1797
2007
|
|
|
1798
|
-
###
|
|
2008
|
+
### detach
|
|
1799
2009
|
|
|
1800
|
-
▸ **
|
|
2010
|
+
▸ **detach**(`extensionSlotName`, `extensionId`): `void`
|
|
1801
2011
|
|
|
1802
|
-
|
|
1803
|
-
If this is not possible, throws an error.
|
|
2012
|
+
Avoid using this. Extension attachments should be considered declarative.
|
|
1804
2013
|
|
|
1805
2014
|
#### Parameters
|
|
1806
2015
|
|
|
1807
|
-
| Name | Type |
|
|
1808
|
-
| :------ | :------ |
|
|
1809
|
-
| `
|
|
2016
|
+
| Name | Type |
|
|
2017
|
+
| :------ | :------ |
|
|
2018
|
+
| `extensionSlotName` | `string` |
|
|
2019
|
+
| `extensionId` | `string` |
|
|
1810
2020
|
|
|
1811
2021
|
#### Returns
|
|
1812
2022
|
|
|
1813
|
-
`
|
|
2023
|
+
`void`
|
|
1814
2024
|
|
|
1815
2025
|
#### Defined in
|
|
1816
2026
|
|
|
1817
|
-
[packages/framework/esm-
|
|
2027
|
+
[packages/framework/esm-extensions/src/extensions.ts:203](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/extensions.ts#L203)
|
|
1818
2028
|
|
|
1819
2029
|
___
|
|
1820
2030
|
|
|
1821
|
-
###
|
|
2031
|
+
### detachAll
|
|
1822
2032
|
|
|
1823
|
-
▸ **
|
|
2033
|
+
▸ **detachAll**(`extensionSlotName`): `void`
|
|
1824
2034
|
|
|
1825
|
-
|
|
1826
|
-
registered synchronization handlers.
|
|
2035
|
+
Avoid using this. Extension attachments should be considered declarative.
|
|
1827
2036
|
|
|
1828
2037
|
#### Parameters
|
|
1829
2038
|
|
|
1830
|
-
| Name | Type |
|
|
1831
|
-
| :------ | :------ |
|
|
1832
|
-
| `
|
|
2039
|
+
| Name | Type |
|
|
2040
|
+
| :------ | :------ |
|
|
2041
|
+
| `extensionSlotName` | `string` |
|
|
1833
2042
|
|
|
1834
2043
|
#### Returns
|
|
1835
2044
|
|
|
1836
|
-
`
|
|
2045
|
+
`void`
|
|
1837
2046
|
|
|
1838
2047
|
#### Defined in
|
|
1839
2048
|
|
|
1840
|
-
[packages/framework/esm-
|
|
2049
|
+
[packages/framework/esm-extensions/src/extensions.ts:227](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/extensions.ts#L227)
|
|
1841
2050
|
|
|
1842
2051
|
___
|
|
1843
2052
|
|
|
1844
|
-
###
|
|
2053
|
+
### getAssignedExtensions
|
|
1845
2054
|
|
|
1846
|
-
▸ **
|
|
2055
|
+
▸ **getAssignedExtensions**(`slotName`): [`AssignedExtension`](interfaces/AssignedExtension.md)[]
|
|
1847
2056
|
|
|
1848
2057
|
#### Parameters
|
|
1849
2058
|
|
|
1850
|
-
| Name | Type |
|
|
1851
|
-
| :------ | :------ |
|
|
1852
|
-
| `
|
|
1853
|
-
| `offline` | `boolean` \| `object` | `false` |
|
|
2059
|
+
| Name | Type |
|
|
2060
|
+
| :------ | :------ |
|
|
2061
|
+
| `slotName` | `string` |
|
|
1854
2062
|
|
|
1855
2063
|
#### Returns
|
|
1856
2064
|
|
|
1857
|
-
`
|
|
2065
|
+
[`AssignedExtension`](interfaces/AssignedExtension.md)[]
|
|
1858
2066
|
|
|
1859
2067
|
#### Defined in
|
|
1860
2068
|
|
|
1861
|
-
[packages/framework/esm-extensions/src/
|
|
2069
|
+
[packages/framework/esm-extensions/src/extensions.ts:328](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/extensions.ts#L328)
|
|
1862
2070
|
|
|
1863
2071
|
___
|
|
1864
2072
|
|
|
1865
|
-
###
|
|
2073
|
+
### getConnectedExtensions
|
|
2074
|
+
|
|
2075
|
+
▸ **getConnectedExtensions**(`assignedExtensions`, `online?`): [`ConnectedExtension`](interfaces/ConnectedExtension.md)[]
|
|
1866
2076
|
|
|
1867
|
-
|
|
2077
|
+
Filters a list of extensions according to whether they support the
|
|
2078
|
+
current connectivity status.
|
|
1868
2079
|
|
|
1869
2080
|
#### Parameters
|
|
1870
2081
|
|
|
1871
|
-
| Name | Type | Default value |
|
|
1872
|
-
| :------ | :------ | :------ |
|
|
1873
|
-
| `
|
|
1874
|
-
| `online` | `boolean`
|
|
1875
|
-
| `offline` | `boolean` \| `object` | `false` |
|
|
2082
|
+
| Name | Type | Default value | Description |
|
|
2083
|
+
| :------ | :------ | :------ | :------ |
|
|
2084
|
+
| `assignedExtensions` | [`AssignedExtension`](interfaces/AssignedExtension.md)[] | `undefined` | The list of extensions to filter. |
|
|
2085
|
+
| `online` | ``null`` \| `boolean` | `null` | Whether the app is currently online. If `null`, uses `navigator.onLine`. |
|
|
1876
2086
|
|
|
1877
2087
|
#### Returns
|
|
1878
2088
|
|
|
1879
|
-
`
|
|
2089
|
+
[`ConnectedExtension`](interfaces/ConnectedExtension.md)[]
|
|
2090
|
+
|
|
2091
|
+
A list of extensions that should be rendered
|
|
1880
2092
|
|
|
1881
2093
|
#### Defined in
|
|
1882
2094
|
|
|
1883
|
-
[packages/framework/esm-extensions/src/
|
|
2095
|
+
[packages/framework/esm-extensions/src/extensions.ts:285](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/extensions.ts#L285)
|
|
1884
2096
|
|
|
1885
2097
|
___
|
|
1886
2098
|
|
|
1887
|
-
###
|
|
1888
|
-
|
|
1889
|
-
▸ **createErrorHandler**(): (`incomingErr`: `any`) => `void`
|
|
2099
|
+
### getExtensionNameFromId
|
|
1890
2100
|
|
|
1891
|
-
|
|
2101
|
+
▸ **getExtensionNameFromId**(`extensionId`): `string`
|
|
1892
2102
|
|
|
1893
|
-
|
|
2103
|
+
Given an extension ID, which is a string uniquely identifying
|
|
2104
|
+
an instance of an extension within an extension slot, this
|
|
2105
|
+
returns the extension name.
|
|
1894
2106
|
|
|
1895
|
-
|
|
2107
|
+
**`example`**
|
|
2108
|
+
```js
|
|
2109
|
+
getExtensionNameFromId("foo#bar")
|
|
2110
|
+
--> "foo"
|
|
2111
|
+
getExtensionNameFromId("baz")
|
|
2112
|
+
--> "baz"
|
|
2113
|
+
```
|
|
1896
2114
|
|
|
1897
|
-
|
|
2115
|
+
#### Parameters
|
|
1898
2116
|
|
|
1899
2117
|
| Name | Type |
|
|
1900
2118
|
| :------ | :------ |
|
|
1901
|
-
| `
|
|
2119
|
+
| `extensionId` | `string` |
|
|
1902
2120
|
|
|
1903
|
-
|
|
2121
|
+
#### Returns
|
|
1904
2122
|
|
|
1905
|
-
`
|
|
2123
|
+
`string`
|
|
1906
2124
|
|
|
1907
2125
|
#### Defined in
|
|
1908
2126
|
|
|
1909
|
-
[packages/framework/esm-
|
|
2127
|
+
[packages/framework/esm-extensions/src/extensions.ts:116](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/extensions.ts#L116)
|
|
1910
2128
|
|
|
1911
2129
|
___
|
|
1912
2130
|
|
|
1913
|
-
###
|
|
1914
|
-
|
|
1915
|
-
▸ **createGlobalStore**<`TState`\>(`name`, `initialState`): `Store`<`TState`\>
|
|
1916
|
-
|
|
1917
|
-
Creates a Unistore [store](https://github.com/developit/unistore#store).
|
|
1918
|
-
|
|
1919
|
-
#### Type parameters
|
|
1920
|
-
|
|
1921
|
-
| Name |
|
|
1922
|
-
| :------ |
|
|
1923
|
-
| `TState` |
|
|
2131
|
+
### getExtensionStore
|
|
1924
2132
|
|
|
1925
|
-
|
|
2133
|
+
▸ `Const` **getExtensionStore**(): `Store`<[`ExtensionStore`](interfaces/ExtensionStore.md)\>
|
|
1926
2134
|
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
| `initialState` | `TState` | An object which will be the initial state of the store. |
|
|
2135
|
+
This returns a [store](https://github.com/developit/unistore#store)
|
|
2136
|
+
that modules can use to get information about the state of the
|
|
2137
|
+
extension system.
|
|
1931
2138
|
|
|
1932
2139
|
#### Returns
|
|
1933
2140
|
|
|
1934
|
-
`Store
|
|
1935
|
-
|
|
1936
|
-
The newly created store.
|
|
2141
|
+
`Store`<[`ExtensionStore`](interfaces/ExtensionStore.md)\>
|
|
1937
2142
|
|
|
1938
2143
|
#### Defined in
|
|
1939
2144
|
|
|
1940
|
-
[packages/framework/esm-
|
|
2145
|
+
[packages/framework/esm-extensions/src/store.ts:129](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L129)
|
|
1941
2146
|
|
|
1942
2147
|
___
|
|
1943
2148
|
|
|
1944
|
-
###
|
|
1945
|
-
|
|
1946
|
-
▸ **createUseStore**<`T`\>(`store`): () => `T`(`actions`: [`Actions`](API.md#actions)) => `T` & [`BoundActions`](API.md#boundactions)(`actions?`: [`Actions`](API.md#actions)) => `T` & [`BoundActions`](API.md#boundactions)
|
|
2149
|
+
### renderExtension
|
|
1947
2150
|
|
|
1948
|
-
|
|
2151
|
+
▸ **renderExtension**(`domElement`, `extensionSlotName`, `extensionSlotModuleName`, `extensionId`, `renderFunction?`, `additionalProps?`): [`CancelLoading`](interfaces/CancelLoading.md)
|
|
1949
2152
|
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
#### Parameters
|
|
1955
|
-
|
|
1956
|
-
| Name | Type |
|
|
1957
|
-
| :------ | :------ |
|
|
1958
|
-
| `store` | `Store`<`T`\> |
|
|
1959
|
-
|
|
1960
|
-
#### Returns
|
|
1961
|
-
|
|
1962
|
-
`fn`
|
|
1963
|
-
|
|
1964
|
-
▸ (): `T`
|
|
1965
|
-
|
|
1966
|
-
##### Returns
|
|
1967
|
-
|
|
1968
|
-
`T`
|
|
1969
|
-
|
|
1970
|
-
▸ (`actions`): `T` & [`BoundActions`](API.md#boundactions)
|
|
1971
|
-
|
|
1972
|
-
##### Parameters
|
|
1973
|
-
|
|
1974
|
-
| Name | Type |
|
|
1975
|
-
| :------ | :------ |
|
|
1976
|
-
| `actions` | [`Actions`](API.md#actions) |
|
|
1977
|
-
|
|
1978
|
-
##### Returns
|
|
1979
|
-
|
|
1980
|
-
`T` & [`BoundActions`](API.md#boundactions)
|
|
1981
|
-
|
|
1982
|
-
▸ (`actions?`): `T` & [`BoundActions`](API.md#boundactions)
|
|
1983
|
-
|
|
1984
|
-
##### Parameters
|
|
1985
|
-
|
|
1986
|
-
| Name | Type |
|
|
1987
|
-
| :------ | :------ |
|
|
1988
|
-
| `actions?` | [`Actions`](API.md#actions) |
|
|
1989
|
-
|
|
1990
|
-
##### Returns
|
|
1991
|
-
|
|
1992
|
-
`T` & [`BoundActions`](API.md#boundactions)
|
|
1993
|
-
|
|
1994
|
-
#### Defined in
|
|
1995
|
-
|
|
1996
|
-
[packages/framework/esm-react-utils/src/createUseStore.ts:21](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/createUseStore.ts#L21)
|
|
1997
|
-
|
|
1998
|
-
___
|
|
1999
|
-
|
|
2000
|
-
### daysIntoYear
|
|
2001
|
-
|
|
2002
|
-
▸ **daysIntoYear**(`date`): `number`
|
|
2003
|
-
|
|
2004
|
-
Gets the number of days in the year of the given date.
|
|
2005
|
-
|
|
2006
|
-
#### Parameters
|
|
2007
|
-
|
|
2008
|
-
| Name | Type | Description |
|
|
2009
|
-
| :------ | :------ | :------ |
|
|
2010
|
-
| `date` | `Date` | The date to compute the days within the year. |
|
|
2011
|
-
|
|
2012
|
-
#### Returns
|
|
2013
|
-
|
|
2014
|
-
`number`
|
|
2015
|
-
|
|
2016
|
-
The number of days.
|
|
2017
|
-
|
|
2018
|
-
#### Defined in
|
|
2019
|
-
|
|
2020
|
-
[packages/framework/esm-utils/src/age-helpers.tsx:6](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/age-helpers.tsx#L6)
|
|
2021
|
-
|
|
2022
|
-
___
|
|
2023
|
-
|
|
2024
|
-
### defineConfigSchema
|
|
2025
|
-
|
|
2026
|
-
▸ **defineConfigSchema**(`moduleName`, `schema`): `void`
|
|
2027
|
-
|
|
2028
|
-
#### Parameters
|
|
2029
|
-
|
|
2030
|
-
| Name | Type |
|
|
2031
|
-
| :------ | :------ |
|
|
2032
|
-
| `moduleName` | `string` |
|
|
2033
|
-
| `schema` | [`ConfigSchema`](interfaces/ConfigSchema.md) |
|
|
2034
|
-
|
|
2035
|
-
#### Returns
|
|
2036
|
-
|
|
2037
|
-
`void`
|
|
2038
|
-
|
|
2039
|
-
#### Defined in
|
|
2040
|
-
|
|
2041
|
-
[packages/framework/esm-config/src/module-config/module-config.ts:170](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/module-config/module-config.ts#L170)
|
|
2042
|
-
|
|
2043
|
-
___
|
|
2044
|
-
|
|
2045
|
-
### deleteSynchronizationItem
|
|
2046
|
-
|
|
2047
|
-
▸ **deleteSynchronizationItem**(`id`): `Promise`<`void`\>
|
|
2048
|
-
|
|
2049
|
-
Deletes a queued up sync item with the given ID.
|
|
2050
|
-
|
|
2051
|
-
#### Parameters
|
|
2052
|
-
|
|
2053
|
-
| Name | Type | Description |
|
|
2054
|
-
| :------ | :------ | :------ |
|
|
2055
|
-
| `id` | `number` | The ID of the synchronization item to be deleted. |
|
|
2056
|
-
|
|
2057
|
-
#### Returns
|
|
2058
|
-
|
|
2059
|
-
`Promise`<`void`\>
|
|
2060
|
-
|
|
2061
|
-
#### Defined in
|
|
2062
|
-
|
|
2063
|
-
[packages/framework/esm-offline/src/sync.ts:374](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L374)
|
|
2064
|
-
|
|
2065
|
-
___
|
|
2066
|
-
|
|
2067
|
-
### detach
|
|
2068
|
-
|
|
2069
|
-
▸ **detach**(`extensionSlotName`, `extensionId`): `void`
|
|
2070
|
-
|
|
2071
|
-
Avoid using this. Extension attachments should be considered declarative.
|
|
2153
|
+
Mounts into a DOM node (representing an extension slot)
|
|
2154
|
+
a lazy-loaded component from *any* frontend module
|
|
2155
|
+
that registered an extension component for this slot.
|
|
2072
2156
|
|
|
2073
2157
|
#### Parameters
|
|
2074
2158
|
|
|
2075
2159
|
| Name | Type |
|
|
2076
2160
|
| :------ | :------ |
|
|
2161
|
+
| `domElement` | `HTMLElement` |
|
|
2077
2162
|
| `extensionSlotName` | `string` |
|
|
2163
|
+
| `extensionSlotModuleName` | `string` |
|
|
2078
2164
|
| `extensionId` | `string` |
|
|
2165
|
+
| `renderFunction` | (`lifecycle`: [`Lifecycle`](interfaces/Lifecycle.md)) => [`Lifecycle`](interfaces/Lifecycle.md) |
|
|
2166
|
+
| `additionalProps` | `Record`<`string`, `any`\> |
|
|
2079
2167
|
|
|
2080
2168
|
#### Returns
|
|
2081
2169
|
|
|
2082
|
-
`
|
|
2083
|
-
|
|
2084
|
-
#### Defined in
|
|
2085
|
-
|
|
2086
|
-
[packages/framework/esm-extensions/src/extensions.ts:157](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/extensions.ts#L157)
|
|
2087
|
-
|
|
2088
|
-
___
|
|
2089
|
-
|
|
2090
|
-
### detachAll
|
|
2091
|
-
|
|
2092
|
-
▸ **detachAll**(`extensionSlotName`): `void`
|
|
2093
|
-
|
|
2094
|
-
Avoid using this. Extension attachments should be considered declarative.
|
|
2095
|
-
|
|
2096
|
-
#### Parameters
|
|
2097
|
-
|
|
2098
|
-
| Name | Type |
|
|
2099
|
-
| :------ | :------ |
|
|
2100
|
-
| `extensionSlotName` | `string` |
|
|
2101
|
-
|
|
2102
|
-
#### Returns
|
|
2103
|
-
|
|
2104
|
-
`void`
|
|
2105
|
-
|
|
2106
|
-
#### Defined in
|
|
2107
|
-
|
|
2108
|
-
[packages/framework/esm-extensions/src/extensions.ts:181](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/extensions.ts#L181)
|
|
2109
|
-
|
|
2110
|
-
___
|
|
2111
|
-
|
|
2112
|
-
### dispatchConnectivityChanged
|
|
2113
|
-
|
|
2114
|
-
▸ **dispatchConnectivityChanged**(`online`): `void`
|
|
2115
|
-
|
|
2116
|
-
#### Parameters
|
|
2117
|
-
|
|
2118
|
-
| Name | Type |
|
|
2119
|
-
| :------ | :------ |
|
|
2120
|
-
| `online` | `boolean` |
|
|
2121
|
-
|
|
2122
|
-
#### Returns
|
|
2123
|
-
|
|
2124
|
-
`void`
|
|
2125
|
-
|
|
2126
|
-
#### Defined in
|
|
2127
|
-
|
|
2128
|
-
[packages/framework/esm-globals/src/events.ts:7](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-globals/src/events.ts#L7)
|
|
2129
|
-
|
|
2130
|
-
___
|
|
2131
|
-
|
|
2132
|
-
### dispatchNetworkRequestFailed
|
|
2133
|
-
|
|
2134
|
-
▸ **dispatchNetworkRequestFailed**(`data`): `void`
|
|
2135
|
-
|
|
2136
|
-
#### Parameters
|
|
2137
|
-
|
|
2138
|
-
| Name | Type |
|
|
2139
|
-
| :------ | :------ |
|
|
2140
|
-
| `data` | [`NetworkRequestFailedEvent`](interfaces/NetworkRequestFailedEvent.md) |
|
|
2141
|
-
|
|
2142
|
-
#### Returns
|
|
2143
|
-
|
|
2144
|
-
`void`
|
|
2145
|
-
|
|
2146
|
-
#### Defined in
|
|
2147
|
-
|
|
2148
|
-
[packages/framework/esm-offline/src/events.ts:5](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/events.ts#L5)
|
|
2149
|
-
|
|
2150
|
-
___
|
|
2151
|
-
|
|
2152
|
-
### dispatchNotificationShown
|
|
2153
|
-
|
|
2154
|
-
▸ **dispatchNotificationShown**(`data`): `void`
|
|
2155
|
-
|
|
2156
|
-
#### Parameters
|
|
2157
|
-
|
|
2158
|
-
| Name | Type |
|
|
2159
|
-
| :------ | :------ |
|
|
2160
|
-
| `data` | [`ShowNotificationEvent`](interfaces/ShowNotificationEvent.md) |
|
|
2161
|
-
|
|
2162
|
-
#### Returns
|
|
2163
|
-
|
|
2164
|
-
`void`
|
|
2165
|
-
|
|
2166
|
-
#### Defined in
|
|
2167
|
-
|
|
2168
|
-
[packages/framework/esm-globals/src/events.ts:81](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-globals/src/events.ts#L81)
|
|
2169
|
-
|
|
2170
|
-
___
|
|
2171
|
-
|
|
2172
|
-
### dispatchPrecacheStaticDependencies
|
|
2173
|
-
|
|
2174
|
-
▸ **dispatchPrecacheStaticDependencies**(`data?`): `void`
|
|
2175
|
-
|
|
2176
|
-
#### Parameters
|
|
2177
|
-
|
|
2178
|
-
| Name | Type |
|
|
2179
|
-
| :------ | :------ |
|
|
2180
|
-
| `data` | [`PrecacheStaticDependenciesEvent`](interfaces/PrecacheStaticDependenciesEvent.md) |
|
|
2181
|
-
|
|
2182
|
-
#### Returns
|
|
2183
|
-
|
|
2184
|
-
`void`
|
|
2185
|
-
|
|
2186
|
-
#### Defined in
|
|
2187
|
-
|
|
2188
|
-
[packages/framework/esm-globals/src/events.ts:34](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-globals/src/events.ts#L34)
|
|
2189
|
-
|
|
2190
|
-
___
|
|
2191
|
-
|
|
2192
|
-
### generateOfflineUuid
|
|
2193
|
-
|
|
2194
|
-
▸ **generateOfflineUuid**(): `string`
|
|
2195
|
-
|
|
2196
|
-
Generates a UUID-like string which is used for uniquely identifying objects while offline.
|
|
2197
|
-
|
|
2198
|
-
#### Returns
|
|
2199
|
-
|
|
2200
|
-
`string`
|
|
2201
|
-
|
|
2202
|
-
#### Defined in
|
|
2203
|
-
|
|
2204
|
-
[packages/framework/esm-offline/src/uuid.ts:6](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/uuid.ts#L6)
|
|
2205
|
-
|
|
2206
|
-
___
|
|
2207
|
-
|
|
2208
|
-
### getAppState
|
|
2209
|
-
|
|
2210
|
-
▸ **getAppState**(): `Store`<[`AppState`](interfaces/AppState.md)\>
|
|
2211
|
-
|
|
2212
|
-
#### Returns
|
|
2213
|
-
|
|
2214
|
-
`Store`<[`AppState`](interfaces/AppState.md)\>
|
|
2215
|
-
|
|
2216
|
-
The [store](https://github.com/developit/unistore#store) named `app`.
|
|
2217
|
-
|
|
2218
|
-
#### Defined in
|
|
2219
|
-
|
|
2220
|
-
[packages/framework/esm-state/src/state.ts:85](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-state/src/state.ts#L85)
|
|
2221
|
-
|
|
2222
|
-
___
|
|
2223
|
-
|
|
2224
|
-
### getAssignedExtensions
|
|
2225
|
-
|
|
2226
|
-
▸ **getAssignedExtensions**(`slotName`): [`AssignedExtension`](interfaces/AssignedExtension.md)[]
|
|
2227
|
-
|
|
2228
|
-
#### Parameters
|
|
2229
|
-
|
|
2230
|
-
| Name | Type |
|
|
2231
|
-
| :------ | :------ |
|
|
2232
|
-
| `slotName` | `string` |
|
|
2233
|
-
|
|
2234
|
-
#### Returns
|
|
2235
|
-
|
|
2236
|
-
[`AssignedExtension`](interfaces/AssignedExtension.md)[]
|
|
2237
|
-
|
|
2238
|
-
#### Defined in
|
|
2239
|
-
|
|
2240
|
-
[packages/framework/esm-extensions/src/extensions.ts:249](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/extensions.ts#L249)
|
|
2241
|
-
|
|
2242
|
-
___
|
|
2243
|
-
|
|
2244
|
-
### getAsyncExtensionLifecycle
|
|
2245
|
-
|
|
2246
|
-
▸ `Const` **getAsyncExtensionLifecycle**<`T`\>(`lazy`, `options`): () => `Promise`<`ReactAppOrParcel`<`any`\>\>
|
|
2247
|
-
|
|
2248
|
-
**`deprecated`** Use getAsyncLifecycle instead.
|
|
2249
|
-
|
|
2250
|
-
#### Type parameters
|
|
2251
|
-
|
|
2252
|
-
| Name |
|
|
2253
|
-
| :------ |
|
|
2254
|
-
| `T` |
|
|
2255
|
-
|
|
2256
|
-
#### Parameters
|
|
2257
|
-
|
|
2258
|
-
| Name | Type |
|
|
2259
|
-
| :------ | :------ |
|
|
2260
|
-
| `lazy` | () => `Promise`<{ `default`: `ComponentType`<`T`\> }\> |
|
|
2261
|
-
| `options` | [`ComponentDecoratorOptions`](interfaces/ComponentDecoratorOptions.md) |
|
|
2262
|
-
|
|
2263
|
-
#### Returns
|
|
2264
|
-
|
|
2265
|
-
`fn`
|
|
2266
|
-
|
|
2267
|
-
▸ (): `Promise`<`ReactAppOrParcel`<`any`\>\>
|
|
2268
|
-
|
|
2269
|
-
##### Returns
|
|
2270
|
-
|
|
2271
|
-
`Promise`<`ReactAppOrParcel`<`any`\>\>
|
|
2272
|
-
|
|
2273
|
-
#### Defined in
|
|
2274
|
-
|
|
2275
|
-
[packages/framework/esm-react-utils/src/getLifecycle.ts:38](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/getLifecycle.ts#L38)
|
|
2276
|
-
|
|
2277
|
-
___
|
|
2278
|
-
|
|
2279
|
-
### getAsyncLifecycle
|
|
2280
|
-
|
|
2281
|
-
▸ **getAsyncLifecycle**<`T`\>(`lazy`, `options`): () => `Promise`<`ReactAppOrParcel`<`any`\>\>
|
|
2282
|
-
|
|
2283
|
-
#### Type parameters
|
|
2284
|
-
|
|
2285
|
-
| Name |
|
|
2286
|
-
| :------ |
|
|
2287
|
-
| `T` |
|
|
2288
|
-
|
|
2289
|
-
#### Parameters
|
|
2290
|
-
|
|
2291
|
-
| Name | Type |
|
|
2292
|
-
| :------ | :------ |
|
|
2293
|
-
| `lazy` | () => `Promise`<{ `default`: `ComponentType`<`T`\> }\> |
|
|
2294
|
-
| `options` | [`ComponentDecoratorOptions`](interfaces/ComponentDecoratorOptions.md) |
|
|
2295
|
-
|
|
2296
|
-
#### Returns
|
|
2297
|
-
|
|
2298
|
-
`fn`
|
|
2299
|
-
|
|
2300
|
-
▸ (): `Promise`<`ReactAppOrParcel`<`any`\>\>
|
|
2301
|
-
|
|
2302
|
-
##### Returns
|
|
2303
|
-
|
|
2304
|
-
`Promise`<`ReactAppOrParcel`<`any`\>\>
|
|
2305
|
-
|
|
2306
|
-
#### Defined in
|
|
2307
|
-
|
|
2308
|
-
[packages/framework/esm-react-utils/src/getLifecycle.ts:20](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/getLifecycle.ts#L20)
|
|
2309
|
-
|
|
2310
|
-
___
|
|
2311
|
-
|
|
2312
|
-
### getConfig
|
|
2313
|
-
|
|
2314
|
-
▸ **getConfig**(`moduleName`): `Promise`<[`Config`](interfaces/Config.md)\>
|
|
2315
|
-
|
|
2316
|
-
A promise-based way to access the config as soon as it is fully loaded.
|
|
2317
|
-
If it is already loaded, resolves the config in its present state.
|
|
2318
|
-
|
|
2319
|
-
In general you should use the Unistore-based API provided by
|
|
2320
|
-
`getConfigStore`, which allows creating a subscription so that you always
|
|
2321
|
-
have the latest config. If using React, just use `useConfig`.
|
|
2322
|
-
|
|
2323
|
-
This is a useful function if you need to get the config in the course
|
|
2324
|
-
of the execution of a function.
|
|
2325
|
-
|
|
2326
|
-
#### Parameters
|
|
2327
|
-
|
|
2328
|
-
| Name | Type | Description |
|
|
2329
|
-
| :------ | :------ | :------ |
|
|
2330
|
-
| `moduleName` | `string` | The name of the module for which to look up the config |
|
|
2331
|
-
|
|
2332
|
-
#### Returns
|
|
2333
|
-
|
|
2334
|
-
`Promise`<[`Config`](interfaces/Config.md)\>
|
|
2335
|
-
|
|
2336
|
-
#### Defined in
|
|
2337
|
-
|
|
2338
|
-
[packages/framework/esm-config/src/module-config/module-config.ts:198](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/module-config/module-config.ts#L198)
|
|
2339
|
-
|
|
2340
|
-
___
|
|
2341
|
-
|
|
2342
|
-
### getConnectedExtensions
|
|
2343
|
-
|
|
2344
|
-
▸ **getConnectedExtensions**(`assignedExtensions`, `online?`): [`ConnectedExtension`](interfaces/ConnectedExtension.md)[]
|
|
2345
|
-
|
|
2346
|
-
Filters a list of extensions according to whether they support the
|
|
2347
|
-
current connectivity status.
|
|
2348
|
-
|
|
2349
|
-
#### Parameters
|
|
2350
|
-
|
|
2351
|
-
| Name | Type | Default value | Description |
|
|
2352
|
-
| :------ | :------ | :------ | :------ |
|
|
2353
|
-
| `assignedExtensions` | [`AssignedExtension`](interfaces/AssignedExtension.md)[] | `undefined` | The list of extensions to filter. |
|
|
2354
|
-
| `online` | ``null`` \| `boolean` | `null` | Whether the app is currently online. If `null`, uses `navigator.onLine`. |
|
|
2355
|
-
|
|
2356
|
-
#### Returns
|
|
2357
|
-
|
|
2358
|
-
[`ConnectedExtension`](interfaces/ConnectedExtension.md)[]
|
|
2359
|
-
|
|
2360
|
-
A list of extensions that should be rendered
|
|
2361
|
-
|
|
2362
|
-
#### Defined in
|
|
2363
|
-
|
|
2364
|
-
[packages/framework/esm-extensions/src/extensions.ts:239](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/extensions.ts#L239)
|
|
2365
|
-
|
|
2366
|
-
___
|
|
2367
|
-
|
|
2368
|
-
### getCurrentOfflineMode
|
|
2369
|
-
|
|
2370
|
-
▸ **getCurrentOfflineMode**(): [`OfflineModeResult`](interfaces/OfflineModeResult.md)
|
|
2371
|
-
|
|
2372
|
-
#### Returns
|
|
2373
|
-
|
|
2374
|
-
[`OfflineModeResult`](interfaces/OfflineModeResult.md)
|
|
2375
|
-
|
|
2376
|
-
#### Defined in
|
|
2377
|
-
|
|
2378
|
-
[packages/framework/esm-offline/src/mode.ts:47](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/mode.ts#L47)
|
|
2379
|
-
|
|
2380
|
-
___
|
|
2381
|
-
|
|
2382
|
-
### getCustomProps
|
|
2383
|
-
|
|
2384
|
-
▸ **getCustomProps**(`online`, `offline`): `object`
|
|
2385
|
-
|
|
2386
|
-
#### Parameters
|
|
2387
|
-
|
|
2388
|
-
| Name | Type |
|
|
2389
|
-
| :------ | :------ |
|
|
2390
|
-
| `online` | `undefined` \| `boolean` \| `object` |
|
|
2391
|
-
| `offline` | `undefined` \| `boolean` \| `object` |
|
|
2392
|
-
|
|
2393
|
-
#### Returns
|
|
2394
|
-
|
|
2395
|
-
`object`
|
|
2396
|
-
|
|
2397
|
-
#### Defined in
|
|
2398
|
-
|
|
2399
|
-
[packages/framework/esm-extensions/src/helpers.ts:17](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/helpers.ts#L17)
|
|
2400
|
-
|
|
2401
|
-
___
|
|
2402
|
-
|
|
2403
|
-
### getExtensionNameFromId
|
|
2404
|
-
|
|
2405
|
-
▸ **getExtensionNameFromId**(`extensionId`): `string`
|
|
2406
|
-
|
|
2407
|
-
Given an extension ID, which is a string uniquely identifying
|
|
2408
|
-
an instance of an extension within an extension slot, this
|
|
2409
|
-
returns the extension name.
|
|
2410
|
-
|
|
2411
|
-
**`example`**
|
|
2412
|
-
```js
|
|
2413
|
-
getExtensionNameFromId("foo#bar")
|
|
2414
|
-
--> "foo"
|
|
2415
|
-
getExtensionNameFromId("baz")
|
|
2416
|
-
--> "baz"
|
|
2417
|
-
```
|
|
2418
|
-
|
|
2419
|
-
#### Parameters
|
|
2420
|
-
|
|
2421
|
-
| Name | Type |
|
|
2422
|
-
| :------ | :------ |
|
|
2423
|
-
| `extensionId` | `string` |
|
|
2424
|
-
|
|
2425
|
-
#### Returns
|
|
2426
|
-
|
|
2427
|
-
`string`
|
|
2428
|
-
|
|
2429
|
-
#### Defined in
|
|
2430
|
-
|
|
2431
|
-
[packages/framework/esm-extensions/src/extensions.ts:70](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/extensions.ts#L70)
|
|
2432
|
-
|
|
2433
|
-
___
|
|
2434
|
-
|
|
2435
|
-
### getExtensionRegistration
|
|
2436
|
-
|
|
2437
|
-
▸ **getExtensionRegistration**(`extensionId`): [`ExtensionRegistration`](interfaces/ExtensionRegistration.md) \| `undefined`
|
|
2438
|
-
|
|
2439
|
-
#### Parameters
|
|
2440
|
-
|
|
2441
|
-
| Name | Type |
|
|
2442
|
-
| :------ | :------ |
|
|
2443
|
-
| `extensionId` | `string` |
|
|
2444
|
-
|
|
2445
|
-
#### Returns
|
|
2446
|
-
|
|
2447
|
-
[`ExtensionRegistration`](interfaces/ExtensionRegistration.md) \| `undefined`
|
|
2448
|
-
|
|
2449
|
-
#### Defined in
|
|
2450
|
-
|
|
2451
|
-
[packages/framework/esm-extensions/src/extensions.ts:83](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/extensions.ts#L83)
|
|
2452
|
-
|
|
2453
|
-
___
|
|
2454
|
-
|
|
2455
|
-
### getExtensionRegistrationFrom
|
|
2456
|
-
|
|
2457
|
-
▸ **getExtensionRegistrationFrom**(`state`, `extensionId`): [`ExtensionRegistration`](interfaces/ExtensionRegistration.md) \| `undefined`
|
|
2458
|
-
|
|
2459
|
-
#### Parameters
|
|
2460
|
-
|
|
2461
|
-
| Name | Type |
|
|
2462
|
-
| :------ | :------ |
|
|
2463
|
-
| `state` | [`ExtensionInternalStore`](interfaces/ExtensionInternalStore.md) |
|
|
2464
|
-
| `extensionId` | `string` |
|
|
2465
|
-
|
|
2466
|
-
#### Returns
|
|
2467
|
-
|
|
2468
|
-
[`ExtensionRegistration`](interfaces/ExtensionRegistration.md) \| `undefined`
|
|
2469
|
-
|
|
2470
|
-
#### Defined in
|
|
2471
|
-
|
|
2472
|
-
[packages/framework/esm-extensions/src/extensions.ts:75](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/extensions.ts#L75)
|
|
2473
|
-
|
|
2474
|
-
___
|
|
2475
|
-
|
|
2476
|
-
### getExtensionStore
|
|
2477
|
-
|
|
2478
|
-
▸ `Const` **getExtensionStore**(): `Store`<[`ExtensionStore`](interfaces/ExtensionStore.md)\>
|
|
2479
|
-
|
|
2480
|
-
This returns a [store](https://github.com/developit/unistore#store)
|
|
2481
|
-
that modules can use to get information about the state of the
|
|
2482
|
-
extension system.
|
|
2483
|
-
|
|
2484
|
-
#### Returns
|
|
2485
|
-
|
|
2486
|
-
`Store`<[`ExtensionStore`](interfaces/ExtensionStore.md)\>
|
|
2487
|
-
|
|
2488
|
-
#### Defined in
|
|
2489
|
-
|
|
2490
|
-
[packages/framework/esm-extensions/src/store.ts:129](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L129)
|
|
2491
|
-
|
|
2492
|
-
___
|
|
2493
|
-
|
|
2494
|
-
### getGlobalStore
|
|
2495
|
-
|
|
2496
|
-
▸ **getGlobalStore**<`TState`\>(`name`, `fallbackState?`): `Store`<`TState`\>
|
|
2497
|
-
|
|
2498
|
-
Returns the existing [store](https://github.com/developit/unistore#store) named `name`,
|
|
2499
|
-
or creates a new store named `name` if none exists.
|
|
2500
|
-
|
|
2501
|
-
#### Type parameters
|
|
2502
|
-
|
|
2503
|
-
| Name | Type |
|
|
2504
|
-
| :------ | :------ |
|
|
2505
|
-
| `TState` | `any` |
|
|
2506
|
-
|
|
2507
|
-
#### Parameters
|
|
2508
|
-
|
|
2509
|
-
| Name | Type | Description |
|
|
2510
|
-
| :------ | :------ | :------ |
|
|
2511
|
-
| `name` | `string` | The name of the store to look up. |
|
|
2512
|
-
| `fallbackState?` | `TState` | The initial value of the new store if no store named `name` exists. |
|
|
2513
|
-
|
|
2514
|
-
#### Returns
|
|
2515
|
-
|
|
2516
|
-
`Store`<`TState`\>
|
|
2517
|
-
|
|
2518
|
-
The found or newly created store.
|
|
2519
|
-
|
|
2520
|
-
#### Defined in
|
|
2521
|
-
|
|
2522
|
-
[packages/framework/esm-state/src/state.ts:55](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-state/src/state.ts#L55)
|
|
2523
|
-
|
|
2524
|
-
___
|
|
2525
|
-
|
|
2526
|
-
### getLifecycle
|
|
2527
|
-
|
|
2528
|
-
▸ **getLifecycle**<`T`\>(`Component`, `options`): `ReactAppOrParcel`<`any`\>
|
|
2529
|
-
|
|
2530
|
-
#### Type parameters
|
|
2531
|
-
|
|
2532
|
-
| Name |
|
|
2533
|
-
| :------ |
|
|
2534
|
-
| `T` |
|
|
2535
|
-
|
|
2536
|
-
#### Parameters
|
|
2537
|
-
|
|
2538
|
-
| Name | Type |
|
|
2539
|
-
| :------ | :------ |
|
|
2540
|
-
| `Component` | `ComponentType`<`T`\> |
|
|
2541
|
-
| `options` | [`ComponentDecoratorOptions`](interfaces/ComponentDecoratorOptions.md) |
|
|
2542
|
-
|
|
2543
|
-
#### Returns
|
|
2544
|
-
|
|
2545
|
-
`ReactAppOrParcel`<`any`\>
|
|
2546
|
-
|
|
2547
|
-
#### Defined in
|
|
2548
|
-
|
|
2549
|
-
[packages/framework/esm-react-utils/src/getLifecycle.ts:9](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/getLifecycle.ts#L9)
|
|
2550
|
-
|
|
2551
|
-
___
|
|
2552
|
-
|
|
2553
|
-
### getOfflinePatientDataStore
|
|
2554
|
-
|
|
2555
|
-
▸ **getOfflinePatientDataStore**(): `Store`<[`OfflinePatientDataSyncStore`](interfaces/OfflinePatientDataSyncStore.md)\>
|
|
2556
|
-
|
|
2557
|
-
#### Returns
|
|
2558
|
-
|
|
2559
|
-
`Store`<[`OfflinePatientDataSyncStore`](interfaces/OfflinePatientDataSyncStore.md)\>
|
|
2560
|
-
|
|
2561
|
-
#### Defined in
|
|
2562
|
-
|
|
2563
|
-
[packages/framework/esm-offline/src/offline-patient-data.ts:85](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/offline-patient-data.ts#L85)
|
|
2564
|
-
|
|
2565
|
-
___
|
|
2566
|
-
|
|
2567
|
-
### getOfflineSynchronizationStore
|
|
2568
|
-
|
|
2569
|
-
▸ **getOfflineSynchronizationStore**(): `Store`<[`OfflineSynchronizationStore`](interfaces/OfflineSynchronizationStore.md)\>
|
|
2570
|
-
|
|
2571
|
-
#### Returns
|
|
2572
|
-
|
|
2573
|
-
`Store`<[`OfflineSynchronizationStore`](interfaces/OfflineSynchronizationStore.md)\>
|
|
2574
|
-
|
|
2575
|
-
#### Defined in
|
|
2576
|
-
|
|
2577
|
-
[packages/framework/esm-offline/src/sync.ts:133](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L133)
|
|
2578
|
-
|
|
2579
|
-
___
|
|
2580
|
-
|
|
2581
|
-
### getOmrsServiceWorker
|
|
2582
|
-
|
|
2583
|
-
▸ **getOmrsServiceWorker**(): `Promise`<`Workbox` \| `undefined`\>
|
|
2584
|
-
|
|
2585
|
-
If a service worker has been registered, returns a promise that resolves to a {@link Workbox}
|
|
2586
|
-
instance which is used by the application to manage that service worker.
|
|
2587
|
-
|
|
2588
|
-
If no service worker has been registered (e.g. when the application is built without offline specific features),
|
|
2589
|
-
returns a promise which immediately resolves to `undefined`.
|
|
2590
|
-
|
|
2591
|
-
#### Returns
|
|
2592
|
-
|
|
2593
|
-
`Promise`<`Workbox` \| `undefined`\>
|
|
2594
|
-
|
|
2595
|
-
A promise which either resolves to `undefined` or to the app's {@link Workbox} instance.
|
|
2596
|
-
|
|
2597
|
-
#### Defined in
|
|
2598
|
-
|
|
2599
|
-
[packages/framework/esm-offline/src/service-worker.ts:42](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker.ts#L42)
|
|
2600
|
-
|
|
2601
|
-
___
|
|
2602
|
-
|
|
2603
|
-
### getSyncLifecycle
|
|
2604
|
-
|
|
2605
|
-
▸ **getSyncLifecycle**<`T`\>(`Component`, `options`): () => `Promise`<`ReactAppOrParcel`<`any`\>\>
|
|
2606
|
-
|
|
2607
|
-
#### Type parameters
|
|
2608
|
-
|
|
2609
|
-
| Name |
|
|
2610
|
-
| :------ |
|
|
2611
|
-
| `T` |
|
|
2612
|
-
|
|
2613
|
-
#### Parameters
|
|
2614
|
-
|
|
2615
|
-
| Name | Type |
|
|
2616
|
-
| :------ | :------ |
|
|
2617
|
-
| `Component` | `ComponentType`<`T`\> |
|
|
2618
|
-
| `options` | [`ComponentDecoratorOptions`](interfaces/ComponentDecoratorOptions.md) |
|
|
2619
|
-
|
|
2620
|
-
#### Returns
|
|
2621
|
-
|
|
2622
|
-
`fn`
|
|
2623
|
-
|
|
2624
|
-
▸ (): `Promise`<`ReactAppOrParcel`<`any`\>\>
|
|
2625
|
-
|
|
2626
|
-
##### Returns
|
|
2627
|
-
|
|
2628
|
-
`Promise`<`ReactAppOrParcel`<`any`\>\>
|
|
2629
|
-
|
|
2630
|
-
#### Defined in
|
|
2631
|
-
|
|
2632
|
-
[packages/framework/esm-react-utils/src/getLifecycle.ts:28](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/getLifecycle.ts#L28)
|
|
2633
|
-
|
|
2634
|
-
___
|
|
2635
|
-
|
|
2636
|
-
### getSynchronizationItem
|
|
2637
|
-
|
|
2638
|
-
▸ **getSynchronizationItem**<`T`\>(`id`): `Promise`<[`SyncItem`](interfaces/SyncItem.md)<`T`\> \| `undefined`\>
|
|
2639
|
-
|
|
2640
|
-
Returns a queued sync item with the given ID or `undefined` if no such item exists.
|
|
2641
|
-
|
|
2642
|
-
#### Type parameters
|
|
2643
|
-
|
|
2644
|
-
| Name | Type |
|
|
2645
|
-
| :------ | :------ |
|
|
2646
|
-
| `T` | `any` |
|
|
2647
|
-
|
|
2648
|
-
#### Parameters
|
|
2649
|
-
|
|
2650
|
-
| Name | Type | Description |
|
|
2651
|
-
| :------ | :------ | :------ |
|
|
2652
|
-
| `id` | `number` | The ID of the requested sync item. |
|
|
2653
|
-
|
|
2654
|
-
#### Returns
|
|
2655
|
-
|
|
2656
|
-
`Promise`<[`SyncItem`](interfaces/SyncItem.md)<`T`\> \| `undefined`\>
|
|
2657
|
-
|
|
2658
|
-
#### Defined in
|
|
2659
|
-
|
|
2660
|
-
[packages/framework/esm-offline/src/sync.ts:333](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L333)
|
|
2661
|
-
|
|
2662
|
-
___
|
|
2663
|
-
|
|
2664
|
-
### getSynchronizationItems
|
|
2665
|
-
|
|
2666
|
-
▸ **getSynchronizationItems**<`T`\>(`type`): `Promise`<`T`[]\>
|
|
2667
|
-
|
|
2668
|
-
Returns all currently queued up sync items of the currently signed in user.
|
|
2669
|
-
|
|
2670
|
-
#### Type parameters
|
|
2671
|
-
|
|
2672
|
-
| Name |
|
|
2673
|
-
| :------ |
|
|
2674
|
-
| `T` |
|
|
2675
|
-
|
|
2676
|
-
#### Parameters
|
|
2677
|
-
|
|
2678
|
-
| Name | Type | Description |
|
|
2679
|
-
| :------ | :------ | :------ |
|
|
2680
|
-
| `type` | `string` | The identifying type of the synchronization items to be returned. |
|
|
2681
|
-
|
|
2682
|
-
#### Returns
|
|
2683
|
-
|
|
2684
|
-
`Promise`<`T`[]\>
|
|
2685
|
-
|
|
2686
|
-
#### Defined in
|
|
2687
|
-
|
|
2688
|
-
[packages/framework/esm-offline/src/sync.ts:324](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L324)
|
|
2689
|
-
|
|
2690
|
-
___
|
|
2691
|
-
|
|
2692
|
-
### getSynchronizationItemsFor
|
|
2693
|
-
|
|
2694
|
-
▸ **getSynchronizationItemsFor**<`T`\>(`userId`, `type`): `Promise`<`T`[]\>
|
|
2695
|
-
|
|
2696
|
-
Returns all currently queued up sync items of a given user.
|
|
2697
|
-
|
|
2698
|
-
#### Type parameters
|
|
2699
|
-
|
|
2700
|
-
| Name |
|
|
2701
|
-
| :------ |
|
|
2702
|
-
| `T` |
|
|
2703
|
-
|
|
2704
|
-
#### Parameters
|
|
2705
|
-
|
|
2706
|
-
| Name | Type | Description |
|
|
2707
|
-
| :------ | :------ | :------ |
|
|
2708
|
-
| `userId` | `string` | The ID of the user whose synchronization items should be returned. |
|
|
2709
|
-
| `type` | `string` | The identifying type of the synchronization items to be returned.. |
|
|
2710
|
-
|
|
2711
|
-
#### Returns
|
|
2712
|
-
|
|
2713
|
-
`Promise`<`T`[]\>
|
|
2170
|
+
[`CancelLoading`](interfaces/CancelLoading.md)
|
|
2714
2171
|
|
|
2715
2172
|
#### Defined in
|
|
2716
2173
|
|
|
2717
|
-
[packages/framework/esm-
|
|
2174
|
+
[packages/framework/esm-extensions/src/render.ts:17](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/render.ts#L17)
|
|
2718
2175
|
|
|
2719
2176
|
___
|
|
2720
2177
|
|
|
2721
|
-
###
|
|
2722
|
-
|
|
2723
|
-
▸ **handleApiError**(): (`incomingResponseErr`: `any`) => `void`
|
|
2178
|
+
### useAssignedExtensionIds
|
|
2724
2179
|
|
|
2725
|
-
|
|
2180
|
+
▸ **useAssignedExtensionIds**(`slotName`): `string`[]
|
|
2726
2181
|
|
|
2727
|
-
|
|
2182
|
+
Gets the assigned extension ids for a given extension slot name.
|
|
2183
|
+
Does not consider if offline or online.
|
|
2728
2184
|
|
|
2729
|
-
|
|
2185
|
+
**`deprecated`** Use `useAssignedExtensions`
|
|
2730
2186
|
|
|
2731
|
-
|
|
2187
|
+
#### Parameters
|
|
2732
2188
|
|
|
2733
|
-
| Name | Type |
|
|
2734
|
-
| :------ | :------ |
|
|
2735
|
-
| `
|
|
2189
|
+
| Name | Type | Description |
|
|
2190
|
+
| :------ | :------ | :------ |
|
|
2191
|
+
| `slotName` | `string` | The name of the slot to get the assigned IDs for. |
|
|
2736
2192
|
|
|
2737
|
-
|
|
2193
|
+
#### Returns
|
|
2738
2194
|
|
|
2739
|
-
`
|
|
2195
|
+
`string`[]
|
|
2740
2196
|
|
|
2741
2197
|
#### Defined in
|
|
2742
2198
|
|
|
2743
|
-
[packages/framework/esm-
|
|
2199
|
+
[packages/framework/esm-react-utils/src/useAssignedExtensionIds.ts:13](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/useAssignedExtensionIds.ts#L13)
|
|
2744
2200
|
|
|
2745
2201
|
___
|
|
2746
2202
|
|
|
2747
|
-
###
|
|
2203
|
+
### useAssignedExtensions
|
|
2748
2204
|
|
|
2749
|
-
▸
|
|
2205
|
+
▸ **useAssignedExtensions**(`slotName`): [`AssignedExtension`](interfaces/AssignedExtension.md)[]
|
|
2750
2206
|
|
|
2751
|
-
|
|
2207
|
+
Gets the assigned extensions for a given extension slot name.
|
|
2208
|
+
Does not consider if offline or online.
|
|
2752
2209
|
|
|
2753
2210
|
#### Parameters
|
|
2754
2211
|
|
|
2755
2212
|
| Name | Type | Description |
|
|
2756
2213
|
| :------ | :------ | :------ |
|
|
2757
|
-
| `
|
|
2758
|
-
| `max` | `number` | Maximum acceptable value |
|
|
2214
|
+
| `slotName` | `string` | The name of the slot to get the assigned extensions for. |
|
|
2759
2215
|
|
|
2760
2216
|
#### Returns
|
|
2761
2217
|
|
|
2762
|
-
[`
|
|
2218
|
+
[`AssignedExtension`](interfaces/AssignedExtension.md)[]
|
|
2763
2219
|
|
|
2764
2220
|
#### Defined in
|
|
2765
2221
|
|
|
2766
|
-
[packages/framework/esm-
|
|
2222
|
+
[packages/framework/esm-react-utils/src/useAssignedExtensions.ts:15](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/useAssignedExtensions.ts#L15)
|
|
2767
2223
|
|
|
2768
2224
|
___
|
|
2769
2225
|
|
|
2770
|
-
###
|
|
2226
|
+
### useConnectedExtensions
|
|
2227
|
+
|
|
2228
|
+
▸ **useConnectedExtensions**(`slotName`): [`ConnectedExtension`](interfaces/ConnectedExtension.md)[]
|
|
2229
|
+
|
|
2230
|
+
Gets the assigned extension for a given extension slot name.
|
|
2231
|
+
Considers if offline or online.
|
|
2232
|
+
|
|
2233
|
+
#### Parameters
|
|
2771
2234
|
|
|
2772
|
-
|
|
2235
|
+
| Name | Type | Description |
|
|
2236
|
+
| :------ | :------ | :------ |
|
|
2237
|
+
| `slotName` | `string` | The name of the slot to get the assigned extensions for. |
|
|
2773
2238
|
|
|
2774
2239
|
#### Returns
|
|
2775
2240
|
|
|
2776
|
-
`
|
|
2241
|
+
[`ConnectedExtension`](interfaces/ConnectedExtension.md)[]
|
|
2777
2242
|
|
|
2778
2243
|
#### Defined in
|
|
2779
2244
|
|
|
2780
|
-
[packages/framework/esm-
|
|
2245
|
+
[packages/framework/esm-react-utils/src/useConnectedExtensions.ts:15](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/useConnectedExtensions.ts#L15)
|
|
2781
2246
|
|
|
2782
2247
|
___
|
|
2783
2248
|
|
|
2784
|
-
###
|
|
2249
|
+
### useExtensionSlotMeta
|
|
2785
2250
|
|
|
2786
|
-
▸ **
|
|
2251
|
+
▸ **useExtensionSlotMeta**<`T`\>(`extensionSlotName`): `Object`
|
|
2787
2252
|
|
|
2788
|
-
|
|
2253
|
+
Extract meta data from all extension for a given extension slot.
|
|
2254
|
+
|
|
2255
|
+
#### Type parameters
|
|
2256
|
+
|
|
2257
|
+
| Name | Type |
|
|
2258
|
+
| :------ | :------ |
|
|
2259
|
+
| `T` | [`ExtensionMeta`](interfaces/ExtensionMeta.md) |
|
|
2789
2260
|
|
|
2790
2261
|
#### Parameters
|
|
2791
2262
|
|
|
2792
2263
|
| Name | Type |
|
|
2793
2264
|
| :------ | :------ |
|
|
2794
|
-
| `
|
|
2265
|
+
| `extensionSlotName` | `string` |
|
|
2795
2266
|
|
|
2796
2267
|
#### Returns
|
|
2797
2268
|
|
|
2798
|
-
`
|
|
2269
|
+
`Object`
|
|
2799
2270
|
|
|
2800
2271
|
#### Defined in
|
|
2801
2272
|
|
|
2802
|
-
[packages/framework/esm-
|
|
2273
|
+
[packages/framework/esm-react-utils/src/useExtensionSlotMeta.ts:10](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/useExtensionSlotMeta.ts#L10)
|
|
2803
2274
|
|
|
2804
2275
|
___
|
|
2805
2276
|
|
|
2806
|
-
###
|
|
2807
|
-
|
|
2808
|
-
▸ **isSameDay**(`firstDate`, `secondDate`): `boolean`
|
|
2809
|
-
|
|
2810
|
-
Checks if two dates are representing the same day.
|
|
2811
|
-
|
|
2812
|
-
#### Parameters
|
|
2277
|
+
### useExtensionStore
|
|
2813
2278
|
|
|
2814
|
-
|
|
2815
|
-
| :------ | :------ | :------ |
|
|
2816
|
-
| `firstDate` | `Date` | The first date. |
|
|
2817
|
-
| `secondDate` | `Date` | The second date. |
|
|
2279
|
+
▸ `Const` **useExtensionStore**(): `T`
|
|
2818
2280
|
|
|
2819
2281
|
#### Returns
|
|
2820
2282
|
|
|
2821
|
-
`
|
|
2822
|
-
|
|
2823
|
-
True if both are located on the same day.
|
|
2283
|
+
`T`
|
|
2824
2284
|
|
|
2825
2285
|
#### Defined in
|
|
2826
2286
|
|
|
2827
|
-
[packages/framework/esm-utils/src/
|
|
2828
|
-
|
|
2829
|
-
___
|
|
2830
|
-
|
|
2831
|
-
### isVersionSatisfied
|
|
2287
|
+
[packages/framework/esm-react-utils/src/useExtensionStore.ts:5](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/useExtensionStore.ts#L5)
|
|
2832
2288
|
|
|
2833
|
-
▸ **
|
|
2289
|
+
▸ `Const` **useExtensionStore**(`actions`): `T` & [`BoundActions`](API.md#boundactions)
|
|
2834
2290
|
|
|
2835
2291
|
#### Parameters
|
|
2836
2292
|
|
|
2837
2293
|
| Name | Type |
|
|
2838
2294
|
| :------ | :------ |
|
|
2839
|
-
| `
|
|
2840
|
-
| `installedVersion` | `string` |
|
|
2295
|
+
| `actions` | [`Actions`](API.md#actions) |
|
|
2841
2296
|
|
|
2842
2297
|
#### Returns
|
|
2843
2298
|
|
|
2844
|
-
`
|
|
2299
|
+
`T` & [`BoundActions`](API.md#boundactions)
|
|
2845
2300
|
|
|
2846
2301
|
#### Defined in
|
|
2847
2302
|
|
|
2848
|
-
[packages/framework/esm-utils/src/
|
|
2303
|
+
[packages/framework/esm-react-utils/src/useExtensionStore.ts:5](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/useExtensionStore.ts#L5)
|
|
2849
2304
|
|
|
2850
|
-
|
|
2305
|
+
▸ `Const` **useExtensionStore**(`actions?`): `T` & [`BoundActions`](API.md#boundactions)
|
|
2851
2306
|
|
|
2852
|
-
|
|
2307
|
+
#### Parameters
|
|
2853
2308
|
|
|
2854
|
-
|
|
2309
|
+
| Name | Type |
|
|
2310
|
+
| :------ | :------ |
|
|
2311
|
+
| `actions?` | [`Actions`](API.md#actions) |
|
|
2855
2312
|
|
|
2856
2313
|
#### Returns
|
|
2857
2314
|
|
|
2858
|
-
`
|
|
2315
|
+
`T` & [`BoundActions`](API.md#boundactions)
|
|
2859
2316
|
|
|
2860
2317
|
#### Defined in
|
|
2861
2318
|
|
|
2862
|
-
[packages/framework/esm-
|
|
2319
|
+
[packages/framework/esm-react-utils/src/useExtensionStore.ts:5](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/useExtensionStore.ts#L5)
|
|
2863
2320
|
|
|
2864
2321
|
___
|
|
2865
2322
|
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
▸ **messageOmrsServiceWorker**(`message`): `Promise`<[`MessageServiceWorkerResult`](interfaces/MessageServiceWorkerResult.md)<`any`\>\>
|
|
2869
|
-
|
|
2870
|
-
Sends the specified message to the application's service worker.
|
|
2871
|
-
|
|
2872
|
-
#### Parameters
|
|
2873
|
-
|
|
2874
|
-
| Name | Type | Description |
|
|
2875
|
-
| :------ | :------ | :------ |
|
|
2876
|
-
| `message` | [`KnownOmrsServiceWorkerMessages`](API.md#knownomrsserviceworkermessages) | The message to be sent. |
|
|
2877
|
-
|
|
2878
|
-
#### Returns
|
|
2879
|
-
|
|
2880
|
-
`Promise`<[`MessageServiceWorkerResult`](interfaces/MessageServiceWorkerResult.md)<`any`\>\>
|
|
2881
|
-
|
|
2882
|
-
A promise which completes when the message has been successfully processed by the Service Worker.
|
|
2323
|
+
## Framework Functions
|
|
2883
2324
|
|
|
2884
|
-
|
|
2325
|
+
### getAsyncExtensionLifecycle
|
|
2885
2326
|
|
|
2886
|
-
|
|
2327
|
+
▸ `Const` **getAsyncExtensionLifecycle**<`T`\>(`lazy`, `options`): () => `Promise`<`ReactAppOrParcel`<`any`\>\>
|
|
2887
2328
|
|
|
2888
|
-
|
|
2329
|
+
**`deprecated`** Use getAsyncLifecycle instead.
|
|
2889
2330
|
|
|
2890
|
-
|
|
2331
|
+
#### Type parameters
|
|
2891
2332
|
|
|
2892
|
-
|
|
2333
|
+
| Name |
|
|
2334
|
+
| :------ |
|
|
2335
|
+
| `T` |
|
|
2893
2336
|
|
|
2894
2337
|
#### Parameters
|
|
2895
2338
|
|
|
2896
2339
|
| Name | Type |
|
|
2897
2340
|
| :------ | :------ |
|
|
2898
|
-
| `
|
|
2341
|
+
| `lazy` | () => `Promise`<{ `default`: `ComponentType`<`T`\> }\> |
|
|
2342
|
+
| `options` | `ComponentDecoratorOptions` |
|
|
2899
2343
|
|
|
2900
2344
|
#### Returns
|
|
2901
2345
|
|
|
2902
2346
|
`fn`
|
|
2903
2347
|
|
|
2904
|
-
▸ (
|
|
2905
|
-
|
|
2906
|
-
##### Parameters
|
|
2907
|
-
|
|
2908
|
-
| Name | Type |
|
|
2909
|
-
| :------ | :------ |
|
|
2910
|
-
| `Comp` | `ComponentType`<{}\> |
|
|
2348
|
+
▸ (): `Promise`<`ReactAppOrParcel`<`any`\>\>
|
|
2911
2349
|
|
|
2912
2350
|
##### Returns
|
|
2913
2351
|
|
|
2914
|
-
`
|
|
2352
|
+
`Promise`<`ReactAppOrParcel`<`any`\>\>
|
|
2915
2353
|
|
|
2916
2354
|
#### Defined in
|
|
2917
2355
|
|
|
2918
|
-
[packages/framework/esm-react-utils/src/
|
|
2356
|
+
[packages/framework/esm-react-utils/src/getLifecycle.ts:39](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/getLifecycle.ts#L39)
|
|
2919
2357
|
|
|
2920
2358
|
___
|
|
2921
2359
|
|
|
2922
|
-
###
|
|
2923
|
-
|
|
2924
|
-
▸ **patchXMLHttpRequest**(): `void`
|
|
2925
|
-
|
|
2926
|
-
#### Returns
|
|
2927
|
-
|
|
2928
|
-
`void`
|
|
2360
|
+
### getAsyncLifecycle
|
|
2929
2361
|
|
|
2930
|
-
|
|
2362
|
+
▸ **getAsyncLifecycle**<`T`\>(`lazy`, `options`): () => `Promise`<`ReactAppOrParcel`<`any`\>\>
|
|
2931
2363
|
|
|
2932
|
-
|
|
2364
|
+
#### Type parameters
|
|
2933
2365
|
|
|
2934
|
-
|
|
2366
|
+
| Name |
|
|
2367
|
+
| :------ |
|
|
2368
|
+
| `T` |
|
|
2935
2369
|
|
|
2936
|
-
|
|
2370
|
+
#### Parameters
|
|
2937
2371
|
|
|
2938
|
-
|
|
2372
|
+
| Name | Type |
|
|
2373
|
+
| :------ | :------ |
|
|
2374
|
+
| `lazy` | () => `Promise`<{ `default`: `ComponentType`<`T`\> }\> |
|
|
2375
|
+
| `options` | `ComponentDecoratorOptions` |
|
|
2939
2376
|
|
|
2940
|
-
|
|
2377
|
+
#### Returns
|
|
2941
2378
|
|
|
2942
|
-
|
|
2379
|
+
`fn`
|
|
2943
2380
|
|
|
2944
|
-
|
|
2945
|
-
| :------ | :------ | :------ | :------ |
|
|
2946
|
-
| `schema` | [`ConfigSchema`](interfaces/ConfigSchema.md) | `undefined` | a configuration schema |
|
|
2947
|
-
| `providedConfig` | [`ConfigObject`](interfaces/ConfigObject.md) | `undefined` | an object of config values (without the top-level module name) |
|
|
2948
|
-
| `keyPathContext` | `string` | `undefined` | a dot-deparated string which helps the user figure out where the provided config came from |
|
|
2949
|
-
| `devDefaultsAreOn` | `boolean` | `false` | - |
|
|
2381
|
+
▸ (): `Promise`<`ReactAppOrParcel`<`any`\>\>
|
|
2950
2382
|
|
|
2951
|
-
|
|
2383
|
+
##### Returns
|
|
2952
2384
|
|
|
2953
|
-
|
|
2385
|
+
`Promise`<`ReactAppOrParcel`<`any`\>\>
|
|
2954
2386
|
|
|
2955
2387
|
#### Defined in
|
|
2956
2388
|
|
|
2957
|
-
[packages/framework/esm-
|
|
2389
|
+
[packages/framework/esm-react-utils/src/getLifecycle.ts:21](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/getLifecycle.ts#L21)
|
|
2958
2390
|
|
|
2959
2391
|
___
|
|
2960
2392
|
|
|
2961
|
-
###
|
|
2393
|
+
### getLifecycle
|
|
2962
2394
|
|
|
2963
|
-
▸ **
|
|
2395
|
+
▸ **getLifecycle**<`T`\>(`Component`, `options`): `ReactAppOrParcel`<`any`\>
|
|
2396
|
+
|
|
2397
|
+
#### Type parameters
|
|
2398
|
+
|
|
2399
|
+
| Name |
|
|
2400
|
+
| :------ |
|
|
2401
|
+
| `T` |
|
|
2964
2402
|
|
|
2965
2403
|
#### Parameters
|
|
2966
2404
|
|
|
2967
|
-
| Name | Type |
|
|
2968
|
-
| :------ | :------ |
|
|
2969
|
-
| `
|
|
2970
|
-
| `
|
|
2405
|
+
| Name | Type |
|
|
2406
|
+
| :------ | :------ |
|
|
2407
|
+
| `Component` | `ComponentType`<`T`\> |
|
|
2408
|
+
| `options` | `ComponentDecoratorOptions` |
|
|
2971
2409
|
|
|
2972
2410
|
#### Returns
|
|
2973
2411
|
|
|
2974
|
-
`
|
|
2412
|
+
`ReactAppOrParcel`<`any`\>
|
|
2975
2413
|
|
|
2976
2414
|
#### Defined in
|
|
2977
2415
|
|
|
2978
|
-
[packages/framework/esm-
|
|
2416
|
+
[packages/framework/esm-react-utils/src/getLifecycle.ts:10](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/getLifecycle.ts#L10)
|
|
2979
2417
|
|
|
2980
2418
|
___
|
|
2981
2419
|
|
|
2982
|
-
###
|
|
2420
|
+
### getSyncLifecycle
|
|
2421
|
+
|
|
2422
|
+
▸ **getSyncLifecycle**<`T`\>(`Component`, `options`): () => `Promise`<`ReactAppOrParcel`<`any`\>\>
|
|
2983
2423
|
|
|
2984
|
-
|
|
2424
|
+
#### Type parameters
|
|
2985
2425
|
|
|
2986
|
-
|
|
2426
|
+
| Name |
|
|
2427
|
+
| :------ |
|
|
2428
|
+
| `T` |
|
|
2987
2429
|
|
|
2988
2430
|
#### Parameters
|
|
2989
2431
|
|
|
2990
2432
|
| Name | Type |
|
|
2991
2433
|
| :------ | :------ |
|
|
2992
|
-
| `
|
|
2434
|
+
| `Component` | `ComponentType`<`T`\> |
|
|
2435
|
+
| `options` | `ComponentDecoratorOptions` |
|
|
2993
2436
|
|
|
2994
2437
|
#### Returns
|
|
2995
2438
|
|
|
2996
2439
|
`fn`
|
|
2997
2440
|
|
|
2998
|
-
▸ (): `
|
|
2441
|
+
▸ (): `Promise`<`ReactAppOrParcel`<`any`\>\>
|
|
2999
2442
|
|
|
3000
2443
|
##### Returns
|
|
3001
2444
|
|
|
3002
|
-
`
|
|
2445
|
+
`Promise`<`ReactAppOrParcel`<`any`\>\>
|
|
3003
2446
|
|
|
3004
2447
|
#### Defined in
|
|
3005
2448
|
|
|
3006
|
-
[packages/framework/esm-
|
|
2449
|
+
[packages/framework/esm-react-utils/src/getLifecycle.ts:29](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/getLifecycle.ts#L29)
|
|
3007
2450
|
|
|
3008
2451
|
___
|
|
3009
2452
|
|
|
3010
|
-
|
|
2453
|
+
## Navigation Functions
|
|
3011
2454
|
|
|
3012
|
-
|
|
2455
|
+
### interpolateString
|
|
3013
2456
|
|
|
3014
|
-
|
|
2457
|
+
▸ **interpolateString**(`template`, `params`): `string`
|
|
3015
2458
|
|
|
3016
|
-
|
|
2459
|
+
Interpolates values of `params` into the `template` string.
|
|
3017
2460
|
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
2461
|
+
Useful for additional template parameters in URLs.
|
|
2462
|
+
|
|
2463
|
+
Example usage:
|
|
2464
|
+
```js
|
|
2465
|
+
navigate({
|
|
2466
|
+
to: interpolateString(
|
|
2467
|
+
config.links.patientChart,
|
|
2468
|
+
{ patientUuid: patient.uuid }
|
|
2469
|
+
)
|
|
2470
|
+
});
|
|
2471
|
+
```
|
|
3021
2472
|
|
|
3022
2473
|
#### Parameters
|
|
3023
2474
|
|
|
3024
2475
|
| Name | Type | Description |
|
|
3025
2476
|
| :------ | :------ | :------ |
|
|
3026
|
-
| `
|
|
3027
|
-
| `
|
|
3028
|
-
| `descriptor?` | [`QueueItemDescriptor`](interfaces/QueueItemDescriptor.md) | An optional descriptor providing additional metadata about the sync item. |
|
|
2477
|
+
| `template` | `string` | With optional params wrapped in `${ }` |
|
|
2478
|
+
| `params` | `object` | Values to interpolate into the string template |
|
|
3029
2479
|
|
|
3030
2480
|
#### Returns
|
|
3031
2481
|
|
|
3032
|
-
`
|
|
2482
|
+
`string`
|
|
3033
2483
|
|
|
3034
2484
|
#### Defined in
|
|
3035
2485
|
|
|
3036
|
-
[packages/framework/esm-
|
|
2486
|
+
[packages/framework/esm-config/src/navigation/interpolate-string.ts:41](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/navigation/interpolate-string.ts#L41)
|
|
3037
2487
|
|
|
3038
2488
|
___
|
|
3039
2489
|
|
|
3040
|
-
###
|
|
3041
|
-
|
|
3042
|
-
▸ **queueSynchronizationItemFor**<`T`\>(`userId`, `type`, `content`, `descriptor?`): `Promise`<`number`\>
|
|
2490
|
+
### interpolateUrl
|
|
3043
2491
|
|
|
3044
|
-
|
|
2492
|
+
▸ **interpolateUrl**(`template`): `string`
|
|
3045
2493
|
|
|
3046
|
-
|
|
2494
|
+
Interpolates a string with openmrsBase and openmrsSpaBase.
|
|
3047
2495
|
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
| `T` |
|
|
2496
|
+
Useful for accepting `${openmrsBase}` or `${openmrsSpaBase}` template
|
|
2497
|
+
parameters in configurable URLs.
|
|
3051
2498
|
|
|
3052
2499
|
#### Parameters
|
|
3053
2500
|
|
|
3054
2501
|
| Name | Type | Description |
|
|
3055
2502
|
| :------ | :------ | :------ |
|
|
3056
|
-
| `
|
|
3057
|
-
| `type` | `string` | The identifying type of the synchronization item. |
|
|
3058
|
-
| `content` | `T` | The actual data to be synchronized. |
|
|
3059
|
-
| `descriptor?` | [`QueueItemDescriptor`](interfaces/QueueItemDescriptor.md) | An optional descriptor providing additional metadata about the sync item. |
|
|
2503
|
+
| `template` | `string` | A string to interpolate |
|
|
3060
2504
|
|
|
3061
2505
|
#### Returns
|
|
3062
2506
|
|
|
3063
|
-
`
|
|
2507
|
+
`string`
|
|
3064
2508
|
|
|
3065
2509
|
#### Defined in
|
|
3066
2510
|
|
|
3067
|
-
[packages/framework/esm-
|
|
2511
|
+
[packages/framework/esm-config/src/navigation/interpolate-string.ts:15](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/navigation/interpolate-string.ts#L15)
|
|
3068
2512
|
|
|
3069
2513
|
___
|
|
3070
2514
|
|
|
3071
|
-
###
|
|
2515
|
+
### navigate
|
|
3072
2516
|
|
|
3073
|
-
▸ **
|
|
2517
|
+
▸ **navigate**(`to`): `void`
|
|
3074
2518
|
|
|
3075
|
-
|
|
2519
|
+
Calls `location.assign` for non-SPA paths and [navigateToUrl](https://single-spa.js.org/docs/api/#navigatetourl) for SPA paths
|
|
2520
|
+
|
|
2521
|
+
Example usage:
|
|
2522
|
+
```js
|
|
2523
|
+
const config = getConfig();
|
|
2524
|
+
const submitHandler = () => {
|
|
2525
|
+
navigate({ to: config.links.submitSuccess });
|
|
2526
|
+
};
|
|
2527
|
+
```
|
|
3076
2528
|
|
|
3077
2529
|
#### Parameters
|
|
3078
2530
|
|
|
3079
2531
|
| Name | Type | Description |
|
|
3080
|
-
| :------ | :------ | :------ |
|
|
3081
|
-
| `
|
|
3082
|
-
| `handler` | [`OfflinePatientDataSyncHandler`](interfaces/OfflinePatientDataSyncHandler.md) | The patient handler registration to be registered. |
|
|
2532
|
+
| :------ | :------ | :------ |
|
|
2533
|
+
| `to` | [`NavigateOptions`](interfaces/NavigateOptions.md) | The target path or URL. Supports templating with 'openmrsBase' and 'openmrsSpaBase'. For example, `${openmrsSpaBase}/home` will resolve to `/openmrs/spa/home` for implementations using the standard OpenMRS and SPA base paths. |
|
|
3083
2534
|
|
|
3084
2535
|
#### Returns
|
|
3085
2536
|
|
|
3086
2537
|
`void`
|
|
3087
2538
|
|
|
3088
|
-
`true` if the registration was successfully made; `false` if another registration with
|
|
3089
|
-
the same identifier has already been registered before.
|
|
3090
|
-
|
|
3091
2539
|
#### Defined in
|
|
3092
2540
|
|
|
3093
|
-
[packages/framework/esm-
|
|
2541
|
+
[packages/framework/esm-config/src/navigation/navigate.ts:29](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/navigation/navigate.ts#L29)
|
|
3094
2542
|
|
|
3095
2543
|
___
|
|
3096
2544
|
|
|
3097
|
-
|
|
2545
|
+
## Offline Functions
|
|
2546
|
+
|
|
2547
|
+
### beginEditSynchronizationItem
|
|
3098
2548
|
|
|
3099
|
-
▸ **
|
|
2549
|
+
▸ **beginEditSynchronizationItem**(`id`): `Promise`<`void`\>
|
|
3100
2550
|
|
|
3101
|
-
|
|
3102
|
-
|
|
2551
|
+
Triggers an edit flow for the given synchronization item.
|
|
2552
|
+
If this is not possible, throws an error.
|
|
3103
2553
|
|
|
3104
2554
|
#### Parameters
|
|
3105
2555
|
|
|
3106
|
-
| Name | Type |
|
|
3107
|
-
| :------ | :------ |
|
|
3108
|
-
| `
|
|
3109
|
-
| `registerOptions?` | `object` |
|
|
2556
|
+
| Name | Type | Description |
|
|
2557
|
+
| :------ | :------ | :------ |
|
|
2558
|
+
| `id` | `number` | The ID of the synchronization item to be edited. |
|
|
3110
2559
|
|
|
3111
2560
|
#### Returns
|
|
3112
2561
|
|
|
3113
|
-
`Promise`<`
|
|
3114
|
-
|
|
3115
|
-
A promise which resolves to the registered {@link Workbox} instance which manages the SW.
|
|
2562
|
+
`Promise`<`void`\>
|
|
3116
2563
|
|
|
3117
2564
|
#### Defined in
|
|
3118
2565
|
|
|
3119
|
-
[packages/framework/esm-offline/src/
|
|
2566
|
+
[packages/framework/esm-offline/src/sync.ts:377](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L377)
|
|
3120
2567
|
|
|
3121
2568
|
___
|
|
3122
2569
|
|
|
3123
|
-
###
|
|
2570
|
+
### canBeginEditSynchronizationItemsOfType
|
|
3124
2571
|
|
|
3125
|
-
▸ **
|
|
2572
|
+
▸ **canBeginEditSynchronizationItemsOfType**(`type`): `boolean`
|
|
3126
2573
|
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
that registered an extension component for this slot.
|
|
2574
|
+
Returns whether editing synchronization items of the given type is supported by the currently
|
|
2575
|
+
registered synchronization handlers.
|
|
3130
2576
|
|
|
3131
2577
|
#### Parameters
|
|
3132
2578
|
|
|
3133
|
-
| Name | Type |
|
|
3134
|
-
| :------ | :------ |
|
|
3135
|
-
| `
|
|
3136
|
-
| `extensionSlotName` | `string` |
|
|
3137
|
-
| `extensionSlotModuleName` | `string` |
|
|
3138
|
-
| `extensionId` | `string` |
|
|
3139
|
-
| `renderFunction` | (`lifecycle`: [`Lifecycle`](interfaces/Lifecycle.md)) => [`Lifecycle`](interfaces/Lifecycle.md) |
|
|
3140
|
-
| `additionalProps` | `Record`<`string`, `any`\> |
|
|
2579
|
+
| Name | Type | Description |
|
|
2580
|
+
| :------ | :------ | :------ |
|
|
2581
|
+
| `type` | `string` | The identifying type of the synchronization item which should be edited. |
|
|
3141
2582
|
|
|
3142
2583
|
#### Returns
|
|
3143
2584
|
|
|
3144
|
-
|
|
2585
|
+
`boolean`
|
|
3145
2586
|
|
|
3146
2587
|
#### Defined in
|
|
3147
2588
|
|
|
3148
|
-
[packages/framework/esm-
|
|
2589
|
+
[packages/framework/esm-offline/src/sync.ts:367](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L367)
|
|
3149
2590
|
|
|
3150
2591
|
___
|
|
3151
2592
|
|
|
3152
|
-
###
|
|
2593
|
+
### deleteSynchronizationItem
|
|
3153
2594
|
|
|
3154
|
-
▸ **
|
|
2595
|
+
▸ **deleteSynchronizationItem**(`id`): `Promise`<`void`\>
|
|
3155
2596
|
|
|
3156
|
-
|
|
3157
|
-
Under normal conditions there is no need to use this function.
|
|
2597
|
+
Deletes a queued up sync item with the given ID.
|
|
3158
2598
|
|
|
3159
2599
|
#### Parameters
|
|
3160
2600
|
|
|
3161
2601
|
| Name | Type | Description |
|
|
3162
2602
|
| :------ | :------ | :------ |
|
|
3163
|
-
| `
|
|
2603
|
+
| `id` | `number` | The ID of the synchronization item to be deleted. |
|
|
3164
2604
|
|
|
3165
2605
|
#### Returns
|
|
3166
2606
|
|
|
3167
|
-
`void
|
|
2607
|
+
`Promise`<`void`\>
|
|
3168
2608
|
|
|
3169
2609
|
#### Defined in
|
|
3170
2610
|
|
|
3171
|
-
[packages/framework/esm-
|
|
2611
|
+
[packages/framework/esm-offline/src/sync.ts:397](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L397)
|
|
3172
2612
|
|
|
3173
2613
|
___
|
|
3174
2614
|
|
|
3175
|
-
###
|
|
3176
|
-
|
|
3177
|
-
▸ **renderLoadingSpinner**(`target`): () => `any`
|
|
2615
|
+
### generateOfflineUuid
|
|
3178
2616
|
|
|
3179
|
-
|
|
2617
|
+
▸ **generateOfflineUuid**(): `string`
|
|
3180
2618
|
|
|
3181
|
-
|
|
3182
|
-
| :------ | :------ |
|
|
3183
|
-
| `target` | `HTMLElement` |
|
|
2619
|
+
Generates a UUID-like string which is used for uniquely identifying objects while offline.
|
|
3184
2620
|
|
|
3185
2621
|
#### Returns
|
|
3186
2622
|
|
|
3187
|
-
`
|
|
3188
|
-
|
|
3189
|
-
▸ (): `any`
|
|
3190
|
-
|
|
3191
|
-
##### Returns
|
|
3192
|
-
|
|
3193
|
-
`any`
|
|
2623
|
+
`string`
|
|
3194
2624
|
|
|
3195
2625
|
#### Defined in
|
|
3196
2626
|
|
|
3197
|
-
[packages/framework/esm-
|
|
2627
|
+
[packages/framework/esm-offline/src/uuid.ts:7](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/uuid.ts#L7)
|
|
3198
2628
|
|
|
3199
2629
|
___
|
|
3200
2630
|
|
|
3201
|
-
###
|
|
3202
|
-
|
|
3203
|
-
▸ **renderModals**(`modalContainer`): `void`
|
|
3204
|
-
|
|
3205
|
-
#### Parameters
|
|
2631
|
+
### getCurrentOfflineMode
|
|
3206
2632
|
|
|
3207
|
-
|
|
3208
|
-
| :------ | :------ |
|
|
3209
|
-
| `modalContainer` | ``null`` \| `HTMLElement` |
|
|
2633
|
+
▸ **getCurrentOfflineMode**(): [`OfflineModeResult`](interfaces/OfflineModeResult.md)
|
|
3210
2634
|
|
|
3211
2635
|
#### Returns
|
|
3212
2636
|
|
|
3213
|
-
`
|
|
2637
|
+
[`OfflineModeResult`](interfaces/OfflineModeResult.md)
|
|
3214
2638
|
|
|
3215
2639
|
#### Defined in
|
|
3216
2640
|
|
|
3217
|
-
[packages/framework/esm-
|
|
2641
|
+
[packages/framework/esm-offline/src/mode.ts:49](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/mode.ts#L49)
|
|
3218
2642
|
|
|
3219
2643
|
___
|
|
3220
2644
|
|
|
3221
|
-
###
|
|
3222
|
-
|
|
3223
|
-
▸ **renderToasts**(`target`): `void`
|
|
3224
|
-
|
|
3225
|
-
Starts a rendering host for toast notifications. Should only be used by the app shell.
|
|
3226
|
-
Under normal conditions there is no need to use this function.
|
|
3227
|
-
|
|
3228
|
-
#### Parameters
|
|
3229
|
-
|
|
3230
|
-
| Name | Type | Description |
|
|
3231
|
-
| :------ | :------ | :------ |
|
|
3232
|
-
| `target` | ``null`` \| `HTMLElement` | The container target that hosts the toast notifications. |
|
|
3233
|
-
|
|
3234
|
-
#### Returns
|
|
3235
|
-
|
|
3236
|
-
`void`
|
|
3237
|
-
|
|
3238
|
-
#### Defined in
|
|
2645
|
+
### getFullSynchronizationItems
|
|
3239
2646
|
|
|
3240
|
-
[
|
|
2647
|
+
▸ **getFullSynchronizationItems**<`T`\>(`type`): `Promise`<[`SyncItem`](interfaces/SyncItem.md)<`T`\>[]\>
|
|
3241
2648
|
|
|
3242
|
-
|
|
2649
|
+
Returns all currently queued up sync items of the currently signed in user.
|
|
3243
2650
|
|
|
3244
|
-
|
|
2651
|
+
#### Type parameters
|
|
3245
2652
|
|
|
3246
|
-
|
|
2653
|
+
| Name |
|
|
2654
|
+
| :------ |
|
|
2655
|
+
| `T` |
|
|
3247
2656
|
|
|
3248
2657
|
#### Parameters
|
|
3249
2658
|
|
|
3250
|
-
| Name | Type |
|
|
3251
|
-
| :------ | :------ |
|
|
3252
|
-
| `
|
|
2659
|
+
| Name | Type | Description |
|
|
2660
|
+
| :------ | :------ | :------ |
|
|
2661
|
+
| `type` | `string` | The identifying type of the synchronization items to be returned. |
|
|
3253
2662
|
|
|
3254
2663
|
#### Returns
|
|
3255
2664
|
|
|
3256
|
-
`
|
|
2665
|
+
`Promise`<[`SyncItem`](interfaces/SyncItem.md)<`T`\>[]\>
|
|
3257
2666
|
|
|
3258
2667
|
#### Defined in
|
|
3259
2668
|
|
|
3260
|
-
[packages/framework/esm-
|
|
2669
|
+
[packages/framework/esm-offline/src/sync.ts:347](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L347)
|
|
3261
2670
|
|
|
3262
2671
|
___
|
|
3263
2672
|
|
|
3264
|
-
###
|
|
3265
|
-
|
|
3266
|
-
▸ **retry**<`T`\>(`fn`, `options?`): `Promise`<`T`\>
|
|
3267
|
-
|
|
3268
|
-
Executes the specified function and retries executing on failure with a custom backoff strategy
|
|
3269
|
-
defined by the options.
|
|
2673
|
+
### getFullSynchronizationItemsFor
|
|
3270
2674
|
|
|
3271
|
-
|
|
3272
|
-
* Retries 5 times beyond the initial attempt.
|
|
3273
|
-
* Uses an exponential backoff starting with an initial delay of 1000ms.
|
|
2675
|
+
▸ **getFullSynchronizationItemsFor**<`T`\>(`userId`, `type`): `Promise`<[`SyncItem`](interfaces/SyncItem.md)<`T`\>[]\>
|
|
3274
2676
|
|
|
3275
|
-
|
|
2677
|
+
Returns all currently queued up sync items of a given user.
|
|
3276
2678
|
|
|
3277
2679
|
#### Type parameters
|
|
3278
2680
|
|
|
@@ -3284,62 +2686,66 @@ If not configured otherwise, this function uses the following default options:
|
|
|
3284
2686
|
|
|
3285
2687
|
| Name | Type | Description |
|
|
3286
2688
|
| :------ | :------ | :------ |
|
|
3287
|
-
| `
|
|
3288
|
-
| `
|
|
2689
|
+
| `userId` | `string` | The ID of the user whose synchronization items should be returned. |
|
|
2690
|
+
| `type` | `string` | The identifying type of the synchronization items to be returned.. |
|
|
3289
2691
|
|
|
3290
2692
|
#### Returns
|
|
3291
2693
|
|
|
3292
|
-
`Promise
|
|
3293
|
-
|
|
3294
|
-
The result of successfully executing `fn`.
|
|
2694
|
+
`Promise`<[`SyncItem`](interfaces/SyncItem.md)<`T`\>[]\>
|
|
3295
2695
|
|
|
3296
2696
|
#### Defined in
|
|
3297
2697
|
|
|
3298
|
-
[packages/framework/esm-
|
|
2698
|
+
[packages/framework/esm-offline/src/sync.ts:320](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L320)
|
|
3299
2699
|
|
|
3300
2700
|
___
|
|
3301
2701
|
|
|
3302
|
-
###
|
|
3303
|
-
|
|
3304
|
-
▸ **runSynchronization**(): `Promise`<`void`\>
|
|
2702
|
+
### getOfflinePatientDataStore
|
|
3305
2703
|
|
|
3306
|
-
|
|
2704
|
+
▸ **getOfflinePatientDataStore**(): `Store`<[`OfflinePatientDataSyncStore`](interfaces/OfflinePatientDataSyncStore.md)\>
|
|
3307
2705
|
|
|
3308
2706
|
#### Returns
|
|
3309
2707
|
|
|
3310
|
-
`
|
|
2708
|
+
`Store`<[`OfflinePatientDataSyncStore`](interfaces/OfflinePatientDataSyncStore.md)\>
|
|
3311
2709
|
|
|
3312
2710
|
#### Defined in
|
|
3313
2711
|
|
|
3314
|
-
[packages/framework/esm-offline/src/
|
|
2712
|
+
[packages/framework/esm-offline/src/offline-patient-data.ts:86](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/offline-patient-data.ts#L86)
|
|
3315
2713
|
|
|
3316
2714
|
___
|
|
3317
2715
|
|
|
3318
|
-
###
|
|
2716
|
+
### getSynchronizationItem
|
|
3319
2717
|
|
|
3320
|
-
▸ **
|
|
2718
|
+
▸ **getSynchronizationItem**<`T`\>(`id`): `Promise`<[`SyncItem`](interfaces/SyncItem.md)<`T`\> \| `undefined`\>
|
|
3321
2719
|
|
|
3322
|
-
|
|
2720
|
+
Returns a queued sync item with the given ID or `undefined` if no such item exists.
|
|
2721
|
+
|
|
2722
|
+
#### Type parameters
|
|
3323
2723
|
|
|
3324
2724
|
| Name | Type |
|
|
3325
2725
|
| :------ | :------ |
|
|
3326
|
-
| `
|
|
2726
|
+
| `T` | `any` |
|
|
2727
|
+
|
|
2728
|
+
#### Parameters
|
|
2729
|
+
|
|
2730
|
+
| Name | Type | Description |
|
|
2731
|
+
| :------ | :------ | :------ |
|
|
2732
|
+
| `id` | `number` | The ID of the requested sync item. |
|
|
3327
2733
|
|
|
3328
2734
|
#### Returns
|
|
3329
2735
|
|
|
3330
|
-
`
|
|
2736
|
+
`Promise`<[`SyncItem`](interfaces/SyncItem.md)<`T`\> \| `undefined`\>
|
|
3331
2737
|
|
|
3332
2738
|
#### Defined in
|
|
3333
2739
|
|
|
3334
|
-
[packages/framework/esm-offline/src/
|
|
2740
|
+
[packages/framework/esm-offline/src/sync.ts:356](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L356)
|
|
3335
2741
|
|
|
3336
2742
|
___
|
|
3337
2743
|
|
|
3338
|
-
###
|
|
2744
|
+
### getSynchronizationItems
|
|
3339
2745
|
|
|
3340
|
-
▸ **
|
|
2746
|
+
▸ **getSynchronizationItems**<`T`\>(`type`): `Promise`<`T`[]\>
|
|
3341
2747
|
|
|
3342
|
-
|
|
2748
|
+
Returns the content of all currently queued up sync items of the currently signed in user.
|
|
3343
2749
|
|
|
3344
2750
|
#### Type parameters
|
|
3345
2751
|
|
|
@@ -3351,192 +2757,174 @@ Registers a new synchronization handler which is able to synchronize data of a s
|
|
|
3351
2757
|
|
|
3352
2758
|
| Name | Type | Description |
|
|
3353
2759
|
| :------ | :------ | :------ |
|
|
3354
|
-
| `type` | `string` | The identifying type of the synchronization items
|
|
3355
|
-
| `dependsOn` | `string`[] | An array of other sync item types which must be synchronized before this handler can synchronize its own data. Items of these types are effectively dependencies of the data synchronized by this handler. |
|
|
3356
|
-
| `process` | [`ProcessSyncItem`](API.md#processsyncitem)<`T`\> | A function which, when invoked, performs the actual client-server synchronization of the given `item` (which is the actual data to be synchronized). |
|
|
3357
|
-
| `options` | `SetupOfflineSyncOptions`<`T`\> | Additional options which can optionally be provided when setting up a synchronization callback for a specific synchronization item type. |
|
|
2760
|
+
| `type` | `string` | The identifying type of the synchronization items to be returned. |
|
|
3358
2761
|
|
|
3359
2762
|
#### Returns
|
|
3360
2763
|
|
|
3361
|
-
`
|
|
2764
|
+
`Promise`<`T`[]\>
|
|
3362
2765
|
|
|
3363
2766
|
#### Defined in
|
|
3364
2767
|
|
|
3365
|
-
[packages/framework/esm-offline/src/sync.ts:
|
|
2768
|
+
[packages/framework/esm-offline/src/sync.ts:338](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L338)
|
|
3366
2769
|
|
|
3367
2770
|
___
|
|
3368
2771
|
|
|
3369
|
-
###
|
|
2772
|
+
### isOfflineUuid
|
|
2773
|
+
|
|
2774
|
+
▸ **isOfflineUuid**(`uuid`): `boolean`
|
|
3370
2775
|
|
|
3371
|
-
|
|
2776
|
+
Checks whether the given string has the format of an offline UUID generated by [generateOfflineUuid](API.md#generateofflineuuid)
|
|
3372
2777
|
|
|
3373
2778
|
#### Parameters
|
|
3374
2779
|
|
|
3375
2780
|
| Name | Type |
|
|
3376
2781
|
| :------ | :------ |
|
|
3377
|
-
| `
|
|
2782
|
+
| `uuid` | `string` |
|
|
3378
2783
|
|
|
3379
2784
|
#### Returns
|
|
3380
2785
|
|
|
3381
|
-
`
|
|
2786
|
+
`boolean`
|
|
3382
2787
|
|
|
3383
2788
|
#### Defined in
|
|
3384
2789
|
|
|
3385
|
-
[packages/framework/esm-
|
|
2790
|
+
[packages/framework/esm-offline/src/uuid.ts:12](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/uuid.ts#L12)
|
|
3386
2791
|
|
|
3387
2792
|
___
|
|
3388
2793
|
|
|
3389
|
-
###
|
|
2794
|
+
### loadPersistedPatientDataSyncState
|
|
3390
2795
|
|
|
3391
|
-
▸ **
|
|
2796
|
+
▸ **loadPersistedPatientDataSyncState**(): `Promise`<`void`\>
|
|
3392
2797
|
|
|
3393
2798
|
#### Returns
|
|
3394
2799
|
|
|
3395
|
-
`void
|
|
2800
|
+
`Promise`<`void`\>
|
|
3396
2801
|
|
|
3397
2802
|
#### Defined in
|
|
3398
2803
|
|
|
3399
|
-
[packages/framework/esm-
|
|
2804
|
+
[packages/framework/esm-offline/src/offline-patient-data.ts:200](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/offline-patient-data.ts#L200)
|
|
3400
2805
|
|
|
3401
2806
|
___
|
|
3402
2807
|
|
|
3403
|
-
###
|
|
2808
|
+
### messageOmrsServiceWorker
|
|
3404
2809
|
|
|
3405
|
-
▸ **
|
|
2810
|
+
▸ **messageOmrsServiceWorker**(`message`): `Promise`<[`MessageServiceWorkerResult`](interfaces/MessageServiceWorkerResult.md)<`any`\>\>
|
|
3406
2811
|
|
|
3407
|
-
|
|
2812
|
+
Sends the specified message to the application's service worker.
|
|
3408
2813
|
|
|
3409
2814
|
#### Parameters
|
|
3410
2815
|
|
|
3411
2816
|
| Name | Type | Description |
|
|
3412
2817
|
| :------ | :------ | :------ |
|
|
3413
|
-
| `
|
|
3414
|
-
| `props` | `Record`<`string`, `any`\> | The optional props to provide to the extension. |
|
|
3415
|
-
| `onClose` | () => `void` | The optional notification to receive when the modal is closed. |
|
|
2818
|
+
| `message` | [`KnownOmrsServiceWorkerMessages`](API.md#knownomrsserviceworkermessages) | The message to be sent. |
|
|
3416
2819
|
|
|
3417
2820
|
#### Returns
|
|
3418
2821
|
|
|
3419
|
-
`
|
|
3420
|
-
|
|
3421
|
-
The dispose function to force closing the modal dialog.
|
|
3422
|
-
|
|
3423
|
-
▸ (): `void`
|
|
3424
|
-
|
|
3425
|
-
##### Returns
|
|
2822
|
+
`Promise`<[`MessageServiceWorkerResult`](interfaces/MessageServiceWorkerResult.md)<`any`\>\>
|
|
3426
2823
|
|
|
3427
|
-
|
|
2824
|
+
A promise which completes when the message has been successfully processed by the Service Worker.
|
|
3428
2825
|
|
|
3429
2826
|
#### Defined in
|
|
3430
2827
|
|
|
3431
|
-
[packages/framework/esm-
|
|
2828
|
+
[packages/framework/esm-offline/src/service-worker-messaging.ts:11](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/service-worker-messaging.ts#L11)
|
|
3432
2829
|
|
|
3433
2830
|
___
|
|
3434
2831
|
|
|
3435
|
-
###
|
|
2832
|
+
### queueSynchronizationItem
|
|
3436
2833
|
|
|
3437
|
-
▸ **
|
|
2834
|
+
▸ **queueSynchronizationItem**<`T`\>(`type`, `content`, `descriptor?`): `Promise`<`number`\>
|
|
3438
2835
|
|
|
3439
|
-
|
|
2836
|
+
Enqueues a new item in the sync queue and associates the item with the currently signed in user.
|
|
2837
|
+
|
|
2838
|
+
#### Type parameters
|
|
2839
|
+
|
|
2840
|
+
| Name |
|
|
2841
|
+
| :------ |
|
|
2842
|
+
| `T` |
|
|
3440
2843
|
|
|
3441
2844
|
#### Parameters
|
|
3442
2845
|
|
|
3443
2846
|
| Name | Type | Description |
|
|
3444
2847
|
| :------ | :------ | :------ |
|
|
3445
|
-
| `
|
|
2848
|
+
| `type` | `string` | The identifying type of the synchronization item. |
|
|
2849
|
+
| `content` | `T` | The actual data to be synchronized. |
|
|
2850
|
+
| `descriptor?` | [`QueueItemDescriptor`](interfaces/QueueItemDescriptor.md) | An optional descriptor providing additional metadata about the sync item. |
|
|
3446
2851
|
|
|
3447
2852
|
#### Returns
|
|
3448
2853
|
|
|
3449
|
-
`
|
|
2854
|
+
`Promise`<`number`\>
|
|
3450
2855
|
|
|
3451
2856
|
#### Defined in
|
|
3452
2857
|
|
|
3453
|
-
[packages/framework/esm-
|
|
2858
|
+
[packages/framework/esm-offline/src/sync.ts:293](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L293)
|
|
3454
2859
|
|
|
3455
2860
|
___
|
|
3456
2861
|
|
|
3457
|
-
###
|
|
2862
|
+
### registerOfflinePatientHandler
|
|
3458
2863
|
|
|
3459
|
-
▸ **
|
|
2864
|
+
▸ **registerOfflinePatientHandler**(`identifier`, `handler`): `void`
|
|
3460
2865
|
|
|
3461
|
-
|
|
2866
|
+
Attempts to add the specified patient handler registration to the list of offline patient handlers.
|
|
3462
2867
|
|
|
3463
2868
|
#### Parameters
|
|
3464
2869
|
|
|
3465
2870
|
| Name | Type | Description |
|
|
3466
2871
|
| :------ | :------ | :------ |
|
|
3467
|
-
| `
|
|
2872
|
+
| `identifier` | `string` | A key which uniquely identifies the registration. |
|
|
2873
|
+
| `handler` | [`OfflinePatientDataSyncHandler`](interfaces/OfflinePatientDataSyncHandler.md) | The patient handler registration to be registered. |
|
|
3468
2874
|
|
|
3469
2875
|
#### Returns
|
|
3470
2876
|
|
|
3471
2877
|
`void`
|
|
3472
2878
|
|
|
2879
|
+
`true` if the registration was successfully made; `false` if another registration with
|
|
2880
|
+
the same identifier has already been registered before.
|
|
2881
|
+
|
|
3473
2882
|
#### Defined in
|
|
3474
2883
|
|
|
3475
|
-
[packages/framework/esm-
|
|
2884
|
+
[packages/framework/esm-offline/src/offline-patient-data.ts:97](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/offline-patient-data.ts#L97)
|
|
3476
2885
|
|
|
3477
2886
|
___
|
|
3478
2887
|
|
|
3479
|
-
###
|
|
3480
|
-
|
|
3481
|
-
▸ **subscribeConnectivity**(`cb`): () => `void`
|
|
3482
|
-
|
|
3483
|
-
#### Parameters
|
|
3484
|
-
|
|
3485
|
-
| Name | Type |
|
|
3486
|
-
| :------ | :------ |
|
|
3487
|
-
| `cb` | (`ev`: [`ConnectivityChangedEvent`](interfaces/ConnectivityChangedEvent.md)) => `void` |
|
|
3488
|
-
|
|
3489
|
-
#### Returns
|
|
3490
|
-
|
|
3491
|
-
`fn`
|
|
3492
|
-
|
|
3493
|
-
▸ (): `void`
|
|
3494
|
-
|
|
3495
|
-
##### Returns
|
|
3496
|
-
|
|
3497
|
-
`void`
|
|
3498
|
-
|
|
3499
|
-
#### Defined in
|
|
2888
|
+
### setupOfflineSync
|
|
3500
2889
|
|
|
3501
|
-
|
|
2890
|
+
▸ **setupOfflineSync**<`T`\>(`type`, `dependsOn`, `process`, `options?`): `void`
|
|
3502
2891
|
|
|
3503
|
-
|
|
2892
|
+
Registers a new synchronization handler which is able to synchronize data of a specific type.
|
|
3504
2893
|
|
|
3505
|
-
|
|
2894
|
+
#### Type parameters
|
|
3506
2895
|
|
|
3507
|
-
|
|
2896
|
+
| Name |
|
|
2897
|
+
| :------ |
|
|
2898
|
+
| `T` |
|
|
3508
2899
|
|
|
3509
2900
|
#### Parameters
|
|
3510
2901
|
|
|
3511
|
-
| Name | Type |
|
|
3512
|
-
| :------ | :------ |
|
|
3513
|
-
| `
|
|
2902
|
+
| Name | Type | Description |
|
|
2903
|
+
| :------ | :------ | :------ |
|
|
2904
|
+
| `type` | `string` | The identifying type of the synchronization items which can be handled by this handler. |
|
|
2905
|
+
| `dependsOn` | `string`[] | An array of other sync item types which must be synchronized before this handler can synchronize its own data. Items of these types are effectively dependencies of the data synchronized by this handler. |
|
|
2906
|
+
| `process` | `ProcessSyncItem`<`T`\> | A function which, when invoked, performs the actual client-server synchronization of the given `item` (which is the actual data to be synchronized). |
|
|
2907
|
+
| `options` | `SetupOfflineSyncOptions`<`T`\> | Additional options which can optionally be provided when setting up a synchronization callback for a specific synchronization item type. |
|
|
3514
2908
|
|
|
3515
2909
|
#### Returns
|
|
3516
2910
|
|
|
3517
|
-
`fn`
|
|
3518
|
-
|
|
3519
|
-
▸ (): `void`
|
|
3520
|
-
|
|
3521
|
-
##### Returns
|
|
3522
|
-
|
|
3523
2911
|
`void`
|
|
3524
2912
|
|
|
3525
2913
|
#### Defined in
|
|
3526
2914
|
|
|
3527
|
-
[packages/framework/esm-
|
|
2915
|
+
[packages/framework/esm-offline/src/sync.ts:412](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/sync.ts#L412)
|
|
3528
2916
|
|
|
3529
2917
|
___
|
|
3530
2918
|
|
|
3531
|
-
###
|
|
2919
|
+
### subscribeConnectivity
|
|
3532
2920
|
|
|
3533
|
-
▸ **
|
|
2921
|
+
▸ **subscribeConnectivity**(`cb`): () => `void`
|
|
3534
2922
|
|
|
3535
2923
|
#### Parameters
|
|
3536
2924
|
|
|
3537
2925
|
| Name | Type |
|
|
3538
2926
|
| :------ | :------ |
|
|
3539
|
-
| `cb` | (`
|
|
2927
|
+
| `cb` | (`ev`: [`ConnectivityChangedEvent`](interfaces/ConnectivityChangedEvent.md)) => `void` |
|
|
3540
2928
|
|
|
3541
2929
|
#### Returns
|
|
3542
2930
|
|
|
@@ -3550,19 +2938,19 @@ ___
|
|
|
3550
2938
|
|
|
3551
2939
|
#### Defined in
|
|
3552
2940
|
|
|
3553
|
-
[packages/framework/esm-
|
|
2941
|
+
[packages/framework/esm-globals/src/events.ts:24](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-globals/src/events.ts#L24)
|
|
3554
2942
|
|
|
3555
2943
|
___
|
|
3556
2944
|
|
|
3557
|
-
###
|
|
2945
|
+
### subscribeConnectivityChanged
|
|
3558
2946
|
|
|
3559
|
-
▸ **
|
|
2947
|
+
▸ **subscribeConnectivityChanged**(`cb`): () => `void`
|
|
3560
2948
|
|
|
3561
2949
|
#### Parameters
|
|
3562
2950
|
|
|
3563
2951
|
| Name | Type |
|
|
3564
2952
|
| :------ | :------ |
|
|
3565
|
-
| `cb` | (`
|
|
2953
|
+
| `cb` | (`ev`: [`ConnectivityChangedEvent`](interfaces/ConnectivityChangedEvent.md)) => `void` |
|
|
3566
2954
|
|
|
3567
2955
|
#### Returns
|
|
3568
2956
|
|
|
@@ -3576,7 +2964,7 @@ ___
|
|
|
3576
2964
|
|
|
3577
2965
|
#### Defined in
|
|
3578
2966
|
|
|
3579
|
-
[packages/framework/esm-globals/src/events.ts:
|
|
2967
|
+
[packages/framework/esm-globals/src/events.ts:14](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-globals/src/events.ts#L14)
|
|
3580
2968
|
|
|
3581
2969
|
___
|
|
3582
2970
|
|
|
@@ -3602,403 +2990,451 @@ ___
|
|
|
3602
2990
|
|
|
3603
2991
|
#### Defined in
|
|
3604
2992
|
|
|
3605
|
-
[packages/framework/esm-globals/src/events.ts:
|
|
2993
|
+
[packages/framework/esm-globals/src/events.ts:45](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-globals/src/events.ts#L45)
|
|
3606
2994
|
|
|
3607
2995
|
___
|
|
3608
2996
|
|
|
3609
|
-
###
|
|
3610
|
-
|
|
3611
|
-
▸ **subscribeTo**<`T`, `U`\>(`store`, `select`, `handle`): `Unsubscribe`
|
|
2997
|
+
### syncOfflinePatientData
|
|
3612
2998
|
|
|
3613
|
-
|
|
2999
|
+
▸ **syncOfflinePatientData**(`patientUuid`): `Promise`<`void`\>
|
|
3614
3000
|
|
|
3615
|
-
|
|
3616
|
-
| :------ |
|
|
3617
|
-
| `T` |
|
|
3618
|
-
| `U` |
|
|
3001
|
+
Notifies all registered offline patient handlers that a new patient must be made available offline.
|
|
3619
3002
|
|
|
3620
3003
|
#### Parameters
|
|
3621
3004
|
|
|
3622
3005
|
| Name | Type |
|
|
3623
3006
|
| :------ | :------ |
|
|
3624
|
-
| `
|
|
3625
|
-
| `select` | (`state`: `T`) => `U` |
|
|
3626
|
-
| `handle` | (`subState`: `U`) => `void` |
|
|
3007
|
+
| `patientUuid` | `string` |
|
|
3627
3008
|
|
|
3628
3009
|
#### Returns
|
|
3629
3010
|
|
|
3630
|
-
`
|
|
3011
|
+
`Promise`<`void`\>
|
|
3012
|
+
|
|
3013
|
+
A promise which resolves once all registered handlers have finished synchronizing.
|
|
3631
3014
|
|
|
3632
3015
|
#### Defined in
|
|
3633
3016
|
|
|
3634
|
-
[packages/framework/esm-
|
|
3017
|
+
[packages/framework/esm-offline/src/offline-patient-data.ts:112](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-offline/src/offline-patient-data.ts#L112)
|
|
3635
3018
|
|
|
3636
3019
|
___
|
|
3637
3020
|
|
|
3638
|
-
###
|
|
3639
|
-
|
|
3640
|
-
▸ **subscribeToastShown**(`cb`): () => `void`
|
|
3641
|
-
|
|
3642
|
-
#### Parameters
|
|
3021
|
+
### useConnectivity
|
|
3643
3022
|
|
|
3644
|
-
|
|
3645
|
-
| :------ | :------ |
|
|
3646
|
-
| `cb` | (`data`: [`ShowToastEvent`](interfaces/ShowToastEvent.md)) => `void` |
|
|
3023
|
+
▸ **useConnectivity**(): `boolean`
|
|
3647
3024
|
|
|
3648
3025
|
#### Returns
|
|
3649
3026
|
|
|
3650
|
-
`
|
|
3651
|
-
|
|
3652
|
-
▸ (): `void`
|
|
3653
|
-
|
|
3654
|
-
##### Returns
|
|
3655
|
-
|
|
3656
|
-
`void`
|
|
3027
|
+
`boolean`
|
|
3657
3028
|
|
|
3658
3029
|
#### Defined in
|
|
3659
3030
|
|
|
3660
|
-
[packages/framework/esm-
|
|
3031
|
+
[packages/framework/esm-react-utils/src/useConnectivity.ts:5](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/useConnectivity.ts#L5)
|
|
3661
3032
|
|
|
3662
3033
|
___
|
|
3663
3034
|
|
|
3664
|
-
|
|
3035
|
+
## Store Functions
|
|
3036
|
+
|
|
3037
|
+
### createGlobalStore
|
|
3665
3038
|
|
|
3666
|
-
▸ **
|
|
3039
|
+
▸ **createGlobalStore**<`TState`\>(`name`, `initialState`): `Store`<`TState`\>
|
|
3667
3040
|
|
|
3668
|
-
|
|
3041
|
+
Creates a Unistore [store](https://github.com/developit/unistore#store).
|
|
3669
3042
|
|
|
3670
3043
|
#### Type parameters
|
|
3671
3044
|
|
|
3672
3045
|
| Name |
|
|
3673
3046
|
| :------ |
|
|
3674
|
-
| `
|
|
3047
|
+
| `TState` |
|
|
3675
3048
|
|
|
3676
3049
|
#### Parameters
|
|
3677
3050
|
|
|
3678
|
-
| Name | Type |
|
|
3679
|
-
| :------ | :------ |
|
|
3680
|
-
| `
|
|
3681
|
-
| `
|
|
3682
|
-
| `_state?` | `T` |
|
|
3051
|
+
| Name | Type | Description |
|
|
3052
|
+
| :------ | :------ | :------ |
|
|
3053
|
+
| `name` | `string` | A name by which the store can be looked up later. Must be unique across the entire application. |
|
|
3054
|
+
| `initialState` | `TState` | An object which will be the initial state of the store. |
|
|
3683
3055
|
|
|
3684
3056
|
#### Returns
|
|
3685
3057
|
|
|
3686
|
-
`
|
|
3058
|
+
`Store`<`TState`\>
|
|
3059
|
+
|
|
3060
|
+
The newly created store.
|
|
3687
3061
|
|
|
3688
3062
|
#### Defined in
|
|
3689
3063
|
|
|
3690
|
-
[packages/framework/esm-
|
|
3064
|
+
[packages/framework/esm-state/src/state.ts:19](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-state/src/state.ts#L19)
|
|
3691
3065
|
|
|
3692
3066
|
___
|
|
3693
3067
|
|
|
3694
|
-
###
|
|
3068
|
+
### createUseStore
|
|
3695
3069
|
|
|
3696
|
-
▸ **
|
|
3070
|
+
▸ **createUseStore**<`T`\>(`store`): () => `T`(`actions`: [`Actions`](API.md#actions)) => `T` & [`BoundActions`](API.md#boundactions)(`actions?`: [`Actions`](API.md#actions)) => `T` & [`BoundActions`](API.md#boundactions)
|
|
3697
3071
|
|
|
3698
|
-
|
|
3072
|
+
Avoid this; generally prefer to have clients use `useStore(yourStore)`
|
|
3073
|
+
|
|
3074
|
+
#### Type parameters
|
|
3075
|
+
|
|
3076
|
+
| Name |
|
|
3077
|
+
| :------ |
|
|
3078
|
+
| `T` |
|
|
3699
3079
|
|
|
3700
3080
|
#### Parameters
|
|
3701
3081
|
|
|
3702
3082
|
| Name | Type |
|
|
3703
3083
|
| :------ | :------ |
|
|
3704
|
-
| `
|
|
3084
|
+
| `store` | `Store`<`T`\> |
|
|
3705
3085
|
|
|
3706
3086
|
#### Returns
|
|
3707
3087
|
|
|
3708
|
-
`
|
|
3088
|
+
`fn`
|
|
3709
3089
|
|
|
3710
|
-
|
|
3090
|
+
▸ (): `T`
|
|
3711
3091
|
|
|
3712
|
-
|
|
3092
|
+
##### Returns
|
|
3713
3093
|
|
|
3714
|
-
|
|
3094
|
+
`T`
|
|
3715
3095
|
|
|
3716
|
-
|
|
3096
|
+
▸ (`actions`): `T` & [`BoundActions`](API.md#boundactions)
|
|
3717
3097
|
|
|
3718
|
-
|
|
3098
|
+
##### Parameters
|
|
3719
3099
|
|
|
3720
|
-
|
|
3100
|
+
| Name | Type |
|
|
3101
|
+
| :------ | :------ |
|
|
3102
|
+
| `actions` | [`Actions`](API.md#actions) |
|
|
3721
3103
|
|
|
3722
|
-
|
|
3104
|
+
##### Returns
|
|
3105
|
+
|
|
3106
|
+
`T` & [`BoundActions`](API.md#boundactions)
|
|
3107
|
+
|
|
3108
|
+
▸ (`actions?`): `T` & [`BoundActions`](API.md#boundactions)
|
|
3109
|
+
|
|
3110
|
+
##### Parameters
|
|
3723
3111
|
|
|
3724
3112
|
| Name | Type |
|
|
3725
3113
|
| :------ | :------ |
|
|
3726
|
-
| `
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3114
|
+
| `actions?` | [`Actions`](API.md#actions) |
|
|
3115
|
+
|
|
3116
|
+
##### Returns
|
|
3117
|
+
|
|
3118
|
+
`T` & [`BoundActions`](API.md#boundactions)
|
|
3119
|
+
|
|
3120
|
+
#### Defined in
|
|
3121
|
+
|
|
3122
|
+
[packages/framework/esm-react-utils/src/createUseStore.ts:23](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/createUseStore.ts#L23)
|
|
3123
|
+
|
|
3124
|
+
___
|
|
3125
|
+
|
|
3126
|
+
### getAppState
|
|
3127
|
+
|
|
3128
|
+
▸ **getAppState**(): `Store`<[`AppState`](interfaces/AppState.md)\>
|
|
3730
3129
|
|
|
3731
3130
|
#### Returns
|
|
3732
3131
|
|
|
3733
|
-
`
|
|
3132
|
+
`Store`<[`AppState`](interfaces/AppState.md)\>
|
|
3133
|
+
|
|
3134
|
+
The [store](https://github.com/developit/unistore#store) named `app`.
|
|
3734
3135
|
|
|
3735
3136
|
#### Defined in
|
|
3736
3137
|
|
|
3737
|
-
[packages/framework/esm-
|
|
3138
|
+
[packages/framework/esm-state/src/state.ts:86](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-state/src/state.ts#L86)
|
|
3738
3139
|
|
|
3739
3140
|
___
|
|
3740
3141
|
|
|
3741
|
-
###
|
|
3142
|
+
### getGlobalStore
|
|
3143
|
+
|
|
3144
|
+
▸ **getGlobalStore**<`TState`\>(`name`, `fallbackState?`): `Store`<`TState`\>
|
|
3742
3145
|
|
|
3743
|
-
|
|
3146
|
+
Returns the existing [store](https://github.com/developit/unistore#store) named `name`,
|
|
3147
|
+
or creates a new store named `name` if none exists.
|
|
3744
3148
|
|
|
3745
3149
|
#### Type parameters
|
|
3746
3150
|
|
|
3747
3151
|
| Name | Type |
|
|
3748
3152
|
| :------ | :------ |
|
|
3749
|
-
| `
|
|
3153
|
+
| `TState` | `any` |
|
|
3750
3154
|
|
|
3751
3155
|
#### Parameters
|
|
3752
3156
|
|
|
3753
|
-
| Name | Type |
|
|
3754
|
-
| :------ | :------ |
|
|
3755
|
-
| `
|
|
3756
|
-
| `
|
|
3757
|
-
| `value` | `any` |
|
|
3157
|
+
| Name | Type | Description |
|
|
3158
|
+
| :------ | :------ | :------ |
|
|
3159
|
+
| `name` | `string` | The name of the store to look up. |
|
|
3160
|
+
| `fallbackState?` | `TState` | The initial value of the new store if no store named `name` exists. |
|
|
3758
3161
|
|
|
3759
3162
|
#### Returns
|
|
3760
3163
|
|
|
3761
|
-
`
|
|
3164
|
+
`Store`<`TState`\>
|
|
3165
|
+
|
|
3166
|
+
The found or newly created store.
|
|
3762
3167
|
|
|
3763
3168
|
#### Defined in
|
|
3764
3169
|
|
|
3765
|
-
[packages/framework/esm-state/src/
|
|
3170
|
+
[packages/framework/esm-state/src/state.ts:56](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-state/src/state.ts#L56)
|
|
3766
3171
|
|
|
3767
3172
|
___
|
|
3768
3173
|
|
|
3769
|
-
###
|
|
3174
|
+
### subscribeTo
|
|
3770
3175
|
|
|
3771
|
-
▸ **
|
|
3176
|
+
▸ **subscribeTo**<`T`, `U`\>(`store`, `select`, `handle`): `Unsubscribe`
|
|
3772
3177
|
|
|
3773
|
-
|
|
3774
|
-
Does not consider if offline or online.
|
|
3178
|
+
#### Type parameters
|
|
3775
3179
|
|
|
3776
|
-
|
|
3180
|
+
| Name |
|
|
3181
|
+
| :------ |
|
|
3182
|
+
| `T` |
|
|
3183
|
+
| `U` |
|
|
3777
3184
|
|
|
3778
3185
|
#### Parameters
|
|
3779
3186
|
|
|
3780
|
-
| Name | Type |
|
|
3781
|
-
| :------ | :------ |
|
|
3782
|
-
| `
|
|
3187
|
+
| Name | Type |
|
|
3188
|
+
| :------ | :------ |
|
|
3189
|
+
| `store` | `Store`<`T`\> |
|
|
3190
|
+
| `select` | (`state`: `T`) => `U` |
|
|
3191
|
+
| `handle` | (`subState`: `U`) => `void` |
|
|
3783
3192
|
|
|
3784
3193
|
#### Returns
|
|
3785
3194
|
|
|
3786
|
-
`
|
|
3195
|
+
`Unsubscribe`
|
|
3787
3196
|
|
|
3788
3197
|
#### Defined in
|
|
3789
3198
|
|
|
3790
|
-
[packages/framework/esm-
|
|
3199
|
+
[packages/framework/esm-state/src/state.ts:90](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-state/src/state.ts#L90)
|
|
3791
3200
|
|
|
3792
3201
|
___
|
|
3793
3202
|
|
|
3794
|
-
###
|
|
3203
|
+
### useStore
|
|
3795
3204
|
|
|
3796
|
-
▸ **
|
|
3205
|
+
▸ **useStore**<`T`, `U`\>(`store`): `T`
|
|
3797
3206
|
|
|
3798
|
-
|
|
3799
|
-
|
|
3207
|
+
#### Type parameters
|
|
3208
|
+
|
|
3209
|
+
| Name |
|
|
3210
|
+
| :------ |
|
|
3211
|
+
| `T` |
|
|
3212
|
+
| `U` |
|
|
3800
3213
|
|
|
3801
3214
|
#### Parameters
|
|
3802
3215
|
|
|
3803
|
-
| Name | Type |
|
|
3804
|
-
| :------ | :------ |
|
|
3805
|
-
| `
|
|
3216
|
+
| Name | Type |
|
|
3217
|
+
| :------ | :------ |
|
|
3218
|
+
| `store` | `Store`<`T`\> |
|
|
3806
3219
|
|
|
3807
3220
|
#### Returns
|
|
3808
3221
|
|
|
3809
|
-
|
|
3222
|
+
`T`
|
|
3810
3223
|
|
|
3811
3224
|
#### Defined in
|
|
3812
3225
|
|
|
3813
|
-
[packages/framework/esm-react-utils/src/
|
|
3226
|
+
[packages/framework/esm-react-utils/src/useStore.ts:23](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/useStore.ts#L23)
|
|
3814
3227
|
|
|
3815
|
-
|
|
3228
|
+
▸ **useStore**<`T`, `U`\>(`store`, `select`): `U`
|
|
3816
3229
|
|
|
3817
|
-
|
|
3230
|
+
#### Type parameters
|
|
3818
3231
|
|
|
3819
|
-
|
|
3232
|
+
| Name |
|
|
3233
|
+
| :------ |
|
|
3234
|
+
| `T` |
|
|
3235
|
+
| `U` |
|
|
3820
3236
|
|
|
3821
3237
|
#### Parameters
|
|
3822
3238
|
|
|
3823
3239
|
| Name | Type |
|
|
3824
3240
|
| :------ | :------ |
|
|
3825
|
-
| `
|
|
3241
|
+
| `store` | `Store`<`T`\> |
|
|
3242
|
+
| `select` | (`state`: `T`) => `U` |
|
|
3826
3243
|
|
|
3827
3244
|
#### Returns
|
|
3828
3245
|
|
|
3829
|
-
`
|
|
3246
|
+
`U`
|
|
3830
3247
|
|
|
3831
3248
|
#### Defined in
|
|
3832
3249
|
|
|
3833
|
-
[packages/framework/esm-react-utils/src/
|
|
3250
|
+
[packages/framework/esm-react-utils/src/useStore.ts:24](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/useStore.ts#L24)
|
|
3834
3251
|
|
|
3835
|
-
|
|
3252
|
+
▸ **useStore**<`T`, `U`\>(`store`, `select`, `actions`): `T` & [`BoundActions`](API.md#boundactions)
|
|
3836
3253
|
|
|
3837
|
-
|
|
3254
|
+
#### Type parameters
|
|
3838
3255
|
|
|
3839
|
-
|
|
3256
|
+
| Name |
|
|
3257
|
+
| :------ |
|
|
3258
|
+
| `T` |
|
|
3259
|
+
| `U` |
|
|
3840
3260
|
|
|
3841
|
-
|
|
3261
|
+
#### Parameters
|
|
3842
3262
|
|
|
3843
|
-
|
|
3263
|
+
| Name | Type |
|
|
3264
|
+
| :------ | :------ |
|
|
3265
|
+
| `store` | `Store`<`T`\> |
|
|
3266
|
+
| `select` | `undefined` |
|
|
3267
|
+
| `actions` | [`Actions`](API.md#actions) |
|
|
3844
3268
|
|
|
3845
|
-
|
|
3269
|
+
#### Returns
|
|
3846
3270
|
|
|
3847
|
-
|
|
3848
|
-
| :------ | :------ | :------ |
|
|
3849
|
-
| `constructor` | `Function` | The initial value of Object.prototype.constructor is the standard built-in Object constructor. |
|
|
3850
|
-
| `hasOwnProperty` | (`v`: `PropertyKey`) => `boolean` | Determines whether an object has a property with the specified name. |
|
|
3851
|
-
| `isPrototypeOf` | (`v`: `Object`) => `boolean` | Determines whether an object exists in another object's prototype chain. |
|
|
3852
|
-
| `propertyIsEnumerable` | (`v`: `PropertyKey`) => `boolean` | Determines whether a specified property is enumerable. |
|
|
3853
|
-
| `toLocaleString` | () => `string` | Returns a date converted to a string using the current locale. |
|
|
3854
|
-
| `toString` | () => `string` | Returns a string representation of an object. |
|
|
3855
|
-
| `valueOf` | () => `Object` | Returns the primitive value of the specified object. |
|
|
3271
|
+
`T` & [`BoundActions`](API.md#boundactions)
|
|
3856
3272
|
|
|
3857
3273
|
#### Defined in
|
|
3858
3274
|
|
|
3859
|
-
[packages/framework/esm-react-utils/src/
|
|
3860
|
-
|
|
3861
|
-
___
|
|
3275
|
+
[packages/framework/esm-react-utils/src/useStore.ts:25](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/useStore.ts#L25)
|
|
3862
3276
|
|
|
3863
|
-
|
|
3277
|
+
▸ **useStore**<`T`, `U`\>(`store`, `select`, `actions`): `U` & [`BoundActions`](API.md#boundactions)
|
|
3864
3278
|
|
|
3865
|
-
|
|
3279
|
+
#### Type parameters
|
|
3866
3280
|
|
|
3867
|
-
|
|
3868
|
-
|
|
3281
|
+
| Name |
|
|
3282
|
+
| :------ |
|
|
3283
|
+
| `T` |
|
|
3284
|
+
| `U` |
|
|
3869
3285
|
|
|
3870
3286
|
#### Parameters
|
|
3871
3287
|
|
|
3872
|
-
| Name | Type |
|
|
3873
|
-
| :------ | :------ |
|
|
3874
|
-
| `
|
|
3288
|
+
| Name | Type |
|
|
3289
|
+
| :------ | :------ |
|
|
3290
|
+
| `store` | `Store`<`T`\> |
|
|
3291
|
+
| `select` | (`state`: `T`) => `U` |
|
|
3292
|
+
| `actions` | [`Actions`](API.md#actions) |
|
|
3875
3293
|
|
|
3876
3294
|
#### Returns
|
|
3877
3295
|
|
|
3878
|
-
[`
|
|
3296
|
+
`U` & [`BoundActions`](API.md#boundactions)
|
|
3879
3297
|
|
|
3880
3298
|
#### Defined in
|
|
3881
3299
|
|
|
3882
|
-
[packages/framework/esm-react-utils/src/
|
|
3300
|
+
[packages/framework/esm-react-utils/src/useStore.ts:30](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/useStore.ts#L30)
|
|
3883
3301
|
|
|
3884
3302
|
___
|
|
3885
3303
|
|
|
3886
|
-
###
|
|
3304
|
+
### useStoreWithActions
|
|
3887
3305
|
|
|
3888
|
-
▸ **
|
|
3306
|
+
▸ **useStoreWithActions**<`T`\>(`store`, `actions`): `T` & [`BoundActions`](API.md#boundactions)
|
|
3307
|
+
|
|
3308
|
+
#### Type parameters
|
|
3309
|
+
|
|
3310
|
+
| Name |
|
|
3311
|
+
| :------ |
|
|
3312
|
+
| `T` |
|
|
3313
|
+
|
|
3314
|
+
#### Parameters
|
|
3315
|
+
|
|
3316
|
+
| Name | Type |
|
|
3317
|
+
| :------ | :------ |
|
|
3318
|
+
| `store` | `Store`<`T`\> |
|
|
3319
|
+
| `actions` | [`Actions`](API.md#actions) |
|
|
3889
3320
|
|
|
3890
3321
|
#### Returns
|
|
3891
3322
|
|
|
3892
|
-
`
|
|
3323
|
+
`T` & [`BoundActions`](API.md#boundactions)
|
|
3893
3324
|
|
|
3894
3325
|
#### Defined in
|
|
3895
3326
|
|
|
3896
|
-
[packages/framework/esm-react-utils/src/
|
|
3327
|
+
[packages/framework/esm-react-utils/src/useStore.ts:52](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/useStore.ts#L52)
|
|
3897
3328
|
|
|
3898
3329
|
___
|
|
3899
3330
|
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
▸ **useCurrentPatient**(`patientUuid?`): [`boolean`, `NullablePatient`, [`PatientUuid`](API.md#patientuuid), `Error` \| ``null``]
|
|
3903
|
-
|
|
3904
|
-
This React hook returns the current patient, as specified by the current route. It returns
|
|
3905
|
-
all the information needed to render a loading state, error state, and normal/success state.
|
|
3331
|
+
## UI Functions
|
|
3906
3332
|
|
|
3907
|
-
|
|
3333
|
+
### setLeftNav
|
|
3334
|
+
|
|
3335
|
+
▸ **setLeftNav**(`__namedParameters`): `void`
|
|
3908
3336
|
|
|
3909
3337
|
#### Parameters
|
|
3910
3338
|
|
|
3911
3339
|
| Name | Type |
|
|
3912
3340
|
| :------ | :------ |
|
|
3913
|
-
| `
|
|
3341
|
+
| `__namedParameters` | `Object` |
|
|
3914
3342
|
|
|
3915
3343
|
#### Returns
|
|
3916
3344
|
|
|
3917
|
-
|
|
3345
|
+
`void`
|
|
3918
3346
|
|
|
3919
3347
|
#### Defined in
|
|
3920
3348
|
|
|
3921
|
-
[packages/framework/esm-
|
|
3349
|
+
[packages/framework/esm-styleguide/src/left-nav/index.tsx:18](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-styleguide/src/left-nav/index.tsx#L18)
|
|
3922
3350
|
|
|
3923
3351
|
___
|
|
3924
3352
|
|
|
3925
|
-
###
|
|
3926
|
-
|
|
3927
|
-
▸ **useExtensionSlotMeta**<`T`\>(`extensionSlotName`): `Object`
|
|
3928
|
-
|
|
3929
|
-
Extract meta data from all extension for a given extension slot.
|
|
3353
|
+
### showModal
|
|
3930
3354
|
|
|
3931
|
-
|
|
3355
|
+
▸ **showModal**(`extensionId`, `props?`, `onClose?`): () => `void`
|
|
3932
3356
|
|
|
3933
|
-
|
|
3934
|
-
| :------ | :------ |
|
|
3935
|
-
| `T` | [`ExtensionMeta`](interfaces/ExtensionMeta.md) |
|
|
3357
|
+
Shows the provided extension component in a modal dialog.
|
|
3936
3358
|
|
|
3937
3359
|
#### Parameters
|
|
3938
3360
|
|
|
3939
|
-
| Name | Type |
|
|
3940
|
-
| :------ | :------ |
|
|
3941
|
-
| `
|
|
3361
|
+
| Name | Type | Description |
|
|
3362
|
+
| :------ | :------ | :------ |
|
|
3363
|
+
| `extensionId` | `string` | The id of the extension to show. |
|
|
3364
|
+
| `props` | `Record`<`string`, `any`\> | The optional props to provide to the extension. |
|
|
3365
|
+
| `onClose` | () => `void` | The optional notification to receive when the modal is closed. |
|
|
3942
3366
|
|
|
3943
3367
|
#### Returns
|
|
3944
3368
|
|
|
3945
|
-
`
|
|
3369
|
+
`fn`
|
|
3946
3370
|
|
|
3947
|
-
|
|
3371
|
+
The dispose function to force closing the modal dialog.
|
|
3948
3372
|
|
|
3949
|
-
|
|
3373
|
+
▸ (): `void`
|
|
3950
3374
|
|
|
3951
|
-
|
|
3375
|
+
##### Returns
|
|
3952
3376
|
|
|
3953
|
-
|
|
3377
|
+
`void`
|
|
3954
3378
|
|
|
3955
|
-
|
|
3379
|
+
#### Defined in
|
|
3956
3380
|
|
|
3957
|
-
|
|
3381
|
+
[packages/framework/esm-styleguide/src/modals/index.tsx:164](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-styleguide/src/modals/index.tsx#L164)
|
|
3958
3382
|
|
|
3959
|
-
|
|
3383
|
+
___
|
|
3960
3384
|
|
|
3961
|
-
|
|
3385
|
+
### showNotification
|
|
3962
3386
|
|
|
3963
|
-
|
|
3387
|
+
▸ **showNotification**(`notification`): `void`
|
|
3964
3388
|
|
|
3965
|
-
|
|
3389
|
+
Displays an inline notification in the UI.
|
|
3966
3390
|
|
|
3967
3391
|
#### Parameters
|
|
3968
3392
|
|
|
3969
|
-
| Name | Type |
|
|
3970
|
-
| :------ | :------ |
|
|
3971
|
-
| `
|
|
3393
|
+
| Name | Type | Description |
|
|
3394
|
+
| :------ | :------ | :------ |
|
|
3395
|
+
| `notification` | [`NotificationDescriptor`](interfaces/NotificationDescriptor.md) | The description of the notification to display. |
|
|
3972
3396
|
|
|
3973
3397
|
#### Returns
|
|
3974
3398
|
|
|
3975
|
-
`
|
|
3399
|
+
`void`
|
|
3976
3400
|
|
|
3977
3401
|
#### Defined in
|
|
3978
3402
|
|
|
3979
|
-
[packages/framework/esm-
|
|
3403
|
+
[packages/framework/esm-styleguide/src/notifications/index.tsx:41](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-styleguide/src/notifications/index.tsx#L41)
|
|
3980
3404
|
|
|
3981
|
-
|
|
3405
|
+
___
|
|
3406
|
+
|
|
3407
|
+
### showToast
|
|
3408
|
+
|
|
3409
|
+
▸ **showToast**(`toast`): `void`
|
|
3410
|
+
|
|
3411
|
+
Displays a toast notification in the UI.
|
|
3982
3412
|
|
|
3983
3413
|
#### Parameters
|
|
3984
3414
|
|
|
3985
|
-
| Name | Type |
|
|
3986
|
-
| :------ | :------ |
|
|
3987
|
-
| `
|
|
3415
|
+
| Name | Type | Description |
|
|
3416
|
+
| :------ | :------ | :------ |
|
|
3417
|
+
| `toast` | [`ToastDescriptor`](interfaces/ToastDescriptor.md) | The description of the toast to display. |
|
|
3988
3418
|
|
|
3989
3419
|
#### Returns
|
|
3990
3420
|
|
|
3991
|
-
`
|
|
3421
|
+
`void`
|
|
3992
3422
|
|
|
3993
3423
|
#### Defined in
|
|
3994
3424
|
|
|
3995
|
-
[packages/framework/esm-
|
|
3425
|
+
[packages/framework/esm-styleguide/src/toasts/index.tsx:35](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-styleguide/src/toasts/index.tsx#L35)
|
|
3996
3426
|
|
|
3997
3427
|
___
|
|
3998
3428
|
|
|
3999
|
-
###
|
|
3429
|
+
### subscribeNotificationShown
|
|
3430
|
+
|
|
3431
|
+
▸ **subscribeNotificationShown**(`cb`): () => `void`
|
|
3432
|
+
|
|
3433
|
+
#### Parameters
|
|
4000
3434
|
|
|
4001
|
-
|
|
3435
|
+
| Name | Type |
|
|
3436
|
+
| :------ | :------ |
|
|
3437
|
+
| `cb` | (`data`: [`ShowNotificationEvent`](interfaces/ShowNotificationEvent.md)) => `void` |
|
|
4002
3438
|
|
|
4003
3439
|
#### Returns
|
|
4004
3440
|
|
|
@@ -4012,49 +3448,65 @@ ___
|
|
|
4012
3448
|
|
|
4013
3449
|
#### Defined in
|
|
4014
3450
|
|
|
4015
|
-
[packages/framework/esm-
|
|
3451
|
+
[packages/framework/esm-globals/src/events.ts:93](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-globals/src/events.ts#L93)
|
|
4016
3452
|
|
|
4017
3453
|
___
|
|
4018
3454
|
|
|
4019
|
-
###
|
|
3455
|
+
### subscribeToastShown
|
|
4020
3456
|
|
|
4021
|
-
▸ **
|
|
3457
|
+
▸ **subscribeToastShown**(`cb`): () => `void`
|
|
3458
|
+
|
|
3459
|
+
#### Parameters
|
|
3460
|
+
|
|
3461
|
+
| Name | Type |
|
|
3462
|
+
| :------ | :------ |
|
|
3463
|
+
| `cb` | (`data`: [`ShowToastEvent`](interfaces/ShowToastEvent.md)) => `void` |
|
|
4022
3464
|
|
|
4023
3465
|
#### Returns
|
|
4024
3466
|
|
|
4025
|
-
|
|
3467
|
+
`fn`
|
|
3468
|
+
|
|
3469
|
+
▸ (): `void`
|
|
3470
|
+
|
|
3471
|
+
##### Returns
|
|
3472
|
+
|
|
3473
|
+
`void`
|
|
4026
3474
|
|
|
4027
3475
|
#### Defined in
|
|
4028
3476
|
|
|
4029
|
-
[packages/framework/esm-
|
|
3477
|
+
[packages/framework/esm-globals/src/events.ts:102](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-globals/src/events.ts#L102)
|
|
4030
3478
|
|
|
4031
3479
|
___
|
|
4032
3480
|
|
|
4033
|
-
###
|
|
3481
|
+
### unsetLeftNav
|
|
4034
3482
|
|
|
4035
|
-
▸ **
|
|
3483
|
+
▸ **unsetLeftNav**(`name`): `void`
|
|
3484
|
+
|
|
3485
|
+
#### Parameters
|
|
3486
|
+
|
|
3487
|
+
| Name | Type |
|
|
3488
|
+
| :------ | :------ |
|
|
3489
|
+
| `name` | `any` |
|
|
4036
3490
|
|
|
4037
3491
|
#### Returns
|
|
4038
3492
|
|
|
4039
|
-
|
|
3493
|
+
`void`
|
|
4040
3494
|
|
|
4041
3495
|
#### Defined in
|
|
4042
3496
|
|
|
4043
|
-
[packages/framework/esm-
|
|
3497
|
+
[packages/framework/esm-styleguide/src/left-nav/index.tsx:22](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-styleguide/src/left-nav/index.tsx#L22)
|
|
4044
3498
|
|
|
4045
3499
|
___
|
|
4046
3500
|
|
|
4047
|
-
###
|
|
4048
|
-
|
|
4049
|
-
▸ **useNavigationContext**(`context`): `void`
|
|
3501
|
+
### useBodyScrollLock
|
|
4050
3502
|
|
|
4051
|
-
|
|
3503
|
+
▸ **useBodyScrollLock**(`active`): `void`
|
|
4052
3504
|
|
|
4053
3505
|
#### Parameters
|
|
4054
3506
|
|
|
4055
3507
|
| Name | Type |
|
|
4056
3508
|
| :------ | :------ |
|
|
4057
|
-
| `
|
|
3509
|
+
| `active` | `boolean` |
|
|
4058
3510
|
|
|
4059
3511
|
#### Returns
|
|
4060
3512
|
|
|
@@ -4062,7 +3514,21 @@ ___
|
|
|
4062
3514
|
|
|
4063
3515
|
#### Defined in
|
|
4064
3516
|
|
|
4065
|
-
[packages/framework/esm-react-utils/src/
|
|
3517
|
+
[packages/framework/esm-react-utils/src/useBodyScrollLock.ts:4](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/useBodyScrollLock.ts#L4)
|
|
3518
|
+
|
|
3519
|
+
___
|
|
3520
|
+
|
|
3521
|
+
### useLayoutType
|
|
3522
|
+
|
|
3523
|
+
▸ **useLayoutType**(): [`LayoutType`](API.md#layouttype)
|
|
3524
|
+
|
|
3525
|
+
#### Returns
|
|
3526
|
+
|
|
3527
|
+
[`LayoutType`](API.md#layouttype)
|
|
3528
|
+
|
|
3529
|
+
#### Defined in
|
|
3530
|
+
|
|
3531
|
+
[packages/framework/esm-react-utils/src/useLayoutType.ts:23](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/useLayoutType.ts#L23)
|
|
4066
3532
|
|
|
4067
3533
|
___
|
|
4068
3534
|
|
|
@@ -4089,7 +3555,7 @@ ___
|
|
|
4089
3555
|
|
|
4090
3556
|
#### Defined in
|
|
4091
3557
|
|
|
4092
|
-
[packages/framework/esm-react-utils/src/useOnClickOutside.tsx:
|
|
3558
|
+
[packages/framework/esm-react-utils/src/useOnClickOutside.tsx:4](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/useOnClickOutside.tsx#L4)
|
|
4093
3559
|
|
|
4094
3560
|
___
|
|
4095
3561
|
|
|
@@ -4128,187 +3594,161 @@ ___
|
|
|
4128
3594
|
|
|
4129
3595
|
#### Defined in
|
|
4130
3596
|
|
|
4131
|
-
[packages/framework/esm-react-utils/src/usePagination.ts:
|
|
3597
|
+
[packages/framework/esm-react-utils/src/usePagination.ts:6](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/usePagination.ts#L6)
|
|
4132
3598
|
|
|
4133
3599
|
___
|
|
4134
3600
|
|
|
4135
|
-
|
|
3601
|
+
## Utility Functions
|
|
4136
3602
|
|
|
4137
|
-
|
|
3603
|
+
### age
|
|
4138
3604
|
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
a route listener is set up to update the patient whenever the route changes.
|
|
3605
|
+
▸ **age**(`dateString`): `string`
|
|
3606
|
+
|
|
3607
|
+
Gets a human readable age represention of the provided date string.
|
|
4143
3608
|
|
|
4144
3609
|
#### Parameters
|
|
4145
3610
|
|
|
4146
|
-
| Name | Type |
|
|
4147
|
-
| :------ | :------ |
|
|
4148
|
-
| `
|
|
3611
|
+
| Name | Type | Description |
|
|
3612
|
+
| :------ | :------ | :------ |
|
|
3613
|
+
| `dateString` | `string` | The stringified date. |
|
|
4149
3614
|
|
|
4150
3615
|
#### Returns
|
|
4151
3616
|
|
|
4152
|
-
`
|
|
4153
|
-
|
|
4154
|
-
| Name | Type |
|
|
4155
|
-
| :------ | :------ |
|
|
4156
|
-
| `error` | ``null`` \| `Error` |
|
|
4157
|
-
| `isLoading` | `boolean` |
|
|
4158
|
-
| `patient` | `NullablePatient` |
|
|
4159
|
-
| `patientUuid` | ``null`` \| `string` |
|
|
4160
|
-
|
|
4161
|
-
#### Defined in
|
|
4162
|
-
|
|
4163
|
-
[packages/framework/esm-react-utils/src/usePatient.ts:91](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/usePatient.ts#L91)
|
|
4164
|
-
|
|
4165
|
-
___
|
|
4166
|
-
|
|
4167
|
-
### useSessionUser
|
|
4168
|
-
|
|
4169
|
-
▸ **useSessionUser**(): ``null`` \| [`SessionUser`](interfaces/SessionUser.md)
|
|
4170
|
-
|
|
4171
|
-
#### Returns
|
|
3617
|
+
`string`
|
|
4172
3618
|
|
|
4173
|
-
|
|
3619
|
+
A human-readable string version of the age.
|
|
4174
3620
|
|
|
4175
3621
|
#### Defined in
|
|
4176
3622
|
|
|
4177
|
-
[packages/framework/esm-
|
|
3623
|
+
[packages/framework/esm-utils/src/age-helpers.tsx:39](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/age-helpers.tsx#L39)
|
|
4178
3624
|
|
|
4179
3625
|
___
|
|
4180
3626
|
|
|
4181
|
-
###
|
|
4182
|
-
|
|
4183
|
-
▸ **useStore**<`T`\>(`store`): `T`
|
|
3627
|
+
### daysIntoYear
|
|
4184
3628
|
|
|
4185
|
-
|
|
3629
|
+
▸ **daysIntoYear**(`date`): `number`
|
|
4186
3630
|
|
|
4187
|
-
|
|
4188
|
-
| :------ |
|
|
4189
|
-
| `T` |
|
|
3631
|
+
Gets the number of days in the year of the given date.
|
|
4190
3632
|
|
|
4191
3633
|
#### Parameters
|
|
4192
3634
|
|
|
4193
|
-
| Name | Type |
|
|
4194
|
-
| :------ | :------ |
|
|
4195
|
-
| `
|
|
3635
|
+
| Name | Type | Description |
|
|
3636
|
+
| :------ | :------ | :------ |
|
|
3637
|
+
| `date` | `Date` | The date to compute the days within the year. |
|
|
4196
3638
|
|
|
4197
3639
|
#### Returns
|
|
4198
3640
|
|
|
4199
|
-
`
|
|
3641
|
+
`number`
|
|
3642
|
+
|
|
3643
|
+
The number of days.
|
|
4200
3644
|
|
|
4201
3645
|
#### Defined in
|
|
4202
3646
|
|
|
4203
|
-
[packages/framework/esm-
|
|
3647
|
+
[packages/framework/esm-utils/src/age-helpers.tsx:8](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/age-helpers.tsx#L8)
|
|
4204
3648
|
|
|
4205
|
-
|
|
3649
|
+
___
|
|
4206
3650
|
|
|
4207
|
-
|
|
3651
|
+
### isSameDay
|
|
4208
3652
|
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
3653
|
+
▸ **isSameDay**(`firstDate`, `secondDate`): `boolean`
|
|
3654
|
+
|
|
3655
|
+
Checks if two dates are representing the same day.
|
|
4212
3656
|
|
|
4213
3657
|
#### Parameters
|
|
4214
3658
|
|
|
4215
|
-
| Name | Type |
|
|
4216
|
-
| :------ | :------ |
|
|
4217
|
-
| `
|
|
4218
|
-
| `
|
|
3659
|
+
| Name | Type | Description |
|
|
3660
|
+
| :------ | :------ | :------ |
|
|
3661
|
+
| `firstDate` | `Date` | The first date. |
|
|
3662
|
+
| `secondDate` | `Date` | The second date. |
|
|
4219
3663
|
|
|
4220
3664
|
#### Returns
|
|
4221
3665
|
|
|
4222
|
-
`
|
|
3666
|
+
`boolean`
|
|
3667
|
+
|
|
3668
|
+
True if both are located on the same day.
|
|
4223
3669
|
|
|
4224
3670
|
#### Defined in
|
|
4225
3671
|
|
|
4226
|
-
[packages/framework/esm-
|
|
3672
|
+
[packages/framework/esm-utils/src/age-helpers.tsx:25](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/age-helpers.tsx#L25)
|
|
4227
3673
|
|
|
4228
3674
|
___
|
|
4229
3675
|
|
|
4230
|
-
###
|
|
4231
|
-
|
|
4232
|
-
▸ **useStoreState**<`T`, `U`\>(`store`, `select`): `U`
|
|
4233
|
-
|
|
4234
|
-
#### Type parameters
|
|
3676
|
+
### isVersionSatisfied
|
|
4235
3677
|
|
|
4236
|
-
|
|
4237
|
-
| :------ |
|
|
4238
|
-
| `T` |
|
|
4239
|
-
| `U` |
|
|
3678
|
+
▸ **isVersionSatisfied**(`requiredVersion`, `installedVersion`): `boolean`
|
|
4240
3679
|
|
|
4241
3680
|
#### Parameters
|
|
4242
3681
|
|
|
4243
3682
|
| Name | Type |
|
|
4244
3683
|
| :------ | :------ |
|
|
4245
|
-
| `
|
|
4246
|
-
| `
|
|
3684
|
+
| `requiredVersion` | `string` |
|
|
3685
|
+
| `installedVersion` | `string` |
|
|
4247
3686
|
|
|
4248
3687
|
#### Returns
|
|
4249
3688
|
|
|
4250
|
-
`
|
|
3689
|
+
`boolean`
|
|
4251
3690
|
|
|
4252
3691
|
#### Defined in
|
|
4253
3692
|
|
|
4254
|
-
[packages/framework/esm-
|
|
3693
|
+
[packages/framework/esm-utils/src/version.ts:22](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/version.ts#L22)
|
|
4255
3694
|
|
|
4256
3695
|
___
|
|
4257
3696
|
|
|
4258
|
-
###
|
|
4259
|
-
|
|
4260
|
-
▸ **useVisit**(`patientUuid`): `Object`
|
|
4261
|
-
|
|
4262
|
-
#### Parameters
|
|
4263
|
-
|
|
4264
|
-
| Name | Type |
|
|
4265
|
-
| :------ | :------ |
|
|
4266
|
-
| `patientUuid` | `string` |
|
|
3697
|
+
### retry
|
|
4267
3698
|
|
|
4268
|
-
|
|
3699
|
+
▸ **retry**<`T`\>(`fn`, `options?`): `Promise`<`T`\>
|
|
4269
3700
|
|
|
4270
|
-
|
|
3701
|
+
Executes the specified function and retries executing on failure with a custom backoff strategy
|
|
3702
|
+
defined by the options.
|
|
4271
3703
|
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
| `error` | ``null`` |
|
|
3704
|
+
If not configured otherwise, this function uses the following default options:
|
|
3705
|
+
* Retries 5 times beyond the initial attempt.
|
|
3706
|
+
* Uses an exponential backoff starting with an initial delay of 1000ms.
|
|
4276
3707
|
|
|
4277
|
-
|
|
3708
|
+
**`throws`** Rethrows the final error of running `fn` when the function stops retrying.
|
|
4278
3709
|
|
|
4279
|
-
|
|
3710
|
+
#### Type parameters
|
|
4280
3711
|
|
|
4281
|
-
|
|
3712
|
+
| Name |
|
|
3713
|
+
| :------ |
|
|
3714
|
+
| `T` |
|
|
4282
3715
|
|
|
4283
|
-
|
|
3716
|
+
#### Parameters
|
|
4284
3717
|
|
|
4285
|
-
|
|
3718
|
+
| Name | Type | Description |
|
|
3719
|
+
| :------ | :------ | :------ |
|
|
3720
|
+
| `fn` | () => `Promise`<`T`\> | The function to be executed and retried on failure. |
|
|
3721
|
+
| `options` | [`RetryOptions`](interfaces/RetryOptions.md) | Additional options which configure the retry behavior. |
|
|
4286
3722
|
|
|
4287
3723
|
#### Returns
|
|
4288
3724
|
|
|
4289
|
-
|
|
3725
|
+
`Promise`<`T`\>
|
|
3726
|
+
|
|
3727
|
+
The result of successfully executing `fn`.
|
|
4290
3728
|
|
|
4291
3729
|
#### Defined in
|
|
4292
3730
|
|
|
4293
|
-
[packages/framework/esm-
|
|
3731
|
+
[packages/framework/esm-utils/src/retry.ts:40](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/retry.ts#L40)
|
|
4294
3732
|
|
|
4295
3733
|
___
|
|
4296
3734
|
|
|
4297
|
-
###
|
|
3735
|
+
### translateFrom
|
|
4298
3736
|
|
|
4299
|
-
▸ **
|
|
3737
|
+
▸ **translateFrom**(`moduleName`, `key`, `fallback?`, `options?`): `string`
|
|
4300
3738
|
|
|
4301
3739
|
#### Parameters
|
|
4302
3740
|
|
|
4303
3741
|
| Name | Type |
|
|
4304
3742
|
| :------ | :------ |
|
|
4305
|
-
| `
|
|
4306
|
-
| `
|
|
3743
|
+
| `moduleName` | `string` |
|
|
3744
|
+
| `key` | `string` |
|
|
3745
|
+
| `fallback?` | `string` |
|
|
3746
|
+
| `options?` | `object` |
|
|
4307
3747
|
|
|
4308
3748
|
#### Returns
|
|
4309
3749
|
|
|
4310
|
-
|
|
3750
|
+
`string`
|
|
4311
3751
|
|
|
4312
3752
|
#### Defined in
|
|
4313
3753
|
|
|
4314
|
-
[packages/framework/esm-
|
|
3754
|
+
[packages/framework/esm-utils/src/translate.ts:4](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-utils/src/translate.ts#L4)
|