@openmrs/esm-framework 3.2.1-pre.986 → 3.3.1-pre.1177

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