@openmrs/esm-framework 3.2.1-pre.1094 → 3.2.1-pre.1102

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